/* ==========================================================================
   Nebula — shared design system for Gram Rakshak (app) and the Quantox
   licence console. Dark "deep space" and light "daylight" themes.
   Fonts: Outfit (Latin), Anek Devanagari (Marathi), JetBrains Mono (codes).
   ========================================================================== */

@font-face { font-family: "Outfit"; src: url("fonts/Outfit.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Anek Devanagari"; src: url("fonts/AnekDevanagari.woff2") format("woff2"); font-weight: 100 800; font-display: swap;
  unicode-range: U+0900-097F, U+1CD0-1CFF, U+200C-200D, U+20B9, U+25CC, U+A8E0-A8FF; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/JetBrainsMono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --font: "Outfit", "Anek Devanagari", "Segoe UI", system-ui, sans-serif;
  --font-mr: "Anek Devanagari", "Outfit", "Nirmala UI", sans-serif;
  --mono: "JetBrains Mono", Consolas, ui-monospace, monospace;
  --r-xs: 10px; --r-sm: 14px; --r: 20px; --r-lg: 28px; --r-pill: 999px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --lime: #c8f26a; --mint: #74e6c0; --cyan: #5ccfff; --violet: #a48bff; --pink: #f58bd0; --amber: #ffc857; --coral: #ff7a7a;
  --hero: linear-gradient(125deg, #7fe7c4 0%, #b9f07a 48%, #e9f78e 100%);
  --hero-violet: linear-gradient(150deg, #c7b8ff 0%, #9d86ff 55%, #7f6af0 100%);
  --hero-ink: #0c1512;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07080e;
  --bg-glow-1: rgba(122, 92, 255, .20);
  --bg-glow-2: rgba(72, 214, 176, .12);
  --bg-glow-3: rgba(92, 207, 255, .08);
  --glass: rgba(255, 255, 255, .045);
  --glass-2: rgba(255, 255, 255, .07);
  --glass-3: rgba(255, 255, 255, .11);
  --glass-solid: #12141d;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #eef0f8;
  --text-2: #c2c7d8;
  --muted: #858ba3;
  --accent: #c8f26a;          /* primary action */
  --accent-ink: #0d140a;
  --accent-soft: rgba(200, 242, 106, .14);
  --accent-text: #d6f78d;
  --focus: #a48bff;
  --ok: #6ee7a8; --ok-soft: rgba(110, 231, 168, .14);
  --warn: #ffc857; --warn-soft: rgba(255, 200, 87, .15);
  --bad: #ff6b85; --bad-soft: rgba(255, 107, 133, .15);
  --info: #8fb4ff; --info-soft: rgba(143, 180, 255, .15);
  --violet-text: #c3b4ff; --violet-soft: rgba(164, 139, 255, .16);
  --btn-contrast-bg: #ffffff; --btn-contrast-ink: #0a0b10;
  --shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 20px 50px -24px rgba(0, 0, 0, .8);
  --shadow-lg: 0 40px 90px -30px rgba(0, 0, 0, .9);
  --tile: #04050a;
  --scrim: rgba(4, 5, 10, .66);
  --blur: saturate(140%) blur(18px);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #eef0f7;
  --bg-glow-1: rgba(164, 139, 255, .28);
  --bg-glow-2: rgba(116, 230, 192, .26);
  --bg-glow-3: rgba(92, 207, 255, .18);
  --glass: rgba(255, 255, 255, .68);
  --glass-2: rgba(255, 255, 255, .86);
  --glass-3: #ffffff;
  --glass-solid: #ffffff;
  --line: rgba(20, 24, 50, .08);
  --line-2: rgba(20, 24, 50, .15);
  --text: #0d1020;
  --text-2: #3a4058;
  --muted: #6b7189;
  --accent: #111320;          /* dark pill on light */
  --accent-ink: #ffffff;
  --accent-soft: rgba(124, 92, 240, .12);
  --accent-text: #5b3fd6;
  --focus: #7c5cf0;
  --ok: #148a52; --ok-soft: rgba(20, 138, 82, .12);
  --warn: #a86200; --warn-soft: rgba(230, 150, 20, .15);
  --bad: #d63150; --bad-soft: rgba(214, 49, 80, .11);
  --info: #2a62d6; --info-soft: rgba(42, 98, 214, .11);
  --violet-text: #5b3fd6; --violet-soft: rgba(124, 92, 240, .12);
  --btn-contrast-bg: #111320; --btn-contrast-ink: #ffffff;
  --shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 16px 40px -22px rgba(30, 30, 80, .28);
  --shadow-lg: 0 40px 80px -30px rgba(30, 30, 80, .4);
  --tile: #0b0c12;
  --scrim: rgba(20, 22, 40, .38);
  --blur: saturate(160%) blur(20px);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 15px/1.5 var(--font); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 0;
}
body::before {  /* nebula glow */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 600px at 8% -10%, var(--bg-glow-1), transparent 60%),
    radial-gradient(800px 600px at 105% 110%, var(--bg-glow-2), transparent 60%),
    radial-gradient(700px 500px at 70% 10%, var(--bg-glow-3), transparent 65%),
    var(--bg);
}
html[lang="mr"] body { font-family: var(--font-mr); }
a { color: var(--accent-text); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -.01em; }
p { margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.grow { flex: 1; min-width: 0; }
.err { color: var(--bad); font-size: 13.5px; min-height: 1em; }
.ic { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ic svg { width: 100%; height: 100%; }
::selection { background: var(--violet-soft); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--glass-3); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }

/* ------------------------------------------------------------------ glass */
.glass, .card {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-lg);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); box-shadow: var(--shadow);
}
.card { padding: 22px 24px; display: grid; gap: 18px; align-content: start; min-width: 0; }
.card.flush { padding: 0; gap: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h3 { font-size: 19px; font-weight: 500; }
.card-head h3 sup { font-size: 12px; color: var(--muted); margin-left: 4px; }
.card-head .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.hero {
  position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 26px 28px; color: var(--hero-ink);
  background: var(--hero); box-shadow: 0 30px 60px -30px rgba(160, 230, 110, .55);
}
.hero::after {  /* soft folded-glass shape like the reference */
  content: ""; position: absolute; right: -60px; bottom: -80px; width: 340px; height: 300px; border-radius: 60px;
  background: linear-gradient(140deg, rgba(255, 255, 255, .0), rgba(20, 60, 40, .16)); transform: rotate(-28deg);
}
.hero.violet { background: var(--hero-violet); color: #140d2c; box-shadow: 0 30px 60px -30px rgba(127, 106, 240, .6); }
.hero.alarm { background: linear-gradient(125deg, #ff9a8b 0%, #ff6a88 50%, #ff99ac 100%); color: #2a0610; box-shadow: 0 30px 60px -30px rgba(255, 106, 136, .7); }
.hero > * { position: relative; z-index: 1; }
.hero .label { font-size: 18px; font-weight: 500; opacity: .9; }
.hero .big { font-size: 56px; font-weight: 400; letter-spacing: -.03em; line-height: 1.05; margin-top: 8px; }
.hero .big sup { font-size: 18px; margin-left: 10px; vertical-align: top; letter-spacing: 0; word-spacing: .1em; }
.hero .pill { background: rgba(10, 12, 20, .82); color: #fff; }
.hero .foot { font-size: 14px; opacity: .8; margin-top: 8px; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  height: 42px; padding: 0 20px; border-radius: var(--r-pill); border: 1px solid var(--line-2);
  background: var(--glass-2); color: var(--text); font: inherit; font-size: 14.5px; font-weight: 500; cursor: pointer;
  transition: transform .12s var(--ease), background .2s, border-color .2s, box-shadow .2s, opacity .2s;
}
.btn .ic { width: 17px; height: 17px; }
.btn:hover { background: var(--glass-3); border-color: var(--muted); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { box-shadow: 0 10px 30px -10px var(--accent); filter: brightness(1.05); }
.btn.contrast { background: var(--btn-contrast-bg); color: var(--btn-contrast-ink); border-color: transparent; }
.btn.dark { background: #0a0b10; color: #fff; border-color: transparent; }
.btn.danger { background: var(--bad); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--glass-2); color: var(--text); }
.btn.danger-ghost { background: transparent; color: var(--bad); border-color: var(--bad-soft); }
.btn.danger-ghost:hover { background: var(--bad-soft); }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn.lg { height: 52px; padding: 0 26px; font-size: 16px; }
.btn.wide { width: 100%; }
.btn.file { position: relative; overflow: hidden; }
.btn.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.btn-pair { display: inline-flex; align-items: center; background: var(--btn-contrast-bg); border-radius: var(--r-pill); padding: 4px 4px 4px 18px; gap: 12px; color: var(--btn-contrast-ink); font-weight: 500; }
.btn-pair .circle { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--glass-solid); color: var(--text); border: 1px solid var(--line); }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; position: relative;
  border-radius: 50%; border: 1px solid var(--line); background: var(--glass); color: var(--text);
  cursor: pointer; transition: background .2s, transform .12s var(--ease), border-color .2s;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.icon-btn .ic, .icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { background: var(--glass-3); border-color: var(--line-2); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.sm { width: 34px; height: 34px; }
.icon-btn.sm .ic { width: 16px; height: 16px; }
.icon-btn.plain { background: transparent; border-color: transparent; backdrop-filter: none; }
.icon-btn.plain:hover { background: var(--glass-2); }
.icon-btn.danger:hover { background: var(--bad-soft); color: var(--bad); }
.icon-btn.solid { background: var(--btn-contrast-bg); color: var(--btn-contrast-ink); border-color: transparent; }
.badge-dot { position: absolute; top: 9px; right: 10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 3px var(--bg); }

/* ------------------------------------------------------------------ top bar with pill navigation */
.topbar {
  position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 18px 32px; background: linear-gradient(var(--bg), color-mix(in srgb, var(--bg) 70%, transparent) 70%, transparent);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); min-width: 0; }
.brand img { width: 40px; height: 40px; border-radius: 12px; }
.brand .name { display: grid; line-height: 1.15; min-width: 0; }
.brand .name b { font-size: 19px; font-weight: 600; letter-spacing: -.01em; font-family: var(--font-mr); }
.brand .name small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.pillnav {
  display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: var(--r-pill);
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  position: relative; box-shadow: var(--shadow);
}
.pillnav .dot-lead { width: 22px; height: 22px; border-radius: 50%; margin: 0 6px 0 8px; background: var(--hero); box-shadow: 0 0 18px rgba(200, 242, 106, .5); flex: none; }
.pillnav a {
  position: relative; display: flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: var(--r-pill);
  color: var(--text-2); font-size: 14.5px; font-weight: 500; white-space: nowrap; transition: color .2s, background .2s;
}
.pillnav a:hover { color: var(--text); }
.pillnav a.active { background: var(--btn-contrast-bg); color: var(--btn-contrast-ink); box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .5); }
.pillnav a .count { font-size: 11px; font-weight: 700; background: var(--bad); color: #fff; border-radius: 99px; padding: 0 6px; line-height: 17px; }
.pillnav a .ic { width: 16px; height: 16px; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 16px; flex: none;
  background: var(--hero-violet); color: #140d2c; border: 2px solid var(--line-2); cursor: pointer; }
.avatar.sm { width: 34px; height: 34px; font-size: 13px; }
.lang-toggle { height: 44px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--glass); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; backdrop-filter: var(--blur); }
.lang-toggle:hover { background: var(--glass-3); }

.page { padding: 8px 32px 48px; max-width: 1560px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 6px 0 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 44px; font-weight: 400; letter-spacing: -.03em; line-height: 1.1; }
.page-head p { color: var(--muted); margin-top: 6px; font-size: 15px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------------------ inputs */
input, select, textarea {
  height: 46px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--glass-2);
  color: var(--text); font: inherit; font-size: 14.5px; min-width: 0; transition: border-color .2s, box-shadow .2s, background .2s;
}
textarea { height: auto; padding: 12px 16px; resize: vertical; }
select { cursor: pointer; padding-right: 36px; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23858ba3' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
select option { background: var(--glass-solid); color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--muted); }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 4px var(--violet-soft); background: var(--glass-3); }
input[type=checkbox] { height: 18px; width: 18px; accent-color: var(--focus); padding: 0; }
input[type=range] { height: auto; padding: 0; border: 0; background: none; box-shadow: none; accent-color: var(--focus); flex: 1; }
input[type=date], input[type=time] { padding: 0 12px; }
.field { display: grid; gap: 7px; align-content: start; }
.field > .label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.45; }

.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--glass-3); border: 1px solid var(--line-2); cursor: pointer; transition: background .2s; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); transition: transform .22s var(--ease); }
.switch input:checked + i { background: var(--accent); border-color: transparent; }
[data-theme="dark"] .switch input:checked + i::after { background: #0d140a; }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--focus); outline-offset: 2px; }

.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 16px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); background: var(--glass); color: var(--text-2); font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s;
}
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip.on { background: var(--btn-contrast-bg); color: var(--btn-contrast-ink); border-color: transparent; }
.chip:disabled { opacity: .4; cursor: not-allowed; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }

.seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: var(--r-pill); background: var(--glass); border: 1px solid var(--line); flex: none; }
.seg button, .seg a { height: 34px; padding: 0 16px; border-radius: var(--r-pill); border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover, .seg a:hover { color: var(--text); }
.seg .on { background: var(--btn-contrast-bg); color: var(--btn-contrast-ink); }
.seg button:disabled { opacity: .4; cursor: default; }
.seg .pg { padding: 0 10px; display: grid; place-items: center; color: var(--muted); font-size: 13.5px; }

.pill { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 12px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn, .pill.medium { background: var(--warn-soft); color: var(--warn); }
.pill.bad, .pill.high { background: var(--bad-soft); color: var(--bad); }
.pill.info, .pill.low { background: var(--info-soft); color: var(--info); }
.pill.violet { background: var(--violet-soft); color: var(--violet-text); }
.pill.neutral { background: var(--glass-2); color: var(--muted); }
.pill.solid-ok { background: var(--lime); color: #1a2508; }
.pill.solid-bad { background: #ff6b85; color: #2a0610; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft), 0 0 12px var(--ok); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }

.note { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-sm); font-size: 14px; }
.note .ic { width: 18px; height: 18px; }
.note.ok { background: var(--ok-soft); color: var(--ok); }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.bad { background: var(--bad-soft); color: var(--bad); }
.note.info { background: var(--info-soft); color: var(--info); }

/* ------------------------------------------------------------------ layout */
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 18px; align-content: start; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.inline { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--text-2); font-weight: 500; }
.divider { height: 1px; background: var(--line); }

/* ------------------------------------------------------------------ KPI / stat cards */
.stat { padding: 22px 24px; display: grid; gap: 4px; align-content: start; min-width: 0; }
.stat .label { font-size: 17px; font-weight: 500; color: var(--text); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat .label .ic { color: var(--muted); }
.stat .value { font-size: 40px; font-weight: 400; letter-spacing: -.03em; line-height: 1.15; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .value sup { font-size: 14px; color: var(--muted); margin-left: 3px; }
.stat .foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------------ bar chart (reference style) */
.bars-chart { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; align-items: end; height: 220px; position: relative; margin-top: 36px; }
.bars-chart .col { display: grid; grid-template-rows: 1fr auto; gap: 10px; height: 100%; min-width: 0; }
.bars-chart .bar {
  align-self: end; border-radius: 18px; min-height: 12px; position: relative;
  background: linear-gradient(180deg, rgba(164, 139, 255, .55), rgba(164, 139, 255, .22));
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 12px; color: #fff; font-size: 13px; font-weight: 500;
  transition: filter .2s, transform .2s var(--ease);
}
[data-theme="light"] .bars-chart .bar { background: linear-gradient(180deg, rgba(124, 92, 240, .45), rgba(124, 92, 240, .15)); color: #221652; }
.bars-chart .bar:hover { filter: brightness(1.15); }
.bars-chart .bar.hot { background: linear-gradient(180deg, #d6c9ff, #a48bff); color: #1a1040; box-shadow: 0 0 40px -6px rgba(164, 139, 255, .8); }
.bars-chart .bar.zero { background: var(--glass-2); }
.bars-chart .x { text-align: center; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.bars-chart .tip { position: absolute; top: -52px; left: 50%; transform: translateX(-50%); padding: 7px 12px; border-radius: 14px; background: var(--glass-solid); border: 1px solid var(--line-2); color: var(--text); font-size: 13px; white-space: nowrap; box-shadow: var(--shadow-lg); }

/* ------------------------------------------------------------------ donut */
.donut-wrap { display: grid; grid-template-columns: minmax(170px, 220px) 1fr; gap: 24px; align-items: center; }
.donut { position: relative; aspect-ratio: 1; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut .center small { color: var(--muted); font-size: 14px; }
.donut .center b { font-size: 34px; font-weight: 400; letter-spacing: -.02em; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.legend div { display: grid; gap: 2px; }
.legend small { color: var(--muted); font-size: 13px; }
.legend b { font-size: 18px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.legend b::before { content: ""; width: 3px; height: 16px; border-radius: 2px; background: var(--c, var(--violet)); }

/* ------------------------------------------------------------------ lists (subscription-style rows) */
.rows { display: grid; gap: 10px; }
.row-card { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--r); background: var(--glass-2); border: 1px solid var(--line); color: var(--text); text-align: left; font: inherit; min-width: 0; }
button.row-card, a.row-card { cursor: pointer; transition: background .2s, transform .15s var(--ease); }
button.row-card:hover, a.row-card:hover { background: var(--glass-3); }
.row-card .thumb { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--glass-3); flex: none; overflow: hidden; color: var(--text); }
.row-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-card .thumb.wide { width: 76px; }
.row-card .main { display: grid; min-width: 0; flex: 1; }
.row-card .main b { font-weight: 500; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-card .main small { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-card .end { display: grid; justify-items: end; gap: 4px; }
.row-card .amount { font-size: 20px; font-weight: 500; letter-spacing: -.01em; }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th { text-align: left; font-size: 12.5px; font-weight: 500; color: var(--muted); padding: 14px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--glass-2); }
.table tr:last-child td { border-bottom: 0; }
.table td.actions { text-align: right; }
.table td.actions > * { margin-left: 4px; vertical-align: middle; }

/* ------------------------------------------------------------------ modal, toast */
.modal-wrap { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: var(--scrim); backdrop-filter: blur(8px); animation: fade .18s; }
.modal-wrap.closing { opacity: 0; transition: opacity .15s; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--glass-solid); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); animation: pop .25s var(--ease); }
.modal.wide { max-width: 960px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 8px; }
.modal-head h3 { font-size: 22px; font-weight: 500; }
.modal-body { padding: 14px 24px 24px; overflow: auto; }
#toasts { position: fixed; right: 24px; bottom: 24px; z-index: 90; display: grid; gap: 10px; }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 18px 12px 12px; border-radius: var(--r-pill); background: var(--glass-solid); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); max-width: 420px; animation: pop .25s var(--ease); transition: opacity .4s, transform .4s; }
.toast .ic { width: 30px; height: 30px; padding: 7px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); }
.toast.bad .ic { background: var(--bad-soft); color: var(--bad); }
.toast.warn .ic { background: var(--warn-soft); color: var(--warn); }
.toast.out { opacity: 0; transform: translateY(10px); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--focus); animation: spin .8s linear infinite; }
.spinner.lg { width: 48px; height: 48px; border-width: 3.5px; }
.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 60px 20px; color: var(--muted); }
.empty h3 { color: var(--text); font-size: 20px; }
.empty .orb { width: 84px; height: 84px; border-radius: 50%; background: var(--hero); opacity: .9; box-shadow: 0 0 60px rgba(200, 242, 106, .35); margin-bottom: 6px; display: grid; place-items: center; color: var(--hero-ink); }
.empty .orb .ic { width: 34px; height: 34px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .topbar { grid-template-columns: auto 1fr; }
  .topbar .pillnav { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; overflow-x: auto; }
  .grid4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .topbar, .page { padding-left: 16px; padding-right: 16px; }
  .page-head h1 { font-size: 32px; }
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
  .hero .big { font-size: 42px; }
  .brand .name small { display: none; }
  .donut-wrap { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
