/* ============================================================
   VAJ PORTAL — mijozlar uchun
   Mobile-first · desktop breakpoint 900px
   ============================================================ */

:root{
  --ink:#17140F; --ink-soft:#221D15; --ink-2:#2C2519; --ink-3:#3A3123;
  --bone:#F1E9DA; --bone-dim:#E5DAC4; --bone-mute:rgba(241,233,218,.55);
  --teal:#1C6B68; --clay:#B54F1D; --clay-br:#D2621F; --sand:#CBAE83; --red:#9E2B25;
  --ok:#4FA96B;
  --line:rgba(241,233,218,.14); --line-2:rgba(241,233,218,.24);
  --ease:cubic-bezier(.16,.8,.24,1);
  --r:14px;
}
*,*::before,*::after{ box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html{ scroll-behavior:smooth; }
@media (prefers-reduced-motion:reduce){ *{ animation-duration:.001ms!important; transition-duration:.001ms!important; } }
body{
  margin:0; background:var(--ink); color:var(--bone);
  font-family:'Manrope',system-ui,sans-serif; font-weight:400;
  -webkit-font-smoothing:antialiased; overflow-x:hidden;
  padding-bottom:env(safe-area-inset-bottom);
}
h1,h2,h3,.dsp{ font-family:'Unbounded',sans-serif; font-weight:700; margin:0; letter-spacing:-.01em; }
.mono{ font-family:'Space Mono',monospace; }
a{ color:inherit; text-decoration:none; }
button,input,select,textarea{ font-family:inherit; font-size:16px; } /* 16px = iOS zoom oldini oladi */
button{ cursor:pointer; border:none; background:none; color:inherit; }
ul{ list-style:none; margin:0; padding:0; }
img{ max-width:100%; display:block; }
:focus-visible{ outline:2px solid var(--clay-br); outline-offset:3px; }

/* ---------- animatsiyalar ---------- */
@keyframes fadeUp{ from{opacity:0; transform:translateY(16px);} to{opacity:1; transform:none;} }
@keyframes fadeIn{ from{opacity:0;} to{opacity:1;} }
@keyframes pop{ from{opacity:0; transform:scale(.94);} to{opacity:1; transform:none;} }
@keyframes spin{ to{ transform:rotate(360deg);} }
@keyframes shimmer{ 0%{background-position:-400px 0;} 100%{background-position:400px 0;} }
@keyframes floaty{ 0%,100%{transform:translateY(0);} 50%{transform:translateY(-10px);} }
@keyframes ringSpin{ to{ transform:rotate(360deg);} }
.anim-up{ animation:fadeUp .55s var(--ease) both; }
.anim-in{ animation:fadeIn .5s var(--ease) both; }
.anim-pop{ animation:pop .45s var(--ease) both; }
.d1{animation-delay:.06s}.d2{animation-delay:.12s}.d3{animation-delay:.18s}
.d4{animation-delay:.24s}.d5{animation-delay:.3s}.d6{animation-delay:.36s}

/* ---------- fon ---------- */
.bg-grid{
  position:fixed; inset:0; z-index:-2; pointer-events:none;
  background-image:linear-gradient(var(--line) 1px,transparent 1px),linear-gradient(90deg,var(--line) 1px,transparent 1px);
  background-size:44px 44px; opacity:.45;
  mask-image:radial-gradient(circle at 60% 25%,#000,transparent 80%);
}
.bg-glow{ position:fixed; z-index:-1; border-radius:50%; pointer-events:none; filter:blur(6px); }
.bg-glow.a{ left:-25%; top:-10%; width:80vw; height:80vw; max-width:620px; max-height:620px;
  background:radial-gradient(circle,rgba(181,79,29,.22),transparent 70%); }
.bg-glow.b{ right:-25%; bottom:-10%; width:80vw; height:80vw; max-width:620px; max-height:620px;
  background:radial-gradient(circle,rgba(28,107,104,.20),transparent 70%); }

/* ---------- layout ---------- */
.wrap{ width:100%; max-width:560px; margin:0 auto; padding:0 20px; }
.wrap-wide{ width:100%; max-width:1180px; margin:0 auto; padding:0 20px; }

/* ---------- topbar ---------- */
.topbar{
  position:sticky; top:0; z-index:60; display:flex; align-items:center; justify-content:space-between;
  padding:14px 20px; background:rgba(23,20,15,.82); backdrop-filter:blur(12px);
  border-bottom:1px solid var(--line);
}
.brand{ display:flex; align-items:center; gap:10px; }
.brand svg{ width:26px; height:26px; flex:0 0 auto; }
.brand span{ font-family:'Unbounded'; font-weight:700; font-size:15px; letter-spacing:.02em; }
.brand small{ font-family:'Space Mono'; font-size:10px; color:var(--sand); letter-spacing:.14em; }

/* ---------- tugmalar ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:10px;
  padding:16px 24px; border-radius:100px; font-size:14px; font-weight:700;
  letter-spacing:.01em; transition:transform .25s var(--ease), background .25s, opacity .2s;
  min-height:52px; width:100%;
}
.btn:active{ transform:scale(.97); }
.btn-primary{ background:var(--clay); color:var(--bone); }
.btn-primary:hover{ background:var(--clay-br); }
.btn-ghost{ border:1px solid var(--line-2); color:var(--bone); }
.btn-ghost:hover{ background:rgba(241,233,218,.06); }
.btn-google{ background:var(--bone); color:var(--ink); }
.btn-google:hover{ background:#fff; }
.btn:disabled{ opacity:.5; cursor:not-allowed; transform:none; }
.btn-sm{ min-height:42px; padding:11px 18px; font-size:12.5px; width:auto; }
.btn-row{ display:flex; gap:10px; }
.btn-row .btn{ flex:1; }

/* ---------- kartalar ---------- */
.card{
  background:linear-gradient(160deg,rgba(241,233,218,.05),rgba(241,233,218,.015));
  border:1px solid var(--line); border-radius:var(--r); padding:20px;
}
.card-solid{ background:var(--ink-soft); border:1px solid var(--line); border-radius:var(--r); padding:20px; }

/* ---------- forma ---------- */
.field{ margin-bottom:16px; }
.field label{ display:block; font-family:'Space Mono'; font-size:11px; letter-spacing:.1em;
  text-transform:uppercase; color:var(--bone-mute); margin-bottom:8px; }
.field label .req{ color:var(--clay-br); }
.field input,.field textarea,.field select{
  width:100%; padding:15px 16px; border-radius:12px; border:1px solid var(--line-2);
  background:var(--ink-soft); color:var(--bone); transition:border-color .2s, box-shadow .2s;
}
.field input::placeholder,.field textarea::placeholder{ color:rgba(241,233,218,.3); }
.field input:focus,.field textarea:focus,.field select:focus{
  outline:none; border-color:var(--clay); box-shadow:0 0 0 3px rgba(181,79,29,.18);
}
.field textarea{ min-height:88px; resize:vertical; line-height:1.6; }
.field .hint{ font-size:12px; color:var(--bone-mute); margin-top:7px; line-height:1.5; }
.field .err{ display:none; font-size:12.5px; color:#e08b7a; margin-top:7px; }
.field.bad input,.field.bad textarea{ border-color:var(--red); }
.field.bad .err{ display:block; }
.two{ display:grid; grid-template-columns:1fr; gap:0; }

/* ---------- progress ---------- */
.steps{ display:flex; gap:6px; padding:16px 20px 0; }
.steps i{ flex:1; height:3px; border-radius:2px; background:var(--line-2); overflow:hidden; position:relative; }
.steps i.on::after{ content:''; position:absolute; inset:0; background:var(--clay-br);
  animation:fillBar .5s var(--ease) both; transform-origin:left; }
@keyframes fillBar{ from{transform:scaleX(0);} to{transform:scaleX(1);} }
.step-meta{ display:flex; justify-content:space-between; align-items:baseline; padding:14px 20px 0; }
.step-meta .n{ font-family:'Space Mono'; font-size:11px; letter-spacing:.14em; color:var(--sand); text-transform:uppercase; }
.step-meta .c{ font-family:'Space Mono'; font-size:11px; color:var(--bone-mute); }

.pane{ display:none; }
.pane.on{ display:block; animation:fadeUp .45s var(--ease) both; }
.pane h2{ font-size:26px; line-height:1.2; margin-bottom:8px; }
.pane .lead{ font-size:14.5px; line-height:1.65; color:var(--bone-mute); margin-bottom:24px; }

/* ---------- shablon tanlash ---------- */
.tpl-grid{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.tpl{
  position:relative; border-radius:var(--r); overflow:hidden; cursor:pointer;
  border:2px solid transparent; transition:transform .25s var(--ease), border-color .25s;
  background:var(--ink-soft);
}
.tpl:active{ transform:scale(.97); }
.tpl.sel{ border-color:var(--clay-br); }
.tpl-prev{ height:132px; position:relative; overflow:hidden; }
.tpl-prev .hd{ height:34%; display:flex; align-items:center; padding:0 10px; gap:6px; }
.tpl-prev .hd .dot{ width:14px; height:14px; border-radius:4px; }
.tpl-prev .hd .ln{ height:5px; border-radius:3px; width:44%; }
.tpl-prev .bd{ padding:8px 10px; display:flex; flex-direction:column; gap:6px; }
.tpl-prev .row{ display:flex; align-items:center; gap:6px; }
.tpl-prev .row .sq{ width:16px; height:16px; border-radius:4px; flex:0 0 auto; }
.tpl-prev .row .t{ height:5px; border-radius:3px; flex:1; }
.tpl-prev .row .p{ height:5px; border-radius:3px; width:22px; }
.tpl-name{ padding:10px; font-size:12.5px; font-weight:700; text-align:center; }
.tpl-check{
  position:absolute; top:8px; right:8px; width:22px; height:22px; border-radius:50%;
  background:var(--clay-br); display:none; align-items:center; justify-content:center;
}
.tpl.sel .tpl-check{ display:flex; animation:pop .3s var(--ease) both; }

/* ---------- rasm yuklash ---------- */
.up{ display:flex; gap:14px; align-items:center; }
.up-prev{
  width:82px; height:82px; border-radius:12px; flex:0 0 auto; overflow:hidden;
  background:var(--ink-soft); border:1px dashed var(--line-2);
  display:flex; align-items:center; justify-content:center;
}
.up-prev.wide{ width:130px; height:74px; }
.up-prev img{ width:100%; height:100%; object-fit:cover; }
.up-prev svg{ opacity:.35; }
.up-act{ flex:1; min-width:0; }
.file-btn{
  display:flex; align-items:center; justify-content:center; gap:8px;
  padding:13px 16px; border:1px solid var(--line-2); border-radius:12px;
  font-size:13px; font-weight:600; cursor:pointer; transition:background .2s;
}
.file-btn:active{ background:rgba(241,233,218,.06); }
.file-btn input{ display:none; }
.up-act .rm{ display:block; width:100%; text-align:center; font-size:12px; color:var(--bone-mute); margin-top:8px; }

/* ---------- xulosa ---------- */
.sum{ display:flex; flex-direction:column; gap:1px; background:var(--line); border-radius:var(--r); overflow:hidden; }
.sum-row{ display:flex; justify-content:space-between; gap:14px; padding:14px 16px; background:var(--ink-soft); font-size:13.5px; }
.sum-row b{ color:var(--bone-mute); font-weight:500; flex:0 0 auto; }
.sum-row span{ text-align:right; word-break:break-word; }

/* ---------- holat ---------- */
.spinner{ width:17px; height:17px; border-radius:50%; border:2px solid rgba(241,233,218,.35);
  border-top-color:var(--bone); animation:spin .7s linear infinite; }
.btn-primary .spinner{ border-top-color:#fff; }
.msg{ padding:14px 16px; border-radius:12px; font-size:13px; line-height:1.55; margin-top:14px; display:none; }
.msg.on{ display:block; animation:fadeUp .3s var(--ease) both; }
.msg.err{ background:rgba(158,43,37,.14); border:1px solid rgba(158,43,37,.4); color:#e8a397; }
.msg.ok{ background:rgba(79,169,107,.12); border:1px solid rgba(79,169,107,.35); color:#9fd6b1; }

.center-screen{ min-height:100dvh; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:32px 20px; text-align:center; }

/* ---------- skeleton ---------- */
.sk{ background:linear-gradient(90deg,var(--ink-soft) 0%,var(--ink-2) 40%,var(--ink-soft) 80%);
  background-size:400px 100%; animation:shimmer 1.3s infinite linear; border-radius:10px; }

/* ---------- dashboard ---------- */
.dash-hero{ padding:26px 0 20px; }
.dash-hero .hi{ font-size:13px; color:var(--bone-mute); }
.dash-hero h1{ font-size:26px; margin-top:6px; line-height:1.2; }
.rest-card{ display:flex; gap:14px; align-items:center; padding:16px; border-radius:var(--r);
  background:var(--ink-soft); border:1px solid var(--line); margin-bottom:12px;
  transition:transform .25s var(--ease), border-color .25s; }
.rest-card:active{ transform:scale(.985); }
.rest-card:hover{ border-color:var(--line-2); }
.rest-logo{ width:52px; height:52px; border-radius:12px; flex:0 0 auto; overflow:hidden; background:var(--ink-2);
  display:flex; align-items:center; justify-content:center; font-family:'Unbounded'; font-weight:700; font-size:19px; }
.rest-logo img{ width:100%; height:100%; object-fit:cover; }
.rest-meta{ flex:1; min-width:0; }
.rest-meta .nm{ font-weight:700; font-size:15px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rest-meta .sl{ font-family:'Space Mono'; font-size:11.5px; color:var(--bone-mute); margin-top:3px; }
.chip{ display:inline-flex; align-items:center; gap:6px; font-family:'Space Mono'; font-size:10.5px;
  letter-spacing:.06em; text-transform:uppercase; padding:5px 10px; border-radius:100px; }
.chip.live{ background:rgba(79,169,107,.16); color:#8fcfa4; }
.chip.wait{ background:rgba(203,174,131,.16); color:var(--sand); }
.link-list{ display:flex; flex-direction:column; gap:1px; background:var(--line); border-radius:var(--r); overflow:hidden; }
.link-row{ display:flex; align-items:center; gap:12px; padding:16px; background:var(--ink-soft); font-size:14px; }
.link-row:active{ background:var(--ink-2); }
.link-row .ic{ width:34px; height:34px; border-radius:9px; background:rgba(181,79,29,.16);
  display:flex; align-items:center; justify-content:center; flex:0 0 auto; }
.link-row .tx{ flex:1; }
.link-row .tx small{ display:block; font-size:11.5px; color:var(--bone-mute); margin-top:2px; }

.sec-title{ font-family:'Space Mono'; font-size:11px; letter-spacing:.16em; text-transform:uppercase;
  color:var(--sand); margin:26px 0 12px; }

.empty{ text-align:center; padding:44px 20px; }
.empty svg{ margin:0 auto 16px; opacity:.4; }
.empty p{ font-size:14px; color:var(--bone-mute); line-height:1.6; margin-bottom:20px; }

/* ---------- super admin ---------- */
.sa-stats{ display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin-bottom:22px; }
.sa-stat{ padding:16px; border-radius:var(--r); background:var(--ink-soft); border:1px solid var(--line); }
.sa-stat b{ display:block; font-family:'Unbounded'; font-size:26px; color:var(--clay-br); line-height:1; }
.sa-stat span{ font-family:'Space Mono'; font-size:10.5px; letter-spacing:.08em; text-transform:uppercase;
  color:var(--bone-mute); margin-top:7px; display:block; }
.search{ position:relative; margin-bottom:16px; }
.search input{ width:100%; padding:14px 16px 14px 44px; border-radius:12px; border:1px solid var(--line-2);
  background:var(--ink-soft); color:var(--bone); }
.search input:focus{ outline:none; border-color:var(--clay); }
.search svg{ position:absolute; left:15px; top:50%; transform:translateY(-50%); opacity:.4; }

.sheet{ position:fixed; inset:0; z-index:100; display:flex; align-items:flex-end; justify-content:center;
  background:rgba(11,9,7,.7); backdrop-filter:blur(4px); opacity:0; pointer-events:none; transition:opacity .3s; }
.sheet.on{ opacity:1; pointer-events:auto; }
.sheet-box{ width:100%; max-width:560px; max-height:88dvh; overflow-y:auto; background:var(--ink-soft);
  border:1px solid var(--line); border-radius:20px 20px 0 0; padding:22px 20px calc(28px + env(safe-area-inset-bottom));
  transform:translateY(100%); transition:transform .35s var(--ease); }
.sheet.on .sheet-box{ transform:none; }
.sheet-grip{ width:38px; height:4px; border-radius:2px; background:var(--line-2); margin:0 auto 18px; }

/* ============================================================
   DESKTOP
   ============================================================ */
@media (min-width:900px){
  .topbar{ padding:18px 40px; }
  .brand svg{ width:30px; height:30px; }
  .brand span{ font-size:17px; }
  .wrap{ max-width:620px; padding:0 32px; }
  .wrap-wide{ padding:0 40px; }
  .btn{ width:auto; min-width:180px; }
  .btn-row .btn{ flex:0 1 auto; }
  .pane h2{ font-size:36px; }
  .pane .lead{ font-size:16px; }
  .two{ grid-template-columns:1fr 1fr; gap:0 16px; }
  .tpl-grid{ grid-template-columns:repeat(3,1fr); gap:16px; }
  .tpl-prev{ height:160px; }
  .steps,.step-meta{ padding-left:0; padding-right:0; }
  .sa-stats{ grid-template-columns:repeat(4,1fr); gap:14px; }
  .sheet{ align-items:center; }
  .sheet-box{ border-radius:20px; max-height:84dvh; padding:26px; }
  .sheet.on .sheet-box{ animation:pop .35s var(--ease) both; }
  .dash-hero h1{ font-size:34px; }
  .dash-grid{ display:grid; grid-template-columns:1.15fr .85fr; gap:26px; align-items:start; }
}
@media (min-width:1100px){
  .sa-list{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
  .rest-card{ margin-bottom:0; }
}

/* desktop'da ko'rsatish/yashirish */
.only-desktop{ display:none; }
@media (min-width:900px){ .only-desktop{ display:block; } .only-mobile{ display:none; } }
