/* ==========================================================================
   shivaraj.space UI kit — shared design system for GCB Tracker + Personal
   (2026-10 redesign). Vanilla CSS, no build step. Light theme by default,
   [data-theme="dark"] on <html> for dark. Per-app accent via [data-app].
   ========================================================================== */
@font-face { font-family: "InterVar"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-wght.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "InterVar"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fonts/inter-latin-ext-wght.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --font: "InterVar", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  /* type scale */
  --fs-xs: 11.5px; --fs-sm: 12.5px; --fs-base: 14px; --fs-md: 15px; --fs-lg: 17px; --fs-xl: 21px; --fs-2xl: 26px; --fs-3xl: 30px;
  /* spacing / shape */
  --r-sm: 6px; --r: 10px; --r-lg: 14px; --r-full: 999px;
  --sidebar-w: 252px; --topbar-h: 64px;
  /* light palette */
  --bg: #f5f6fa; --bg-subtle: #eef0f5; --surface: #ffffff; --surface-2: #f9fafc; --surface-hover: #f3f4f8;
  --border: #e5e7ef; --border-strong: #d4d7e2;
  --text: #0f1729; --text-2: #3c4559; --muted: #6b7489; --faint: #9aa1b2;
  --accent: #4f46e5; --accent-hover: #4338ca; --accent-soft: #eef0ff; --accent-text: #4338ca; --on-accent: #fff;
  --success: #15803d; --success-soft: #e8f7ee; --success-solid: #16a34a;
  --warning: #b45309; --warning-soft: #fff5e1; --warning-solid: #f59e0b;
  --danger: #b91c1c; --danger-soft: #fdecec; --danger-solid: #dc2626;
  --info: #1d4ed8; --info-soft: #e9f0ff;
  --neutral-soft: #eef0f4;
  --shadow-xs: 0 1px 2px rgba(16,24,40,.05);
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.06);
  --shadow-md: 0 4px 12px -2px rgba(16,24,40,.08), 0 2px 4px -2px rgba(16,24,40,.05);
  --shadow-lg: 0 20px 40px -12px rgba(16,24,40,.25);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
  --chart-1: #4f46e5; --chart-2: #f59e0b; --chart-3: #10b981; --chart-4: #ec4899; --chart-5: #06b6d4; --chart-6: #8b5cf6; --chart-7: #f97316; --chart-8: #64748b;
  --grid: #eceef4;
  color-scheme: light;
}
[data-app="personal"] { --accent: #0d9488; --accent-hover: #0f766e; --accent-soft: #e6f6f4; --accent-text: #0f766e; --chart-1: #0d9488; }
[data-theme="dark"] {
  --bg: #0a0d14; --bg-subtle: #0f131c; --surface: #121722; --surface-2: #161c29; --surface-hover: #1a2130;
  --border: #222a3a; --border-strong: #2e374a;
  --text: #e8ebf2; --text-2: #c3c9d6; --muted: #8b93a7; --faint: #5f6880;
  --accent: #7c74ff; --accent-hover: #918aff; --accent-soft: rgba(124,116,255,.14); --accent-text: #a9a3ff;
  --success: #4ade80; --success-soft: rgba(34,197,94,.13); --success-solid: #22c55e;
  --warning: #fbbf24; --warning-soft: rgba(245,158,11,.14); --warning-solid: #f59e0b;
  --danger: #f87171; --danger-soft: rgba(239,68,68,.14); --danger-solid: #ef4444;
  --info: #93b4ff; --info-soft: rgba(59,130,246,.15);
  --neutral-soft: #1c2331;
  --shadow-xs: none; --shadow-sm: 0 1px 2px rgba(0,0,0,.35); --shadow-md: 0 6px 16px rgba(0,0,0,.35); --shadow-lg: 0 24px 48px rgba(0,0,0,.55);
  --chart-1: #7c74ff; --grid: #1e2533;
  color-scheme: dark;
}
[data-theme="dark"][data-app="personal"] { --accent: #2dd4bf; --accent-hover: #5eead4; --accent-soft: rgba(45,212,191,.13); --accent-text: #5eead4; --on-accent: #042f2c; --chart-1: #2dd4bf; }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: var(--fs-base); line-height: 1.5; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "cv11", "ss01"; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
svg.i-sm { width: 15px; height: 15px; } svg.i-lg { width: 22px; height: 22px; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px; z-index: 40; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 18px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #000)); font-weight: 800; font-size: 15px; letter-spacing: -.02em; box-shadow: var(--shadow-sm); }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -.01em; line-height: 1.2; }
.brand-sub { font-size: var(--fs-xs); color: var(--muted); }
.env-badge { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 7px; border-radius: var(--r-full); background: var(--warning-soft); color: var(--warning); }
.nav-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 14px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--text-2);
  font-weight: 500; font-size: 14px; cursor: pointer; text-decoration: none; position: relative; user-select: none; }
.nav-item:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.nav-item .i { color: var(--muted); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.nav-item.active .i { color: var(--accent-text); }
.nav-item .count { margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: var(--r-full); background: var(--danger-soft); color: var(--danger); }
.nav-item .lock { margin-left: auto; color: var(--faint); }
.sidebar-spacer { flex: 1; }
.app-switch { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: var(--r);
  color: var(--text-2); font-size: 13px; font-weight: 500; text-decoration: none; margin-bottom: 8px; background: var(--surface-2); }
.app-switch:hover { border-color: var(--border-strong); text-decoration: none; color: var(--text); }
.app-switch .dot { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff; }
.app-switch small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 400; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 10px 8px 4px; border-top: 1px solid var(--border); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: var(--accent-soft); color: var(--accent-text); flex: none; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.user-card .who { min-width: 0; line-height: 1.25; }
.user-card .who b { display: block; font-size: 13.5px; font-weight: 600; }
.user-card .who small { color: var(--muted); font-size: 12px; text-transform: capitalize; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 14px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border); }
.topbar .crumbs { min-width: 0; }
.topbar .crumbs .t { font-size: var(--fs-lg); font-weight: 650; letter-spacing: -.015em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .crumbs .s { font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn.hamburger { display: none; }
.content { padding: 24px 28px 48px; max-width: 1480px; width: 100%; }
.page { animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 550; font-size: 13.5px; cursor: pointer;
  white-space: nowrap; text-decoration: none; box-shadow: var(--shadow-xs); transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { background: var(--surface-hover); text-decoration: none; }
.btn:focus-visible, .icon-btn:focus-visible, .seg button:focus-visible, .select:focus-visible, .input:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger-solid); border-color: var(--danger-solid); color: #fff; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; gap: 5px; }
.btn.xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 6px; gap: 4px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text-2); cursor: pointer; box-shadow: var(--shadow-xs); }
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn.plain { border-color: transparent; background: transparent; box-shadow: none; width: 30px; height: 30px; }
.select, .input, textarea.input { height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font-size: 13.5px; box-shadow: var(--shadow-xs); min-width: 0; }
.select { padding-right: 30px; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7489' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
textarea.input { height: auto; padding: 10px 12px; }
.search { position: relative; }
.search .i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 16px; height: 16px; }
.search .input { padding-left: 32px; width: 240px; }
.seg { display: inline-flex; padding: 3px; border-radius: 9px; background: var(--bg-subtle); border: 1px solid var(--border); gap: 2px; }
.seg button { border: 0; background: transparent; height: 28px; padding: 0 11px; border-radius: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .grow { flex: 1; }

/* ---------- layout helpers ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.025em; line-height: 1.2; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: var(--fs-md); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid + .grid { margin-top: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-main-r { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.span-2 { grid-column: span 2; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.card-h h3 { margin: 0; font-size: var(--fs-md); font-weight: 650; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.card-h .sub { margin-top: 2px; font-size: var(--fs-sm); color: var(--muted); }
.card-h .tools { display: flex; align-items: center; gap: 6px; flex: none; }
.card-b { padding: 14px 18px 18px; }
.card-b.flush { padding: 8px 0 6px; }
.card-f { border-top: 1px solid var(--border); padding: 10px 18px; display: flex; justify-content: space-between; align-items: center; font-size: var(--fs-sm); color: var(--muted); }
.card-f a { font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.chip-count { font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--neutral-soft); padding: 1px 8px; border-radius: var(--r-full); }

/* ---------- KPI cards ---------- */
.kpis { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; }
.kpis.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (min-width: 1640px) { .kpis.k6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.kpi { padding: 16px 18px; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: var(--fs-sm); color: var(--muted); font-weight: 550; }
.kpi-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.kpi-ic.success { background: var(--success-soft); color: var(--success); }
.kpi-ic.warning { background: var(--warning-soft); color: var(--warning); }
.kpi-ic.danger { background: var(--danger-soft); color: var(--danger); }
.kpi-ic.neutral { background: var(--neutral-soft); color: var(--muted); }
.kpi-ic .i { width: 16px; height: 16px; }
.kpi-value { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value .unit { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 5px; letter-spacing: 0; }
.kpi-value .approx { color: var(--faint); font-weight: 500; margin-right: 2px; }
.kpi-meta { font-size: var(--fs-sm); color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 19px; }
.kpi .progress { margin-top: 4px; }
.kpi.nt .kpi-value { font-size: var(--fs-lg); color: var(--faint); font-weight: 600; letter-spacing: -.01em; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 650; font-size: 12px; padding: 1px 6px; border-radius: var(--r-full); }
.delta.up { color: var(--success); background: var(--success-soft); }
.delta.down { color: var(--danger); background: var(--danger-soft); }
.delta.flat { color: var(--muted); background: var(--neutral-soft); }

/* ---------- badges / pills ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--r-full); font-size: 11.5px; font-weight: 600;
  background: var(--neutral-soft); color: var(--text-2); white-space: nowrap; line-height: 1; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; display: none; }
.badge.dot::before { display: block; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); }
.badge.outline { background: transparent; border: 1px solid var(--border-strong); color: var(--muted); }
button.badge { border: 0; cursor: pointer; }
button.badge:hover { filter: brightness(.96); box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 18%, transparent); }

/* ---------- progress ---------- */
.progress { height: 6px; border-radius: var(--r-full); background: var(--bg-subtle); overflow: hidden; display: flex; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: var(--r-full); transition: width .4s ease; }
.progress > span.success { background: var(--success-solid); } .progress > span.warning { background: var(--warning-solid); } .progress > span.danger { background: var(--danger-solid); }
.progress.lg { height: 8px; }
.segs { display: flex; gap: 3px; } .segs span { flex: 1; height: 6px; border-radius: 3px; background: var(--bg-subtle); } .segs span.done { background: var(--accent); }

/* ---------- list rows ---------- */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 10px 18px; min-height: 56px; border-top: 1px solid var(--border); }
.li:first-child { border-top: 0; }
.li:hover { background: var(--surface-2); }
.li .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; font-size: 11.5px; font-weight: 700; background: var(--neutral-soft); color: var(--text-2); }
.li .ic .i { width: 16px; height: 16px; }
.li .ic.success { background: var(--success-soft); color: var(--success); } .li .ic.warning { background: var(--warning-soft); color: var(--warning); }
.li .ic.danger { background: var(--danger-soft); color: var(--danger); } .li .ic.info { background: var(--info-soft); color: var(--info); }
.li .ic.accent { background: var(--accent-soft); color: var(--accent-text); }
.li .main { flex: 1; min-width: 0; }
.li .ttl { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .amt { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; font-size: 13.5px; }
.li .amt small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.li .act { display: flex; gap: 6px; flex: none; }
.li.attn { align-items: flex-start; }
.li.attn .ttl { white-space: normal; }
.li.attn .meta { white-space: normal; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; }
.table th:first-child { padding-left: 18px; } .table td:first-child { padding-left: 18px; }
.table th:last-child { padding-right: 18px; } .table td:last-child { padding-right: 18px; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .r { text-align: right; white-space: nowrap; } .table .c { text-align: center; }
.table td .num, .table td.r b { white-space: nowrap; }
.table tr.muted td { color: var(--faint); }
.table tfoot td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 0; }
.table .acts { text-align: right; white-space: nowrap; }
.card > .table-wrap:first-child table th:first-child { border-top-left-radius: var(--r-lg); }
.card > .table-wrap:first-child table th:last-child { border-top-right-radius: var(--r-lg); }
.cell-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.cell-main .t { font-weight: 600; } .cell-main .s { font-size: 12px; color: var(--muted); }
.initials { width: 32px; height: 32px; border-radius: 9px; flex: none; display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: #fff; }

/* ---------- empty / not tracked ---------- */
.empty { text-align: center; padding: 30px 20px; color: var(--muted); }
.empty .em-ic { width: 44px; height: 44px; border-radius: 12px; margin: 0 auto 10px; display: grid; place-items: center; background: var(--neutral-soft); color: var(--muted); }
.empty.ok .em-ic { background: var(--success-soft); color: var(--success); }
.empty b { display: block; color: var(--text); font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.empty p { margin: 0 auto; max-width: 340px; font-size: 13px; }
.empty .btn { margin-top: 12px; }
.empty.compact { padding: 18px 16px; }
.nt-box { border: 1px dashed var(--border-strong); border-radius: var(--r); padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; background: var(--surface-2); color: var(--muted); font-size: 12.5px; }
.nt-box .i { color: var(--faint); margin-top: 1px; }
.nt-box b { color: var(--text-2); font-weight: 600; }
.nt-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--faint); border: 1px dashed var(--border-strong); border-radius: var(--r-full); padding: 1px 8px; }

/* ---------- charts ---------- */
.chart-box { position: relative; height: 270px; }
.chart-box.sm { height: 200px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.line { height: 2px; border-radius: 1px; width: 14px; }
.donut-wrap { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 18px; align-items: center; }
.donut-box { position: relative; height: 170px; width: 170px; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.donut-center b { display: block; font-size: 20px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.donut-center small { color: var(--muted); font-size: 11.5px; }
.legend-list { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.legend-list .row { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.legend-list .row i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.legend-list .row .n { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.legend-list .row .v { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.legend-list .row .p { color: var(--muted); font-size: 12px; width: 36px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- stat strip ---------- */
.strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.strip > div { padding: 14px 18px; border-left: 1px solid var(--border); }
.strip > div:first-child { border-left: 0; }
.strip .l { font-size: 12px; color: var(--muted); font-weight: 550; }
.strip .v { font-size: 19px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ---------- debts ---------- */
.debt { padding: 12px 0; border-top: 1px solid var(--border); }
.debt:first-child { border-top: 0; padding-top: 2px; }
.debt .row1 { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 7px; }
.debt .row1 b { font-size: 13.5px; font-weight: 600; }
.debt .row1 .v { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.debt .row2 { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.region { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 10px; }
.region .l { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.region .v { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.debt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.debt-card { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.debt-card h4 { margin: 0; font-size: 14.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.debt-card .bal { font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-weight: 550; font-variant-numeric: tabular-nums; }

/* ---------- section label ---------- */
.sec-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.sec-title h2 { margin: 0; font-size: var(--fs-lg); font-weight: 650; letter-spacing: -.015em; }
.sec-title .sub { color: var(--muted); font-size: var(--fs-sm); }
.sec-title:first-child { margin-top: 0; }

/* ---------- modal / dialog ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(10,13,22,.45); backdrop-filter: blur(2px); animation: fade .15s ease-out; }
.modal-card { width: 100%; max-width: 480px; max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); }
.modal-card.wide { max-width: 640px; }
.modal-h { padding: 18px 22px 4px; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.modal-h h3 { margin: 0; font-size: var(--fs-lg); font-weight: 650; letter-spacing: -.01em; }
.modal-h p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.modal-b { padding: 14px 22px; display: flex; flex-direction: column; gap: 12px; }
.modal-f { padding: 14px 22px 18px; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 550; color: var(--text-2); min-width: 0; }
.field .input, .field .select { width: 100%; height: 38px; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-err { padding: 9px 12px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-size: 13px; font-weight: 500; }

/* ---------- menu ---------- */
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; }
.menu .mh { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu .mh b { display: block; font-size: 13.5px; } .menu .mh small { color: var(--muted); font-size: 12px; }
.menu a, .menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; border: 0; background: transparent; color: var(--text-2); font-size: 13.5px; cursor: pointer; text-align: left; text-decoration: none; }
.menu a:hover, .menu button:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.menu .sep { height: 1px; background: var(--border); margin: 4px 0; }
.user-btn { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 4px; border-radius: var(--r-full); border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; box-shadow: var(--shadow-xs); }
.user-btn:hover { background: var(--surface-hover); }
.user-btn span { font-size: 13px; font-weight: 600; }
.show-sm { display: none !important; }
.menu-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px 8px; font-size: 13px; color: var(--muted); }
.seg.sm button { padding: 3px 9px; font-size: 12px; }

/* ---------- toast ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px; background: #111827; color: #f9fafb; font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-lg); animation: toast .2s ease-out; max-width: 360px; }
.toast.err { background: var(--danger-solid); }
.toast .i { width: 16px; height: 16px; }
@keyframes toast { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- misc ---------- */
.greet-date { font-size: 12.5px; font-weight: 600; color: var(--accent-text); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.skeleton { background: linear-gradient(90deg, var(--bg-subtle), var(--surface-hover), var(--bg-subtle)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.loading-page { display: grid; gap: 16px; }
.loading-page .skeleton { height: 120px; }
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--info-soft); color: var(--info); font-size: 13px; }
.callout.warning { background: var(--warning-soft); color: var(--warning); }
.callout .i { margin-top: 1px; }
.callout b { font-weight: 650; }
.kbd-link { cursor: pointer; color: var(--accent-text); font-weight: 600; }
.pw-cell { font-family: var(--mono); font-size: 12.5px; }
.rep-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.rep-grid > div { padding: 10px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.rep-grid > div:nth-child(-n+2) { border-top: 0; }
.rep-grid .rv { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.sugg { display: flex; gap: 10px; padding: 11px 0; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--text-2); }
.sugg:first-child { border-top: 0; }
.sugg .i { color: var(--accent-text); margin-top: 2px; }
.cron-box { font-family: var(--mono); font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 12px 14px; color: var(--text-2); word-break: break-all; }
.drawer-backdrop { display: none; }

/* ---------- login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--bg); }
.auth-art { position: relative; overflow: hidden; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; color: #fff;
  background: radial-gradient(1200px 600px at 0% 0%, color-mix(in srgb, var(--accent) 85%, #fff 0%), transparent), linear-gradient(140deg, color-mix(in srgb, var(--accent) 92%, #000) 0%, color-mix(in srgb, var(--accent) 55%, #0b1020) 100%); }
.auth-art .brand { padding: 0; }
.auth-art .brand-mark { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); box-shadow: none; color: #fff; }
.auth-art .brand-sub { color: rgba(255,255,255,.7); }
.auth-art h1 { font-size: 38px; line-height: 1.12; letter-spacing: -.035em; margin: 0 0 14px; font-weight: 750; max-width: 520px; }
.auth-art p { color: rgba(255,255,255,.78); font-size: 16px; max-width: 460px; margin: 0; }
.mock { margin-top: 36px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: 16px; padding: 16px; backdrop-filter: blur(6px); max-width: 520px; }
.mock-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mock-k { background: rgba(255,255,255,.1); border-radius: 10px; padding: 12px; }
.mock-k span { display: block; font-size: 11px; color: rgba(255,255,255,.65); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.mock-k b { display: block; font-size: 15px; margin-top: 4px; }
.mock-bars { display: flex; align-items: flex-end; gap: 8px; height: 90px; margin-top: 14px; padding: 0 4px; }
.mock-bars i { flex: 1; border-radius: 5px 5px 2px 2px; background: rgba(255,255,255,.28); }
.mock-bars i:nth-child(2n) { background: rgba(255,255,255,.5); }
.auth-foot { font-size: 12.5px; color: rgba(255,255,255,.6); }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: var(--fs-2xl); letter-spacing: -.025em; margin: 0 0 6px; }
.auth-card .lead { color: var(--muted); margin: 0 0 26px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card .btn.primary { width: 100%; height: 42px; font-size: 14.5px; margin-top: 6px; }
.auth-card .fine { margin-top: 22px; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.auth-card .form-err { margin-bottom: 14px; }
.auth .theme-fab { position: fixed; top: 16px; right: 16px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .g-main, .g-main-r { grid-template-columns: minmax(0, 1fr); }
  .kpis.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) { .kpis.k6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1101px) and (max-width: 1639px) { .kpis.k6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .drawer-backdrop { display: block; position: fixed; inset: 0; background: rgba(10,13,22,.4); z-index: 35; }
  .icon-btn.hamburger { display: inline-grid; }
  .topbar { padding: 0 16px; gap: 10px; }
  .content { padding: 18px 16px 40px; }
  .g-2, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip > div:nth-child(3) { border-left: 0; } .strip > div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
  .search .input { width: 100%; }
  .toolbar .search { flex: 1; min-width: 180px; }
}
@media (max-width: 640px) {
  .topbar .crumbs .s { display: none; }
  .topbar .hide-sm { display: none !important; }
  .show-sm { display: flex !important; }
  .topbar { gap: 8px; }
  .topbar-right { gap: 6px; }
  .topbar #monthSel { max-width: 138px; padding-right: 26px; }
  .user-btn { padding: 0 3px; } .user-btn > svg { display: none; }
  .card-h { flex-wrap: wrap; }
  .card-h .legend { width: 100%; }
  .li .act .btn .lbl { display: none; }
  .li .act .btn.xs { padding: 0 8px; }
  .page-head h1 { font-size: 22px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .kpis, .kpis.k4, .kpis.k6 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 13px 14px; }
  .kpi-value { font-size: 20px; }
  .kpi-value .unit { font-size: 11px; margin-left: 3px; }
  .kpi-ic { display: none; }
  .donut-wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .donut-wrap .legend-list { width: 100%; }
  .li { padding: 10px 14px; }
  .card-h { padding: 14px 14px 0; } .card-b { padding: 12px 14px 14px; }
  .table th:first-child, .table td:first-child { padding-left: 14px; }
  .row2 { grid-template-columns: minmax(0, 1fr); }
  .chart-box { height: 230px; }
  .table.stack-sm thead { display: none; }
  .table.stack-sm, .table.stack-sm tbody, .table.stack-sm tr, .table.stack-sm td { display: block; width: 100%; }
  .table.stack-sm tr { padding: 10px 14px; border-bottom: 1px solid var(--border); }
  .table.stack-sm td { border: 0; padding: 3px 0 !important; text-align: left !important; }
  .table.stack-sm td[data-l]::before { content: attr(data-l); display: inline-block; min-width: 96px; font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
  .table.stack-sm tfoot { display: block; } .table.stack-sm tfoot tr { display: flex; justify-content: space-between; }
  .toasts { left: 16px; right: 16px; }
}
@media print {
  .sidebar, .topbar, .page-head .actions, .toolbar, .btn, .icon-btn { display: none !important; }
  .app { display: block; } .content { padding: 0; } .card { box-shadow: none; break-inside: avoid; }
}

/* section headings inside pages */
.section-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 4px 0 12px; }
.section-h h2 { margin: 0; font-size: var(--fs-lg); font-weight: 650; letter-spacing: -.015em; }
