/* ───────────── Tokens ───────────── */
:root {
  color-scheme: light;
  --bg: #e7e9e5;
  --panel: #ffffff;
  --tile: #f3f4f1;
  --tile-2: #e9ebe6;
  --line: rgba(17, 19, 17, .08);
  --line-2: rgba(17, 19, 17, .14);
  --text: #121412;
  --text-2: #50544e;
  --text-3: #858a83;
  --nav: #121412;
  --nav-text: #b9bdb6;
  --nav-active: #ffffff;
  --nav-active-text: #121412;
  --accent: #c9f45e;          /* лайм — заливки кнопок/плашек, текст на нём тёмный */
  --accent-ink: #121412;
  --accent-2: #b8dbe8;
  --chart: #5c8d00;           /* лайм, затемнённый под светлый фон (≥3:1) */
  --chart-soft: rgba(92, 141, 0, .16);
  --chart-2: #2a78d6;
  --heat: #d9480f;
  --grid: rgba(17, 19, 17, .07);
  --good: #0ca30c;
  --warn: #c98500;
  --bad: #d03b3b;
  --info: #2a78d6;
  --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100; --c5: #e87ba4; --c6: #6250d6;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05);
  --tooltip: #121412;
  --tooltip-text: #f2f3f0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #08090a;
    --panel: #121315;
    --tile: #1a1b1e;
    --tile-2: #222428;
    --line: rgba(255, 255, 255, .06);
    --line-2: rgba(255, 255, 255, .11);
    --text: #f1f2ef;
    --text-2: #a6aaa4;
    --text-3: #6d716b;
    --nav: #1a1b1e;
    --nav-text: #9da19b;
    --nav-active: #2c2e33;
    --nav-active-text: #f1f2ef;
    --accent: #c9f45e;
    --accent-ink: #0d0e0f;
    --accent-2: #a9cfe0;
    --chart: #c9f45e;
    --chart-soft: rgba(201, 244, 94, .14);
    --chart-2: #6da7ec;
    --heat: #ff7a50;
    --grid: rgba(255, 255, 255, .06);
    --good: #3ccf6e;
    --warn: #fab219;
    --bad: #f06a5c;
    --info: #6da7ec;
    --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181; --c6: #9085e9;
    --shadow: none;
    --tooltip: #f1f2ef;
    --tooltip-text: #0d0e0f;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #08090a;
  --panel: #121315;
  --tile: #1a1b1e;
  --tile-2: #222428;
  --line: rgba(255, 255, 255, .06);
  --line-2: rgba(255, 255, 255, .11);
  --text: #f1f2ef;
  --text-2: #a6aaa4;
  --text-3: #6d716b;
  --nav: #1a1b1e;
  --nav-text: #9da19b;
  --nav-active: #2c2e33;
  --nav-active-text: #f1f2ef;
  --accent: #c9f45e;
  --accent-ink: #0d0e0f;
  --accent-2: #a9cfe0;
  --chart: #c9f45e;
  --chart-soft: rgba(201, 244, 94, .14);
  --chart-2: #6da7ec;
  --heat: #ff7a50;
  --grid: rgba(255, 255, 255, .06);
  --good: #3ccf6e;
  --warn: #fab219;
  --bad: #f06a5c;
  --info: #6da7ec;
  --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181; --c6: #9085e9;
  --shadow: none;
  --tooltip: #f1f2ef;
  --tooltip-text: #0d0e0f;
}

/* ───────────── Base ───────────── */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1, "cv11" 1;
  min-height: 100vh;
  transition: background .25s;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
svg { display: block; }
.mono { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.hidden { display: none !important; }

.app { max-width: 1440px; margin: 0 auto; padding: 18px 24px 48px; }

/* ───────────── Top bar ───────────── */
.topbar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  margin-bottom: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 16px; letter-spacing: -.01em; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center;
}
.nav {
  display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--nav);
  border: 1px solid var(--line);
}
.nav button {
  border: 0; background: transparent; color: var(--nav-text); padding: 8px 16px; border-radius: 999px;
  display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav button:hover { color: var(--nav-active-text); }
:root:not([data-theme="dark"]) .nav button:hover { color: #fff; }
.nav button.active { background: var(--nav-active); color: var(--nav-active-text); }
.nav .badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 11px; font-weight: 600;
  background: var(--bad); color: #fff; display: inline-grid; place-items: center;
}
.top-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel);
  display: grid; place-items: center; color: var(--text-2); transition: color .15s, border-color .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }
.live {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2);
  padding: 0 12px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel);
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 var(--good); animation: pulse 2.4s infinite; }
.live.stale .live-dot { background: var(--warn); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 55%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ───────────── Server strip ───────────── */
.strip {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 12px 14px 12px 12px;
  margin-bottom: 14px; box-shadow: var(--shadow);
}
.strip-id { display: flex; align-items: center; gap: 12px; }
.strip-ico {
  width: 40px; height: 40px; border-radius: 12px; background: var(--tile); display: grid; place-items: center; color: var(--text);
}
.strip-name { font-weight: 600; font-size: 15px; }
.strip-sub { font-size: 12px; color: var(--text-3); }
.strip-facts { display: flex; gap: 6px 18px; flex-wrap: wrap; flex: 1; color: var(--text-2); font-size: 13px; }
.fact { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.fact svg { color: var(--text-3); }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 550; background: var(--tile); border: 1px solid var(--line); white-space: nowrap;
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; }
.status-pill.good { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.status-pill.good .dot { background: var(--accent-ink); }
.status-pill.warn .dot { background: var(--warn); }
.status-pill.bad .dot { background: var(--bad); }
button.status-pill { cursor: pointer; }

/* ───────────── Grid & cards ───────────── */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.s2 { grid-column: span 2; } .s3 { grid-column: span 3; } .s4 { grid-column: span 4; }
.s5 { grid-column: span 5; } .s6 { grid-column: span 6; } .s7 { grid-column: span 7; }
.s8 { grid-column: span 8; } .s12 { grid-column: span 12; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 16px;
  box-shadow: var(--shadow); min-width: 0;
}
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; min-height: 34px; }
.card-ico {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center;
  color: var(--text-2); flex: none;
}
.card-t { font-weight: 600; font-size: 14.5px; }
.card-sub { color: var(--text-3); font-size: 12.5px; margin-left: 2px; }
.card-h .spacer { flex: 1; }
.tile { background: var(--tile); border-radius: 16px; padding: 12px 14px; }

.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--tile); gap: 2px; }
.seg button {
  border: 0; background: transparent; color: var(--text-2); font-size: 12px; font-weight: 500;
  padding: 5px 11px; border-radius: 999px;
}
.seg button.active { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
:root[data-theme="dark"] .seg button.active { background: var(--tile-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button.active { background: var(--tile-2); } }

/* ───────────── KPI ───────────── */
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 16px; }
.kpi-top { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }
.kpi-top svg { color: var(--text-3); }
.kpi-val { font-size: 30px; font-weight: 600; letter-spacing: -.025em; line-height: 1.1; margin-top: 6px; }
.kpi-val small { font-size: 15px; font-weight: 500; color: var(--text-3); letter-spacing: 0; margin-left: 2px; }
.kpi-sub { color: var(--text-3); font-size: 12.5px; min-height: 18px; }
.meter { height: 6px; border-radius: 3px; background: var(--tile-2); overflow: hidden; margin-top: 6px; }
.meter > i { display: block; height: 100%; border-radius: 3px; background: var(--chart); transition: width .4s; }
.meter.warn > i { background: var(--warn); } .meter.bad > i { background: var(--bad); }

/* ───────────── Charts ───────────── */
.chart { position: relative; width: 100%; }
.chart svg text { fill: var(--text-3); font-size: 11px; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .hit:hover + .bar, .chart .bar.hover { filter: brightness(1.15); }
.chart-legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart-empty {
  height: 100%; min-height: 160px; display: grid; place-items: center; color: var(--text-3); font-size: 13px;
  border: 1px dashed var(--line-2); border-radius: 14px; text-align: center; padding: 16px;
}
.tooltip {
  position: fixed; z-index: 50; pointer-events: none; background: var(--tooltip); color: var(--tooltip-text);
  padding: 8px 10px; border-radius: 10px; font-size: 12px; line-height: 1.4; box-shadow: 0 6px 24px rgba(0,0,0,.25);
  max-width: 280px; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
}
.tooltip.show { opacity: 1; transform: none; }
.tooltip b { font-weight: 600; }
.tooltip .tt-t { opacity: .65; margin-bottom: 2px; }

/* heatmap */
.heat { display: grid; gap: 3px; }
.heat-row { display: grid; grid-template-columns: 22px repeat(24, minmax(0, 1fr)); gap: 3px; align-items: center; }
.heat-row .lbl { font-size: 10.5px; color: var(--text-3); }
.heat-cell { aspect-ratio: 1; border-radius: 3px; background: var(--tile-2); }
.heat-cell[data-l="1"] { background: color-mix(in oklab, var(--heat) 22%, var(--tile-2)); }
.heat-cell[data-l="2"] { background: color-mix(in oklab, var(--heat) 42%, var(--tile-2)); }
.heat-cell[data-l="3"] { background: color-mix(in oklab, var(--heat) 64%, var(--tile-2)); }
.heat-cell[data-l="4"] { background: color-mix(in oklab, var(--heat) 84%, var(--tile-2)); }
.heat-cell[data-l="5"] { background: var(--heat); }
.heat-cell:hover { outline: 2px solid var(--text); outline-offset: 1px; }
.heat-hours { display: grid; grid-template-columns: 22px repeat(24, minmax(0, 1fr)); gap: 3px; font-size: 10px; color: var(--text-3); }
.heat-hours span { text-align: center; }
.heat-scale { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-3); margin-top: 10px; }
.heat-scale i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.heat-big .heat-cell { border-radius: 4px; }

/* ───────────── Projects ───────────── */
.proj-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.proj-card {
  --pc: var(--c1);
  position: relative; border-radius: 20px; padding: 14px; cursor: pointer; text-align: left; width: 100%;
  border: 1px solid color-mix(in oklab, var(--pc) 35%, transparent);
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--pc) 22%, var(--panel)) 0%, color-mix(in oklab, var(--pc) 7%, var(--panel)) 100%);
  transition: transform .15s, border-color .15s;
}
.proj-card:hover { transform: translateY(-2px); border-color: color-mix(in oklab, var(--pc) 60%, transparent); }
.proj-head { display: flex; align-items: center; gap: 10px; }
.proj-ico {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: color-mix(in oklab, var(--pc) 20%, var(--panel)); color: var(--pc);
  border: 1px solid color-mix(in oklab, var(--pc) 30%, transparent); font-weight: 700; font-size: 15px;
}
.proj-name { font-weight: 600; font-size: 15px; }
.proj-dom { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-state { margin-left: auto; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 550; padding: 4px 9px;
  border-radius: 999px; background: var(--tile); color: var(--text-2); white-space: nowrap; border: 1px solid var(--line);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.pill.good .dot { background: var(--good); } .pill.warn .dot { background: var(--warn); } .pill.bad .dot { background: var(--bad); }
.pill.bad { color: var(--bad); }
.proj-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 14px; }
.proj-stat .v { font-weight: 600; font-size: 15px; }
.proj-stat .l { font-size: 11px; color: var(--text-3); }
.spark { margin-top: 10px; height: 40px; }
.spark path.area { fill: color-mix(in oklab, var(--pc) 22%, transparent); }
.spark path.line { fill: none; stroke: var(--pc); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }

/* graph (projects tab) */
.graph-wrap { position: relative; overflow-x: auto; }
.graph { position: relative; min-width: 640px; }
.graph svg.links { position: absolute; inset: 0; overflow: visible; }
.graph .link { fill: none; stroke: var(--line-2); stroke-width: 1.4; transition: stroke .2s, opacity .2s; }
.graph .link.on { stroke: var(--pc, var(--accent)); stroke-width: 1.8; }
.graph .link.dim { opacity: .45; }
.orb {
  position: absolute; width: 150px; height: 150px; margin: -75px 0 0 -75px; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  background:
    radial-gradient(circle at 50% 50%, color-mix(in oklab, var(--accent) 30%, transparent) 0 18%, transparent 19%),
    radial-gradient(circle, var(--tile) 0 58%, transparent 59%),
    repeating-radial-gradient(circle, transparent 0 5px, var(--line) 5px 6px);
  border: 1px solid var(--line-2);
}
.orb-core {
  width: 46px; height: 46px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0, var(--accent) 35%, color-mix(in oklab, var(--accent) 40%, #2b3a00) 100%);
  box-shadow: 0 0 30px color-mix(in oklab, var(--accent) 60%, transparent);
  animation: breathe 4s ease-in-out infinite;
}
@keyframes breathe { 50% { box-shadow: 0 0 46px color-mix(in oklab, var(--accent) 80%, transparent); transform: scale(1.04); } }
.orb-label { position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); white-space: nowrap; font-weight: 600; font-size: 13px; }
.orb-label small { display: block; font-weight: 400; color: var(--text-3); font-size: 11.5px; }
.gnode {
  --pc: var(--c1);
  position: absolute; transform: translateY(-50%); display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; padding: 8px 12px 8px 8px;
  cursor: pointer; transition: border-color .15s, box-shadow .15s; text-align: left; width: 210px;
}
.gnode-s { white-space: nowrap; }
.gnode:hover { border-color: color-mix(in oklab, var(--pc) 60%, transparent); }
.gnode.on { border-color: var(--pc); box-shadow: 0 0 0 3px color-mix(in oklab, var(--pc) 22%, transparent); }
.gnode .proj-ico { width: 34px; height: 34px; border-radius: 10px; font-size: 13px; }
.gnode-t { font-weight: 600; font-size: 13px; }
.gnode-s { font-size: 11px; color: var(--text-3); display: flex; align-items: center; gap: 5px; }
.gleaf {
  position: absolute; transform: translateY(-50%); display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--text-2); background: var(--tile); border: 1px solid var(--line);
  border-radius: 10px; padding: 5px 9px; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis;
  transition: opacity .2s, border-color .2s;
}
.gleaf svg { color: var(--text-3); flex: none; }
.gleaf.dim { opacity: .5; }
.gleaf.on { border-color: color-mix(in oklab, var(--pc) 45%, transparent); color: var(--text); }
.gleaf .tag { font-size: 10.5px; color: var(--text-3); }

/* detail panel */
.detail-h { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.detail-h .proj-ico { width: 46px; height: 46px; font-size: 18px; border-radius: 14px; }
.detail-name { font-size: 20px; font-weight: 650; letter-spacing: -.015em; }
.detail-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.detail-links a { font-size: 12.5px; color: var(--text-2); text-decoration: none; border-bottom: 1px solid var(--line-2); }
.detail-links a:hover { color: var(--text); }
.mini-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.mini-tiles .tile .v { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.mini-tiles .tile .l { font-size: 11.5px; color: var(--text-3); }

/* rows / lists */
.rows { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-top: 1px solid var(--line); min-width: 0;
}
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .k { color: var(--text-3); font-size: 12.5px; width: 140px; flex: none; }
.row .v { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; margin-left: auto; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; color: var(--text-3); font-size: 12px; padding: 0 8px 8px; }
.tbl td { padding: 9px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl .bar-cell { width: 34%; }
.hbar { height: 6px; border-radius: 3px; background: var(--tile-2); overflow: hidden; }
.hbar > i { display: block; height: 100%; background: var(--heat); border-radius: 3px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12.5px;
  background: var(--tile); border: 1px solid var(--line);
}
.chip b { font-weight: 600; }
.chip .c { color: var(--text-3); font-size: 11.5px; }

/* alerts */
.alert {
  display: flex; gap: 12px; padding: 12px; border-radius: 14px; background: var(--tile); align-items: flex-start;
  border: 1px solid transparent; width: 100%; text-align: left;
}
.alert + .alert { margin-top: 8px; }
.alert .a-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.alert.critical { border-color: color-mix(in oklab, var(--bad) 35%, transparent); }
.alert.critical .a-ico { background: color-mix(in oklab, var(--bad) 18%, transparent); color: var(--bad); }
.alert.warning .a-ico { background: color-mix(in oklab, var(--warn) 18%, transparent); color: var(--warn); }
.alert.info .a-ico { background: color-mix(in oklab, var(--info) 15%, transparent); color: var(--info); }
.alert-t { font-weight: 600; font-size: 13px; }
.alert-x { font-size: 12.5px; color: var(--text-2); margin-top: 1px; }
.alert-lvl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-left: auto; flex: none; padding-top: 2px; }
.all-good {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--accent); color: var(--accent-ink);
  font-weight: 550;
}

/* timeline (журнал) */
.timeline { position: relative; }
.tl-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; position: relative; padding-bottom: 14px; }
.tl-item::before {
  content: ""; position: absolute; left: 16px; top: 34px; bottom: 0; width: 0; border-left: 1px dashed var(--line-2);
}
.tl-item:last-child::before { display: none; }
.tl-dot {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--tile);
  border: 1px solid var(--line-2); color: var(--text-2);
}
.tl-dot.ok { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.tl-dot.bad { background: color-mix(in oklab, var(--bad) 18%, var(--panel)); color: var(--bad); border-color: transparent; }
.tl-dot.warn { background: color-mix(in oklab, var(--warn) 18%, var(--panel)); color: var(--warn); border-color: transparent; }
.tl-t { font-weight: 550; font-size: 13.5px; padding-top: 2px; }
.tl-x { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-time { font-size: 12px; color: var(--text-3); padding-top: 4px; white-space: nowrap; }
.count-b { font-size: 11px; font-weight: 600; background: var(--tile-2); color: var(--text-2); border-radius: 6px; padding: 1px 6px; margin-left: 6px; }

.big-num { font-size: 40px; font-weight: 650; letter-spacing: -.03em; line-height: 1; }
.big-num small { font-size: 14px; font-weight: 500; color: var(--text-3); letter-spacing: 0; margin-left: 4px; }
.trend { font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--tile); }
.trend.up { color: var(--bad); } .trend.down { color: var(--good); }

.f2b-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.f2b-grid .tile .v { font-size: 20px; font-weight: 600; }
.f2b-grid .tile .l { font-size: 11.5px; color: var(--text-3); }
.note {
  margin-top: 12px; padding: 12px; border-radius: 14px; font-size: 12.5px; color: var(--text-2);
  background: color-mix(in oklab, var(--warn) 10%, var(--tile)); border: 1px solid color-mix(in oklab, var(--warn) 25%, transparent);
}
.note b { color: var(--text); }
.empty { color: var(--text-3); font-size: 13px; padding: 14px 2px; }

.view { display: none; }
.view.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ───────────── Login ───────────── */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card {
  width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 26px;
  padding: 28px; box-shadow: var(--shadow);
}
.login-card h1 { font-size: 22px; letter-spacing: -.02em; margin: 18px 0 4px; }
.login-card p { margin: 0 0 20px; color: var(--text-2); font-size: 13.5px; }
.field {
  width: 100%; height: 46px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--tile);
  color: var(--text); padding: 0 14px; font: inherit; font-size: 15px; outline: none;
}
.field:focus { border-color: var(--text-2); }
.btn-primary {
  width: 100%; height: 46px; margin-top: 12px; border: 0; border-radius: 14px; background: var(--accent);
  color: var(--accent-ink); font-weight: 600; font-size: 14.5px;
}
.btn-primary:disabled { opacity: .6; }
.login-err { color: var(--bad); font-size: 13px; min-height: 20px; margin-top: 10px; }

/* ───────────── Responsive ───────────── */
@media (max-width: 1180px) {
  .s2 { grid-column: span 4; }
  .s3 { grid-column: span 6; }
  .s4, .s5, .s7, .s8 { grid-column: span 12; }
}
@media (max-width: 860px) {
  .topbar { grid-template-columns: 1fr auto; }
  .nav { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; overflow-x: auto; }
  .nav button { flex: 1; justify-content: center; }
  .s6 { grid-column: span 12; }
}
@media (max-width: 640px) {
  .app { padding: 12px 16px 40px; }
  .s2 { grid-column: span 6; } .s3 { grid-column: span 12; }
  .kpi-val { font-size: 24px; }
  .nav button span.lbl { display: none; }
  .live .txt { display: none; }
  .mini-tiles { grid-template-columns: repeat(2, 1fr); }
  .row .k { width: 110px; }
  .strip-facts { flex-basis: 100%; }
}
