/* NAM Agent — market boshqaruv paneli.
   Yo'nalish: do'kon peshtaxtasi — toza oq yuzalar, yangi ko'kat yashili, narx yorlig'i sariq.
   Istisnolar "narx yorlig'i" ko'rinishida — panelning yagona yorqin elementi. */

@font-face { font-family: "Manrope"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/manrope-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/manrope-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 700; font-display: swap; src: url("/static/fonts/manrope-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/fonts/unbounded-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/fonts/unbounded-latin-600-normal.woff2") format("woff2"); }

:root {
  --ink: #1D2A33;
  --ink-2: #33444F;
  --muted: #5F6E68;
  --paper: #F3F6F2;
  --card: #FFFFFF;
  --line: #DCE3DD;
  --leaf: #1F7A5A;
  --leaf-d: #16614A;
  --leaf-l: #E2F0E8;
  --tag: #F2C230;
  --tag-l: #FFF5D1;
  --orange: #E08A2E;
  --orange-l: #FCEBD7;
  --red: #C8402F;
  --red-l: #FBE5E1;
  --radius: 10px;
  --display: "Unbounded", "Manrope", system-ui, sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 500 15px/1.5 var(--body); font-feature-settings: "tnum" 1;
}
a { color: var(--leaf-d); text-decoration-thickness: 1px; text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--tag); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 22px; line-height: 1.25; }
h2 { font-size: 16px; line-height: 1.3; }
h3 { font-size: 14px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-family: var(--display); font-weight: 600; }

/* ---------- каркас */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side {
  background: var(--ink); color: #DDE6E1; padding: 20px 14px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
}
.brand { padding: 4px 10px 18px; }
.brand b { display: block; font-family: var(--display); font-size: 17px; color: #fff; font-weight: 600; }
.brand span { font-size: 12px; color: #9FB2A9; }
.side a.nav {
  display: flex; align-items: center; gap: 10px; color: #DDE6E1; text-decoration: none;
  padding: 9px 10px; border-radius: 8px; font-weight: 600; font-size: 14px;
}
.side a.nav:hover { background: rgba(255,255,255,.06); }
.side a.nav.on { background: var(--leaf); color: #fff; }
.side .who { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; }
.side .who b { display: block; color: #fff; }
.side form button { background: none; border: 0; color: #9FB2A9; padding: 6px 0; cursor: pointer; font: inherit; }
.ico { width: 18px; height: 18px; flex: none; }

main.content { padding: 24px 28px 96px; max-width: 1180px; width: 100%; min-width: 0; }
.shell > div { min-width: 0; }
.grid > *, .stack > * { min-width: 0; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.head p { margin: 4px 0 0; color: var(--muted); }

/* ---------- mobil */
.topbar, .tabbar { display: none; }
@media (max-width: 860px) {
  .shell { display: block; }
  .side { display: none; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; background: var(--ink); color: #fff;
    padding: 12px 16px; position: sticky; top: 0; z-index: 20;
  }
  .topbar b { font-family: var(--display); font-size: 15px; font-weight: 600; }
  main.content { padding: 16px 16px 96px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a, .tabbar summary {
    display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 700;
    color: var(--muted); text-decoration: none; padding: 4px 0; cursor: pointer; list-style: none;
  }
  .tabbar summary::-webkit-details-marker { display: none; }
  .tabbar a.on { color: var(--leaf); }
  .tabbar details[open] .sheet { display: block; }
  .sheet {
    display: none; position: fixed; left: 0; right: 0; bottom: 64px; background: var(--card); border-top: 1px solid var(--line);
    box-shadow: 0 -12px 30px rgba(29,42,51,.12); padding: 8px 12px; max-height: 70vh; overflow: auto;
  }
  .sheet a { flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 15px; padding: 12px 6px; color: var(--ink); }
}

/* ---------- bloklar */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.panel + .panel, .stack > * + * { margin-top: 14px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .g2, .g3, .g-main { grid-template-columns: 1fr; } }
.panel h2 { margin-bottom: 12px; }
.panel .ph { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.panel .ph h2 { margin: 0; }

/* raqamlar qatori — kartalarsiz, bitta lenta */
.figures { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.figures > div { padding: 14px 16px; border-left: 1px solid var(--line); }
.figures > div:first-child { border-left: 0; }
.figures .v { font-family: var(--display); font-size: 22px; font-weight: 600; line-height: 1.2; }
.figures .l { font-size: 13px; color: var(--muted); }
.figures .v.bad { color: var(--red); }
@media (max-width: 860px) {
  .figures { grid-template-columns: 1fr 1fr; }
  .figures > div:nth-child(3) { border-left: 0; }
  .figures > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ---------- istisnolar: narx yorliqlari */
.tags { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; }
.tag {
  position: relative; display: block; padding: 10px 14px 10px 30px; max-width: 100%;
  background: var(--tag-l); border: 1.5px solid var(--tag); border-radius: 6px 14px 14px 6px;
  font-weight: 600; font-size: 14px; color: var(--ink); text-decoration: none; line-height: 1.35;
}
.tag::before { /* yorliq teshigi */
  content: ""; position: absolute; left: 11px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px;
  border-radius: 50%; background: var(--paper); border: 1.5px solid var(--tag);
}
.tag.red { background: var(--red-l); border-color: var(--red); }
.tag.red::before { border-color: var(--red); }
.tag.orange { background: var(--orange-l); border-color: var(--orange); }
.tag.orange::before { border-color: var(--orange); }
.tag:hover { filter: brightness(.98); }
.allgood { display: flex; gap: 10px; align-items: center; background: var(--leaf-l); border: 1.5px solid var(--leaf); border-radius: 6px 14px 14px 6px; padding: 10px 14px; font-weight: 700; margin-bottom: 18px; }

/* ---------- jadvallar */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 700; color: var(--muted); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
tr.link { cursor: pointer; }
tr.link:hover td { background: #F7FAF7; }
.tablewrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }

.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.ok { background: var(--leaf-l); color: var(--leaf-d); }
.pill.warn { background: var(--tag-l); color: #7A5B00; }
.pill.bad { background: var(--red-l); color: var(--red); }
.pill.off { background: #EEF1EE; color: var(--muted); }
.pill.orange { background: var(--orange-l); color: #8A4B0B; }

/* ---------- formalar va tugmalar */
label { display: block; font-weight: 700; font-size: 13px; margin: 0 0 4px; }
.field { margin-bottom: 12px; }
input[type=text], input[type=number], input[type=tel], input[type=date], input[type=time], input[type=month], input[type=password], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #C9D3CC; border-radius: 8px; background: #fff; font: inherit; color: var(--ink);
}
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--leaf); outline: 2px solid var(--leaf-l); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1 1 160px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 8px;
  border: 1px solid var(--leaf); background: var(--leaf); color: #fff; font: 700 14px var(--body); cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--leaf-d); }
.btn.ghost { background: #fff; color: var(--leaf-d); }
.btn.ghost:hover { background: var(--leaf-l); }
.btn.danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #C9D3CC; border-radius: 8px; padding: 6px 10px; font-weight: 600; margin: 0; cursor: pointer; }
.checks input { accent-color: var(--leaf); }
details.add > summary { list-style: none; cursor: pointer; }
details.add > summary::-webkit-details-marker { display: none; }
details.add[open] > summary { margin-bottom: 12px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-weight: 600; }
.flash.ok { background: var(--leaf-l); color: var(--leaf-d); }
.flash.err { background: var(--red-l); color: var(--red); }

/* ---------- davomat kalendari */
.cal { border-collapse: separate; border-spacing: 2px; font-size: 12px; }
.cal th { padding: 2px 0; text-align: center; font-size: 11px; border: 0; min-width: 26px; }
.cal th.name { text-align: left; min-width: 150px; padding-right: 8px; }
.cal td { padding: 0; border: 0; }
.cal td.name { padding: 4px 8px 4px 0; font-weight: 600; white-space: nowrap; position: sticky; left: 0; background: var(--card); z-index: 1; }
.cal th.name { position: sticky; left: 0; background: var(--card); z-index: 1; }
.cal .c { display: block; width: 26px; height: 26px; border-radius: 5px; text-align: center; line-height: 26px; font-weight: 700; font-size: 11px; text-decoration: none; color: var(--ink); }
.c.present { background: #CFE7DA; }
.c.late { background: var(--tag); }
.c.absent { background: var(--red); color: #fff; }
.c.off { background: transparent; box-shadow: inset 0 0 0 1.5px #D3DBD5; }
.c.leave { background: #DCE7F4; }
.c.working { background: var(--leaf); color: #fff; }
.c.none { background: transparent; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- savdo ustunlari */
.bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; align-items: end; height: 120px; }
.bars div { background: var(--leaf); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.bars div.zero { background: var(--line); }
.bars-x { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; font-size: 11px; color: var(--muted); text-align: center; margin-top: 4px; }

/* ---------- tasdiqlar */
.appr { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.appr:last-child { border-bottom: 0; }
.appr.done { color: var(--muted); font-weight: 600; }
.appr .acts { display: flex; gap: 6px; flex: none; }

/* ---------- selfilar */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.shots figure { margin: 0; }
.shots img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 8px; background: #E8EDE9; display: block; }
.shots figcaption { font-size: 12px; margin-top: 4px; }

/* ---------- xarita */
#map { height: 380px; border-radius: var(--radius); border: 1px solid var(--line); }
.range { display: flex; align-items: center; gap: 12px; }
.range input { flex: 1; accent-color: var(--leaf); }
.range output { font-family: var(--display); font-weight: 600; min-width: 70px; }

/* ---------- AI chat */
.chat { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 78%; padding: 10px 13px; border-radius: 12px; white-space: pre-wrap; line-height: 1.45; }
.msg.q { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.msg.a { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.suggest button { border: 1px solid #C9D3CC; background: #fff; border-radius: 999px; padding: 6px 12px; font: 600 13px var(--body); cursor: pointer; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }

/* ---------- kirish sahifasi */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .box { width: 100%; max-width: 420px; }
.auth .mark { font-family: var(--display); font-size: 28px; font-weight: 600; line-height: 1.15; margin-bottom: 8px; }
.steps { padding-left: 20px; margin: 12px 0 18px; }
.steps li { margin-bottom: 6px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- ulgurji */
.wbars { display: grid; grid-template-columns: repeat(30, 1fr); gap: 2px; align-items: end; height: 120px; }
.wbars div { display: flex; gap: 1px; align-items: flex-end; height: 100%; }
.wbars i { flex: 1; background: var(--ink); border-radius: 2px 2px 0 0; min-height: 1px; }
.wbars i.p { background: var(--leaf); }
.wbars + .bars-x { grid-template-columns: repeat(30, 1fr); gap: 2px; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; }
.items { display: grid; gap: 6px; margin-bottom: 8px; }
.irow { display: grid; grid-template-columns: 1.3fr 1fr .7fr .6fr .8fr 1fr; gap: 6px; }
.irow select { min-width: 0; padding: 8px 4px; }
.irow input { min-width: 0; padding: 8px; }
.ihead { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.wdoc { border-left: 3px solid var(--ink); padding: 8px 0 8px 12px; margin-bottom: 10px; }
.wdoc.credit { border-left-color: var(--leaf); }
.wdoc.void { opacity: .5; }
.wdoc-h { display: flex; justify-content: space-between; gap: 10px; }
.wit { width: auto; font-size: 13px; margin: 6px 0; }
.wit td { padding: 2px 16px 2px 0; border: 0; }
@media (max-width: 520px) {
  .irow { grid-template-columns: 1fr 1fr 1fr; }
  .irow input[name=model] { grid-column: 1 / -1; }
  .ihead { display: none; }
}

/* ---------- ko'k tema (ulgurji / DeForno): och fon, ko'k-binafsha urg'u, yashil yo'q */
[data-theme="blue"] {
  --ink: #0E1530; --ink-2: #2A3355; --muted: #5D6584; --paper: #F5F6FC; --card: #FFFFFF; --line: #E4E7F3;
  --leaf: #3B5BFF; --leaf-d: #2A43D6; --leaf-l: #ECEFFF; --grad: linear-gradient(100deg, #3B5BFF 0%, #6A4DFF 60%, #8B5CF6 100%);
  --display: "Manrope", system-ui, sans-serif; --radius: 16px;
}
[data-theme="blue"] body, body[data-theme="blue"] {
  background: radial-gradient(1200px 600px at 85% -10%, #EDE7FF 0%, rgba(237,231,255,0) 60%),
              radial-gradient(900px 500px at -10% 10%, #E3EAFF 0%, rgba(227,234,255,0) 60%), var(--paper);
  background-attachment: fixed;
}
body[data-theme="blue"] h1 { font-weight: 800; letter-spacing: -0.02em; font-size: 24px; }
body[data-theme="blue"] h2 { font-weight: 800; }
body[data-theme="blue"] .side { background: rgba(255,255,255,.85); color: var(--ink); border-right: 1px solid var(--line); backdrop-filter: blur(8px); }
body[data-theme="blue"] .brand b { color: var(--ink); font-weight: 800; }
body[data-theme="blue"] .brand span, body[data-theme="blue"] .side form button { color: var(--muted); }
body[data-theme="blue"] .side a.nav { color: var(--ink-2); }
body[data-theme="blue"] .side a.nav:hover { background: var(--leaf-l); }
body[data-theme="blue"] .side a.nav.on { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(59,91,255,.28); }
body[data-theme="blue"] .side .who { border-top-color: var(--line); }
body[data-theme="blue"] .side .who b { color: var(--ink); }
body[data-theme="blue"] .topbar { background: rgba(255,255,255,.9); color: var(--ink); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
body[data-theme="blue"] .panel, body[data-theme="blue"] .figures { border-color: var(--line); box-shadow: 0 1px 2px rgba(14,21,48,.04), 0 8px 24px rgba(59,91,255,.05); }
body[data-theme="blue"] .figures .v { font-weight: 800; }
body[data-theme="blue"] .btn { background: var(--grad); border-color: transparent; border-radius: 999px; box-shadow: 0 6px 16px rgba(59,91,255,.22); }
body[data-theme="blue"] .btn:hover { filter: brightness(1.05); background: var(--grad); }
body[data-theme="blue"] .btn.ghost { background: #fff; color: var(--leaf-d); border-color: var(--line); box-shadow: none; }
body[data-theme="blue"] .btn.ghost:hover { background: var(--leaf-l); }
body[data-theme="blue"] .btn.danger { background: #fff; color: var(--red); border-color: var(--red); box-shadow: none; }
body[data-theme="blue"] .allgood { background: var(--leaf-l); border-color: var(--leaf); }
body[data-theme="blue"] .wdoc.credit { border-left-color: #8B5CF6; }
body[data-theme="blue"] .wbars i.p { background: #8B5CF6; }
body[data-theme="blue"] .wbars i { background: var(--leaf); }

/* bonus chizig'i */
.tiers { position: relative; height: 12px; background: var(--leaf-l); border-radius: 999px; margin: 18px 0 30px; }
.tiers .fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--grad, var(--leaf)); }
.tiers .mk { position: absolute; top: -6px; width: 2px; height: 24px; background: var(--ink-2); opacity: .35; }
.tiers .mk span { position: absolute; top: 26px; left: 50%; transform: translateX(-50%); font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.tiers .mk.on { background: var(--leaf); opacity: 1; }
.tiers .mk.on span { color: var(--leaf-d); }
.tiers .mk:last-child span { left: auto; right: 0; transform: none; }
.key.s { background: var(--ink); } .key.p { background: var(--leaf); }
body[data-theme="blue"] .key.s { background: var(--leaf); } body[data-theme="blue"] .key.p { background: #8B5CF6; }

/* ===== Ulgurji: telefon uchun yangi ko'rinish (Bugun, mijoz kartasi, pastdan ochiladigan formalar) ===== */
.wtab { grid-template-columns: repeat(5, 1fr); align-items: end; }
.wtab a.wplus { padding: 0; }
.wtab a.wplus span { width: 56px; height: 56px; margin-top: -24px; border-radius: 18px; background: var(--grad, var(--leaf)); color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 24px rgba(59,91,255,.35); }
.wtab a.wplus .ico { width: 28px; height: 28px; stroke-width: 2.6; }
.wcard { background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.wlist { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.wrow { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-top: 1px solid var(--line); color: var(--ink);
  text-decoration: none; width: 100%; background: none; text-align: left; font: inherit; }
.wlist > .wrow:first-child, .wlist > details:first-child > summary.wrow { border-top: 0; }
a.wrow:hover, summary.wrow:hover { background: #FAFBFE; }
.wgrow { flex: 1; min-width: 0; }
.wname { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wsub { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.wsub.bad { color: var(--red); } .wsub.warn { color: #8A6400; }
.wava { width: 42px; height: 42px; border-radius: 12px; background: var(--leaf-l); color: var(--leaf-d); font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex: none; }
.wibtn { width: 42px; height: 42px; border-radius: 12px; background: var(--leaf-l); color: var(--leaf-d); display: inline-flex;
  align-items: center; justify-content: center; flex: none; text-decoration: none; }
.wibtn .ico { width: 18px; height: 18px; }
.wdark { height: 42px; padding: 0 13px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 800; font-size: 13px;
  display: inline-flex; align-items: center; flex: none; text-decoration: none; border: 0; cursor: pointer; font-family: inherit; }
.wchips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.wchips::-webkit-scrollbar { display: none; }
.wchip { border: 1px solid var(--line); background: var(--card); color: var(--ink-2); border-radius: 999px; padding: 9px 13px;
  font-size: 13px; font-weight: 700; white-space: nowrap; min-height: 38px; text-decoration: none; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; }
.wchip.on, .wchips input:checked + .wchip { background: var(--ink); color: #fff; border-color: var(--ink); }
.wchips input[type=radio] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wchips input:focus-visible + .wchip { outline: 2px solid var(--leaf); outline-offset: 2px; }
.wstack { display: flex; flex-direction: column; gap: 14px; }
.wh2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 4px 2px -6px; }
.wh2 b { font-size: 16px; }
.wask { padding: 12px; }
.wask form { display: flex; gap: 8px; }
.wask input[type=text] { flex: 1; min-width: 0; }
.wsend { flex: none; width: 48px; border-radius: 12px; border: 0; background: var(--grad, var(--leaf)); color: #fff; display: flex;
  align-items: center; justify-content: center; cursor: pointer; }
.wans:empty { display: none; }
.wans { margin-top: 10px; background: #F3F5FF; border-radius: 12px; padding: 12px; font-size: 14px; line-height: 1.5; white-space: pre-line; }
.wans .msg.q { font-weight: 800; margin-bottom: 4px; } .wans .msg { background: none; padding: 0; margin: 0; max-width: none; }
.wkpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.wkpis > div { padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.wkpis b { display: block; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.wkpis b.bad { color: var(--red); }
@media (max-width: 860px) { .wkpis { grid-template-columns: 1fr 1fr; } }
.wcols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 860px) { .wcols { grid-template-columns: 1fr; } }
/* mijoz kartasi */
.whead { padding: 16px; }
.whead .top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.wbig { font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.wpills { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.wpill { border-radius: 999px; padding: 4px 10px; font-size: 12.5px; font-weight: 700; background: var(--leaf-l); color: var(--leaf-d); }
.wpill.warn { background: #FFF5D1; color: #6B4E00; } .wpill.bad { background: var(--red-l); color: var(--red); }
.wpill.off { background: #EEF0F6; color: var(--muted); }
.wbonus { margin-top: 14px; }
.wbonus .t { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; }
.wbar { position: relative; height: 10px; background: #ECEFFF; border-radius: 999px; margin: 8px 0 24px; }
.wbar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--grad, var(--leaf)); }
.wbar .tk { position: absolute; top: -4px; width: 2px; height: 18px; background: var(--muted); opacity: .45; }
.wbar .tl { position: absolute; top: 16px; font-size: 11px; font-weight: 700; color: var(--muted); transform: translateX(-50%); white-space: nowrap; }
.wbar .tl.end { transform: translateX(-100%); }
.wact { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; position: sticky; top: 0; z-index: 15; background: var(--paper); padding: 6px 0; }
@media (max-width: 860px) { .wact { top: 50px; } }
.wact button { height: 58px; border-radius: 14px; border: 0; font: inherit; font-weight: 800; font-size: 13.5px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.wact .ico { width: 20px; height: 20px; }
.wact .g { background: var(--grad, var(--leaf)); color: #fff; } .wact .d { background: var(--ink); color: #fff; }
.wact .w { background: var(--card); color: var(--ink); border: 1px solid #D9DDEC; }
.wdot { width: 10px; height: 10px; border-radius: 999px; flex: none; background: #8A93B0; }
.wdot.sale { background: #3B5BFF; } .wdot.payment, .wdot.bonus { background: #7B4DFF; } .wdot.return { background: #E08A2E; }
.wamt { text-align: right; font-variant-numeric: tabular-nums; } .wamt b { display: block; font-size: 14.5px; }
.wamt b.cr { color: #5B3FD9; }
.wrow.void { opacity: .55; } .wrow.void .wname { text-decoration: line-through; }
details.wdoc2 > summary { list-style: none; cursor: pointer; } details.wdoc2 > summary::-webkit-details-marker { display: none; }
.wdetail { padding: 0 12px 12px 32px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.wdetail .it { display: flex; justify-content: space-between; gap: 8px; color: var(--ink-2); }
.wmore { display: block; padding: 13px; text-align: center; background: #FAFBFE; color: var(--leaf-d); font-weight: 800; font-size: 13.5px;
  border-top: 1px solid var(--line); text-decoration: none; }
/* pastdan ochiladigan forma */
dialog.wsheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 90vh; border-radius: 24px 24px 0 0;
  background: var(--card); color: var(--ink); box-shadow: 0 -10px 40px rgba(14,21,48,.2); }
@media (min-width: 861px) { dialog.wsheet { margin: auto; border-radius: 24px; } }
dialog.wsheet::backdrop { background: rgba(14,21,48,.4); }
.wsheet-in { padding: 10px 16px calc(20px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 12px; }
.wgrab { width: 40px; height: 5px; border-radius: 999px; background: #D9DDEC; margin: 0 auto; }
.wst { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.wst b { font-size: 18px; }
.wx { border: 0; background: var(--leaf-l); color: var(--leaf-d); border-radius: 10px; height: 36px; padding: 0 12px; font: inherit; font-weight: 800; cursor: pointer; }
.wsheet label.l { font-size: 12px; font-weight: 700; color: var(--muted); display: block; margin-bottom: 5px; }
.wsheet input[type=text], .wsheet input[type=number], .wsheet input[type=date], .wsheet select { width: 100%; font-size: 16px; }
.wline { border: 1px solid var(--line); border-radius: 16px; padding: 10px; background: #FAFBFE; display: flex; flex-direction: column; gap: 8px; position: relative; }
.wline .hd { display: flex; justify-content: space-between; font-size: 12px; font-weight: 800; color: var(--muted); }
.wline .hd button { border: 0; background: none; color: var(--muted); font: inherit; cursor: pointer; padding: 0 4px; }
.wg3 { display: grid; grid-template-columns: 1.2fr .8fr 1fr; gap: 8px; }
.wsug { border: 1px solid #D9DDEC; border-radius: 12px; overflow: hidden; background: var(--card); }
.wsug:empty { display: none; }
.wsug button { display: flex; width: 100%; gap: 10px; align-items: baseline; padding: 11px 12px; border: 0; border-top: 1px solid #F0F2F8;
  background: var(--card); text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.wsug button:first-child { border-top: 0; }
.wsug b { width: 64px; flex: none; }
.wdash { height: 46px; border-radius: 12px; border: 1.5px dashed #B9C2E8; background: var(--card); color: var(--leaf-d); font: inherit; font-weight: 800; cursor: pointer; }
.wtot { background: #F3F5FF; border-radius: 14px; padding: 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; font-variant-numeric: tabular-nums; }
.wtot b { display: block; font-size: 17px; } .wtot span { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.wsave { height: 54px; border-radius: 14px; border: 0; font: inherit; font-weight: 800; font-size: 16px; width: 100%; cursor: pointer;
  background: var(--grad, var(--leaf)); color: #fff; }
.wsave.d { background: var(--ink); }
.wseg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: #E9ECF7; padding: 4px; border-radius: 14px; }
.wseg a, .wseg label { height: 40px; border-radius: 11px; color: var(--muted); font-weight: 800; font-size: 13.5px; display: flex;
  align-items: center; justify-content: center; text-decoration: none; cursor: pointer; }
.wseg a.on, .wseg input:checked + label { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(14,21,48,.12); }
.wseg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wnote { font-size: 12px; color: var(--muted); text-align: center; margin: 0; }
.wopt { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink); }
.wopt .ic { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex: none; color: #fff; }
.wopt .ic .ico { width: 20px; height: 20px; }
[hidden] { display: none !important; }
