/* Self-hosted fonts (SIL Open Font License 1.1, see fonts/OFL-*.txt): Hind Siliguri by Indian Type Foundry, Anek Bangla by Ek Type */
@font-face {
  font-family: 'Hind Siliguri';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/hind-siliguri-bengali-400-normal.woff2) format('woff2');
  unicode-range: U+0951-0952,U+0964-0965,U+0980-09FE,U+1CD0,U+1CD2,U+1CD5-1CD6,U+1CD8,U+1CE1,U+1CEA,U+1CED,U+1CF2,U+1CF5-1CF7,U+200C-200D,U+20B9,U+25CC,U+A8F1;
}
@font-face {
  font-family: 'Hind Siliguri';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/hind-siliguri-latin-400-normal.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: 'Hind Siliguri';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/hind-siliguri-bengali-500-normal.woff2) format('woff2');
  unicode-range: U+0951-0952,U+0964-0965,U+0980-09FE,U+1CD0,U+1CD2,U+1CD5-1CD6,U+1CD8,U+1CE1,U+1CEA,U+1CED,U+1CF2,U+1CF5-1CF7,U+200C-200D,U+20B9,U+25CC,U+A8F1;
}
@font-face {
  font-family: 'Hind Siliguri';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(fonts/hind-siliguri-latin-500-normal.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: 'Hind Siliguri';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/hind-siliguri-bengali-600-normal.woff2) format('woff2');
  unicode-range: U+0951-0952,U+0964-0965,U+0980-09FE,U+1CD0,U+1CD2,U+1CD5-1CD6,U+1CD8,U+1CE1,U+1CEA,U+1CED,U+1CF2,U+1CF5-1CF7,U+200C-200D,U+20B9,U+25CC,U+A8F1;
}
@font-face {
  font-family: 'Hind Siliguri';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/hind-siliguri-latin-600-normal.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: 'Anek Bangla';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url(fonts/anek-bangla-bengali-wght-normal.woff2) format('woff2-variations'), url(fonts/anek-bangla-bengali-wght-normal.woff2) format('woff2');
  unicode-range: U+0951-0952,U+0964-0965,U+0980-09FE,U+1CD0,U+1CD2,U+1CD5-1CD6,U+1CD8,U+1CE1,U+1CEA,U+1CED,U+1CF2,U+1CF5-1CF7,U+200C-200D,U+20B9,U+25CC,U+A8F1;
}
@font-face {
  font-family: 'Anek Bangla';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url(fonts/anek-bangla-latin-wght-normal.woff2) format('woff2-variations'), url(fonts/anek-bangla-latin-wght-normal.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;
}

/* ==========================================================================
   হিসাব খাতা — stylesheet
   Mobile first. Light/dark via prefers-color-scheme or [data-theme].
   ========================================================================== */

:root {
  --bg: #f4f1ea;
  --surface: #ffffff;
  --surface-2: #faf8f3;
  --ink: #16211e;
  --ink-2: #44524e;
  --muted: #74827e;
  --line: #e5dfd3;
  --line-2: #efeae0;
  --brand: #0d5c54;
  --brand-2: #0a4a43;
  --brand-ink: #ffffff;
  --brand-soft: #e2eeeb;
  --pos: #137446;
  --pos-soft: #e3f2e9;
  --neg: #c0410f;
  --neg-soft: #fbe8de;
  --neu: #5b6a8a;
  --neu-soft: #e8ebf3;
  --gold: #e0a526;
  --gold-soft: #fbf1d9;
  --danger: #b42318;
  --focus: 0 0 0 3px rgba(13, 92, 84, .28);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(22, 33, 30, .04), 0 6px 20px rgba(22, 33, 30, .05);
  --shadow-lg: 0 10px 40px rgba(22, 33, 30, .16);
  --font: "Hind Siliguri", "Noto Sans Bengali", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-d: "Anek Bangla", "Hind Siliguri", "Noto Sans Bengali", system-ui, sans-serif;
  --nav-h: 68px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1311;
    --surface: #131c1a;
    --surface-2: #18231f;
    --ink: #e7eeeb;
    --ink-2: #b3c1bc;
    --muted: #84938e;
    --line: #25322e;
    --line-2: #1e2a27;
    --brand: #3fb3a3;
    --brand-2: #2e9a8b;
    --brand-ink: #04211d;
    --brand-soft: #16332e;
    --pos: #53c890;
    --pos-soft: #15321f;
    --neg: #f28a5c;
    --neg-soft: #3a2017;
    --neu: #9aa9cc;
    --neu-soft: #222a3b;
    --gold: #eab84b;
    --gold-soft: #3a2f14;
    --danger: #ff7a6b;
    --focus: 0 0 0 3px rgba(63, 179, 163, .35);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1311;
  --surface: #131c1a;
  --surface-2: #18231f;
  --ink: #e7eeeb;
  --ink-2: #b3c1bc;
  --muted: #84938e;
  --line: #25322e;
  --line-2: #1e2a27;
  --brand: #3fb3a3;
  --brand-2: #2e9a8b;
  --brand-ink: #04211d;
  --brand-soft: #16332e;
  --pos: #53c890;
  --pos-soft: #15321f;
  --neg: #f28a5c;
  --neg-soft: #3a2017;
  --neu: #9aa9cc;
  --neu-soft: #222a3b;
  --gold: #eab84b;
  --gold-soft: #3a2f14;
  --danger: #ff7a6b;
  --focus: 0 0 0 3px rgba(63, 179, 163, .35);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.no-scroll { overflow: hidden; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-d); font-weight: 600; line-height: 1.25; margin: 0; }
p { margin: 0 0 .6em; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
[hidden] { display: none !important; }
.ic { flex: none; display: inline-block; vertical-align: middle; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.neu { color: var(--neu); }
.num, .hero-amt, .t-amt, .stat strong, .kpi strong, .acc-bal, .acc-row-bal, .pr-amt, .due-tile strong {
  font-variant-numeric: tabular-nums;
}

/* ---------- app shell ---------- */
.app { min-height: 100vh; }
.sidebar { display: none; }
.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
}
.page-title { font-size: 1.3rem; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-mini img { display: block; border-radius: 9px; }
.top-actions { display: flex; align-items: center; gap: 4px; }
.content { padding: 4px 16px calc(var(--nav-h) + 40px + env(safe-area-inset-bottom)); max-width: 1120px; margin: 0 auto; }
.content > * + * { margin-top: 16px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px; border-radius: 12px;
  border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--line-2); color: var(--ink); text-decoration: none; }

/* bottom nav (mobile) */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.bottomnav a, .bottomnav button {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font: inherit; font-size: .74rem; color: var(--muted);
  background: none; border: 0; padding: 6px 0; cursor: pointer;
}
.bottomnav a:hover { text-decoration: none; }
.bottomnav .active { color: var(--brand); font-weight: 600; }
.bottomnav .fab {
  width: 56px; height: 56px; margin: -26px auto 0; border-radius: 18px;
  background: var(--brand); color: var(--brand-ink);
  display: grid; place-items: center; box-shadow: 0 8px 20px rgba(13, 92, 84, .35);
  border: 4px solid var(--bg);
}
.only-mobile { display: inline-grid; }

/* bottom sheet */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(8, 14, 12, .45); animation: fade .18s ease; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg); animation: up .22s cubic-bezier(.2, .8, .2, 1);
}
.sheet-handle { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 14px; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.sheet-grid a, .sheet-grid button {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 14px 6px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2);
  color: var(--ink); font: inherit; font-size: .88rem; cursor: pointer; width: 100%;
}
.sheet-grid form { display: contents; }
.sheet-grid a:hover { text-decoration: none; background: var(--brand-soft); }
.sheet-grid .active { border-color: var(--brand); color: var(--brand); }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.me-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.me-text strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--font-d); font-weight: 600;
  background: var(--brand-soft); color: var(--brand);
}
.avatar.sm { width: 38px; height: 38px; font-size: .95rem; }
.avatar.lg { width: 60px; height: 60px; font-size: 1.5rem; }

/* ---------- desktop ---------- */
@media (min-width: 960px) {
  .app { display: grid; grid-template-columns: 264px 1fr; }
  .sidebar {
    display: flex; flex-direction: column; gap: 14px;
    position: sticky; top: 0; height: 100vh; padding: 20px 14px;
    background: var(--surface); border-right: 1px solid var(--line);
  }
  .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 6px; color: var(--ink); font-family: var(--font-d); font-size: 1.25rem; font-weight: 700; }
  .brand:hover { text-decoration: none; }
  .brand img { border-radius: 10px; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
  .side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--ink-2); font-weight: 500; }
  .side-nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
  .side-nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
  .side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
  .side-tools { display: flex; gap: 4px; }
  .side-tools form { margin: 0; }
  .bottomnav, .sheet, .only-mobile, .brand-mini { display: none !important; }
  .topbar { padding: 22px 32px 12px; }
  .page-title { font-size: 1.6rem; }
  .content { padding: 8px 32px 48px; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 9px 18px; border-radius: 12px;
  border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .95rem;
  cursor: pointer; text-decoration: none !important; transition: background .15s, border-color .15s, transform .05s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-2); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--muted); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn-danger-ghost:hover { background: color-mix(in srgb, var(--danger) 8%, transparent); }
.btn-block { width: 100%; }
.btn-lg { min-height: 52px; font-size: 1.02rem; border-radius: 14px; }
.btn-sm { min-height: 34px; padding: 5px 11px; font-size: .84rem; border-radius: 10px; }
.link { display: inline-flex; align-items: center; gap: 2px; font-size: .9rem; font-weight: 500; }
.pill { display: inline-block; padding: 4px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: .85rem; color: var(--ink-2); }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-title { font-size: 1.08rem; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.card-head .card-title { margin: 0; }
.sub-title { font-size: .98rem; margin: 20px 0 10px; }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary.card-title { margin: 0; }
details > summary.card-title::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .2s; }
details[open] > summary.card-title::after { transform: rotate(180deg); }
.split { display: grid; gap: 16px; }
@media (min-width: 820px) { .split { grid-template-columns: 1fr 1fr; align-items: start; } }

/* ---------- greeting & hero ---------- */
.greet { color: var(--ink-2); margin: 2px 0 0; }
.hero {
  position: relative; overflow: hidden; color: #fff;
  border-radius: 22px; padding: 22px 20px 18px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(240, 180, 60, .28), transparent 55%),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(255, 255, 255, .06) 27px 28px),
    linear-gradient(145deg, #11695f, #093f39);
  box-shadow: 0 12px 30px rgba(9, 63, 57, .25);
}
.hero::before { /* ledger margin line */
  content: ""; position: absolute; top: 0; bottom: 0; left: 14px; width: 2px; background: rgba(240, 140, 110, .45);
}
.hero-main { display: flex; flex-direction: column; padding-left: 8px; }
.hero-label { font-size: .9rem; opacity: .85; }
.hero-amt { font-family: var(--font-d); font-weight: 700; font-size: clamp(2rem, 8vw, 2.8rem); line-height: 1.15; letter-spacing: -.01em; }
.hero .hero-amt.neg { color: #ffc2a6; }
.hero-sub { font-size: .85rem; opacity: .85; }
.hero-sub a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; padding-left: 8px; }
.hs {
  display: flex; flex-direction: column; gap: 1px; min-width: 0;
  padding: 9px 11px; border-radius: 12px; color: #fff;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .12);
}
.hs:hover { text-decoration: none; background: rgba(255, 255, 255, .16); }
.hs span { font-size: .78rem; opacity: .85; }
.hs strong { font-family: var(--font-d); font-weight: 600; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-compact .hero-stats { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero { background: radial-gradient(120% 90% at 100% 0%, rgba(240, 180, 60, .18), transparent 55%), repeating-linear-gradient(0deg, transparent 0 27px, rgba(255, 255, 255, .04) 27px 28px), linear-gradient(145deg, #0f4d46, #082b27); } }
:root[data-theme="dark"] .hero { background: radial-gradient(120% 90% at 100% 0%, rgba(240, 180, 60, .18), transparent 55%), repeating-linear-gradient(0deg, transparent 0 27px, rgba(255, 255, 255, .04) 27px 28px), linear-gradient(145deg, #0f4d46, #082b27); }

/* ---------- quick actions ---------- */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-2 { grid-template-columns: 1fr 1fr; }
.q {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 4px 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2);
  color: var(--ink); font-size: .86rem; font-weight: 500; text-align: center; box-shadow: var(--shadow);
}
.q:hover { text-decoration: none; border-color: var(--line); transform: translateY(-1px); }
.q span { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.q-expense span { background: var(--neg-soft); color: var(--neg); }
.q-income span { background: var(--pos-soft); color: var(--pos); }
.q-transfer span { background: var(--neu-soft); color: var(--neu); }
.q-due span { background: var(--gold-soft); color: #9a6b06; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .q-due span { color: var(--gold); } }
:root[data-theme="dark"] .q-due span { color: var(--gold); }
.quick-2 .q { flex-direction: row; justify-content: center; font-size: .95rem; padding: 10px; }

/* ---------- dashboard grid ---------- */
.dash-grid { display: grid; gap: 16px; }
@media (min-width: 820px) {
  .dash-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .dash-grid .span-2 { grid-row: span 2; }
}
@media (min-width: 1200px) { .dash-grid { grid-template-columns: 1fr 1fr 1fr; } }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { display: flex; flex-direction: column; min-width: 0; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.stat span { font-size: .8rem; color: var(--muted); }
.stat strong { font-family: var(--font-d); font-weight: 600; font-size: 1.08rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat small { font-size: .75rem; color: var(--muted); }
.sum-row .stat { background: var(--surface); border: 1px solid var(--line-2); }
.compare { display: flex; align-items: center; gap: 6px; font-size: .88rem; margin: 12px 0 0; padding: 8px 10px; border-radius: 10px; }
.compare.up { background: var(--neg-soft); color: var(--neg); }
.compare.down { background: var(--pos-soft); color: var(--pos); }
.budget-box { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.budget-top { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; margin-bottom: 8px; }
.budget-top span:first-child { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.budget-box p { margin: 8px 0 0; }
.budget-cta { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: .9rem; }

/* progress bars */
.bar { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--brand); transition: width .4s; }
.bar.warn span { background: var(--gold); }
.bar.over span { background: var(--neg); }
.bar.plain span { background: var(--bar, var(--neg)); opacity: .8; }
.bar.plain.inc span { background: var(--pos); }

.cat-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.cat-bars li { display: flex; flex-direction: column; gap: 6px; }
.cb-top { display: flex; justify-content: space-between; gap: 10px; font-size: .94rem; color: var(--ink); }
.cb-top:hover { text-decoration: none; }
.cb-top span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-top strong { font-weight: 600; white-space: nowrap; }

/* ---------- onboarding ---------- */
.onboard { background: linear-gradient(180deg, var(--gold-soft), var(--surface) 70%); border-color: color-mix(in srgb, var(--gold) 30%, transparent); }
.onboard-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.onboard-steps li { display: flex; align-items: center; gap: 10px; }
.onboard-steps a { color: var(--ink); }
.ob-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1.5px solid var(--gold); font-size: .85rem; font-weight: 600; color: #8a5d00; }
.onboard-steps li.done a { color: var(--muted); text-decoration: line-through; }
.onboard-steps li.done .ob-n { background: var(--pos); border-color: var(--pos); color: #fff; }

/* ---------- accounts ---------- */
.acc-list, .people-list { display: flex; flex-direction: column; }
.acc-row, .person-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 6px; color: var(--ink);
  border-bottom: 1px solid var(--line-2);
}
.acc-row:last-child, .person-row:last-child { border-bottom: 0; }
.acc-row:hover, .person-row:hover { text-decoration: none; background: var(--surface-2); border-radius: 12px; }
.acc-ic {
  flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  color: var(--acc, var(--brand)); background: color-mix(in srgb, var(--acc, var(--brand)) 14%, transparent);
}
.acc-ic.lg { width: 46px; height: 46px; border-radius: 14px; }
.acc-row-main, .pr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.acc-row-main strong, .pr-main strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-row-main small, .pr-main small { color: var(--muted); font-size: .8rem; }
.acc-row-bal, .pr-amt { font-family: var(--font-d); font-weight: 600; white-space: nowrap; }
.acc-row-bal.neg { color: var(--neg); }
.muted-row { opacity: .7; }

.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 12px; }
.acc-card {
  position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 128px;
  padding: 16px; border-radius: var(--radius); color: var(--ink); overflow: hidden;
  background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow);
}
.acc-card::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--acc, var(--brand)); }
.acc-card:hover { text-decoration: none; border-color: var(--line); transform: translateY(-1px); }
.acc-top { display: flex; align-items: center; gap: 8px; }
.acc-top .acc-ic { width: 32px; height: 32px; border-radius: 9px; }
.acc-type { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-name { font-weight: 600; margin-top: 6px; }
.acc-bal { font-family: var(--font-d); font-weight: 700; font-size: 1.4rem; margin-top: auto; }
.acc-bal.neg { color: var(--neg); }
.acc-new { align-items: center; justify-content: center; color: var(--muted); border-style: dashed; border-width: 1.5px; border-color: var(--line); box-shadow: none; background: transparent; }
.acc-new::after { display: none; }

.acc-hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 18px 20px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--acc) 90%, #000 10%), color-mix(in srgb, var(--acc) 55%, #000 45%));
  color: #fff; display: flex; flex-direction: column;
  box-shadow: 0 12px 30px color-mix(in srgb, var(--acc) 30%, transparent);
}
.acc-hero::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent 0 27px, rgba(255, 255, 255, .06) 27px 28px); pointer-events: none; }
.acc-hero-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; position: relative; }
.acc-hero-top div { display: flex; flex-direction: column; line-height: 1.3; flex: 1; min-width: 0; }
.acc-hero-top small { opacity: .85; font-size: .85rem; }
.acc-hero .acc-ic { background: rgba(255, 255, 255, .18); color: #fff; }
.acc-hero .hero-amt.neg { color: #ffd0bb; }
.acc-hero-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; font-size: .88rem; opacity: .92; position: relative; }
.badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); vertical-align: middle; font-family: var(--font); }
.acc-hero .badge { background: rgba(255, 255, 255, .2); color: #fff; }
.badge-red { background: var(--neg-soft); color: var(--neg); }
.badge-soft { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

.recon-diff { font-weight: 600; padding: 8px 12px; border-radius: 10px; margin: 0; }
.recon-diff.ok { background: var(--pos-soft); color: var(--pos); }
.recon-diff.up { background: var(--neu-soft); color: var(--neu); }
.recon-diff.down { background: var(--neg-soft); color: var(--neg); }
.radio-list { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.radio-list label { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.radio-list label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.radio-list input { margin-top: 5px; accent-color: var(--brand); }
.radio-list span { display: flex; flex-direction: column; line-height: 1.35; }
.radio-list small { color: var(--muted); font-size: .82rem; }
.danger-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.ledger-foot { margin: 12px 0 0; }

/* ---------- transactions ---------- */
.txn-list { display: flex; flex-direction: column; }
.day-group + .day-group { margin-top: 6px; }
.day-head { font-size: .8rem; font-weight: 600; color: var(--muted); padding: 8px 4px 4px; letter-spacing: .01em; }
.txn {
  display: flex; align-items: center; gap: 12px; padding: 10px 6px; color: var(--ink);
  border-radius: 12px;
}
.txn:hover { background: var(--surface-2); text-decoration: none; }
.t-ic {
  flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink-2);
}
.t-ic.emoji { font-size: 1.25rem; }
.t-income, .t-borrow, .t-receive { background: var(--pos-soft); color: var(--pos); border-color: transparent; }
.t-expense, .t-lend, .t-repay { background: var(--neg-soft); color: var(--neg); border-color: transparent; }
.t-transfer, .t-adjust { background: var(--neu-soft); color: var(--neu); border-color: transparent; }
.t-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.t-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-sub { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-amt { font-family: var(--font-d); font-weight: 600; white-space: nowrap; text-align: right; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.t-amt.neu { color: var(--ink-2); }
.t-run { font-family: var(--font); font-weight: 400; font-size: .74rem; color: var(--muted); }

.month-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.month-nav strong { font-family: var(--font-d); font-size: 1.12rem; font-weight: 600; min-width: 130px; text-align: center; }
.month-nav .pill, .month-nav .seg-sm { margin-left: auto; }
.filters summary { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.filter-form { margin-top: 14px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 820px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.form legend { font-family: var(--font-d); font-weight: 600; font-size: 1.02rem; margin-bottom: 8px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form div[data-show-when] { display: flex; flex-direction: column; gap: 12px; }
.field > span:first-child { font-size: .9rem; font-weight: 500; color: var(--ink-2); }
.input {
  width: 100%; min-height: 46px; padding: 10px 13px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 1rem; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
select.input { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea.input { min-height: 120px; resize: vertical; }
.input.mono { font-family: ui-monospace, Menlo, monospace; font-size: .8rem; }
.input-money { font-family: var(--font-d); font-weight: 600; font-variant-numeric: tabular-nums; }
.hint { font-size: .82rem; color: var(--muted); margin: 0; }
.hint.calc { color: var(--brand); font-weight: 600; }
.field-error { font-size: .84rem; color: var(--danger); margin: 0; }
.grid-2 { display: grid; gap: 14px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } .span-2 { grid-column: span 2; } }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: .94rem; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--brand); flex: none; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; flex-direction: row; }
.inline-form .grow, .grow { flex: 1; min-width: 180px; }
.inline-form p { margin: 0; align-self: center; }
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { padding-right: 70px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: var(--surface-2); color: var(--ink-2); font: inherit; font-size: .8rem; padding: 5px 10px; border-radius: 8px; cursor: pointer; }
.hp { position: absolute; left: -9999px; }

/* segmented control */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-2); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span, .seg a { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 6px 8px; border-radius: 10px; font-weight: 500; font-size: .92rem; color: var(--ink-2); text-align: center; line-height: 1.2; }
.seg small { font-weight: 400; color: var(--muted); }
.seg input:checked + span, .seg a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); font-weight: 600; }
.seg input:focus-visible + span { box-shadow: var(--focus); }
.seg-sm { display: inline-grid; padding: 3px; border-radius: 12px; }
.seg-sm a { min-height: 32px; padding: 4px 14px; font-size: .86rem; }
.seg-sm a:hover { text-decoration: none; }
.seg-4 { grid-template-columns: repeat(4, 1fr); grid-auto-flow: row; }
@media (max-width: 440px) { .seg-4 span { flex-direction: column; gap: 2px; font-size: .8rem; min-height: 54px; } }
.seg-expense input:checked + span { color: var(--neg); }
.seg-income input:checked + span { color: var(--pos); }
.seg-transfer input:checked + span { color: var(--neu); }
.seg-due input:checked + span { color: #9a6b06; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg-due input:checked + span { color: var(--gold); } }
:root[data-theme="dark"] .seg-due input:checked + span { color: var(--gold); }

/* due type options */
.due-types { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.due-opt { position: relative; cursor: pointer; }
.due-opt input { position: absolute; opacity: 0; }
.due-opt span { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); line-height: 1.3; height: 100%; }
.due-opt small { font-size: .78rem; color: var(--muted); }
.due-opt input:checked + span { border-color: var(--brand); background: var(--brand-soft); }
.due-opt input:focus-visible + span { box-shadow: var(--focus); }

/* amount */
.amount-field .amount-wrap { position: relative; display: block; }
.amount-wrap .cur { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-family: var(--font-d); font-size: 1.6rem; color: var(--muted); pointer-events: none; }
.input-amount { min-height: 64px; padding-left: 44px; font-family: var(--font-d); font-size: 2rem; font-weight: 600; letter-spacing: -.01em; }
[data-mode="expense"] .input-amount { color: var(--neg); }
[data-mode="income"] .input-amount { color: var(--pos); }

.date-quick { display: flex; gap: 6px; }
.date-quick button { font: inherit; font-size: .8rem; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.date-quick button:hover { border-color: var(--brand); color: var(--brand); }

/* category chips */
.cat-chips, .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-chip, .chip { position: relative; cursor: pointer; }
.cat-chip input, .chip input { position: absolute; opacity: 0; pointer-events: none; }
.cat-chip span, .chip span {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px 7px 8px; border-radius: 99px;
  border: 1.5px solid var(--line); background: var(--surface); font-size: .9rem; color: var(--ink); line-height: 1.2;
}
.chip span { padding-left: 12px; }
.cat-chip i { font-style: normal; font-size: 1.05rem; }
.cat-chip input:checked + span, .chip input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.cat-chip input:focus-visible + span, .chip input:focus-visible + span { box-shadow: var(--focus); }
.cat-chip.add span { border-style: dashed; color: var(--muted); }
.cat-chip.add:hover { text-decoration: none; }

.split-box { padding: 12px 14px; border-radius: 14px; background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 25%, transparent); display: flex; flex-direction: column; gap: 12px; }
.person-hints { font-size: .86rem; color: var(--brand); font-weight: 500; }
.txn-form { gap: 18px; }
.txn-form .form-actions .btn { flex: 1; }
@media (min-width: 640px) { .txn-form .form-actions .btn { flex: 0 0 auto; } }
.delete-form { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.content > .txn-form { max-width: 760px; }

/* swatches & emoji */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; }
.swatch span { display: block; width: 32px; height: 32px; border-radius: 50%; background: var(--c); border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--line); }
.swatch input:checked + span { box-shadow: 0 0 0 2.5px var(--c); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.emoji-grid label { position: relative; cursor: pointer; }
.emoji-grid input { position: absolute; opacity: 0; }
.emoji-grid span { display: grid; place-items: center; height: 42px; border-radius: 10px; border: 1.5px solid var(--line-2); font-size: 1.3rem; background: var(--surface-2); }
.emoji-grid input:checked + span { border-color: var(--brand); background: var(--brand-soft); }

/* categories page */
.cat-list { display: flex; flex-direction: column; }
.cat-item { border-bottom: 1px solid var(--line-2); }
.cat-item:last-child { border-bottom: 0; }
.cat-item summary { display: flex; align-items: center; gap: 12px; padding: 10px 4px; }
.cat-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; background: var(--surface-2); }
.cat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; line-height: 1.3; }
.cat-main small { color: var(--muted); font-size: .8rem; }
.cat-edit-ic { color: var(--muted); }
.cat-item[open] summary { background: var(--surface-2); border-radius: 12px; }
.cat-form { padding: 12px 4px 4px; }
.cat-item .danger-row { margin: 10px 4px 14px; }

/* ---------- alerts ---------- */
.alert {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 14px;
  font-size: .94rem; border: 1px solid transparent; transition: opacity .4s, transform .4s;
}
.alert .ic { margin-top: 3px; }
.alert-success { background: var(--pos-soft); color: var(--pos); border-color: color-mix(in srgb, var(--pos) 20%, transparent); }
.alert-error { background: var(--neg-soft); color: var(--neg); border-color: color-mix(in srgb, var(--neg) 20%, transparent); }
.alert-info { background: var(--neu-soft); color: var(--neu); }
.alert.fade { opacity: 0; transform: translateY(-4px); pointer-events: none; }
.alert code.pw { font-size: 1.1rem; font-weight: 700; letter-spacing: .05em; color: var(--ink); }

/* ---------- empty state ---------- */
.empty { text-align: center; padding: 26px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty-ic { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 6px; }
.empty h3 { font-size: 1.05rem; }
.empty p { color: var(--muted); max-width: 380px; margin: 0 0 8px; font-size: .92rem; }

/* ---------- dues ---------- */
.dues-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.due-tile { display: flex; flex-direction: column; padding: 16px; border-radius: var(--radius); color: var(--ink); border: 1px solid transparent; }
.due-tile:hover { text-decoration: none; transform: translateY(-1px); }
.due-tile span { font-size: .9rem; font-weight: 500; }
.due-tile strong { font-family: var(--font-d); font-weight: 700; font-size: clamp(1.3rem, 5vw, 1.8rem); line-height: 1.2; margin: 2px 0; }
.due-tile small { font-size: .8rem; color: var(--muted); }
.due-tile.recv { background: var(--pos-soft); border-color: color-mix(in srgb, var(--pos) 15%, transparent); }
.due-tile.recv strong { color: var(--pos); }
.due-tile.pay { background: var(--neg-soft); border-color: color-mix(in srgb, var(--neg) 15%, transparent); }
.due-tile.pay strong { color: var(--neg); }
.pr-amt.pos { color: var(--pos); }
.pr-amt.neg { color: var(--neg); }
.tabs { display: flex; gap: 4px; overflow-x: auto; margin: -4px -4px 10px; padding: 4px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: 7px 13px; border-radius: 99px; color: var(--ink-2); font-size: .9rem; font-weight: 500; }
.tabs a small { color: var(--muted); font-size: .78rem; }
.tabs a:hover { background: var(--surface-2); text-decoration: none; }
.tabs a.active { background: var(--ink); color: var(--surface); }
.tabs a.active small { color: inherit; opacity: .7; }
.person-hero { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.person-hero > div { display: flex; flex-direction: column; min-width: 0; }
.person-hero small { color: var(--muted); }
.person-hero.recv { background: linear-gradient(135deg, var(--pos-soft), var(--surface)); }
.person-hero.recv .hero-amt { color: var(--pos); }
.person-hero.pay { background: linear-gradient(135deg, var(--neg-soft), var(--surface)); }
.person-hero.pay .hero-amt { color: var(--neg); }
.person-hero .hero-label { opacity: 1; color: var(--ink-2); }
.reminder { background: var(--surface-2); border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; font-size: .94rem; }

/* ---------- reports ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(46%, 150px), 1fr)); gap: 10px; }
.kpi { display: flex; flex-direction: column; min-width: 0; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.kpi span { font-size: .82rem; color: var(--muted); }
.kpi strong { font-family: var(--font-d); font-weight: 600; font-size: 1.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 6px; }
.lg-inc { background: var(--pos); }
.lg-exp { background: var(--neg); }
.vchart { display: grid; grid-template-columns: auto 1fr; gap: 8px; height: 220px; }
.vc-axis { display: flex; flex-direction: column; justify-content: space-between; font-size: .72rem; color: var(--muted); text-align: right; padding-bottom: 22px; }
.vc-cols {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; align-items: end;
  background: linear-gradient(var(--line-2) 1px, transparent 1px) 0 0 / 100% 50%;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
  position: relative;
}
.vc-col { position: relative; display: flex; flex-direction: column; align-items: stretch; height: 100%; color: var(--muted); }
.vc-col:hover { text-decoration: none; }
.vc-col:hover .vc-bars { background: var(--surface-2); }
.vc-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-radius: 6px 6px 0 0; }
.vc-bars .b { display: block; width: 44%; max-width: 18px; min-height: 0; border-radius: 4px 4px 0 0; }
.vc-bars .b.inc { background: var(--pos); }
.vc-bars .b.exp { background: var(--neg); opacity: .85; }
.vc-label { position: absolute; bottom: -21px; left: 0; right: 0; text-align: center; font-size: .7rem; white-space: nowrap; }
.vc-col.cur .vc-label { color: var(--brand); font-weight: 700; }
.vc-col.cur .vc-bars { background: var(--brand-soft); }
.vchart-daily { height: 170px; }
@media (max-width: 560px) {
  .vchart:not(.vchart-daily) .vc-col:nth-child(even):not(.cur) .vc-label { visibility: hidden; }
  .vc-label { font-size: .66rem; }
  .kpis .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.vchart-daily .vc-cols { gap: 2px; }
.vchart-daily .vc-bars .b { width: 80%; max-width: 14px; }
.dl { margin: 0; display: flex; flex-direction: column; }
.dl div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.dl dt { color: var(--ink-2); font-size: .92rem; }
.dl dd { margin: 0; font-family: var(--font-d); font-weight: 600; white-space: nowrap; }

/* ---------- admin ---------- */
.user-list { display: flex; flex-direction: column; }
.user-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line-2); }
.user-row:last-child { border-bottom: 0; }
.user-row.inactive { opacity: .6; }
.ur-main { flex: 1; min-width: 200px; display: flex; flex-direction: column; line-height: 1.4; }
.ur-main small { font-size: .82rem; color: var(--ink-2); }
.ur-main small.muted { color: var(--muted); }
.ur-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ur-actions form { margin: 0; }
.danger-card { border-color: color-mix(in srgb, var(--danger) 25%, transparent); }

/* ---------- auth pages ---------- */
.auth-body {
  min-height: 100vh;
  background:
    radial-gradient(90% 60% at 100% 0%, color-mix(in srgb, var(--gold) 16%, transparent), transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 31px, color-mix(in srgb, var(--brand) 7%, transparent) 31px 32px),
    var(--bg);
}
.auth-wrap { max-width: 460px; margin: 0 auto; padding: 36px 16px 48px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin: 8px 4px 20px; }
.auth-brand img { border-radius: 14px; box-shadow: 0 6px 16px rgba(13, 92, 84, .25); }
.auth-brand strong { display: block; font-family: var(--font-d); font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.auth-brand span { color: var(--ink-2); font-size: .92rem; }
.auth-card { background: var(--surface); border: 1px solid var(--line-2); border-radius: 22px; padding: 24px 20px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 12px; }
.auth-title { font-size: 1.45rem; }
.auth-card > .muted { margin: -6px 0 4px; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: .92rem; margin-top: 4px; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.checks { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 14px; font-size: .9rem; }
.checks summary { font-weight: 600; }
.checks ul { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 4px; }
.checks li.ok { color: var(--pos); }
.checks li.bad { color: var(--neg); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print {
  .sidebar, .bottomnav, .topbar .top-actions, .quick, .filters, form, .pager { display: none !important; }
  .content { padding: 0; }
  .card, .hero { box-shadow: none; border: 1px solid #ccc; }
}
