/* PTG Board — asosiy uslub (BOARD-C, A0 karkasi ustida). Control Tower bilan bir oila (controltower/public/css/app.css):
   monoxrom grafit / iliq krem shkala + BITTA aksent (to'q sariq) — faqat og'irlik, muddati o'tgan va faol holat uchun.
   STANDART tema — YORUG': CT'ning iliq krem/bej token'lari (rahbar 2026-11-03). Qorong'i — "Tema" tugmasi, CT grafit token'lari.
   Qoidalar (tests/ui/static.test.mjs): gradient/glow/soya/blur YO'Q, radius ≤ 6px, matn ≥ 12px, binafsha YO'Q, inline style YO'Q,
   tashqi resurs YO'Q. Animatsiya faqat funksional; prefers-reduced-motion — o'chadi.
   DEPT modullari uchun yadro klasslari: .ctx, .ctx-block, .ctx-title, .ctx-table, .ctx-kv (generik renderer ham shularni ishlatadi). */

/* Yorug' tema (standart; atributsiz :root ham shu): iliq krem/bej shkala. Aksent matni — ink tusi (WCAG AA). */
:root,
:root[data-theme="light"] {
  /* KPI (2026-11-05, CT app.css bilan bir xil): oxirgi KPI ustuni va KPI % belgisi — kontrast ≥ 4.5:1 */
  --kpi-ink: #16764e;
  --kpi-wash: rgba(22, 118, 78, 0.065);
  --kpi-pill: rgba(22, 118, 78, 0.1);
  color-scheme: light;
  --bg: #f5f4ef;
  --surface: #fcfbf8;
  --surface-2: #f8f6f1;
  --surface-3: #efede6;
  --surface-hi: #e8e5dc;
  --border: rgba(60, 50, 30, 0.14);
  --border-soft: rgba(60, 50, 30, 0.1);
  --border-strong: rgba(60, 50, 30, 0.18);
  --text: #1f1e1c;
  --text-2: #4a4740;
  --muted: #69655c;
  --faint: #bab4a8;
  --accent: #c94a20;
  --accent-ink: #b0401a;
  --accent-wash: rgba(201, 74, 32, 0.09);
  --primary: #1f1e1c;
  --on-primary: #ffffff;
  --sev-critical: #c94a20;
  --sev-high: #b56a4b;
  --sev-medium: #736e65;
  --sev-low: #afa99e;
  --ring: 0 0 0 2px rgba(31, 30, 28, 0.3);
  --t-fast: 120ms;
  --radius: 6px;
  --radius-s: 4px;
  --fs-label: max(12px, 0.8125rem);
  --fs-small: max(12.5px, 0.875rem);
  --fs-body: 0.9375rem;
}

/* Qorong'i tema ("Tema" tugmasi): CT grafit shkalasi. */
:root[data-theme="dark"] {
  /* KPI (2026-11-05, CT app.css bilan bir xil): oxirgi KPI ustuni va KPI % belgisi — kontrast ≥ 4.5:1 */
  --kpi-ink: #5cd3a0;
  --kpi-wash: rgba(76, 201, 146, 0.08);
  --kpi-pill: rgba(76, 201, 146, 0.14);
  color-scheme: dark;
  --bg: #0b0c0e;
  --surface: #101113;
  --surface-2: #151619;
  --surface-3: #1b1c20;
  --surface-hi: #24262a;
  --border: rgba(255, 255, 255, 0.085);
  --border-soft: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e6e7e9;
  --text-2: #a8acb3;
  --muted: #80858d;
  --faint: #4a4e55;
  --accent: #ec6a3e;
  --accent-ink: #f08a63;
  --accent-wash: rgba(236, 106, 62, 0.12);
  --primary: #e6e7e9;
  --on-primary: #0b0c0e;
  --sev-critical: #ec6a3e;
  --sev-high: #c4704f;
  --sev-medium: #9a9ea5;
  --sev-low: #5c6067;
  --ring: 0 0 0 2px rgba(230, 231, 233, 0.35);
}

/* 1366px noutbukdan 4K gacha: o'lchamlar rem'da (1366 da ≈ 14px) */
html { font-size: clamp(14px, 0.36vw + 9.2px, 23px); }
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
::selection { background: color-mix(in srgb, var(--text) 18%, transparent); }
a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--faint); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-s); }
h1, h2, h3, h4 { margin: 0; font-weight: 560; letter-spacing: -0.01em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-label); }
.tabnum { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }

/* ---------- karkas ---------- */
.app { display: grid; grid-template-columns: 13.5rem minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 1rem; padding: 1.1rem 0.7rem;
  background: var(--bg); border-right: 1px solid var(--border-soft);
}
.brand { padding: 0.2rem 0.6rem 0.6rem; }
.brand-name { font-weight: 620; font-size: var(--fs-body); letter-spacing: -0.01em; }
.brand-sub { margin-top: 0.15rem; color: var(--muted); font-size: var(--fs-label); }
.nav { display: flex; flex-direction: column; gap: 0.05rem; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 0.6rem;
  padding: 0.48rem 0.6rem; border-radius: var(--radius-s);
  color: var(--text-2); font-size: var(--fs-small);
  transition: background var(--t-fast), color var(--t-fast);
}
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a.active { color: var(--text); background: var(--surface-3); }
.nav a.active::before { content: ""; position: absolute; left: -0.7rem; top: 0.5rem; bottom: 0.5rem; width: 2px; background: var(--accent); }
.nav .badge { margin-left: auto; }
.badge {
  display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.2rem; padding: 0 0.35rem;
  border-radius: var(--radius-s); background: var(--surface-3); color: var(--text-2);
  font-size: var(--fs-label); font-variant-numeric: tabular-nums;
}
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 0.75rem; min-height: 3.2rem; padding: 0.55rem 1.5rem;
  background: var(--bg); border-bottom: 1px solid var(--border-soft);
}
.topbar h1 { min-width: 0; font-size: var(--fs-body); font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .who { font-size: var(--fs-small); color: var(--text-2); white-space: nowrap; }
.topbar .clock { font-size: var(--fs-small); color: var(--muted); white-space: nowrap; }
.content { display: flex; flex-direction: column; gap: 1rem; min-width: 0; padding: 1.4rem 1.5rem 3rem; }
.content:focus { outline: none; }

/* ---------- boshqaruv elementlari ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  padding: 0.4rem 0.8rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: transparent; color: var(--text); font-size: var(--fs-small); white-space: nowrap; cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); text-decoration: none; }
.btn:disabled, .btn.disabled { opacity: 0.5; cursor: not-allowed; }
.btn:disabled:hover { background: transparent; border-color: var(--border); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 88%, var(--bg)); border-color: transparent; }
.btn-primary:disabled:hover { background: var(--primary); border-color: var(--primary); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; color: var(--text); }
.btn-sm { padding: 0.24rem 0.6rem; font-size: var(--fs-label); }
.toggle[aria-pressed="true"] { background: var(--surface-hi); border-color: var(--text-2); color: var(--text); }
.input, select.input, textarea.input {
  min-width: 0; padding: 0.38rem 0.6rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: transparent; color: var(--text); font-size: var(--fs-small);
  transition: border-color var(--t-fast);
}
select.input option { background: var(--surface); color: var(--text); }
.input:hover { border-color: var(--border-strong); }
.input:focus { border-color: var(--text-2); }
.input::placeholder { color: var(--muted); }
.input:disabled { opacity: 0.6; }
textarea.input { width: 100%; min-height: 9rem; resize: vertical; line-height: 1.5; }
.file-label { position: relative; overflow: hidden; }
.file-label input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-label:focus-within { box-shadow: var(--ring); }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 0.45rem; padding: 0; color: var(--muted); font-size: var(--fs-label); }

/* ---------- karta, KPI ---------- */
.card { position: relative; min-width: 0; padding: 1.1rem 1.25rem; border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--surface); }
.card.flush { padding: 0; }
.card-h { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.9rem; min-height: 1.6rem; }
.card-title { font-size: var(--fs-small); font-weight: 560; }
.list { display: flex; flex-direction: column; gap: 1rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem; }
.kpi { display: flex; flex-direction: column; gap: 0.45rem; min-width: 0; padding: 0.95rem 1.1rem; border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--surface); }
.kpi-label { color: var(--muted); font-size: var(--fs-label); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value { font-size: 1.75rem; font-weight: 500; letter-spacing: -0.02em; line-height: 1.1; white-space: nowrap; }
.kpi-sub { color: var(--muted); font-size: var(--fs-label); }
.kpi.alert .kpi-value { color: var(--accent-ink); }

/* ---------- tablar, filtrlar, jadval ---------- */
.tabs { display: flex; gap: 0.25rem; padding: 0 0.6rem; border-bottom: 1px solid var(--border-soft); overflow-x: auto; scrollbar-width: none; }
.tab {
  margin-bottom: -1px; padding: 0.7rem 0.8rem; border: 0; border-bottom: 2px solid transparent;
  background: none; color: var(--muted); font-size: var(--fs-small); white-space: nowrap; cursor: pointer;
  transition: color var(--t-fast);
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-soft); }
.filters .search { width: 15rem; max-width: 100%; }
.list-body { min-height: 6rem; }
.list-body.busy { opacity: 0.6; transition: opacity var(--t-fast); }
.list-body > .empty { margin: 1rem; }
.list-body > .alertbox { margin: 1rem; }
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-small); }
.tbl th {
  padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--border-soft);
  background: var(--surface); color: var(--muted); font-size: var(--fs-label); font-weight: 500; text-align: left; white-space: nowrap;
}
.tbl td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.clickable { cursor: pointer; transition: background var(--t-fast); }
.tbl tbody tr.clickable:hover { background: var(--surface-2); }
.tbl tr.is-overdue td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl .title-cell { min-width: 16rem; }
.tbl .title-cell a { color: var(--text); }
.tbl td.overdue { color: var(--accent-ink); }
.od { display: block; color: var(--accent-ink); font-size: var(--fs-label); }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 0.6rem; padding: 0.7rem 1rem; border-top: 1px solid var(--border-soft); color: var(--muted); font-size: var(--fs-small); }
.loading { padding: 2rem; color: var(--muted); font-size: var(--fs-small); text-align: center; }

/* ---------- belgilar ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 0.38rem; padding: 0.05rem 0.45rem;
  border: 1px solid transparent; border-radius: var(--radius-s);
  color: var(--text-2); font-size: var(--fs-label); line-height: 1.55; white-space: nowrap;
}
.chip.outline { border-color: var(--border); }
.dot { display: inline-block; flex: none; width: 0.42rem; height: 0.42rem; border-radius: 50%; background: currentColor; }
.sev, .sev-low { --c: var(--sev-low); }
.sev-medium { --c: var(--sev-medium); }
.sev-high { --c: var(--sev-high); }
.sev-critical { --c: var(--sev-critical); }
.chip.sev { padding-left: 0; }
.chip.sev .dot { background: var(--c); }
.chip.sev-critical, .chip.sev-high { color: var(--accent-ink); }
.st { --c: var(--muted); }
.st-pending, .st-returned { --c: var(--accent); }
.st-in_progress { --c: var(--text-2); }
.st-answered { --c: var(--muted); }
.st-closed { --c: var(--faint); }
.chip.st { border-color: var(--border); }
.chip.st .dot { background: var(--c); }
.chip.due.overdue { border-color: var(--accent); color: var(--accent-ink); }
.od-inline { margin-left: 0.3rem; }

/* ---------- case sahifasi ---------- */
.case { display: flex; flex-direction: column; gap: 1rem; max-width: 74rem; }
.back { align-self: flex-start; color: var(--muted); font-size: var(--fs-small); }
.back:hover { color: var(--text); }
.case-head { display: flex; flex-direction: column; gap: 0.7rem; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; }
.case-title { font-size: 1.35rem; line-height: 1.25; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.case-summary { max-width: 64rem; color: var(--text-2); line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 0.7rem 1.5rem; margin: 0.2rem 0 0; }
.meta .m { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.meta dt { color: var(--muted); font-size: var(--fs-label); }
.meta dd { margin: 0; font-size: var(--fs-small); overflow-wrap: anywhere; }
.alertbox {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; padding: 0.6rem 0.8rem;
  border: 1px solid var(--border); border-left: 2px solid var(--accent); border-radius: var(--radius-s);
  color: var(--text-2); font-size: var(--fs-small);
}
.alertbox.info { border-left-color: var(--muted); }
.alertbox ul { margin: 0; padding-left: 1.1rem; }

/* raundlar: avvalgilari yopiq, joriy — ochiq */
.thread { display: flex; flex-direction: column; gap: 0.6rem; }
.round { border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--surface); }
.round.current { display: flex; flex-direction: column; gap: 0.8rem; padding: 0.95rem 1.1rem; }
.round-h { font-size: var(--fs-small); font-weight: 560; }
.round-meta { margin-left: auto; color: var(--muted); font-size: var(--fs-label); }
.round-body { display: flex; flex-direction: column; gap: 0.8rem; padding: 0.95rem 1.1rem; }
.round > summary, .sec > summary {
  display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 1.1rem;
  list-style: none; cursor: pointer; color: var(--text-2); font-size: var(--fs-small);
  transition: background var(--t-fast);
}
.round > summary::-webkit-details-marker, .sec > summary::-webkit-details-marker { display: none; }
.round > summary::before, .sec > summary::before {
  content: ""; flex: none; width: 0.38rem; height: 0.38rem;
  border-right: 1px solid var(--muted); border-bottom: 1px solid var(--muted);
  transform: rotate(-45deg); transition: transform var(--t-fast);
}
.round[open] > summary::before, .sec[open] > summary::before { transform: rotate(45deg); }
.round > summary:hover, .sec > summary:hover { background: var(--surface-2); }
.round[open] > summary, .sec[open] > summary { border-bottom: 1px solid var(--border-soft); color: var(--text); }
.msg { display: flex; flex-direction: column; gap: 0.3rem; padding-left: 0.8rem; border-left: 2px solid var(--border); }
.msg-question { border-left-color: var(--accent); }
.msg-reply { border-left-color: var(--text-2); }
.msg-h { display: flex; align-items: baseline; gap: 0.75rem; }
.msg-kind { color: var(--muted); font-size: var(--fs-label); font-weight: 560; }
.msg-at { color: var(--muted); font-size: var(--fs-label); }
.msg-text { line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.checks-ro { display: flex; flex-direction: column; gap: 0.15rem; margin: 0.2rem 0 0; padding: 0; list-style: none; color: var(--text-2); font-size: var(--fs-small); }
.checks-ro .tick { display: inline-block; width: 1.1rem; color: var(--muted); }
.checks-ro li.on .tick { color: var(--text); }

/* ikkinchi darajali bloklar: kontekst, dalil yorliqlari, havolalar */
.secs { display: flex; flex-direction: column; gap: 0.5rem; }
.sec { border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--surface); }
.sec-title { color: inherit; }
.sec-body { padding: 0.9rem 1.1rem; overflow-x: auto; }
.evlist { display: flex; flex-direction: column; gap: 0.4rem; margin: 0; padding-left: 1.2rem; font-size: var(--fs-small); }
.ev-label { overflow-wrap: anywhere; }
.ev-meta { display: block; color: var(--muted); font-size: var(--fs-label); }
.kv { display: grid; grid-template-columns: minmax(7rem, 12rem) 1fr; gap: 0.35rem 1rem; margin: 0; font-size: var(--fs-small); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* generik kontekst (public/js/boards/_generic.js) — DEPT modullari ham shu klasslarni ishlatadi */
.ctx { display: flex; flex-direction: column; gap: 1rem; }
.ctx-block { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--surface); }
.ctx-title { margin: 0; padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--border-soft); color: var(--text-2); font-size: var(--fs-label); font-weight: 600; }
.ctx-table { width: 100%; border-collapse: collapse; }
.ctx-table th, .ctx-table td { padding: 0.4rem 0.8rem; border-bottom: 1px solid var(--border-soft); font-size: var(--fs-label); text-align: left; vertical-align: top; }
.ctx-table th { color: var(--muted); font-weight: 500; white-space: nowrap; }
.ctx-table td { white-space: pre-line; }
.ctx-table tr:last-child td { border-bottom: 0; }
/* bitta qatorli blok: keng ekranda kalit/qiymat juftlari ikki ustunda (dt dd dt dd) */
.ctx-kv { display: grid; grid-template-columns: minmax(7rem, 12rem) minmax(0, 1fr) minmax(7rem, 12rem) minmax(0, 1fr); margin: 0; }
.ctx-kv dt { padding: 0.35rem 0.8rem; color: var(--muted); font-size: var(--fs-label); }
.ctx-kv dd { margin: 0; padding: 0.35rem 0.8rem; font-size: var(--fs-label); white-space: pre-line; overflow-wrap: anywhere; }

/* ---------- javob formasi ---------- */
.reply-card .card-h { margin-bottom: 0.75rem; }
.reply { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field-h { display: flex; align-items: baseline; gap: 0.75rem; }
.field-h label { color: var(--muted); font-size: var(--fs-label); }
.counter { margin-left: auto; color: var(--muted); font-size: var(--fs-label); }
.counter.short { color: var(--text-2); }
.tpls { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.15rem; }
.expected { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 0.75rem; }
.expected .lbl { color: var(--muted); font-size: var(--fs-label); }
.expected ul { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.expected li { padding: 0.05rem 0.5rem; border: 1px solid var(--border); border-radius: var(--radius-s); color: var(--text-2); font-size: var(--fs-label); }
.reply-addon { min-width: 0; }
.checklist ul { display: flex; flex-direction: column; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.checklist li { display: flex; align-items: center; gap: 0.5rem; font-size: var(--fs-small); }
.checklist input[type="checkbox"] { flex: none; width: 1rem; height: 1rem; margin: 0; accent-color: var(--text); }
.req { color: var(--accent-ink); }
.att-box { display: flex; flex-direction: column; gap: 0.6rem; }
.att-list { display: flex; flex-direction: column; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.att { display: flex; align-items: center; gap: 0.75rem; min-width: 0; padding: 0.45rem 0.7rem; border: 1px solid var(--border-soft); border-radius: var(--radius-s); }
.att.off .att-name { color: var(--muted); }
.att.bad { border-color: var(--accent); }
.att-main { display: flex; flex: 1; flex-direction: column; gap: 0.1rem; min-width: 0; }
.att-name { font-size: var(--fs-small); overflow-wrap: anywhere; }
.att-meta { color: var(--muted); font-size: var(--fs-label); }
.att-note { color: var(--muted); font-size: var(--fs-label); white-space: nowrap; }
.att-note.bad { color: var(--accent-ink); white-space: normal; }
.att-add { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.att-err { color: var(--accent-ink); font-size: var(--fs-small); white-space: pre-line; }
.att-list.ro .att { padding: 0.35rem 0.6rem; }
.reply-foot { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: flex-end; gap: 1rem; }
.missing { flex: 1; min-width: 12rem; color: var(--muted); font-size: var(--fs-label); }
.missing ul { display: flex; flex-wrap: wrap; gap: 0.2rem 1.1rem; margin: 0; padding: 0; list-style: none; }

/* ---------- tasdiq oynasi ---------- */
dialog.confirm {
  width: min(26rem, calc(100vw - 2rem)); padding: 1.2rem 1.3rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
}
dialog.confirm::backdrop { background: rgba(0, 0, 0, 0.5); }
dialog.confirm h3 { margin-bottom: 0.5rem; font-size: var(--fs-body); }
dialog.confirm p { color: var(--text-2); font-size: var(--fs-small); line-height: 1.55; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.1rem; }

/* ---------- holatlar ---------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; padding: 2rem; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); text-align: center; }
.toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 50; display: flex; flex-direction: column; gap: 0.5rem; }
.toast { max-width: 24rem; padding: 0.6rem 0.9rem; border: 1px solid var(--border-strong); border-radius: var(--radius-s); background: var(--surface-3); font-size: var(--fs-small); }
.toast.err { border-color: var(--accent); }

/* ---------- tor ekran ---------- */
@media (max-width: 1100px) {
  .ctx-kv { grid-template-columns: minmax(7rem, 12rem) minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 0.6rem 0.9rem; border-right: 0; border-bottom: 1px solid var(--border-soft); }
  .brand { padding: 0 0.6rem 0 0; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav a.active::before { display: none; }
  .topbar { position: static; flex-wrap: wrap; padding: 0.55rem 0.9rem; }
  .content { padding: 1rem 0.9rem 2rem; }
  .kv, .ctx-kv { grid-template-columns: minmax(0, 1fr); }
}

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