/* TIIU Yotoqxona — panel. Tokenlar va qoidalar: docs/DESIGN.md */
:root {
  color-scheme: light dark;
  /* DormOS Warden Console — Stitch dizayni asosida */
  --bg: #f8f9ff; --surface: #fff; --surface-2: #eff4ff; --surface-3: #e5eeff; --line: #e2e8f0; --line-strong: #cbd5e1;
  --text: #0b1c30; --muted: #464554; --muted-2: #64748b;
  --brand: #4338ca; --brand-fill: #4338ca; --brand-hover: #3730a3; --brand-soft: #e3dfff; --focus: rgb(67 56 202 / .22);
  --accent: #006591; --accent-soft: #c9e6ff;
  --ok: #065f46; --ok-soft: #d1fae5; --ok-fill: #10b981; --ok-pill: #6ffbbe;
  --warn: #92400e; --warn-soft: #fef3c7; --warn-fill: #f59e0b;
  --bad: #ba1a1a; --bad-soft: #ffdad6; --bad-fill: #dc2626; --bad-tint: #fff5f4;
  --off: #94a3b8; --off-soft: #e2e8f0;
  --side: #fff; --side-text: #464554; --side-hover: #eff4ff; --side-active: #4338ca;
  --chart-in: #4338ca; --chart-out: #39b8fd; --row-hover: #f8faff;
  --shadow-1: 0 1px 3px 0 rgb(15 23 42 / .05), 0 1px 2px -1px rgb(15 23 42 / .05);
  --shadow-2: 0 4px 6px -1px rgb(15 23 42 / .07), 0 2px 4px -2px rgb(15 23 42 / .05);
  --shadow-3: 0 20px 25px -5px rgb(15 23 42 / .1), 0 8px 10px -6px rgb(15 23 42 / .06);
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;
  --r-sm: 6px; --r: 8px; --r-md: 12px; --r-lg: 16px;
  --font: Inter, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-head: "Plus Jakarta Sans", Inter, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220; --surface: #121a2b; --surface-2: #17213a; --surface-3: #1d2945; --line: #24304a; --line-strong: #3a4766;
    --text: #eaf1ff; --muted: #a9b4cc; --muted-2: #8b97b0;
    --brand: #c3c0ff; --brand-fill: #5148d7; --brand-hover: #6359e6; --brand-soft: #262158; --focus: rgb(195 192 255 / .35);
    --accent: #89ceff; --accent-soft: #0f3550;
    --ok: #4edea3; --ok-soft: #0f3326; --ok-fill: #10b981; --ok-pill: #0f3326;
    --warn: #fbbf24; --warn-soft: #3a2b10; --warn-fill: #d97706;
    --bad: #ffb4ab; --bad-soft: #3d1b1b; --bad-fill: #ef4444; --bad-tint: #241519;
    --off: #5b6782; --off-soft: #24304a;
    --side: #0f1726; --side-text: #a9b4cc; --side-hover: #17213a; --side-active: #5148d7;
    --chart-in: #8b85ff; --chart-out: #39b8fd; --row-hover: #17213a;
    --shadow-1: 0 1px 2px rgb(0 0 0 / .3); --shadow-2: 0 8px 24px rgb(0 0 0 / .45); --shadow-3: 0 20px 40px rgb(0 0 0 / .5);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/20px "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; text-underline-offset: 2px; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; line-height: 28px; font-weight: 650; letter-spacing: -.01em; margin: 0; }
h2 { font-size: 15px; line-height: 20px; font-weight: 600; margin: 0 0 var(--s3); }
code { font: 12.5px/16px ui-monospace, "Cascadia Mono", Consolas, monospace; background: var(--surface-2);
  padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line); }
.num, .stat .value, .t td, .kv dd { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; line-height: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
svg.i { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); border-radius: var(--r-sm); }
.skip { position: absolute; left: var(--s3); top: -48px; z-index: 100; background: var(--brand-fill); color: #fff;
  padding: var(--s2) var(--s4); border-radius: var(--r); transition: top .12s var(--ease); }
.skip:focus { top: var(--s3); }

/* ---------- layout */
.layout { display: flex; min-height: 100vh; }
.side { width: 232px; background: var(--side); color: var(--side-text); flex-shrink: 0; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 30; }
.side .logo { padding: var(--s5) var(--s5) var(--s4); color: #fff; font-weight: 650; font-size: 16px; display: flex; gap: 10px; align-items: center; }
.side .logo .mark { width: 30px; height: 30px; border-radius: var(--r); background: #2f54e0; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; }
.side .logo small { display: block; font-weight: 400; color: var(--side-text); font-size: 12px; line-height: 14px; }
.side nav { padding: var(--s2) var(--s2); flex: 1; overflow-y: auto; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 9px var(--s3); margin-bottom: 2px; color: var(--side-text);
  border-radius: var(--r); transition: background .12s var(--ease), color .12s var(--ease); }
.side nav a:hover { background: var(--side-hover); color: #fff; text-decoration: none; }
.side nav a[aria-current="page"] { background: var(--side-active); color: #fff; font-weight: 600; }
.side nav a[aria-current="page"] svg.i { color: #9fb6ff; }
.side nav .count { margin-left: auto; background: #e5484d; color: #fff; font-size: 12px; font-weight: 700; min-width: 22px; height: 20px;
  padding: 0 6px; border-radius: 999px; display: grid; place-items: center; }
.side nav .count[hidden] { display: none; }
.side .me { padding: var(--s4) var(--s5); border-top: 1px solid rgb(255 255 255 / .08); font-size: 12.5px; display: flex; align-items: center; gap: var(--s2); }
.side .me .who { flex: 1; min-width: 0; line-height: 16px; }
.side .me .who b { display: block; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .me .btn { background: transparent; color: var(--side-text); border-color: rgb(255 255 255 / .25); }
.side .me .btn:hover { background: var(--side-hover); color: #fff; }
.topbar { display: none; }
.scrim { display: none; }

.main { flex: 1; min-width: 0; padding: var(--s6) var(--s8) 48px; max-width: 1440px; }
.head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s5); flex-wrap: wrap; }
.head .sub { color: var(--muted); }
.head .spacer { flex: 1; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; }

/* ---------- surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4); box-shadow: var(--shadow-1); }
.card.flush { padding: 0; overflow: auto; }
.grid { display: grid; gap: var(--s4); }
.two { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.section { margin-top: var(--s4); }
.overline { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

/* ---------- stats */
.stats { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin-bottom: var(--s4); }
.stat { display: flex; flex-direction: column; gap: 2px; position: relative; color: inherit; }
.stat .value { font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -.01em; }
.stat .sub { color: var(--muted); font-size: 12.5px; line-height: 16px; }
.stat.ok .value { color: var(--ok); } .stat.bad .value { color: var(--bad); } .stat.warn .value { color: var(--warn); }
a.stat { transition: border-color .12s var(--ease), box-shadow .16s var(--ease), transform .16s var(--ease); }
a.stat:hover { text-decoration: none; border-color: var(--line-strong); box-shadow: var(--shadow-2); }
a.stat:active { transform: scale(.99); }
a.stat { padding-right: 40px; }
a.stat .go { position: absolute; right: var(--s3); top: var(--s4); color: var(--muted); }

.attn-row { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: var(--s4); }
.chart-empty { height: 168px; display: grid; place-items: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r); margin-top: var(--s3); }
.attn { border-left: 4px solid var(--off); }
.attn.bad { border-left-color: var(--bad-fill); } .attn.warn { border-left-color: var(--warn-fill); }
.attn.clear { border-left-color: var(--ok-fill); }
.attn.clear .value { color: var(--ok); font-size: 18px; line-height: 34px; }

.occ { display: grid; grid-template-columns: auto 1fr; gap: var(--s2) var(--s6); align-items: center; }
.occ .big { font-size: 28px; line-height: 34px; font-weight: 700; font-variant-numeric: tabular-nums; }
.meter { height: 10px; background: var(--off-soft); border-radius: 999px; overflow: hidden; display: flex; }
.meter i { display: block; height: 100%; background: var(--brand-fill); }
.occ .facts { display: flex; gap: var(--s6); flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }
.occ .facts b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- badges & buttons */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; line-height: 16px;
  font-weight: 600; background: var(--off-soft); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); } .badge.brand { background: var(--brand-soft); color: var(--brand); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--r);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 500; cursor: pointer;
  white-space: nowrap; transition: background .12s var(--ease), border-color .12s var(--ease), transform .16s var(--ease); }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--brand-fill); border-color: var(--brand-fill); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: progress; }

.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.seg button { border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--text); min-height: 32px; padding: 0 12px;
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; transition: background .12s var(--ease), color .12s var(--ease); }
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--surface-2); }
.seg button:focus-visible { border-radius: 0; box-shadow: inset 0 0 0 3px var(--focus); }
.seg button[aria-pressed="true"].paid { background: var(--ok-fill); color: #fff; }
.seg button[aria-pressed="true"].partial { background: var(--warn-fill); color: #fff; }
.seg button[aria-pressed="true"].debt { background: var(--bad-fill); color: #fff; }

/* ---------- forms */
.filters { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; margin-bottom: var(--s4); }
.input, select, input[type=text], input[type=search], input[type=date], input[type=month], input[type=number], input[type=password] {
  height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r); font: inherit; color: var(--text);
  background: var(--surface); min-width: 0; transition: border-color .12s var(--ease); }
.input:hover, select:hover, input:hover { border-color: var(--muted); }
.input:focus-visible, select:focus-visible, input:focus-visible { border-color: var(--brand); border-radius: var(--r); }
.check { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand-fill); }
.search { position: relative; }
.search svg.i { position: absolute; left: 10px; top: 9px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 34px; width: 300px; }

.form-card { max-width: 560px; }
.form-card p { display: grid; gap: 6px; margin: 0 0 var(--s4); }
.form-card label { font-size: 13px; font-weight: 600; }
.form-card .input { width: 100%; }
.errorlist { color: var(--bad); margin: 0; padding-left: 18px; font-size: 12.5px; }

/* ---------- tables */
table.t { width: 100%; border-collapse: separate; border-spacing: 0; }
.t th, .t td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.t thead th { font-size: 12px; line-height: 16px; color: var(--muted); font-weight: 600; background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
.t tbody tr { transition: background .12s var(--ease); }
.t tbody tr:hover td { background: var(--surface-2); }
.t tbody tr:last-child td { border-bottom: 0; }
.t tr.debt td { background: var(--bad-soft); }
.t tr.debt td:first-child { box-shadow: inset 3px 0 0 var(--bad-fill); }
.t tr.debt td.name a { color: var(--bad); font-weight: 600; }
.t tr.debt:hover td { background: var(--bad-soft); filter: brightness(.98); }
.t .num { text-align: right; }
.t .empty { text-align: center; color: var(--muted); padding: var(--s8); }
.dir { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.dir-in { color: var(--ok); } .dir-out { color: var(--muted); }
.pay-form { display: flex; gap: var(--s2); align-items: center; justify-content: flex-end; }
.pay-form input[name=amount] { width: 120px; text-align: right; font-variant-numeric: tabular-nums; }
.saved { color: var(--ok); font-size: 12px; opacity: 0; transition: opacity .2s var(--ease); width: 14px; }
.saved.on { opacity: 1; }

/* ---------- rooms */
.rooms { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.room { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px; }
.room::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--off); }
.room.free::before { background: var(--ok-fill); } .room.partial::before { background: var(--warn-fill); } .room.full::before { background: var(--bad-fill); }
.room .top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); }
.room .no { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.room .freeN { font-size: 13px; font-weight: 600; }
.room.free .freeN, .room.partial .freeN { color: var(--ok); } .room.full .freeN { color: var(--bad); } .room.off .freeN { color: var(--muted); }
.room .meta { color: var(--muted); font-size: 12.5px; }
.bar { height: 6px; background: var(--off-soft); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--warn-fill); border-radius: 999px; }
.room.free .bar i { background: var(--ok-fill); } .room.full .bar i { background: var(--bad-fill); }
.room ul { list-style: none; padding: var(--s2) 0 0; margin: 0; font-size: 12.5px; border-top: 1px solid var(--line); }
.room ul li { padding: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room .edit { position: absolute; top: 12px; right: 10px; color: var(--muted); padding: 4px; border-radius: var(--r-sm); }
.room .edit:hover { color: var(--brand); background: var(--surface-2); }
.room:has(.edit) .top { padding-right: 26px; }
.legend { display: flex; gap: var(--s4); font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- attendance (xonalar bo'yicha) */
.tabs { overflow-y: hidden; display: flex; gap: var(--s1); border-bottom: 1px solid var(--line); margin-bottom: var(--s4); overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; gap: var(--s2); padding: 10px var(--s3); color: var(--muted); font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .12s var(--ease), border-color .12s var(--ease); }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.seg button[aria-pressed="true"]:not(.paid):not(.partial):not(.debt) { background: var(--brand-fill); color: #fff; }
.room.att-all::before { background: var(--ok-fill); } .room.att-some::before { background: var(--warn-fill); }
.room.att-none::before { background: var(--off); } .room.att-roomless::before { background: var(--bad-fill); }
.room.att .bar i { background: var(--ok-fill); }
.room.att-all .freeN { color: var(--ok); } .room.att-some .freeN { color: var(--warn); }
.room.att-none .freeN { color: var(--muted); } .room.att-roomless .freeN { color: var(--bad); }
.people li { display: flex; align-items: center; gap: var(--s2); padding: 3px 0; }
.people li a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people li .t { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.people li.p-in .t { color: var(--ok); }
.people li.p-out a, .people li.p-none a { color: var(--muted); }
.pdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; margin: 0; vertical-align: 0; }
.pdot.in { background: var(--ok-fill); box-shadow: 0 0 0 3px var(--ok-soft); }
.pdot.out { background: var(--off); }
.pdot.none { border: 1.5px dashed var(--off); background: transparent; }
.legend .pdot { margin-right: 6px; width: 9px; height: 9px; border-radius: 50%; vertical-align: 0; }

/* ---------- alerts */
.alert-card { border-left: 4px solid var(--bad-fill); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s3) var(--s4);
  align-items: center; margin-bottom: var(--s3); }
.alert-card > .body { flex: 1 1 340px; min-width: 0; display: grid; gap: 4px; }
.alert-card.unknown_card { border-left-color: var(--warn-fill); }
.alert-card.closed { border-left-color: var(--off); }
.alert-card .q { font-size: 15px; font-weight: 600; color: var(--bad); margin: 0; }
.alert-card.unknown_card .q { color: var(--warn); }
.alert-card.closed .q { color: var(--muted); }
.alert-card form { display: flex; gap: var(--s2); flex-wrap: wrap; justify-content: flex-end; flex: 0 1 auto; }
.alert-card select { max-width: 280px; }

/* ---------- chart */
.chart { display: flex; align-items: flex-end; gap: 3px; height: 168px; padding-top: var(--s3); }
.chart .h { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.chart .bars { display: flex; gap: 1px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.chart .bars i { width: 45%; min-height: 1px; border-radius: 3px 3px 0 0; }
.chart .bars i.in { background: var(--chart-in); } .chart .bars i.out { background: var(--chart-out); }
.chart .lbl { font-size: 11px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.chart .h:nth-child(odd) .lbl { visibility: hidden; }

/* ---------- misc */
.messages { list-style: none; padding: 0; margin: 0 0 var(--s4); display: grid; gap: var(--s2); }
.messages li { padding: 10px 14px; border-radius: var(--r); background: var(--brand-soft); color: var(--brand); font-weight: 500;
  animation: in .2s var(--ease); }
.messages li.success { background: var(--ok-soft); color: var(--ok); } .messages li.error { background: var(--bad-soft); color: var(--bad); }
.messages li.info { background: var(--off-soft); color: var(--text); }
@keyframes in { from { opacity: 0; transform: translateY(-4px); } }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: var(--s2) var(--s3); margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.pager { display: flex; gap: var(--s2); align-items: center; margin-top: var(--s3); }
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok-fill); animation: pulse 1.6s infinite; }
.live.paused::before { background: var(--off); animation: none; }
@keyframes pulse { 50% { opacity: .35; } }
.monthnav { display: inline-flex; align-items: center; gap: 4px; }
.login { max-width: 380px; margin: 12vh auto; padding: var(--s6); }

/* ---------- responsive */
@media (max-width: 1100px) { .two { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .layout { display: block; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 20; align-items: center; gap: var(--s3); height: 56px; padding: 0 var(--s4);
    background: var(--side); color: #fff; }
  .topbar .title { font-weight: 650; flex: 1; }
  .topbar .btn { background: transparent; color: #fff; border-color: rgb(255 255 255 / .3); height: 40px; }
  .topbar .count { background: #e5484d; color: #fff; font-size: 12px; font-weight: 700; padding: 0 7px; border-radius: 999px; line-height: 20px; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(280px, 84vw); transform: translateX(-100%); transition: transform .2s var(--ease); box-shadow: var(--shadow-2); }
  .side.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgb(0 0 0 / .45); z-index: 25; }
  .scrim.open { display: block; }
  .main { padding: var(--s4) var(--s4) 40px; }
  .attn-row { grid-template-columns: 1fr; }
  .search input { width: 100%; } .search, .filters > input[type=search] { flex: 1 1 100%; }
  .btn, .input, select, input[type=text], input[type=search], input[type=date], input[type=month], input[type=number] { height: 40px; }
  .seg button { min-height: 40px; }
}
@media (max-width: 720px) {
  h1 { font-size: 20px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
  .stat .value { font-size: 22px; line-height: 28px; }
  .card { padding: 14px; }
  /* jadval -> kartalar */
  .t.stack thead { display: none; }
  .t.stack, .t.stack tbody, .t.stack tr, .t.stack td { display: block; width: 100%; }
  .t.stack tr { border-bottom: 1px solid var(--line); padding: var(--s2) 0; }
  .t.stack td { border: 0; padding: 4px 14px; display: flex; justify-content: space-between; gap: var(--s3); text-align: right; }
  .t.stack td::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; text-align: left; flex-shrink: 0; }
  .t.stack td.name { font-size: 15px; font-weight: 600; }
  .t.stack td.name::before, .t.stack td.full::before { content: none; }
  .t.stack td.full { display: block; }
  .t.stack tr.debt td:first-child { box-shadow: none; }
  .t.stack tr.debt { box-shadow: inset 4px 0 0 var(--bad-fill); background: var(--bad-soft); }
  .pay-form { flex-wrap: wrap; justify-content: stretch; }
  .pay-form input[name=amount] { flex: 1; width: auto; }
  .pay-form .seg { flex: 1 1 100%; } .pay-form .seg button { flex: 1; }
  .pay-form .saved { display: none; }
  .alert-card form, .alert-card select { width: 100%; max-width: none; }
  .alert-card form .btn { flex: 1; }
  .kv { grid-template-columns: 110px 1fr; }
  .occ { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Inventarizatsiya / xona sahifasi */
a.no { color: inherit; } a.no:hover { color: var(--brand); }
.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.card.flush > .head h2 { font-size: inherit; }
.card .filters + .filters { margin-top: var(--s3); }
.room .inv { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s2); margin-top: var(--s2); padding-top: var(--s2);
  border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text); text-decoration: none; }
.room .inv svg.i { width: 14px; height: 14px; color: var(--muted); }
.room .inv:hover span:first-of-type { color: var(--brand); text-decoration: underline; }
.room .inv .badge { font-size: 11px; padding: 1px 6px; }

/* Sirtqi: hisoblangan summa izohi */
.charge-note { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; margin-top: 2px; }
.charge-note .badge { font-size: 11px; }
.t.stack td.num .charge-note { align-items: inherit; }
label.inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.stay-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.stay-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.stay-form .btn { justify-self: start; }
.stay-form p { grid-column: 1 / -1; margin: 0; }

/* =====================================================================
   DormOS uslubi (Stitch: dormos_warden_console/DESIGN.md)
   ===================================================================== */
body { font-family: var(--font); }
h1 { font-family: var(--font-head); font-size: 28px; line-height: 36px; font-weight: 700; letter-spacing: -.02em; }
h2 { font-family: var(--font-head); font-size: 17px; line-height: 24px; font-weight: 600; letter-spacing: -.01em; }
code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); border-color: transparent; color: var(--text); border-radius: var(--r-sm); }
.overline { font-size: 11px; line-height: 14px; font-weight: 600; letter-spacing: .06em; color: var(--muted); }

/* sidebar — oq panel, indigo aktiv element */
.side { width: 256px; border-right: 1px solid var(--line); box-shadow: 0 1px 8px rgb(0 0 0 / .04); }
.side .logo { padding: var(--s6) var(--s5) var(--s4); color: var(--brand); font-family: var(--font-head); font-size: 17px; font-weight: 700; gap: var(--s3); line-height: 20px; }
.side .logo .mark { width: 38px; height: 38px; border-radius: var(--r); background: var(--brand-fill); font-family: var(--font-head); font-size: 17px;
  box-shadow: 0 2px 6px rgb(67 56 202 / .35); }
.side .logo small { color: var(--muted); font-family: var(--font); font-size: 10.5px; line-height: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-top: 2px; }
.side nav { padding: var(--s2) var(--s3); }
.side nav a { padding: 10px var(--s4); margin-bottom: 4px; color: var(--side-text); font-weight: 500; border-radius: var(--r-md); }
.side nav a:hover { background: var(--side-hover); color: var(--text); }
.side nav a[aria-current="page"] { background: var(--side-active); color: #fff; font-weight: 600; box-shadow: 0 4px 12px -2px rgb(67 56 202 / .35); }
.side nav a[aria-current="page"] svg.i { color: #fff; }
.side nav .count { background: var(--bad-fill); font-size: 11px; height: 20px; }
.side nav a[aria-current="page"] .count { background: #fff; color: var(--bad-fill); }
.side .me { border-top: 1px solid var(--line); margin: 0 var(--s3); padding: var(--s4) var(--s2); color: var(--muted); }
.side .me::before { content: attr(data-initials); width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-weight: 700; font-family: var(--font-head); font-size: 13px; text-transform: uppercase; }
.side .me .who b { color: var(--text); }
.side .me .btn { background: var(--surface); color: var(--text); border-color: var(--line); }
.side .me .btn:hover { background: var(--surface-2); color: var(--text); }

.main { padding: var(--s8) var(--s8) 56px; max-width: 1480px; }
.head { margin-bottom: var(--s6); }

/* kartalar */
.card { border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--shadow-1); }
.grid { gap: var(--s5); }
.section { margin-top: var(--s5); }

/* statistik plitkalar */
.stat { gap: 6px; }
.stat .value { font-family: var(--font-head); font-size: 32px; line-height: 40px; font-weight: 700; letter-spacing: -.02em; }
.stat .sub { color: var(--muted-2); }
.stat.ok .value { color: var(--ok-fill); }
a.stat:hover { border-color: var(--brand-soft); box-shadow: var(--shadow-2); transform: translateY(-1px); }
a.stat .go { top: var(--s5); right: var(--s4); width: 30px; height: 30px; border-radius: var(--r); background: var(--surface-2); color: var(--brand);
  display: grid; place-items: center; }
a.stat .go svg.i { width: 16px; height: 16px; }
.attn, .attn.warn, .attn.clear { border-left: 1px solid var(--line); position: relative; overflow: hidden; }
.attn::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--off); }
.attn.bad { background: linear-gradient(180deg, var(--bad-tint), var(--surface) 75%); border-color: #fecaca; }
.attn.bad::after { background: var(--bad-fill); } .attn.warn::after { background: var(--warn-fill); } .attn.clear::after { background: var(--ok-fill); }
.attn.bad .overline { color: var(--bad); }
.attn.clear .value { font-size: 18px; }

.occ .big { font-family: var(--font-head); font-size: 32px; line-height: 40px; color: var(--brand); }
.meter { height: 8px; background: var(--surface-3); }
.meter i { background: var(--brand-fill); border-radius: 999px; }
.bar { background: var(--surface-3); }

/* badge — pill + nuqta */
.badge { padding: 3px 10px; font-size: 11.5px; background: var(--surface-3); color: var(--muted); }
.badge.ok { background: var(--ok-pill); color: var(--ok); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.ok::before, .badge.bad::before, .badge.warn::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* tugmalar */
.btn { border-color: var(--line); font-weight: 600; font-size: 13px; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand-fill); border-color: var(--brand-fill); box-shadow: inset 0 1px 0 rgb(255 255 255 / .15), 0 1px 2px rgb(67 56 202 / .3); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); filter: none; }
.btn.danger { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.btn.danger:hover { background: #fee2e2; }

.seg { border-color: var(--line); background: var(--surface-2); padding: 3px; gap: 2px; }
.seg button { border: 0; border-right: 0; border-radius: 6px; min-height: 30px; color: var(--muted); }
.seg button:hover { background: var(--surface); color: var(--text); }
.seg button[aria-pressed="true"]:not(.paid):not(.partial):not(.debt) { background: var(--brand-fill); color: #fff; box-shadow: var(--shadow-1); }
.seg button[aria-pressed="true"].paid { background: var(--ok-fill); }
.seg button[aria-pressed="true"].debt { background: var(--bad-fill); }

/* inputlar */
.input, select, input[type=text], input[type=search], input[type=date], input[type=month], input[type=number], input[type=password] { border-color: var(--line-strong); }
.input:focus-visible, select:focus-visible, input:focus-visible { border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus); }
.search input { background: var(--surface-2); border-color: transparent; }
.search input:hover { border-color: var(--line-strong); }
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s3); box-shadow: var(--shadow-1); }
.card .filters { border: 0; box-shadow: none; padding: 0; background: transparent; }

/* jadvallar */
.t th, .t td { padding: 12px 16px; }
.t thead th { font-size: 11px; line-height: 14px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); background: var(--surface-2); }
.t tbody tr:hover td { background: var(--row-hover); }
.t tr.debt td { background: var(--bad-tint); }
.t tr.debt:hover td { background: var(--bad-soft); filter: none; }
.t td code { background: transparent; padding: 0; }
.dir { padding: 3px 10px; border-radius: 999px; font-size: 12px; }
.dir svg.i { width: 14px; height: 14px; }
.dir-in { background: var(--ok-pill); color: var(--ok); } .dir-out { background: var(--accent-soft); color: var(--accent); }

/* tablar */
.tabs { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 6px; gap: 4px; box-shadow: var(--shadow-1); }
.tabs a { border-bottom: 0; margin: 0; border-radius: var(--r); padding: 8px 14px; }
.tabs a:hover { background: var(--surface-2); }
.tabs a[aria-current="page"] { background: var(--brand-fill); color: #fff; }

/* xonalar */
.room { gap: 8px; }
.room::before { height: 4px; }
.room .no { font-family: var(--font-head); font-size: 20px; }
.room .no, a.no { color: var(--brand); }
.room .freeN { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); }
.room.free .freeN, .room.partial .freeN, .room.att-all .freeN { background: var(--ok-pill); color: var(--ok); }
.room.full .freeN, .room.att-roomless .freeN { background: var(--bad-soft); }
.room.att-some .freeN { background: var(--warn-soft); }

/* ogohlantirishlar */
.alert-card { border-left: 1px solid var(--line); position: relative; overflow: hidden; padding-left: calc(var(--s5) + 4px); }
.alert-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--bad-fill); }
.alert-card.unknown_card::before { background: var(--warn-fill); }
.alert-card.closed::before { background: var(--off); }
.alert-card .q { font-family: var(--font-head); font-size: 16px; }

/* grafik, xabarlar, jonli */
.chart .bars i { border-radius: 4px 4px 0 0; }
.messages li { border-radius: var(--r-md); }
.messages li.success { background: var(--ok-pill); }
.live { background: var(--ok-pill); color: var(--ok); padding: 4px 12px; border-radius: 999px; font-weight: 600; font-size: 12px; }
.live.paused { background: var(--surface-3); color: var(--muted); }
.live::before { background: var(--ok); }

/* login */
body:has(.login) { min-height: 100vh; background: radial-gradient(1200px 600px at 10% -10%, var(--brand-soft) 0, transparent 60%),
  radial-gradient(900px 500px at 110% 110%, var(--accent-soft) 0, transparent 55%), var(--bg); }
.login { padding: var(--s8); box-shadow: var(--shadow-3); }
.login h1 { color: var(--brand); }

@media (prefers-color-scheme: dark) {
  .attn.bad { border-color: var(--line); }
  .btn.danger { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
}

/* mobil */
@media (max-width: 900px) {
  .topbar { background: var(--surface); color: var(--text); border-bottom: 1px solid var(--line); }
  .topbar .title { font-family: var(--font-head); color: var(--brand); font-weight: 700; }
  .topbar .btn { color: var(--text); border-color: var(--line); background: var(--surface); }
  .topbar .count { background: var(--bad-fill); }
  .scrim { background: rgb(15 23 42 / .2); backdrop-filter: blur(4px); }
  .side { box-shadow: var(--shadow-3); }
  .main { padding: var(--s4) var(--s4) 40px; }
  .filters { padding: var(--s2); }
}
@media (max-width: 720px) {
  h1 { font-size: 22px; line-height: 30px; }
  .stat .value { font-size: 24px; line-height: 30px; }
  .card { padding: var(--s4); }
  .t.stack tr.debt { background: var(--bad-tint); }
}

/* =====================================================================
   DormOS v2 — layout va sahifa komponentlari (Stitch maketlari asosida)
   ===================================================================== */
.mono, .t td.mono { font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.grow { flex: 1; }
.row-gap { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }

/* ---------- shell */
.layout { display: flex; min-height: 100vh; }
.shell { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main { flex: 1; width: 100%; max-width: 1560px; padding: var(--s6) var(--s8) 56px; }

/* ---------- sidebar */
.side { width: 256px; background: var(--side); border-right: 1px solid var(--line); box-shadow: 0 1px 8px rgb(0 0 0 / .04);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30; }
.side-top { padding: var(--s6) var(--s5) var(--s3); display: grid; gap: var(--s3); }
.side .logo { padding: 0; }
.campus { display: flex; align-items: center; gap: var(--s2); padding: 7px 10px; border-radius: var(--r); background: var(--surface-3);
  color: var(--muted); font-size: 12px; font-weight: 600; }
.campus svg.i { width: 15px; height: 15px; color: var(--accent); }
.campus span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.campus .dot, .livedot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok-fill); flex-shrink: 0; box-shadow: 0 0 0 3px rgb(16 185 129 / .18); }
.livedot { margin-left: auto; animation: pulse 1.8s infinite; }
.side nav { padding: var(--s2) var(--s3); }
.side nav a { font-size: 14px; }
.side nav .pill { margin-left: auto; font-size: 11px; font-weight: 700; line-height: 18px; padding: 0 8px; border-radius: 999px;
  background: var(--surface-3); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.side nav .pill.info { background: var(--accent-soft); color: var(--accent); }
.side nav .pill.bad { background: var(--bad-soft); color: var(--bad); }
.side nav a[aria-current="page"] .pill { background: rgb(255 255 255 / .2); color: #fff; }
.side nav a[aria-current="page"] .livedot { background: #fff; box-shadow: none; }
.side-foot { padding: var(--s3); display: grid; gap: var(--s2); }
.occ-mini { display: grid; gap: 6px; padding: var(--s3); border-radius: var(--r-md); background: var(--surface-2); color: var(--text); font-size: 12px; }
.occ-mini:hover { text-decoration: none; background: var(--surface-3); }
.occ-mini .row { display: flex; justify-content: space-between; font-weight: 600; }
.occ-mini .track { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.occ-mini .track i { display: block; height: 100%; background: var(--brand-fill); border-radius: 999px; }
.side-logout { width: 100%; display: flex; align-items: center; gap: var(--s2); padding: 9px var(--s3); border: 0; background: transparent;
  color: var(--muted); font: inherit; font-size: 13px; font-weight: 500; border-radius: var(--r); cursor: pointer; }
.side-logout:hover { background: var(--bad-soft); color: var(--bad); }

/* ---------- topbar */
.topbar { display: flex; position: sticky; top: 0; z-index: 20; align-items: center; gap: var(--s3); height: 68px; padding: 0 var(--s8);
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.topbar .title, .topbar .menu { display: none; }
.gsearch { position: relative; width: min(420px, 100%); }
.gsearch svg.i { position: absolute; left: 12px; top: 11px; color: var(--muted-2); pointer-events: none; }
.gsearch input { width: 100%; height: 40px; padding: 0 40px 0 38px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow-1); }
.gsearch kbd { position: absolute; right: 10px; top: 10px; font: 600 11px/18px var(--mono); padding: 0 6px; border-radius: 5px;
  background: var(--surface-3); color: var(--muted); }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-md);
  border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface); border-color: var(--line); color: var(--text); text-decoration: none; }
.icon-btn .ping { position: absolute; top: 8px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--bad-fill); border: 2px solid var(--bg); }
.vsep { width: 1px; height: 28px; background: var(--line); }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip .who { display: grid; line-height: 16px; font-size: 13px; }
.user-chip .who small { color: var(--muted-2); font-size: 12px; }
.btn.scan { height: 40px; padding: 0 16px; border-radius: var(--r-md); }

/* ---------- avatar */
.avatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font: 700 12.5px/1 var(--font-head);
  background: var(--brand-soft); color: var(--brand); }
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.avatar.lg { width: 52px; height: 52px; font-size: 17px; border-radius: var(--r-md); }
.avatar.t1 { background: var(--accent-soft); color: var(--accent); }
.avatar.t2 { background: #fde2e1; color: #b42318; }
.avatar.t3 { background: #d1fae5; color: #047857; }
.avatar.bad { background: var(--bad-fill); color: #fff; }
.avatar.warn { background: var(--warn-soft); color: var(--warn); }
@media (prefers-color-scheme: dark) { .avatar.t2 { background: #3d1b1b; color: #ffb4ab; } .avatar.t3 { background: #0f3326; color: #4edea3; } }

/* ---------- sahifa sarlavhasi */
.phead { display: flex; align-items: flex-end; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s6); }
.phead .titles { flex: 1 1 360px; min-width: 0; display: grid; gap: 4px; }
.crumb { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); }
.crumb b { color: var(--brand); font-weight: 700; }
.crumb .badge { text-transform: none; letter-spacing: 0; }
.phead h1 { font-size: 30px; line-height: 38px; }
.phead .lead { color: var(--muted); margin: 0; max-width: 760px; }
.phead .actions { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.phead .actions .btn { height: 40px; border-radius: var(--r-md); background: var(--surface); }
.phead .actions .btn.primary { background: var(--brand-fill); }
.statuschip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: var(--r-md); background: var(--surface);
  border: 1px solid var(--line); font-size: 13px; font-weight: 600; box-shadow: var(--shadow-1); }
.statuschip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok-fill); }
.monthpick { display: inline-flex; align-items: center; gap: 2px; height: 40px; padding: 0 4px; border-radius: var(--r-md); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.monthpick b { min-width: 120px; text-align: center; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.monthpick svg.i { width: 16px; height: 16px; }
.monthpick a { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r); color: var(--muted); }
.monthpick a:hover { background: var(--surface-2); color: var(--brand); }

/* ---------- KPI plitkalar */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s4); margin-bottom: var(--s6); }
.tile { position: relative; display: flex; flex-direction: column; gap: var(--s2); padding: var(--s5); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); color: inherit; min-height: 150px; }
a.tile:hover { text-decoration: none; box-shadow: var(--shadow-2); border-color: var(--brand-soft); transform: translateY(-1px); }
a.tile { transition: box-shadow .16s var(--ease), transform .16s var(--ease), border-color .16s var(--ease); }
.tile-top { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s2); }
.tile-top .overline { max-width: 150px; }
.tile-ico { width: 36px; height: 36px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--surface-2); color: var(--brand); flex-shrink: 0; }
.tile-ico svg.i { width: 18px; height: 18px; }
.tile-ico.ok { background: var(--ok-pill); color: var(--ok); } .tile-ico.bad { background: var(--bad-soft); color: var(--bad); }
.tile-ico.warn { background: var(--warn-soft); color: var(--warn); } .tile-ico.info { background: var(--accent-soft); color: var(--accent); }
.tile .big { font-family: var(--font-head); font-size: 32px; line-height: 40px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.tile .big small { font-family: var(--font); font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.tile .big.ok { color: var(--ok-fill); } .tile .big.bad { color: var(--bad); } .tile .big.brand { color: var(--brand); } .tile .big.warn { color: var(--warn-fill); }
.tile-foot { display: flex; justify-content: space-between; gap: var(--s2); font-size: 12px; line-height: 16px; color: var(--muted); flex-wrap: wrap; }
.tile-foot b { color: var(--text); font-weight: 600; }
.tile-foot .ok { color: var(--ok); } .tile-foot .bad { color: var(--bad); } .tile-foot .brand { color: var(--brand); }
.tile.danger { background: var(--bad-soft); border-color: #fecaca; }
.tile.danger .overline { color: var(--bad); }
.tile.soft { background: var(--surface-2); border-color: transparent; }
.tile.accent-bottom::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 4px; border-radius: 0 0 var(--r-lg) var(--r-lg); background: var(--bad-fill); }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 18px;
  background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.tag.ok { background: var(--ok-pill); color: var(--ok); } .tag.bad { background: var(--bad-fill); color: #fff; } .tag.badsoft { background: var(--bad-soft); color: var(--bad); }
.tag.warn { background: var(--warn-soft); color: var(--warn); } .tag.info { background: var(--accent-soft); color: var(--accent); } .tag.brand { background: var(--brand-soft); color: var(--brand); }
.tag.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
@media (prefers-color-scheme: dark) { .tag.ok { background: var(--ok-soft); } .tile.danger { border-color: transparent; } }
.progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 999px; background: var(--brand-fill); }
.progress.ok i { background: #00442d; } .progress.bad i { background: var(--bad-fill); } .progress.info i { background: var(--accent); }
@media (prefers-color-scheme: dark) { .progress.ok i { background: var(--ok-fill); } }

/* ---------- ish maydoni: kontent + o'ng panel */
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s5); align-items: start; }
.workspace > .rail { display: grid; gap: var(--s5); position: sticky; top: 84px; }
.stack-gap { display: grid; gap: var(--s4); min-width: 0; }

/* toolbar karta */
.toolbar { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; padding: 10px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.toolbar .search input { width: 240px; height: 38px; background: var(--surface-2); border-color: transparent; }
.toolbar select { height: 38px; }
.chips { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r); background: var(--surface-2); flex-wrap: wrap; }
.chips a, .chips button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 6px; font-size: 12.5px; font-weight: 600;
  color: var(--muted); border: 0; background: transparent; font-family: inherit; cursor: pointer; white-space: nowrap; }
.chips a:hover, .chips button:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.chips [aria-current="page"], .chips [aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.chips .solid[aria-current="page"] { background: var(--brand-fill); color: #fff; }
.chips .n { font-size: 11px; padding: 0 6px; border-radius: 999px; background: var(--surface-3); color: var(--muted); line-height: 16px; }
.chips .bad { color: var(--bad); } .chips .bad .n { background: var(--bad-fill); color: #fff; }
.chips [aria-current="page"] .n { background: var(--brand-soft); color: var(--brand); }
.chips .solid[aria-current="page"] .n { background: rgb(255 255 255 / .25); color: #fff; }

/* jadval katakchalari */
.person { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.person .nm { display: grid; min-width: 0; line-height: 18px; }
.person .nm a, .person .nm b { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .nm a:hover { color: var(--brand); }
.person .nm small { font-family: var(--mono); font-size: 11.5px; color: var(--muted-2); }
.roompill { display: inline-flex; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--brand); font: 600 12px/18px var(--mono); white-space: nowrap; }
.roompill.none { background: var(--bad-soft); color: var(--bad); font-family: var(--font); }
.money { font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.money.ok { color: var(--text); font-weight: 600; } .money.bad { color: var(--bad); font-weight: 600; } .money.info { color: var(--accent); font-weight: 600; }
.money.muted { color: var(--muted-2); }
.t tr.unknown td { background: var(--bad-tint); }
.t tr.unknown .nm b { color: var(--bad); }
.tfoot { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; padding: 12px 16px;
  background: var(--surface-2); border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.tfoot b { color: var(--text); } .tfoot .bad { color: var(--bad); font-weight: 600; }
.card.flush { border-radius: var(--r-lg); }

/* o'ng panel kartalari */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: var(--s5); display: grid; gap: var(--s4); }
.panel-h { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s2); }
.panel-h h2 { margin: 0; display: flex; gap: var(--s2); align-items: center; }
.panel-h h2 svg.i { color: var(--brand); }
.panel-h .overline { color: var(--muted); }
.panel p { margin: 0; color: var(--muted); font-size: 13px; }
.panel .inset { background: var(--surface-2); border-radius: var(--r-md); padding: var(--s3) var(--s4); display: grid; gap: var(--s2); font-size: 13px; }
.kvs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.kvs div { display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.kvs b { color: var(--text); font-size: 13px; }
.share { display: grid; gap: var(--s3); }
.share .row { display: grid; gap: 6px; font-size: 12.5px; }
.share .row span:first-child { display: flex; justify-content: space-between; gap: var(--s2); }
.share .row b { color: var(--brand); font-variant-numeric: tabular-nums; }
.payload { margin: 0; padding: var(--s4); border-radius: var(--r-md); background: #0f1e36; color: #cfe1ff; font: 12px/19px var(--mono); overflow-x: auto; }
.payload .k { color: #9ec5ff; } .payload .s { color: #6ffbbe; }
.btn.block { width: 100%; height: 42px; border-radius: var(--r-md); }
.btn.danger-soft { background: var(--bad-soft); border-color: transparent; color: var(--bad); }

/* qurilmalar */
.devs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s3); }
.dev { display: flex; gap: var(--s3); align-items: center; padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--surface-2); }
.dev svg.i { color: var(--brand); width: 22px; height: 22px; }
.dev .nm { flex: 1; display: grid; font-size: 12.5px; color: var(--muted); min-width: 0; }
.dev .nm b { color: var(--text); font-size: 13.5px; }

/* ---------- ogohlantirish kartalari v2 */
.acard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); display: grid; gap: var(--s4); }
.acard.urgent { background: var(--surface-2); border-color: transparent; }
.acard-head { display: flex; gap: var(--s3); align-items: flex-start; }
.acard-head .who { flex: 1; min-width: 0; display: grid; gap: 2px; }
.acard-head .who h3 { margin: 0; font: 700 16px/22px var(--font-head); display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.acard-head .who h3 a { color: var(--text); }
.acard-head .who .meta { font-size: 12.5px; color: var(--muted); }
.acard-head .who .meta b { color: var(--brand); }
.acard-head .when { text-align: right; font-size: 12px; color: var(--muted); white-space: nowrap; }
.acard-head .when b { display: block; color: var(--bad); font-size: 13px; font-family: var(--mono); }
.acard .note { display: flex; gap: var(--s2); align-items: center; padding: 10px var(--s3); border-radius: var(--r); background: var(--surface); font-size: 13px;
  border: 1px solid var(--line); }
.acard.urgent .note { border-color: transparent; }
.acard .note svg.i { width: 16px; height: 16px; color: var(--bad); }
.acard .note .tag { margin-left: auto; }
.acard-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.acard-foot .rfid { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.acard-foot .rfid b { font-family: var(--mono); color: var(--text); }
.acard-foot form { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.acard-foot select { max-width: 260px; height: 38px; }
.acard.unknown .who h3 { color: var(--bad); font-family: var(--mono); }
.acard.closed { opacity: .8; }
.acard.closed .when b { color: var(--muted); }

/* bo'sh xona tavsiyalari */
.fr-list { display: grid; gap: var(--s3); }
.fr { display: grid; gap: 8px; padding: var(--s4); border-radius: var(--r-md); background: var(--surface-2); color: inherit; }
a.fr:hover { text-decoration: none; outline: 2px solid var(--brand-soft); }
.fr .top { display: flex; align-items: center; gap: var(--s2); }
.fr .top b { font: 700 18px/22px var(--font-head); color: var(--brand); }
.fr .top .tag:last-child { margin-left: auto; }
.fr .line { display: flex; justify-content: space-between; gap: var(--s2); font-size: 12px; color: var(--muted); }
.fr .line b { color: var(--text); font-weight: 600; }

/* ---------- dashboard */
.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--s5); }
.mini-alerts { display: grid; gap: var(--s2); }
.mini-alert { display: flex; gap: var(--s3); align-items: center; padding: 10px var(--s3); border-radius: var(--r-md); background: var(--surface-2); color: inherit; }
.mini-alert:hover { text-decoration: none; background: var(--surface-3); }
.mini-alert .nm { flex: 1; min-width: 0; display: grid; font-size: 12px; color: var(--muted); }
.mini-alert .nm b { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- responsive */
@media (max-width: 1279px) {
  .workspace { grid-template-columns: 1fr; }
  .workspace > .rail { position: static; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .main { padding: var(--s5) var(--s6) 48px; }
  .topbar { padding: 0 var(--s6); }
}
@media (max-width: 900px) {
  .layout { display: block; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(280px, 84vw); height: 100%; transform: translateX(-100%); transition: transform .2s var(--ease); }
  .side.open { transform: none; }
  .topbar { height: 60px; padding: 0 var(--s4); background: var(--surface); border-bottom-color: var(--line); backdrop-filter: none; }
  .topbar .menu { display: inline-grid; border-color: var(--line); }
  .topbar .title { display: block; font-family: var(--font-head); font-weight: 700; color: var(--brand); }
  .gsearch, .vsep, .user-chip .who, .btn.scan { display: none; }
  .main { padding: var(--s4) var(--s4) 40px; }
  .phead h1 { font-size: 24px; line-height: 32px; }
  .toolbar .search, .toolbar .search input { width: 100%; flex: 1 1 100%; }
}
@media (max-width: 720px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
  .tile { min-height: 0; padding: var(--s4); }
  .tile .big { font-size: 24px; line-height: 30px; }
  .acard-head .when { display: none; }
  .acard-foot form, .acard-foot select { width: 100%; max-width: none; }
  .phead .actions { width: 100%; }
}
@media (max-width: 1599px) {
  .workspace.wide { grid-template-columns: 1fr; }
  .workspace.wide > .rail { position: static; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}
.pay-form input[name=amount] { height: 34px; }
.pay-form .seg button { min-height: 28px; padding: 0 10px; font-size: 12px; }
.t td.name { min-width: 280px; }
.person .nm { flex: 1; }
.person .nm small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 720px) { .t td.name { min-width: 0; } }

/* ---------- qolgan sahifalar: eski .head / .stats ham yangi uslubda */
.head h1 { font-size: 30px; line-height: 38px; }
.head { margin-bottom: var(--s6); }
.back { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 999px; background: var(--surface-2);
  color: var(--brand); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.back:hover { text-decoration: none; background: var(--surface-3); }
.back svg.i { width: 14px; height: 14px; }
.grid.stats { gap: var(--s4); margin-bottom: var(--s6); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid.stats .card.stat { min-height: 130px; padding: var(--s5); justify-content: space-between; }
.card > h2:first-child { display: flex; align-items: center; gap: var(--s2); }
.t td.bad, .t td.mono.bad b { color: var(--bad); }
.chart { height: 200px; }
.mini-alert .tile-ico { width: 32px; height: 32px; }
.legend { gap: var(--s3); }
.panel .legend { font-size: 12px; }
.dash-grid .panel-h { flex-wrap: wrap; }
.live { display: inline-flex; }
.crumb .live { text-transform: none; letter-spacing: 0; font-size: 11px; padding: 2px 10px; }

/* login — ikki ustunli */
.auth { min-height: 100vh; display: grid; place-items: center; padding: var(--s6); }
.auth-card { width: min(920px, 100%); display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border: 1px solid var(--line);
  border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-3); }
.auth-hero { background: linear-gradient(150deg, #4338ca, #2a14b4 60%, #006591); color: #fff; padding: var(--s8); display: flex; flex-direction: column; gap: var(--s4); }
.auth-hero .mark { width: 44px; height: 44px; border-radius: var(--r-md); background: rgb(255 255 255 / .16); display: grid; place-items: center; font: 700 20px var(--font-head); }
.auth-hero h2 { font: 700 26px/34px var(--font-head); letter-spacing: -.02em; margin: auto 0 0; color: #fff; }
.auth-hero p { margin: 0; color: #c9c6ff; }
.auth-hero ul { list-style: none; padding: 0; margin: var(--s2) 0 0; display: grid; gap: var(--s2); font-size: 13px; color: #e3dfff; }
.auth-hero li::before { content: "✓"; margin-right: 8px; color: #6ffbbe; font-weight: 700; }
.auth-form { padding: var(--s8); display: grid; align-content: center; gap: var(--s2); }
.auth-form h1 { color: var(--text); font-size: 26px; }
.auth-form .form-card { max-width: none; margin-top: var(--s4); }
.auth-form .input { height: 44px; border-radius: var(--r-md); }
@media (max-width: 760px) { .auth-card { grid-template-columns: 1fr; } .auth-hero { padding: var(--s6); } .auth-hero ul { display: none; } .auth-form { padding: var(--s6); } }
.auth-form.login { max-width: none; margin: 0; box-shadow: none; }
.auth-form.login h1 { color: var(--text); }
.stack-gap, .workspace > .rail, .panel { align-content: start; }
