/* FJSTI Hisobotlar markazi. Ranglar rol bo'yicha; yorug' va qorong'i rejim alohida tanlangan. */
:root {
  color-scheme: dark;
  --page: #0b0e14; --surface: #131722; --surface-2: #1a2030; --raise: #20283a;
  --ink: #f0efec; --ink-2: #c3c2b7; --muted: #8a8f9c;
  --grid: #252c3c; --axis: #364057; --border: rgba(255,255,255,.08); --border-2: rgba(255,255,255,.14);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767;
  --good: #0ca30c; --warn: #fab219; --serious: #ec835a; --bad: #e05252;
  --good-ink: #4cc94c; --bad-ink: #f08080; --warn-ink: #fab219;
  --seq-0: #18243a; --seq-1: #1c5cab; --seq-2: #3987e5; --seq-3: #86b6ef;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px -18px rgba(0,0,0,.8);
  --glow: radial-gradient(1200px 500px at 12% -10%, rgba(57,135,229,.16), transparent 60%), radial-gradient(900px 420px at 95% 0%, rgba(144,133,233,.12), transparent 60%);
  --r: 16px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --page: #f4f5f8; --surface: #ffffff; --surface-2: #f6f7fa; --raise: #eef0f5;
  --ink: #0b0b0b; --ink-2: #52514e; --muted: #7d7f86;
  --grid: #e6e8ee; --axis: #c6c9d2; --border: rgba(11,11,11,.09); --border-2: rgba(11,11,11,.16);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --good: #0ca30c; --warn: #fab219; --serious: #ec835a; --bad: #d03b3b;
  --good-ink: #006300; --bad-ink: #b42323; --warn-ink: #8a5a00;
  --seq-0: #e8f1fd; --seq-1: #9ec5f4; --seq-2: #3987e5; --seq-3: #104281;
  --shadow: 0 1px 2px rgba(15,20,40,.05), 0 14px 30px -22px rgba(15,20,40,.25);
  --glow: radial-gradient(1200px 500px at 12% -10%, rgba(42,120,214,.10), transparent 60%), radial-gradient(900px 420px at 95% 0%, rgba(98,80,214,.08), transparent 60%);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--page); color: var(--ink); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }

/* --- Kirish --- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px; background: var(--glow), var(--page); }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 34px 30px; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--raise); border: 1px solid var(--border); display: grid; place-items: center; flex: none; }
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: .01em; }
.brand-sub { color: var(--muted); font-size: 12px; }
.login h1 { font-size: 22px; margin: 26px 0 6px; letter-spacing: -.01em; }
.login p.lead { color: var(--ink-2); margin-bottom: 22px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
.field input { width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--ink); font: inherit; outline: none; }
.field input:focus { border-color: var(--s1); box-shadow: 0 0 0 3px color-mix(in srgb, var(--s1) 25%, transparent); }
.btn { height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--surface-2); }
.btn:hover { background: var(--raise); }
.btn-primary { width: 100%; background: var(--s1); border-color: transparent; color: #fff; font-weight: 600; }
.btn-primary:hover { background: color-mix(in srgb, var(--s1) 88%, #fff); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.form-error { color: var(--bad-ink); font-size: 13px; min-height: 20px; margin: 4px 0 10px; }

/* --- Qobiq --- */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100%; }
.side { position: sticky; top: 0; height: 100vh; padding: 20px 14px; border-right: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: 18px; overflow-y: auto; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--ink-2); }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.on { background: var(--raise); color: var(--ink); font-weight: 600; }
.nav .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.nav .ico { width: 8px; height: 22px; border-radius: 4px; flex: none; }
.nav .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.side-user { font-size: 12px; color: var(--muted); padding: 0 10px; }
.ghost { height: 36px; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--ink-2); padding: 0 12px; text-align: left; }
.ghost:hover { background: var(--surface-2); color: var(--ink); }

.main { min-width: 0; background: var(--glow), var(--page); background-attachment: fixed; }
.wrap { max-width: 1480px; margin: 0 auto; padding: 26px 28px 60px; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.title { font-size: 28px; font-weight: 680; letter-spacing: -.02em; line-height: 1.15; margin-top: 4px; }
.subtitle { color: var(--ink-2); margin-top: 6px; max-width: 70ch; }
.meta-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.pill.ok i { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }
.pill.warn i { background: var(--warn); } .pill.bad i { background: var(--bad); }
.link-out { color: var(--s1); font-size: 13px; }
.link-out:hover { text-decoration: underline; }

/* --- Kartalar --- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
.card-pad { padding: 18px 18px 16px; }
.card h3 { font-size: 14px; font-weight: 620; letter-spacing: -.005em; }
.card .note { color: var(--muted); font-size: 12px; margin-top: 3px; }
.card-head { margin-bottom: 14px; }

.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; }
.pcard { position: relative; overflow: hidden; display: flex; flex-direction: column; transition: transform .15s ease, border-color .15s ease; }
.pcard:hover { transform: translateY(-2px); border-color: var(--border-2); }
.pcard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--accent); }
.pcard::after { content: ""; position: absolute; right: -80px; top: -80px; width: 220px; height: 220px; border-radius: 50%; background: var(--accent); opacity: .09; filter: blur(30px); pointer-events: none; }
.pcard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pname { font-size: 19px; font-weight: 680; letter-spacing: -.01em; }
.ptag { color: var(--muted); font-size: 12.5px; }
.pkpis { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; margin: 16px 0 12px; }
.pfoot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.pfoot b { color: var(--s1); font-weight: 600; }
.pinsight { color: var(--ink-2); font-size: 13px; margin: 2px 0 12px; min-height: 38px; }
.spark-wrap { margin: 2px 0 10px; }
.spark-label { color: var(--muted); font-size: 11.5px; margin-bottom: 4px; }

.kpi-label { color: var(--ink-2); font-size: 12.5px; }
.kpi-value { font-size: 26px; font-weight: 680; letter-spacing: -.02em; line-height: 1.15; margin-top: 2px; }
.kpi-value small { font-size: 14px; font-weight: 600; color: var(--ink-2); margin-left: 2px; }
.kpi-sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; margin-left: 8px; vertical-align: middle; }
.delta.good { color: var(--good-ink); } .delta.bad { color: var(--bad-ink); } .delta.flat { color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); position: relative; }
.kpi-tile.tone-good { box-shadow: inset 3px 0 0 var(--good), var(--shadow); }
.kpi-tile.tone-warn { box-shadow: inset 3px 0 0 var(--warn), var(--shadow); }
.kpi-tile.tone-bad { box-shadow: inset 3px 0 0 var(--bad), var(--shadow); }
.hero-kpis .kpi-value { font-size: 32px; }

.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }

/* --- Xulosalar --- */
.insights { display: grid; gap: 8px; }
.insight { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-2); font-size: 13.5px; }
.insight .badge { flex: none; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: var(--s1); }
.insight.good .badge { background: var(--good); } .insight.warn .badge { background: var(--warn); color: #0b0b0b; } .insight.bad .badge { background: var(--bad); }
.insight .src { color: var(--muted); font-size: 11.5px; display: block; }

/* --- Bo'limlar --- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 6px; position: sticky; top: 0; z-index: 5; padding: 10px 0; background: color-mix(in srgb, var(--page) 86%, transparent); backdrop-filter: blur(10px); }
.chip { height: 32px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); font-size: 13px; }
.chip:hover { color: var(--ink); border-color: var(--border-2); }
.section { margin-top: 26px; scroll-margin-top: 64px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 18px; font-weight: 660; letter-spacing: -.01em; }
.section-head p { color: var(--muted); font-size: 12.5px; }
.blocks { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.b-full { grid-column: span 6; } .b-half { grid-column: span 3; } .b-third { grid-column: span 2; }

/* --- Grafik qismlari --- */
.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 10px; color: var(--ink-2); font-size: 12.5px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.hbars { display: grid; gap: 9px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; align-items: center; gap: 10px; }
.hbar-label { color: var(--ink-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 12px; border-radius: 4px; background: var(--surface-2); position: relative; }
.hbar-fill { height: 100%; border-radius: 0 4px 4px 0; background: var(--s1); min-width: 2px; }
.hbar-ref { position: absolute; top: -3px; bottom: -3px; width: 0; border-left: 1.5px dashed var(--axis); }
.hbar-val { font-size: 13px; font-weight: 600; min-width: 46px; text-align: right; }
.hbar-val small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; }
.share-bar { display: flex; gap: 2px; height: 18px; border-radius: 6px; overflow: hidden; margin-bottom: 14px; }
.share-bar i { display: block; height: 100%; min-width: 3px; }
.share-list { display: grid; gap: 8px; }
.share-row { display: grid; grid-template-columns: 12px 1fr auto auto; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-2); }
.share-row i { width: 10px; height: 10px; border-radius: 3px; }
.share-row b { color: var(--ink); font-weight: 600; }
.share-row em { font-style: normal; color: var(--muted); min-width: 44px; text-align: right; }
.gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 16px 10px; }
.gauge { text-align: center; }
.gauge svg { width: 104px; height: 104px; }
.gauge-label { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.gauge-sub { font-size: 11px; color: var(--muted); }
.heat { overflow-x: auto; }
.heat table { border-collapse: separate; border-spacing: 2px; width: 100%; }
.heat th { font-weight: 500; color: var(--muted); font-size: 11.5px; padding: 2px 6px; white-space: nowrap; text-align: center; }
.heat th.row { text-align: left; color: var(--ink-2); }
.heat td { height: 30px; min-width: 38px; border-radius: 5px; text-align: center; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl-wrap { overflow-x: auto; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 0 10px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--border); color: var(--ink-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink); }
.tbl .cellbar { display: inline-block; height: 6px; border-radius: 3px; background: var(--s1); vertical-align: middle; margin-right: 8px; opacity: .85; }
.more { margin-top: 10px; }
.status-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink-2); }
.empty { color: var(--muted); padding: 26px 0; text-align: center; font-size: 13px; }
.banner { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--ink-2); font-size: 13.5px; margin-bottom: 14px; }
.banner.bad { border-color: color-mix(in srgb, var(--bad) 45%, transparent); } .banner.warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.skel { height: 180px; border-radius: var(--r); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.4s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }

.tip { position: fixed; z-index: 50; pointer-events: none; background: var(--raise); color: var(--ink); border: 1px solid var(--border-2); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.6); max-width: 280px; }
.tip b { display: block; font-weight: 600; margin-bottom: 3px; }
.tip div { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.tip div i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.tip div span { margin-left: auto; padding-left: 12px; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

.mobile-bar { display: none; }
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; border-right: 0; border-bottom: 1px solid var(--border); }
  .side .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-label, .side-user { display: none; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; }
  .wrap { padding: 18px 14px 50px; }
  .title { font-size: 23px; }
  .b-half, .b-third { grid-column: span 6; }
  .pgrid { grid-template-columns: 1fr; }
}
@media (min-width: 981px) and (max-width: 1280px) { .b-third { grid-column: span 3; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .side, .chips { display: none; } .shell { display: block; } .main { background: #fff; } }

/* --- Yagona ko'rinish: manba belgilari, zanjirlar --- */
:root[data-theme="light"] { --page: #f4f6fb; --shadow: 0 1px 2px rgba(16,24,40,.04), 0 10px 28px -18px rgba(16,24,40,.22); }
.src-chip { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: 11px; font-weight: 500; white-space: nowrap; flex: none; }
.src-chip i { width: 6px; height: 6px; border-radius: 50%; }
.kpi-src { margin-top: 8px; }
.src-list { display: flex; gap: 5px; flex-wrap: wrap; }
.insight .grow { flex: 1; min-width: 0; }
.chip i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.sources { display: flex; flex-direction: column; gap: 1px; }
.source-row { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: 8px; font-size: 12.5px; color: var(--ink-2); }
.source-row:hover { background: var(--surface-2); }
.source-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-row em { font-style: normal; color: var(--muted); font-size: 11px; white-space: nowrap; }
.st { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.st.ok { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 18%, transparent); }
.st.warn { background: var(--warn); } .st.bad { background: var(--bad); }
.chains { display: grid; grid-template-columns: repeat(auto-fit, minmax(520px, 1fr)); gap: 16px; margin-top: 4px; }
.chain { display: flex; align-items: stretch; gap: 6px; }
.chain-step { flex: 1 1 0; min-width: 0; padding: 12px 12px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.chain-step.off { opacity: .55; }
.chain-n { width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: var(--surface); font-size: 11px; font-weight: 700; display: grid; place-items: center; margin-bottom: 6px; }
.chain-label { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.chain-value { font-size: 22px; font-weight: 680; letter-spacing: -.02em; }
.chain-hint { font-size: 11px; color: var(--muted); margin-bottom: 8px; flex: 1; }
.chain-arrow { align-self: center; color: var(--muted); font-size: 16px; flex: none; }
.section-head .src-chip { align-self: center; }
@media (max-width: 700px) { .chains { grid-template-columns: 1fr; } .chain { flex-wrap: wrap; } .chain-arrow { display: none; } .chain-step { flex-basis: 46%; } }
