/* Dizayn standarti — Mison Asistent admin paneli uslubida (2026-11-14) */
:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-2: #fafbfc;
  --soft: #f1f3f6;
  --text: #111827;
  --text-2: #374151;
  --muted: #6b7280;
  --border: #e7e9ee;
  --border-strong: #d6dae1;
  --accent: #1677ff;
  --accent-hover: #0f67e8;
  --accent-soft: #e8f1ff;
  --ok: #16a34a;   --ok-soft: #e8f7ee;   --ok-line: #bfe8cc;
  --warn: #d97706; --warn-soft: #fff3e0; --warn-line: #f8d9a8;
  --bad: #dc2626;  --bad-soft: #fdecec;  --bad-line: #f3c4c4;
  --info: #1677ff; --info-soft: #e8f1ff; --info-line: #c4dbff;
  --violet: #7c3aed; --violet-soft: #ede9fe;
  --side: #ffffff;
  --nav-hover: #f1f3f6;
  --nav-active: #e8f1ff;
  --shadow: none;
  --radius: 16px;
  --chart-1: #1677ff;
  --chart-2: #a5b4fc;
  --grid: #eef0f3;
  --sidebar: 272px;
}
/* Tungi ko'rinish */
:root[data-theme="dark"] {
  --bg: #0b0d12; --panel: #12151c; --panel-2: #151922; --soft: #1a1f29; --text: #e8eaef; --text-2: #c3c8d2; --muted: #8b93a3;
  --border: #222733; --border-strong: #2e3442; --accent: #4c8dff; --accent-hover: #6ea2ff; --accent-soft: #15233d;
  --ok: #4ade80; --ok-soft: #0f2418; --ok-line: #1c4a2e;
  --warn: #fbbf24; --warn-soft: #2a2010; --warn-line: #4d3a14;
  --bad: #f87171; --bad-soft: #2b1414; --bad-line: #4f1f1f;
  --info: #6ea2ff; --info-soft: #15233d; --info-line: #24345c;
  --violet: #a78bfa; --violet-soft: #241a3d;
  --side: #0e1117; --nav-hover: #161a22; --nav-active: #15233d;
  --chart-1: #4c8dff; --chart-2: #4b5563; --grid: #1c212b;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #0b0d12; --panel: #12151c; --panel-2: #151922; --soft: #1a1f29; --text: #e8eaef; --text-2: #c3c8d2; --muted: #8b93a3;
    --border: #222733; --border-strong: #2e3442; --accent: #4c8dff; --accent-hover: #6ea2ff; --accent-soft: #15233d;
    --ok: #4ade80; --ok-soft: #0f2418; --ok-line: #1c4a2e;
    --warn: #fbbf24; --warn-soft: #2a2010; --warn-line: #4d3a14;
    --bad: #f87171; --bad-soft: #2b1414; --bad-line: #4f1f1f;
    --info: #6ea2ff; --info-soft: #15233d; --info-line: #24345c;
    --violet: #a78bfa; --violet-soft: #241a3d;
    --side: #0e1117; --nav-hover: #161a22; --nav-active: #15233d;
    --chart-1: #4c8dff; --chart-2: #4b5563; --grid: #1c212b;
    color-scheme: dark;
  }
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
.num, td, .stat .value { font-variant-numeric: tabular-nums; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------- Ko'rinish / til almashtirgich ---------- */
.theme-switch { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.theme-switch a { text-decoration: none; }
.theme-switch button, .theme-switch a {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 5px 10px; min-width: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.theme-switch button:hover, .theme-switch a:hover { color: var(--text); background: transparent; }
.theme-switch button.on, .theme-switch a.on { background: var(--soft); color: var(--text); }
.theme-switch svg.i { width: 14px; height: 14px; }
.topbar { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; margin: -20px 0 16px; }
.login-theme { position: fixed; top: 16px; right: 16px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Sidebar ---------- */
.layout { display: flex; min-height: 100vh; }
.side {
  width: var(--sidebar); flex-shrink: 0; background: var(--side); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 24px 22px 22px; color: var(--text); }
.brand .mark { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); flex-shrink: 0;
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; letter-spacing: -.02em; }
.brand .name { font-weight: 700; font-size: 18px; line-height: 1.2; }
.brand .name small { display: block; font-weight: 500; font-size: 13px; color: var(--muted); }
.nav { flex: 1; padding: 0 14px 12px; display: flex; flex-direction: column; gap: 3px; }
.nav-label { display: none; }
.nav a {
  display: flex; align-items: center; gap: 13px; padding: 10px 14px; border-radius: 12px;
  color: var(--text-2); font-size: 15.5px; font-weight: 500; white-space: nowrap;
}
.nav a svg.i { color: var(--muted); }
.nav a:hover { background: var(--nav-hover); color: var(--text); }
.nav a.on { background: var(--nav-active); color: var(--accent); font-weight: 600; }
.nav a.on svg.i { color: var(--accent); }
.nav a .count { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 99px; background: var(--accent);
  color: #fff; font-size: 12px; font-weight: 700; text-align: center; line-height: 22px; }
.nav a .count.warn { background: var(--warn); }
.side-foot { border-top: 1px solid var(--border); padding: 12px 14px; }
.user { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.user .meta { line-height: 1.25; min-width: 0; }
.user .meta b { font-weight: 600; font-size: 14px; display: block; }
.user .meta span { color: var(--muted); font-size: 12.5px; }
.user a { margin-left: auto; color: var(--muted); padding: 8px; border-radius: 10px; display: flex; }
.user a:hover { background: var(--nav-hover); color: var(--text); }

/* ---------- Asosiy qism ---------- */
.main { flex: 1; min-width: 0; padding: 40px 44px 64px; max-width: 1560px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; margin: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 15.5px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.crumb:hover { color: var(--text); }
h2 { font-size: 18px; margin: 0 0 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Kartalar ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px; }
.card.table-wrap { overflow-x: auto; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 12px; flex-wrap: wrap; }
.card-head h2 { font-size: 16.5px; font-weight: 700; margin: 0; }
.card-head h2 small, .card-head .hint { color: var(--muted); font-size: 13px; font-weight: 500; }
.card-body { padding: 6px 22px 22px; }
.card-pad { padding: 20px 22px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; display: block; color: inherit; }
a.stat:hover { border-color: var(--accent); color: inherit; }
.stat .label { color: var(--muted); font-size: 14px; font-weight: 500; }
.stat .value { font-size: 30px; font-weight: 700; letter-spacing: -.01em; margin-top: 4px; line-height: 1.15; color: var(--text); }
.stat .value small { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.stat .sub { color: var(--muted); font-size: 13px; margin-top: 6px; }
.stat a.value { display: block; }
.stat a.value:hover, .stat.accent .value { color: var(--accent); }
.stat.ok .value { color: var(--ok); }
.stat.bad .value { color: var(--bad); }
.stat.hl { border-color: var(--ok-line); background: linear-gradient(160deg, var(--ok-soft), var(--panel)); }
.stat.hl .value { color: var(--ok); }
.stat.hl.loss { border-color: var(--bad-line); background: linear-gradient(160deg, var(--bad-soft), var(--panel)); }
.stat.hl.loss .value { color: var(--bad); }
.stat .meter { height: 6px; border-radius: 99px; background: var(--soft); overflow: hidden; margin-top: 10px; display: flex; }
.stat .meter i { display: block; height: 100%; }

/* Integratsiyalar bo'yicha sarf */
.spend-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.spend-item { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.spend-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.spend-usd { font-size: 22px; font-weight: 700; }
.spend-item .meter { height: 6px; border-radius: 99px; background: var(--soft); overflow: hidden; margin-top: 10px; }
.spend-item .meter i { display: block; height: 100%; background: var(--accent); }
.spend-lines { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; }
.spend-lines li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-top: 1px dashed var(--border); }

.grid2 { display: grid; gap: 20px; grid-template-columns: 1fr 1fr; margin-bottom: 20px; }
.grid2 > .card, .grid3 > .card { margin-bottom: 0; }
.grid3 { display: grid; gap: 20px; grid-template-columns: repeat(3, 1fr); margin-bottom: 20px; }
.grid-7-5 { display: grid; gap: 20px; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); margin-bottom: 20px; }
.grid-7-5 > .card { margin-bottom: 0; }
.stack { display: grid; gap: 20px; margin-bottom: 20px; }

/* ---------- Jadval ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 13.5px; font-weight: 600; color: var(--muted); padding: 13px 12px; line-height: 1.3;
  border-bottom: 1px solid var(--border); vertical-align: bottom; white-space: nowrap; background: transparent; }
td { padding: 14px 12px; border-top: 1px solid var(--border); vertical-align: middle; font-size: 14.5px; }
td:first-child, th:first-child { padding-left: 22px; }
td:last-child, th:last-child { padding-right: 22px; }
tr:first-child td, thead + tbody tr:first-child td { border-top: 0; }
tr:first-child th + th, tr:first-child th { border-top: 0; }
tbody tr:hover td, table tr:hover td { background: var(--panel-2); }
table tr:has(th):hover td { background: transparent; }
td.r, th.r { text-align: right; }
td.c, th.c { text-align: center; }
tr[data-href] { cursor: pointer; }
td .sub { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
td.empty { color: var(--muted); text-align: center; padding: 32px; }
td.nowrap, th.nowrap { white-space: nowrap; }
td.n { color: var(--muted); font-weight: 600; width: 1%; text-align: center; }
.strong { font-weight: 600; color: var(--text); }
a.strong:hover { color: var(--accent); }
th.sortable { cursor: pointer; user-select: none; }
th.sortable::after { content: " ↕"; color: var(--border-strong); }
th.sortable.asc::after { content: " ↑"; color: var(--accent); }
th.sortable.desc::after { content: " ↓"; color: var(--accent); }

/* Foydalanuvchi katagi (avatar + ism) */
.who { display: flex; align-items: center; gap: 12px; min-width: 190px; }
.who .strong { font-size: 15px; }
.who .sub { color: var(--muted); font-size: 13px; line-height: 1.4; }
.store-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; max-width: 420px; }
.store-tags .tag { margin: 0; font-size: 12.5px; }
.store-tags .tag b { font-weight: 600; color: var(--muted); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--soft); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13.5px; color: #fff; flex-shrink: 0; letter-spacing: .02em; }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.user .avatar { width: 34px; height: 34px; background: var(--accent); }

/* ---------- Belgilar ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 8px;
  font-size: 13px; font-weight: 600; white-space: nowrap; line-height: 18px; border: 0; }
.b-active, .b-approved, .b-resolved, .b-done, .b-ok { color: var(--ok); background: var(--ok-soft); }
.b-trial, .b-pending, .b-in_progress, .b-sending, .b-warn { color: var(--warn); background: var(--warn-soft); }
.b-expired, .b-rejected, .b-blocked, .b-err { color: var(--bad); background: var(--bad-soft); }
.b-new, .b-info { color: var(--info); background: var(--info-soft); }
.b-violet { color: var(--violet); background: var(--violet-soft); }
.b-muted { color: var(--muted); background: var(--soft); }
.tag { display: inline-block; padding: 2px 9px; background: var(--soft); border-radius: 8px; font-size: 13px; color: var(--text-2); margin: 0 4px 3px 0; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; font-size: 13px; font-weight: 600; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.info { background: var(--info-soft); color: var(--info); }
.pill.muted { background: var(--soft); color: var(--muted); }

.neg { color: var(--bad); font-weight: 600; }
.pos { color: var(--ok); font-weight: 600; }
code { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12.5px; background: var(--soft); padding: 1px 5px; border-radius: 6px; }

/* ---------- Formalar ---------- */
input, select, textarea {
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: 12px; padding: 9px 13px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { width: 100%; min-height: 100px; resize: vertical; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.field .help { font-size: 13px; color: var(--muted); margin-top: 5px; }
.field input:not([type=checkbox]), .field select { width: 100%; }
/* Parol maydoni + ko'z tugmasi (pw-eye.js) */
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-right: 44px; }
.pw-eye {
  position: absolute; top: 50%; right: 5px; transform: translateY(-50%);
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; padding: 0;
}
.pw-eye:hover { color: var(--text); background: var(--soft); }
.pw-eye:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pw-eye[aria-pressed="true"] { color: var(--accent); }
.check { display: flex; align-items: center; gap: 9px; margin: 8px 0; color: var(--text-2); }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.form-narrow { max-width: 600px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: 14.5px;
  padding: 9px 18px; border-radius: 12px; border: 1px solid var(--accent); cursor: pointer;
  background: var(--accent); color: #fff; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn.secondary { background: var(--panel); color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: var(--soft); color: var(--text); }
.btn.soft { background: var(--soft); border-color: var(--soft); color: var(--text-2); }
.btn.soft:hover { background: var(--border); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ok:hover { filter: brightness(.95); }
.btn.danger { background: var(--panel); color: var(--bad); border-color: var(--bad-line); }
.btn.danger:hover { background: var(--bad-soft); color: var(--bad); }
.btn.sm { padding: 6px 12px; font-size: 13.5px; border-radius: 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.toolbar input[type=search], .toolbar input[name=q] { min-width: 280px; }

/* Qidiruv maydoni (Mison uslubi) */
.search { display: flex; align-items: center; gap: 10px; width: 380px; max-width: 100%; padding: 0 14px; border-radius: 14px; background: var(--soft); color: var(--muted); }
.search input { flex: 1; border: 0; background: none; padding: 11px 0; box-shadow: none; min-width: 0; }
.search input:focus { box-shadow: none; }

/* Filtr chiplari (eski .seg ham shu ko'rinishda) */
.seg, .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; border: 0; background: none; }
.seg a, .chips a, .chips button {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--panel); color: var(--text-2); font: inherit; font-weight: 500; font-size: 14.5px; cursor: pointer;
}
.seg a:hover, .chips a:hover, .chips button:hover { background: var(--soft); color: var(--text); }
.seg a.on, .chips a.on, .chips button.on { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); font-weight: 600; }
.seg a .c, .chips .c { color: inherit; opacity: .7; font-weight: 700; }

.flash { display: flex; align-items: center; gap: 10px; border: 1px solid var(--ok-line); background: var(--ok-soft); color: var(--ok); padding: 12px 16px; border-radius: 12px; margin-bottom: 20px; font-weight: 500; }
.error { border: 1px solid var(--bad-line); background: var(--bad-soft); color: var(--bad); padding: 12px 16px; border-radius: 12px; margin-bottom: 14px; }
.note { border: 1px solid var(--info-line); background: var(--info-soft); color: var(--text-2); padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-size: 14px; }
.note.warn { border-color: var(--warn-line); background: var(--warn-soft); }

/* ---------- Yozishmalar ---------- */
.thread { padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 78%; border-radius: 16px 16px 16px 4px; padding: 10px 14px; white-space: pre-wrap; background: var(--soft); }
.msg.admin { margin-left: auto; background: var(--accent-soft); border-radius: 16px 16px 4px 16px; }
.msg .meta { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; white-space: normal; }
.receipt { max-width: 160px; max-height: 160px; border-radius: 10px; border: 1px solid var(--border); display: block; }
.answer { white-space: pre-wrap; font-size: 13.5px; color: var(--text-2); background: var(--soft); border-radius: 12px; padding: 10px 13px; margin-top: 6px; }
details summary { cursor: pointer; color: var(--accent); font-size: 13px; margin-top: 4px; list-style: none; }
details summary::-webkit-details-marker { display: none; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; font-size: 14.5px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.bar { height: 7px; background: var(--soft); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar.ok > span { background: var(--ok); } .bar.warn > span { background: var(--warn); } .bar.bad > span { background: var(--bad); }
.qa { white-space: pre-wrap; max-width: 520px; font-size: 14px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Grafiklar (CSS) ---------- */
.vbars { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding-top: 22px; }
.vbar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.vbar b { font-size: 12.5px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.vbar i { display: block; width: 100%; max-width: 46px; border-radius: 6px 6px 3px 3px; background: var(--chart-2); min-height: 3px; }
.vbar.we i { background: #c4b5fd; }
.vbar.today i { background: var(--violet); }
.vbar.alt i { background: var(--chart-1); }
.vlabels { display: flex; gap: 8px; margin-top: 6px; border-top: 1px solid var(--border); padding-top: 6px; }
.vlabels span { flex: 1; text-align: center; font-size: 12px; color: var(--muted); line-height: 1.25; min-width: 0; }
.vlabels span small { display: block; font-size: 11px; }
.chart-foot { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.chart-foot b { color: var(--text); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.duo { display: flex; align-items: flex-end; gap: 4px; height: 100%; width: 100%; justify-content: center; }
.duo i { width: 42%; max-width: 30px; }

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { width: 128px; height: 128px; border-radius: 50%; position: relative; flex-shrink: 0; }
.donut::after { content: ""; position: absolute; inset: 18px; border-radius: 50%; background: var(--panel); }
.donut .c { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.donut .c b { font-size: 26px; font-weight: 800; }
.donut .c span { font-size: 12.5px; color: var(--muted); }
.dlist { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 8px; }
.dlist div { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.dlist i { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.dlist span { flex: 1; color: var(--text-2); }
.dlist b { font-variant-numeric: tabular-nums; min-width: 26px; text-align: right; }
.dlist em { font-style: normal; color: var(--muted); font-size: 13px; min-width: 38px; text-align: right; }

/* Gorizontal chiziqlar (AI sarfi va h.k.) */
.hbars { display: flex; flex-direction: column; }
.hbar { display: grid; grid-template-columns: minmax(130px, 1.2fr) 2fr 52px; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--border); }
.hbar:first-child { border-top: 0; }
.hbar .nm { min-width: 0; }
.hbar .nm a, .hbar .nm b { display: block; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.hbar .nm small { color: var(--muted); font-size: 12.5px; }
.hbar .track { height: 9px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: 99px; background: var(--ok); }
.hbar .track i.warn { background: var(--warn); } .hbar .track i.bad { background: var(--bad); } .hbar .track i.info { background: var(--accent); }
.hbar .pc { text-align: right; font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; }

.mini-list { display: flex; flex-direction: column; }
.mini-list > div, .mini-list > a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 14px; color: var(--text); }
.mini-list > :first-child { border-top: 0; }
.mini-list .muted { font-size: 13px; }

/* ---------- Murojaatlar: Telegram kabi chat ---------- */
.tg { display: grid; grid-template-columns: 370px minmax(0, 1fr); height: calc(100vh - 120px); min-height: 520px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.tg-side { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--border); }
.tg-head { padding: 16px 14px 12px; border-bottom: 1px solid var(--border); }
.tg-head h1 { font-size: 22px; margin: 0 0 12px 4px; display: flex; align-items: baseline; gap: 8px; }
.tg-head h1 .muted { font-size: 14px; font-weight: 500; }
.tg-live { margin-left: auto; align-self: center; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; color: var(--ok); }
.tg-live i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px var(--ok-soft); }
.tg-live[data-state="off"] { color: var(--muted); }
.tg-main { position: relative; }
.tg-newpill { position: absolute; left: 50%; transform: translateX(-50%); bottom: 130px; z-index: 3; border: 0; border-radius: 99px;
  padding: 9px 16px; background: var(--accent); color: #fff; font: inherit; font-weight: 700; cursor: pointer; box-shadow: 0 6px 18px rgba(22,119,255,.35); }
.tg-newpill[hidden] { display: none; }
.tg-head .chips { scrollbar-width: none; }
.tg-head .chips::-webkit-scrollbar { display: none; }
.tg-list { flex: 1; overflow-y: auto; padding: 6px; }
.tg-item { display: flex; gap: 11px; padding: 10px; border-radius: 12px; color: var(--text); align-items: flex-start; }
.tg-item:hover { background: var(--soft); color: var(--text); }
.tg-item.on { background: var(--accent); color: #fff; }
.tg-item.on .muted, .tg-item.on .tg-time, .tg-item.on .tg-meta, .tg-item.on .tg-prev { color: rgba(255,255,255,.85); }
.tg-mid { flex: 1; min-width: 0; }
.tg-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tg-row b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; }
.tg-time { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.tg-prev { font-size: 13.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-meta { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.tg-item.on .tg-dot { background: #fff; }
.tg-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--panel-2); }
.tg-top { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: var(--panel); border-bottom: 1px solid var(--border); }
.tg-back { display: none; color: var(--muted); }
.tg-thread { flex: 1; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 8px; }
.tg-day { text-align: center; margin: 8px 0; }
.tg-day span { background: var(--soft); color: var(--muted); font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; }
.bubble { max-width: min(560px, 80%); padding: 8px 12px 6px; border-radius: 16px 16px 16px 4px; background: var(--panel); border: 1px solid var(--border); align-self: flex-start; }
.bubble.admin { align-self: flex-end; background: var(--accent-soft); border-color: var(--info-line); border-radius: 16px 16px 4px 16px; }
.bubble .txt { white-space: pre-wrap; font-size: 14.5px; word-wrap: break-word; }
.bubble .when { display: block; text-align: right; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.bubble audio { max-width: 260px; height: 36px; }
.tg-reply { padding: 12px 16px; background: var(--panel); border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.tg-reply textarea { min-height: 44px; resize: none; }
.tg-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); }
.tg-empty svg.i { width: 44px; height: 44px; stroke-width: 1.2; }
@media (max-width: 900px) {
  .tg { grid-template-columns: 1fr; height: calc(100vh - 170px); }
  .tg.has-open .tg-side { display: none; }
  .tg:not(.has-open) .tg-main { display: none; }
  .tg-back { display: flex; }
}

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 400px; }
.login-logo { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 22px; }
.login-logo .mark { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); }
.login-logo b { display: block; font-size: 18px; line-height: 1.2; }
.login-logo small { display: block; font-size: 12.5px; color: var(--muted); }
.login .card-body { padding: 28px; }
.login h1 { font-size: 22px; font-weight: 700; margin: 0 0 4px; }
.login p.muted { margin: 0 0 20px; }
.login .btn { width: 100%; padding: 11px 14px; }
/* Kirish sahifasi — animatsiyali fon */
#fx, #fx2 { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.fx-char { position: fixed; bottom: 0; height: 100vh; width: auto; z-index: 0; pointer-events: none; opacity: 0;
  transition: opacity 1.4s ease; will-change: transform, opacity; user-select: none; }
#ch-gojo { right: 0; mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 22%); mask-image: linear-gradient(to right, transparent, #000 22%); }
#ch-itachi { left: 0; filter: sepia(.45) hue-rotate(-30deg) saturate(1.5) brightness(.95);
  -webkit-mask-image: linear-gradient(to right, #000 70%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 10%, #000 82%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, #000 70%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 10%, #000 82%, transparent 100%);
  mask-composite: intersect; }
.fx-on[data-fx="void"] #ch-gojo, .fx-on[data-fx="crow"] #ch-itachi { opacity: 1; }
@media (max-width: 900px) {
  .fx-char { left: 50%; right: auto; translate: -50% 0; }
  .fx-on[data-fx="void"] #ch-gojo, .fx-on[data-fx="crow"] #ch-itachi { opacity: .45; }
}
.fx-on.fx-nogl[data-fx="void"] { background: radial-gradient(ellipse at 25% 50%, #2a0f4a, #050210 70%); }
.fx-on.fx-nogl[data-fx="crow"] { background: linear-gradient(#0a0005, #3d040a 70%, #050002); }
.login-page .login-wrap { position: relative; z-index: 1; }
.login-page .login-theme { z-index: 2; }
.fx-switch { position: fixed; left: 16px; bottom: 16px; z-index: 2; display: flex; gap: 6px; }
.fx-switch button { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel); cursor: pointer; font-size: 16px; opacity: .75; }
.fx-switch button.on { opacity: 1; outline: 2px solid var(--accent); }
.fx-on .login-logo b { color: #fff; }
.fx-on .login-logo small { color: rgba(255,255,255,.7); }
.fx-on .login .card { background: color-mix(in srgb, var(--panel) 82%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.fx-on .login-logo .mark { box-shadow: 0 0 24px var(--accent); }

/* ---------- Davr filtri ---------- */
.dfilter { position: relative; }
.df-label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.df-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; font: inherit; font-weight: 600; font-size: 14px;
  color: var(--text); background: var(--panel); border: 1px solid var(--border); border-radius: 12px; cursor: pointer;
  font-variant-numeric: tabular-nums; transition: border-color .15s, box-shadow .15s;
}
.df-btn:hover, .dfilter.open .df-btn { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.df-btn .chev { display: inline-flex; transition: transform .15s; }
.dfilter.open .df-btn .chev { transform: rotate(180deg); }
.df-pop {
  display: none; position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: 350px; max-width: calc(100vw - 32px);
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 16px;
  box-shadow: 0 18px 40px rgba(16, 24, 40, .16);
}
.dfilter.open .df-pop { display: block; }
.df-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.df-presets button {
  padding: 6px 13px; font: inherit; font-size: 13.5px; font-weight: 500; color: var(--text-2); cursor: pointer;
  background: var(--panel); border: 1px solid var(--border); border-radius: 99px;
}
.df-presets button:hover { background: var(--soft); }
.df-presets button.on { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); font-weight: 600; }
.df-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.df-dates label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.df-dates input { width: 100%; }
.df-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* ---------- Moslashuvchan ---------- */
@media (max-width: 1250px) { .grid3 { grid-template-columns: 1fr 1fr; } .grid-7-5 { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .side { width: 100%; height: auto; position: sticky; top: 0; z-index: 50; border-right: none; border-bottom: 1px solid var(--border); overflow: visible; }
  .brand { padding: 12px 16px 8px; }
  .brand .mark { width: 34px; height: 34px; font-size: 12px; }
  .brand .name { font-size: 16px; }
  .nav { flex-direction: row; overflow-x: auto; padding: 0 12px 10px; gap: 4px; scrollbar-width: thin; }
  .nav a { padding: 8px 12px; font-size: 14px; gap: 8px; }
  .side-foot { display: none; }
  .topbar { margin: 0 0 14px; justify-content: flex-start; }
  .main { padding: 20px 16px 40px; }
  .page-head h1 { font-size: 24px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  th, td { padding: 11px 10px; }
  td:first-child, th:first-child { padding-left: 14px; }
  td:last-child, th:last-child { padding-right: 14px; }
  .toolbar input[name=q], .search { min-width: 0; width: 100%; }
  .df-pop { left: 0; right: auto; }
  .hbar { grid-template-columns: minmax(100px, 1fr) 1.2fr 44px; }
  .vbars, .vlabels { gap: 3px; }
  .vbar b { font-size: 10.5px; }
  .kv { grid-template-columns: 120px 1fr; }
}
@media (max-width: 520px) { .stats { grid-template-columns: 1fr 1fr; } .stat .value { font-size: 24px; } }
