/* ═══════════════════════════════════════════════════════════
   P&L Dashboard — design tokens
   Chart hues come from a validated categorical/diverging set:
   money in = blue, money out = red (diverging poles).
   ═══════════════════════════════════════════════════════════ */

:root {
  color-scheme: light;

  /* surfaces & ink — cool off-white page, white cards read as elevated */
  --page:           #f7f7fb;
  --surface:        #ffffff;
  --surface-2:      #fafaff;
  --surface-sunk:   #f1f1f8;
  --sidebar:        #ffffff;
  --ink:            #14141f;
  --ink-2:          #565a6b;
  --ink-muted:      #8a8ca0;
  --line:           #e8e8f0;
  --line-strong:    #d8d9e6;
  --grid:           #eeeef6;
  --ring:           rgba(20, 20, 31, .08);

  /* brand / accent — indigo→violet. Solid tone is darkened from the
     gradient so it still clears AA as text/icon colour on white. */
  /* lime is unreadable as text on white, so the flat --accent is a deep
     olive for text/icons while fills keep the bright chartreuse with
     dark ink on top */
  --accent:         #55700f;
  --accent-hover:   #445a0b;
  --accent-soft:    rgba(85, 112, 15, .10);
  --accent-ink:     #161a08;
  --accent-grad:    linear-gradient(135deg, #c2ea45 0%, #a5d626 100%);
  --accent-grad-hover: linear-gradient(135deg, #cdef62 0%, #b2e034 100%);
  --accent-glow:    0 6px 18px -8px rgba(140, 190, 40, .55);
  --violet:         #7c3aed;
  --violet-soft:    rgba(124, 58, 237, .10);
  --violet-grad:    linear-gradient(135deg, #7c3aed 0%, #9d5cf5 100%);

  /* data: diverging pair. Money-in moved off plain blue to a cyan-lean
     sky so it can't be confused with the indigo UI accent; still a
     blue↔red diverging pair, so it stays colourblind-separable. */
  --flow-in:        #1f7fa3;
  --flow-in-soft:   rgba(31, 127, 163, .11);
  --flow-out:       #c9556a;
  --flow-out-soft:  rgba(201, 85, 106, .11);

  /* single-hue violet magnitude scale */
  --seq-1: #4c1d95; --seq-2: #6d28d9; --seq-3: #7c3aed;
  --seq-4: #9d5cf5; --seq-5: #bf9bfa; --seq-6: #ddd0fd;

  /* status */
  --good:           #0ca30c;
  --good-text:      #006300;
  --warning:        #fab219;
  --critical:       #d03b3b;

  --glass-bg:   rgba(255, 255, 255, .68);
  --shadow-sm:  0 1px 2px rgba(24,20,50,.04), 0 1px 1px rgba(24,20,50,.03);
  --shadow-md:  0 8px 24px rgba(24,20,50,.07), 0 2px 6px rgba(24,20,50,.04);
  --shadow-lg:  0 28px 64px rgba(24,20,50,.14), 0 6px 16px rgba(24,20,50,.07);

  --r-sm: 10px; --r-md: 14px; --r-lg: 18px; --r-xl: 20px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sidebar-w: 260px;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --date-icon-filter: none;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    /* cool slate rather than pure black — gives the violet room to glow */
    --page:         #08080a;
    --surface:      #121215;
    --surface-2:    #17171b;
    --surface-sunk: #0e0e11;
    --sidebar:      #0b0b0d;
    --ink:          #f4f4f6;
    --ink-2:        #9b9ca6;
    --ink-muted:    #6a6b76;
    --line:         rgba(255,255,255,.07);
    --line-strong:  rgba(255,255,255,.15);
    --grid:         rgba(255,255,255,.05);
    --ring:         rgba(255,255,255,.14);

    /* lime does the shouting, violet does the depth */
    --accent:       #3b82f6;
    --accent-hover: #60a5fa;
    --accent-soft:  rgba(59, 130, 246, .14);
    --accent-ink:   #ffffff;
    --accent-grad:  linear-gradient(135deg, #3b82f6 0%, #2dd4bf 100%);
    --accent-grad-hover: linear-gradient(135deg, #4f8ff7 0%, #4ade80 100%);
    --accent-glow:  0 8px 26px -10px rgba(59, 130, 246, .6);
    --violet:       #38bdf8;
    --violet-soft:  rgba(56, 189, 248, .14);
    --violet-grad:  linear-gradient(135deg, #22d3ee 0%, #3b82f6 100%);

    --flow-in:       #38bdf8;
    --flow-in-soft:  rgba(56, 189, 248, .14);
    --flow-out:      #f2617a;
    --flow-out-soft: rgba(242, 97, 122, .14);

    /* single-hue violet magnitude scale — lime stays reserved for
       actions so it never gets mistaken for data */
    --seq-1: #67e8f9; --seq-2: #38bdf8; --seq-3: #3b82f6;
    --seq-4: #4f6ef2; --seq-5: #4f46e5; --seq-6: #3730a3;

    --good-text:    #34d399;
    --date-icon-filter: invert(1);

    --glass-bg:   rgba(255, 255, 255, .04);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.5);
    --shadow-md: 0 10px 28px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.4);
    --shadow-lg: 0 32px 80px rgba(0,0,0,.65), 0 8px 22px rgba(0,0,0,.45);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  /* cool slate rather than pure black — gives the violet room to glow */
  --page:         #08080a;
  --surface:      #121215;
  --surface-2:    #17171b;
  --surface-sunk: #0e0e11;
  --sidebar:      #0b0b0d;
  --ink:          #f4f4f6;
  --ink-2:        #9b9ca6;
  --ink-muted:    #6a6b76;
  --line:         rgba(255,255,255,.07);
  --line-strong:  rgba(255,255,255,.15);
  --grid:         rgba(255,255,255,.05);
  --ring:         rgba(255,255,255,.14);

  /* lime is reserved for primary actions only — never for data */
  --accent:       #3b82f6;
  --accent-hover: #60a5fa;
  --accent-soft:  rgba(59, 130, 246, .14);
  --accent-ink:   #ffffff;
  --accent-grad:  linear-gradient(135deg, #3b82f6 0%, #2dd4bf 100%);
  --accent-grad-hover: linear-gradient(135deg, #4f8ff7 0%, #4ade80 100%);
  --accent-glow:  0 8px 26px -10px rgba(59, 130, 246, .6);

  /* cyan→blue carries analytics */
  --violet:       #38bdf8;
  --violet-soft:  rgba(56, 189, 248, .14);
  --violet-grad:  linear-gradient(135deg, #22d3ee 0%, #3b82f6 100%);

  --flow-in:       #38bdf8;
  --flow-in-soft:  rgba(56, 189, 248, .14);
  --flow-out:      #f2617a;
  --flow-out-soft: rgba(242, 97, 122, .14);

  --seq-1: #67e8f9; --seq-2: #38bdf8; --seq-3: #3b82f6;
  --seq-4: #4f6ef2; --seq-5: #4f46e5; --seq-6: #3730a3;

  --good-text:    #34d399;
  --date-icon-filter: invert(1);

  --glass-bg:   rgba(255, 255, 255, .045);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.55);
  --shadow-md: 0 12px 32px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.4);
  --shadow-lg: 0 36px 90px rgba(0,0,0,.7), 0 8px 24px rgba(0,0,0,.5);
}

/* ═══════════════════════════════════════════════════════
   Entry gate
   ═══════════════════════════════════════════════════════ */
.gate {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  background: #06060a; overflow: hidden;
  animation: gateIn .5s var(--ease);
}
.gate[hidden] { display: none; }
body.is-locked { overflow: hidden; }
@keyframes gateIn { from { opacity: 0; } to { opacity: 1; } }

/* drifting colour field behind the card */
.gate-bg { position: absolute; inset: -25%; pointer-events: none; filter: blur(90px); opacity: .55; }
.gate-bg span { position: absolute; display: block; border-radius: 50%; }
.gate-bg span:nth-child(1) { width: 46vw; height: 46vw; left: 6%;  top: 4%;   background: #2563eb; animation: drift1 19s ease-in-out infinite alternate; }
.gate-bg span:nth-child(2) { width: 40vw; height: 40vw; right: 4%; top: 18%;  background: #0d9488; animation: drift2 23s ease-in-out infinite alternate; }
.gate-bg span:nth-child(3) { width: 34vw; height: 34vw; left: 32%; bottom: 2%; background: #7c3aed; animation: drift3 27s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate3d(9%, 12%, 0) scale(1.16); } }
@keyframes drift2 { to { transform: translate3d(-11%, 9%, 0) scale(1.1); } }
@keyframes drift3 { to { transform: translate3d(7%, -13%, 0) scale(1.2); } }

/* faint engineering grid over the colour */
.gate-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(70% 55% at 50% 45%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(70% 55% at 50% 45%, #000 0%, transparent 78%);
}
@media (prefers-reduced-motion: reduce) { .gate-bg span { animation: none; } }

.gate-card {
  position: relative; z-index: 1;
  width: min(432px, calc(100vw - 32px));
  padding: 40px 38px 30px; text-align: center;
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,.11);
  background: linear-gradient(180deg, rgba(255,255,255,.07) 0%, rgba(255,255,255,.022) 46%, rgba(255,255,255,.012) 100%), rgba(10,10,14,.72);
  backdrop-filter: blur(26px) saturate(1.3); -webkit-backdrop-filter: blur(26px) saturate(1.3);
  box-shadow: 0 40px 110px rgba(0,0,0,.72), inset 0 1px 0 rgba(255,255,255,.09);
  animation: gateCardIn .6s var(--ease-spring) backwards .1s;
}
@keyframes gateCardIn { from { opacity: 0; transform: translateY(20px) scale(.97); } to { opacity: 1; transform: none; } }

.gate-mark {
  width: 52px; height: 52px; margin: 0 auto 22px;
  display: grid; place-items: center; border-radius: 15px;
  background: linear-gradient(135deg, #3b82f6 0%, #2dd4bf 100%); color: #fff;
  box-shadow: 0 12px 34px -12px rgba(59,130,246,.85);
}
.gate-mark svg { width: 26px; height: 26px; }

.gate-kicker {
  font-size: 11.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  color: rgba(255,255,255,.5); margin-bottom: 10px;
}
.gate-title {
  font-size: clamp(31px, 6.4vw, 43px); font-weight: 800; letter-spacing: -.035em; line-height: 1.04;
  color: #fff; margin-bottom: 12px;
}
.gate-title .gate-n {
  margin: 0 .18em;
  background: linear-gradient(135deg, #3b82f6 0%, #2dd4bf 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.gate-sub { font-size: 13px; color: rgba(255,255,255,.5); margin-bottom: 26px; }

.pin-row { display: flex; gap: 12px; justify-content: center; }
.pin-box {
  width: 58px; height: 66px; text-align: center;
  font-size: 26px; font-weight: 700; color: #fff;
  border-radius: 15px; border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.045);
  outline: none; caret-color: #3b82f6;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease), transform .18s var(--ease);
}
.pin-box::-ms-reveal { display: none; }
.pin-box:focus { border-color: #3b82f6; background: rgba(59,130,246,.1); box-shadow: 0 0 0 4px rgba(59,130,246,.18); transform: translateY(-2px); }
.pin-box.is-filled { border-color: rgba(45,212,191,.5); background: rgba(45,212,191,.09); }
.gate.is-wrong .pin-box { border-color: #f2617a; background: rgba(242,97,122,.1); }
.gate.is-wrong .gate-card { animation: gateShake .42s var(--ease); }
@keyframes gateShake { 10%,90%{transform:translateX(-2px)} 20%,80%{transform:translateX(4px)} 30%,50%,70%{transform:translateX(-8px)} 40%,60%{transform:translateX(8px)} }
@media (prefers-reduced-motion: reduce) { .gate.is-wrong .gate-card { animation: none; } }

.gate-error { min-height: 18px; margin: 14px 0 0; font-size: 12.5px; color: #f2617a; }
.gate-btn {
  width: 100%; margin-top: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 50px; border-radius: 15px;
  background: linear-gradient(135deg, #3b82f6 0%, #2dd4bf 100%); color: #fff;
  font-size: 14.5px; font-weight: 650; letter-spacing: -.005em;
  box-shadow: 0 14px 34px -14px rgba(59,130,246,.9);
  transition: transform .18s var(--ease), box-shadow .22s var(--ease), filter .18s var(--ease);
}
.gate-btn svg { width: 17px; height: 17px; }
.gate-btn:hover { transform: translateY(-2px); filter: brightness(1.07); box-shadow: 0 18px 44px -14px rgba(59,130,246,1); }
.gate-btn:active { transform: translateY(0); }
.gate-btn[disabled] { opacity: .55; pointer-events: none; }
.gate-foot { margin-top: 22px; font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: rgba(255,255,255,.3); }

/* unlock: gate lifts away, dashboard settles in behind it */
.gate.is-open { animation: gateOut .55s var(--ease) forwards; pointer-events: none; }
@keyframes gateOut { to { opacity: 0; transform: scale(1.05); filter: blur(14px); } }
.app.is-revealing { animation: appReveal .7s var(--ease); }
@keyframes appReveal { from { opacity: 0; transform: scale(.988); } to { opacity: 1; transform: none; } }

@media (max-width: 420px) {
  .gate-card { padding: 32px 22px 24px; }
  .pin-box { width: 50px; height: 58px; font-size: 22px; }
  .pin-row { gap: 9px; }
}

/* ── reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--page);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .25s var(--ease), color .25s var(--ease);
}
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { list-style: none; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.table-scroll, .modal-body { scroll-behavior: smooth; }

/* matte backdrop — two very soft radial pools give the flat black
   some depth without ever competing with content */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 45% at 18% 0%, var(--violet-soft) 0%, transparent 62%),
    radial-gradient(52% 40% at 88% 8%, var(--accent-soft) 0%, transparent 60%);
}
.app { position: relative; z-index: 1; }

/* ── shell ─────────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; min-height: 100dvh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  padding: 22px 16px 18px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  transition: background .25s var(--ease), border-color .25s var(--ease);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 26px; }
.brand-mark {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: var(--accent-grad); color: var(--accent-ink);
  box-shadow: var(--shadow-sm), var(--accent-glow);
  transition: box-shadow .25s var(--ease), transform .25s var(--ease);
}
.brand-mark svg { width: 19px; height: 19px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 14.5px; font-weight: 640; letter-spacing: -.015em; }
.brand-text em {
  font-style: normal; font-size: 11.5px; color: var(--ink-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 11px; border-radius: var(--r-sm);
  color: var(--ink-2); font-size: 13.5px; font-weight: 500;
  position: relative;
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
  animation: navIn .4s var(--ease) backwards;
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .75; transition: opacity .18s var(--ease); }
.nav-item span { flex: 1; text-align: left; }
.nav-item:hover { background: var(--surface-sunk); color: var(--ink); transform: translateX(1px); }
/* active nav uses the analytics blue with a soft glow — lime stays
   exclusive to primary action buttons */
.nav-item.is-active {
  background: linear-gradient(100deg, var(--violet-soft) 0%, transparent 90%);
  color: var(--violet); font-weight: 600;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--violet) 22%, transparent),
              0 4px 18px -10px color-mix(in srgb, var(--violet) 60%, transparent);
}
.nav-item.is-active svg { opacity: 1; }
.nav-item.is-active::before {
  content: ""; position: absolute; left: -16px; top: 50%; translate: 0 -50%;
  width: 3px; height: 18px; border-radius: 3px; background: var(--accent-grad);
}
.nav-item.is-active .nav-count { background: var(--accent-grad); color: #fff; }
@keyframes navIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.nav-item:nth-child(1) { animation-delay: .02s; } .nav-item:nth-child(2) { animation-delay: .06s; }
.nav-item:nth-child(3) { animation-delay: .10s; } .nav-item:nth-child(4) { animation-delay: .14s; }
.nav-item:nth-child(5) { animation-delay: .18s; } .nav-item:nth-child(6) { animation-delay: .22s; }
.nav-item:nth-child(7) { animation-delay: .26s; }
.nav-count {
  font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--ink-muted); background: var(--surface-sunk);
  padding: 1px 6px; border-radius: 20px; min-width: 20px; text-align: center;
}
.nav-item.is-active .nav-count { background: var(--accent); color: #fff; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 16px; }
.runway-card {
  padding: 12px 13px; border-radius: var(--r-md);
  background: var(--surface-sunk); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px;
}
.runway-label { font-size: 11px; font-weight: 560; color: var(--ink-muted); text-transform: uppercase; letter-spacing: .05em; }
.runway-card strong { font-size: 20px; font-weight: 640; letter-spacing: -.02em; }
.runway-bar { height: 4px; border-radius: 4px; background: var(--flow-out-soft); overflow: hidden; }
.runway-bar i { display: block; height: 100%; border-radius: 4px; background: var(--flow-in); transition: width .5s var(--ease); }
.runway-sub { font-size: 11.5px; color: var(--ink-muted); }

.theme-toggle { justify-content: flex-start; gap: 10px; padding: 8px 10px; color: var(--ink-2); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon,
:root:where(:not([data-theme="light"])) .theme-toggle .i-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: none; }
@media (prefers-color-scheme: light) { :root:where(:not([data-theme="dark"])) .theme-toggle .i-moon { display: none; } }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .theme-toggle .i-sun { display: none; } }
:root[data-theme="light"] .theme-toggle .i-sun { display: block; }
:root[data-theme="light"] .theme-toggle .i-moon { display: none; }

.scrim { display: none; }

.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }

/* ── topbar ────────────────────────────────────────────── */
/* backdrop-filter lives on ::before, not .topbar itself — like transform,
   filter and backdrop-filter make an element the containing block for any
   position:fixed descendant, which would mispositon our dropdown panels
   relative to the topbar's box instead of the viewport (see the modal fix
   above for the same class of bug) */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 20px 32px;
  border-bottom: 1px solid var(--line);
  transition: border-color .25s var(--ease);
}
.topbar::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--page) 78%, transparent);
  backdrop-filter: saturate(1.7) blur(16px);
  -webkit-backdrop-filter: saturate(1.7) blur(16px);
}
.topbar-title h1 {
  font-size: 24px; font-weight: 720; letter-spacing: -.032em;
  animation: fadeUp .35s var(--ease);
}
.topbar-title { flex: 1; min-width: 0; }
.topbar-title p { font-size: 12.5px; color: var(--ink-muted); margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── controls ──────────────────────────────────────────── */
.primary-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 16px; border-radius: var(--r-sm);
  background: var(--accent-grad); color: var(--accent-ink);
  font-size: 13.5px; font-weight: 580; letter-spacing: -.005em;
  box-shadow: var(--shadow-sm);
  transition: transform .16s var(--ease), box-shadow .25s var(--ease), filter .2s var(--ease);
}
.primary-btn svg { width: 15px; height: 15px; }
.primary-btn:hover { background: var(--accent-grad-hover); box-shadow: var(--accent-glow); transform: translateY(-1px); }
.primary-btn:active { transform: translateY(0); }
.primary-btn.sm { padding: 8px 13px; font-size: 13px; }
.primary-btn.danger-btn { background: var(--critical); color: #fff; }
.primary-btn.danger-btn:hover { filter: brightness(1.08); box-shadow: 0 10px 26px -8px rgba(208,59,59,.5); }

.ghost-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink-2); font-size: 13px; font-weight: 530;
  box-shadow: var(--shadow-sm);
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .18s var(--ease), box-shadow .2s var(--ease);
}
.ghost-btn svg { width: 15px; height: 15px; }
.ghost-btn:hover { background: var(--surface-sunk); color: var(--ink); border-color: var(--ink-muted); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.ghost-btn:active { transform: translateY(0); }
.ghost-btn.sm { padding: 7px 12px; font-size: 12.5px; }
.ghost-btn.danger { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 32%, transparent); }
.ghost-btn.danger:hover { background: color-mix(in srgb, var(--critical) 10%, transparent); color: var(--critical); border-color: var(--critical); }

.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: var(--r-sm); color: var(--ink-2);
  transition: background .18s var(--ease), color .18s var(--ease), transform .15s var(--ease);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--surface-sunk); color: var(--accent); transform: translateY(-1px) scale(1.04); }

/* ── Google Sheets sync indicator ──────────────────────── */
.sync-indicator { position: relative; }
.sync-indicator::after {
  content: ""; position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--surface);
  background: var(--ink-muted); transition: background .2s var(--ease);
}
.sync-indicator--ok::after { background: var(--good-text); }
.sync-indicator--busy::after { background: var(--warning); animation: syncPulse 1s ease-in-out infinite; }
.sync-indicator--error::after { background: var(--critical); }
.sync-indicator--off::after { background: var(--ink-muted); }
@keyframes syncPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.sheets-log-row { display: flex; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.sheets-log-row:last-child { border-bottom: 0; }
.sheets-log-row span:first-child { color: var(--ink-muted); white-space: nowrap; flex: none; font-variant-numeric: tabular-nums; }
.sheets-log-row span:last-child { color: var(--ink-2); }
.sheets-log-row.is-bad span:last-child { color: var(--critical); }

/* ═══════════════════════════════════════════════════════
   Drag to rearrange — Overview row blocks and project cards
   ═══════════════════════════════════════════════════════ */
.drag-handle {
  position: absolute; top: 10px; left: 50%; translate: -50% 0;
  display: flex; align-items: center; justify-content: center;
  width: 46px; height: 20px; border-radius: 20px;
  background: var(--surface-sunk); border: 1px solid var(--line);
  color: var(--ink-muted); cursor: grab;
  opacity: 0; transition: opacity .2s var(--ease), color .2s var(--ease), background .2s var(--ease);
  z-index: 6;
}
.drag-handle svg { width: 15px; height: 15px; }
.drag-handle:hover { color: var(--accent); background: var(--surface); }
.drag-handle:active { cursor: grabbing; }
[data-block], .proj-card { position: relative; }
[data-block]:hover > .drag-handle,
.proj-card:hover > .drag-handle,
.drag-handle:focus-visible { opacity: 1; }

/* the block being carried */
.is-dragging {
  opacity: .9; cursor: grabbing;
  transform: scale(1.012);
  box-shadow: var(--shadow-lg);
  position: relative; z-index: 30;
  transition: none;
}
.is-dragging .card { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
/* siblings glide out of the way rather than jumping */
.drag-shift { transition: transform .28s var(--ease); }
/* where it will land */
.drop-marker {
  border: 1.5px dashed color-mix(in srgb, var(--accent) 60%, transparent);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}
body.is-reordering { cursor: grabbing; user-select: none; }
body.is-reordering .card:hover { transform: none; box-shadow: var(--shadow-sm); }

/* ── module hover: lift + accent edge on every card ─────── */
/* deliberately no `will-change: transform` here — like transform
   itself it creates a containing block for position:fixed children,
   which re-anchors any dropdown panel opened inside a card */
.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--violet) 30%, var(--line));
  box-shadow: var(--shadow-md), 0 0 0 1px color-mix(in srgb, var(--violet) 16%, transparent);
}

/* The sheen sweep needs overflow:hidden, so it is limited to the
   compact module cards. Chart and table cards keep their overflow
   intact — clipping them would cut off tooltips and scroll areas. */
.tile, .proj-card { position: relative; overflow: hidden; }
.tile::after, .proj-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: linear-gradient(115deg, transparent 32%, color-mix(in srgb, var(--violet) 12%, transparent) 48%, transparent 64%);
  transform: translateX(-130%);
}
.tile:hover::after, .proj-card:hover::after { animation: cardSheen .8s var(--ease) forwards; }
@keyframes cardSheen { to { transform: translateX(130%); } }
.tile:hover, .proj-card:hover { box-shadow: var(--shadow-md), 0 0 0 1px color-mix(in srgb, var(--violet) 26%, transparent); }

html.no-motion .card,
html.no-motion .card:hover { transform: none !important; }
html.no-motion .tile::after, html.no-motion .proj-card::after { display: none; }
@media (prefers-reduced-motion: reduce) { .tile::after, .proj-card::after { display: none; } }

/* KPI figures tick up rather than snapping to their new value */
.tile-value, .hero-figure { font-variant-numeric: tabular-nums; }

.select-wrap, .search-wrap {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0 12px; height: 38px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink-2);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.select-wrap:focus-within, .search-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select-wrap svg, .search-wrap svg { width: 15px; height: 15px; flex: none; opacity: .75; }
.select-wrap .csel-trigger, .search-wrap input {
  border: 0; background: none; outline: none;
  font-size: 13px; color: var(--ink); padding: 0;
  cursor: pointer; height: 100%;
}
.search-wrap { flex: 1; min-width: 200px; }
.search-wrap input { flex: 1; cursor: text; }
.search-wrap input::placeholder { color: var(--ink-muted); }

/* ── custom dropdown (replaces native <select> popups everywhere) ── */
.csel { display: contents; }
.csel-native { display: none !important; }
.csel-trigger {
  all: unset; box-sizing: border-box;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  cursor: pointer; width: 100%;
}
.csel-trigger .csel-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.csel-trigger .csel-arrow { width: 14px; height: 14px; flex: none; color: var(--ink-muted); opacity: .8; transition: transform .22s var(--ease); }
.csel-trigger[aria-expanded="true"] .csel-arrow { transform: rotate(180deg); }
.csel-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.csel-trigger.is-disabled { cursor: not-allowed; opacity: .55; }
.csel.is-open .csel-trigger { color: var(--accent); }

.csel-panel {
  position: fixed; z-index: 200;
  list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  overflow-y: auto; outline: none;
  transform-origin: top; animation: cselOpen .18s var(--ease-spring) backwards;
}
.csel-panel--up { transform-origin: bottom; }
@keyframes cselOpen { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }
.csel-panel--up { animation-name: cselOpenUp; }
@keyframes cselOpenUp { from { opacity: 0; transform: scale(.96) translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .csel-panel { animation: none; } }

.csel-group {
  padding: 8px 10px 4px; font-size: 10.5px; font-weight: 650; text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-muted);
}
.csel-option {
  padding: 8px 10px; margin: 1px 0; border-radius: var(--r-sm);
  font-size: 13.5px; color: var(--ink); cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  white-space: nowrap;
  transition: background .12s var(--ease);
}
.csel-option.is-active { background: var(--surface-sunk); }
.csel-option.is-selected { color: var(--accent); font-weight: 590; }
.csel-option.is-selected::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.csel-option[aria-disabled="true"] { color: var(--ink-muted); cursor: default; opacity: .55; }
.csel-panel::-webkit-scrollbar { width: 8px; }
.csel-panel::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }

/* ── global search + notifications ─────────────────────── */
.global-search {
  display: inline-flex; align-items: center; gap: 9px;
  height: 40px; padding: 0 12px; min-width: 260px;
  border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--surface-sunk); color: var(--ink-muted);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.global-search:focus-within {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface);
}
.global-search svg { width: 16px; height: 16px; flex: none; opacity: .8; }
.global-search input {
  flex: 1; min-width: 0; border: 0; background: none; outline: none;
  font-size: 13.5px; color: var(--ink);
}
.global-search input::placeholder { color: var(--ink-muted); }
.global-search input::-webkit-search-cancel-button { display: none; }
.kbd {
  flex: none; font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
  padding: 3px 6px; border-radius: 6px;
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink-muted);
}
/* shared-copy status — tells you at a glance whether what you are
   looking at is the synced record or just this browser */
.cloud-status {
  display: inline-flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 12px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface-sunk);
  font-size: 12px; font-weight: 560; white-space: nowrap;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.cloud-status svg { width: 15px; height: 15px; flex: none; }
.cloud-status--synced   { color: var(--good-text); border-color: color-mix(in srgb, var(--good-text) 30%, transparent); }
.cloud-status--saving   { color: var(--warning);   border-color: color-mix(in srgb, var(--warning) 34%, transparent); }
.cloud-status--conflict { color: var(--warning);   border-color: color-mix(in srgb, var(--warning) 34%, transparent); }
.cloud-status--offline  { color: var(--ink-muted); }
@media (max-width: 1180px) { .cloud-status .cloud-label { display: none; } .cloud-status { padding: 0 10px; } }

.notif-btn { position: relative; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface-sunk); }
.notif-badge {
  position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 10px;
  background: var(--critical); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  border: 2px solid var(--page);
}
.notif-badge[hidden] { display: none; }

/* ── sidebar account card ──────────────────────────────── */
.account-card {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 11px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface-sunk);
  text-align: left;
  transition: background .18s var(--ease), border-color .18s var(--ease);
}
.account-card:hover { background: var(--surface); border-color: var(--line-strong); }
.account-avatar {
  width: 32px; height: 32px; flex: none; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--accent-grad); color: #fff;
  font-size: 13px; font-weight: 700;
}
.account-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.account-meta strong { font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-meta em { font-style: normal; font-size: 11px; color: var(--ink-muted); }
.account-chev { width: 15px; height: 15px; flex: none; color: var(--ink-muted); }

/* ── KPI tiles: chip + value + sparkline ───────────────── */
.tile { position: relative; }
.tile-head { display: flex; align-items: center; gap: 10px; }
.tile-chip {
  width: 30px; height: 30px; flex: none; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--chip-bg, var(--accent-soft));
  color: var(--chip-ink, var(--accent));
  border: 1px solid color-mix(in srgb, var(--chip-ink, var(--accent)) 26%, transparent);
}
.tile-chip svg { width: 15px; height: 15px; }
.tile--in      { --chip-ink: var(--good-text); --chip-bg: color-mix(in srgb, var(--good-text) 14%, transparent); }
.tile--out     { --chip-ink: var(--flow-out);  --chip-bg: var(--flow-out-soft); }
.tile--margin  { --chip-ink: var(--flow-in);   --chip-bg: var(--flow-in-soft); }
.tile--payroll { --chip-ink: #a78bfa;          --chip-bg: rgba(167,139,250,.14); }
.dot-margin  { background: var(--flow-in); }
.dot-payroll { background: #a78bfa; }
.tile-spark {
  position: absolute; right: 18px; bottom: 16px;
  width: 108px; height: 42px; overflow: visible; pointer-events: none;
}
.tile-value { position: relative; z-index: 1; }

/* ── hero ──────────────────────────────────────────────── */
.hero-spark { margin-top: 18px; padding-top: 0; }
.hero-spark svg { width: 100%; height: 132px; overflow: visible; }
.hero-motivation {
  margin-top: 16px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface-sunk);
  display: flex; align-items: center; gap: 11px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-2); line-height: 1.45;
}
.motivation-spark {
  width: 30px; height: 30px; flex: none; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
}
.motivation-spark svg { width: 15px; height: 15px; }

/* ── bottom pulse bar ──────────────────────────────────── */
.pulse-bar {
  display: flex; align-items: center; justify-content: center; gap: 11px;
  padding: 15px 20px;
  font-size: 13.5px; font-weight: 520; color: var(--ink-2);
}
.pulse-bar .pulse-icon { width: 19px; height: 19px; color: var(--accent); flex: none; }
.pulse-bar:hover { transform: none; }

/* ── project leaderboard avatars ───────────────────────── */
.proj-avatar {
  width: 28px; height: 28px; flex: none; border-radius: 8px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff;
  border: 1px solid rgba(255,255,255,.14);
}
.cell-proj { display: flex; align-items: center; gap: 11px; }

/* ── "where money goes" rows ───────────────────────────── */
.spend-list { display: flex; flex-direction: column; gap: 3px; }
.spend-row {
  display: grid; grid-template-columns: 30px minmax(96px, 150px) 1fr auto auto;
  align-items: center; gap: 13px;
  padding: 9px 8px; border-radius: var(--r-sm);
  transition: background .16s var(--ease);
}
.spend-row:hover { background: var(--surface-2); }
.spend-chip {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--bar-hue) 15%, transparent);
  color: var(--bar-hue);
  border: 1px solid color-mix(in srgb, var(--bar-hue) 28%, transparent);
}
.spend-chip svg { width: 14px; height: 14px; }
.spend-name { font-size: 13px; font-weight: 520; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spend-track { display: block; height: 26px; border-radius: 8px; background: var(--surface-sunk); overflow: hidden; }
.spend-fill {
  display: block; height: 100%; border-radius: 8px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--bar-hue) 62%, transparent) 0%, var(--bar-hue) 100%);
  transform-origin: left center;
  animation: barGrow .7s var(--ease) backwards;
}
@keyframes barGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
html.no-motion .spend-fill { animation: none; }
@media (prefers-reduced-motion: reduce) { .spend-fill { animation: none; } }
.spend-amt { font-size: 13px; font-weight: 620; color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; min-width: 62px; }
.spend-pct { font-size: 12px; color: var(--ink-muted); font-variant-numeric: tabular-nums; text-align: right; min-width: 38px; }

/* ── period stepper ────────────────────────────────────── */
.period-bar {
  display: inline-flex; align-items: center; gap: 2px;
  height: 38px; padding: 0 3px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface);
}
.period-bar[hidden] { display: none; }
.period-step { width: 28px; height: 30px; border-radius: 7px; }
.period-step svg { width: 16px; height: 16px; }
.period-step:disabled { opacity: .32; pointer-events: none; }
.period-current {
  min-width: 116px; padding: 0 10px; height: 30px; border-radius: 7px;
  font-size: 13px; font-weight: 560; color: var(--ink);
  font-variant-numeric: tabular-nums; white-space: nowrap;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.period-current:hover:not(:disabled) { background: var(--surface-sunk); color: var(--accent); }
.period-current:disabled { cursor: default; }
/* viewing a past period is a state worth signalling */
.period-bar.is-past { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong)); }
.period-bar.is-past .period-current { color: var(--accent); }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--surface-sunk); }
.seg-btn {
  padding: 5px 12px; border-radius: 7px;
  font-size: 12.5px; font-weight: 540; color: var(--ink-muted);
  transition: background .14s var(--ease), color .14s var(--ease);
}
.seg-btn.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.pill {
  padding: 3px 9px; border-radius: 20px;
  background: var(--surface-sunk); color: var(--ink-muted);
  font-size: 11.5px; font-weight: 540; white-space: nowrap;
}

/* ── content & cards ───────────────────────────────────── */
.content { flex: 1; padding: 30px 32px 64px; max-width: 1600px; width: 100%; }
.view { display: none; flex-direction: column; gap: 22px; }
.view.is-active { display: flex; }
/* module switch: a short blur-and-lift, no overlay */
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* every direct child of a freshly-activated view cascades in — pure
   CSS stagger, no JS timing code needed */
.view.is-active > * { animation: rise .5s var(--ease) backwards; }
.view.is-active > *:nth-child(1) { animation-delay: 0ms; }
.view.is-active > *:nth-child(2) { animation-delay: 60ms; }
.view.is-active > *:nth-child(3) { animation-delay: 110ms; }
.view.is-active > *:nth-child(4) { animation-delay: 160ms; }
.view.is-active > *:nth-child(5) { animation-delay: 200ms; }
.view.is-active > *:nth-child(n+6) { animation-delay: 240ms; }

.card {
  /* glass: a translucent wash over the surface plus a top-edge
     highlight, so cards read as lifted panes rather than flat blocks */
  background:
    linear-gradient(180deg, rgba(255,255,255,.045) 0%, rgba(255,255,255,.012) 38%, transparent 100%),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  transition: background .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease), transform .25s var(--ease);
}
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; margin-bottom: 18px;
}
.card-head h2 { font-size: 14.5px; font-weight: 620; letter-spacing: -.012em; }
.card-sub { font-size: 12.5px; color: var(--ink-muted); margin-top: 3px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section-note { font-size: 13px; color: var(--ink-muted); }
.section-note em { font-style: normal; color: var(--ink-2); font-weight: 540; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
/* natural heights here — a short table shouldn't stretch to match a long feed */
.grid-2--wide-left { grid-template-columns: 1.35fr 1fr; align-items: start; }

/* ── hero & tiles ──────────────────────────────────────── */
.hero-grid { display: grid; grid-template-columns: 1.05fr 1.6fr; gap: 22px; }
.hero-card { display: flex; flex-direction: column; position: relative; overflow: hidden; }
.hero-card::before {
  content: ""; position: absolute; inset: -40% -22% auto auto; width: 300px; height: 300px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 13%, transparent) 0%, transparent 70%);
  pointer-events: none;
}
.hero-card .card-head { margin-bottom: 10px; }
/* solid, not gradient — a headline financial figure should read as
   authoritative, and gradient text at this size looks like marketing */
.hero-figure {
  font-size: clamp(44px, 4.6vw, 62px); font-weight: 760;
  letter-spacing: -.042em; line-height: 1.02;
  margin: 2px 0 6px; color: var(--ink);
}
.hero-figure.is-negative { color: var(--critical); }
.hero-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.hero-meta-sub { color: var(--ink-muted); }
.delta {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px 2px 6px; border-radius: 20px;
  font-size: 12px; font-weight: 590; font-variant-numeric: tabular-nums;
  background: var(--surface-sunk); color: var(--ink-2);
}
.delta .delta-icon { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; }
.delta.is-up { background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--good-text); }
.delta.is-up .delta-icon { border-bottom: 6px solid currentColor; }
.delta.is-down { background: color-mix(in srgb, var(--critical) 12%, transparent); color: var(--critical); }
.delta.is-down .delta-icon { border-top: 6px solid currentColor; }
/* oversized dollar watermark — the theme motif, kept low-contrast so it
   never competes with the figure sitting on top of it */
.hero-glyph {
  position: absolute; right: -6px; bottom: -56px;
  font-size: 190px; font-weight: 600; line-height: 1;
  pointer-events: none; user-select: none;
  letter-spacing: -.05em; opacity: 0;
  color: var(--accent);
}

/* motivational line — reads off real performance, see motivationFor() */
.hero-motivation {
  display: flex; align-items: center; gap: 9px;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 12.5px; font-weight: 540; color: var(--ink-2);
  letter-spacing: -.005em;
}
.motivation-spark {
  width: 6px; height: 6px; border-radius: 50%; flex: none;
  background: var(--accent-grad);
}
.motivation-text { transition: opacity .4s var(--ease); }
.motivation-text.is-swapping { opacity: 0; }

.hero-spark { margin-top: auto; padding-top: 18px; }
.hero-spark svg { width: 100%; height: 64px; overflow: visible; }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.tiles--4 { grid-template-columns: repeat(4, 1fr); }
.tile {
  display: flex; flex-direction: column; justify-content: center; gap: 7px; padding: 20px 22px;
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, color-mix(in srgb, white 4%, var(--surface)) 0%, var(--surface) 55%, color-mix(in srgb, var(--violet) 8%, var(--surface)) 100%);
}
/* gradient hairline along the top edge, revealed on hover.
   ::before because ::after carries the sheen sweep. */
.tile::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; z-index: 3;
  background: var(--accent-grad);
  opacity: 0; transition: opacity .25s var(--ease);
}
.tile:hover::before { opacity: 1; }
.tile:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--line-strong); }
.tile-label { font-size: 12px; color: var(--ink-muted); font-weight: 560; text-transform: uppercase; letter-spacing: .04em; }
.tile-value { font-size: 28px; font-weight: 660; letter-spacing: -.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tile-value.is-negative { color: var(--critical); }
.tile-foot { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-in { background: var(--flow-in); }
.dot-out { background: var(--flow-out); }

/* ── charts ────────────────────────────────────────────── */
.chart-card { display: flex; flex-direction: column; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.key { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.key-in { background: var(--flow-in); }
.key-out { background: var(--flow-out); }

.chart-host { position: relative; height: 260px; }
.chart-host--bars { height: 260px; }
.chart-host svg { width: 100%; height: 100%; overflow: visible; }

.grid-line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.axis-line { stroke: var(--line-strong); stroke-width: 1; shape-rendering: crispEdges; }
.axis-text { fill: var(--ink-muted); font-size: 11px; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.bar-label { fill: var(--ink-2); font-size: 11px; font-family: var(--sans); font-weight: 550; font-variant-numeric: tabular-nums; }
.cat-name { fill: var(--ink-2); font-size: 12px; font-family: var(--sans); }
.hover-band { fill: var(--ink); opacity: 0; transition: opacity .1s; }
.hover-band.is-on { opacity: .05; }
.bar { transition: opacity .15s var(--ease); transform-box: fill-box; }
.chart-host.is-hovering .bar { opacity: .35; }
.chart-host.is-hovering .bar.is-hot { opacity: 1; }
/* bars grow in from their own baseline — direction depends on chart orientation */
.bar-v { transform-origin: 50% 100%; animation: barInV .6s var(--ease-spring) backwards; }
.bar-h { transform-origin: 0% 50%; animation: barInH .6s var(--ease-spring) backwards; }
@keyframes barInV { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
@keyframes barInH { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }
.trend-line { animation: trendDraw 1s var(--ease) forwards; }
.trend-area { animation: fadeIn .6s var(--ease) .3s backwards; }
@keyframes trendDraw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bar-v, .bar-h, .trend-line, .trend-area { animation: none; } }

.tooltip {
  position: absolute; z-index: 5; pointer-events: none;
  opacity: 0; transform: translateY(4px) scale(.98);
  transition: opacity .16s var(--ease), transform .16s var(--ease);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  padding: 10px 12px; min-width: 148px;
  font-size: 12.5px;
}
.tooltip.is-on { opacity: 1; transform: none; }
.tooltip h4 { font-size: 12px; font-weight: 620; margin-bottom: 6px; letter-spacing: -.01em; }
.tooltip-row { display: flex; align-items: center; gap: 7px; padding: 2px 0; }
.tooltip-row .key { width: 8px; height: 8px; border-radius: 2px; }
.tooltip-row span { color: var(--ink-2); }
.tooltip-row b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.tooltip-sep { height: 1px; background: var(--line); margin: 6px 0 4px; }

.table-view { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.table-view summary {
  cursor: pointer; font-size: 12px; color: var(--ink-muted);
  list-style: none; display: inline-flex; align-items: center; gap: 5px;
  user-select: none;
}
.table-view summary::-webkit-details-marker { display: none; }
.table-view summary::before { content: "▸"; font-size: 9px; transition: transform .15s var(--ease); }
.table-view[open] summary::before { transform: rotate(90deg); }
.table-view summary:hover { color: var(--ink-2); }
.table-view table { margin-top: 10px; }

/* ── tables ────────────────────────────────────────────── */
/* bounded + internally scrollable so a long ledger doesn't grow the
   page forever, and so the sticky <thead> below has a scroll context
   that isn't the same one the sticky topbar uses */
.table-scroll { overflow-x: auto; overflow-y: auto; max-height: 560px; margin: 0 -24px; padding: 0 24px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; padding: 0 12px 10px;
  font-size: 11.5px; font-weight: 580; color: var(--ink-muted);
  text-transform: uppercase; letter-spacing: .05em;
  white-space: nowrap; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
thead th:first-child, tbody td:first-child { padding-left: 0; }
thead th:last-child, tbody td:last-child { padding-right: 0; }
tbody td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr {
  transition: background .15s var(--ease);
  animation: rowIn .4s var(--ease) backwards;
}
.data-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--ink) 2.5%, var(--surface)); }
.data-table tbody tr:hover { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
@keyframes rowIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
/* stagger the first screenful, then let the rest render immediately
   rather than making someone wait through a long ramp */
.data-table tbody tr:nth-child(1)  { animation-delay: 0ms; }
.data-table tbody tr:nth-child(2)  { animation-delay: 20ms; }
.data-table tbody tr:nth-child(3)  { animation-delay: 40ms; }
.data-table tbody tr:nth-child(4)  { animation-delay: 60ms; }
.data-table tbody tr:nth-child(5)  { animation-delay: 80ms; }
.data-table tbody tr:nth-child(6)  { animation-delay: 100ms; }
.data-table tbody tr:nth-child(7)  { animation-delay: 120ms; }
.data-table tbody tr:nth-child(8)  { animation-delay: 140ms; }
.data-table tbody tr:nth-child(9)  { animation-delay: 160ms; }
.data-table tbody tr:nth-child(10) { animation-delay: 180ms; }
.data-table tbody tr:nth-child(11) { animation-delay: 200ms; }
.data-table tbody tr:nth-child(n+12) { animation-delay: 220ms; }
@media (prefers-reduced-motion: reduce) { .data-table tbody tr { animation: none; } }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amt-in { color: var(--good-text); font-weight: 570; }
.amt-out { color: var(--critical); font-weight: 570; }
.is-negative { color: var(--critical); }
.sortable th[data-sort] { cursor: pointer; user-select: none; }
.sortable th[data-sort]:hover { color: var(--ink-2); }
.sortable th .caret { opacity: 0; margin-left: 4px; font-size: 9px; }
.sortable th.is-sorted .caret { opacity: 1; }

.cell-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cell-main b { font-weight: 560; letter-spacing: -.005em; }
.cell-main small { font-size: 11.5px; color: var(--ink-muted); }
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 6px;
  background: var(--surface-sunk); color: var(--ink-2);
  font-size: 11.5px; font-weight: 530; white-space: nowrap;
}
.tag--muted { color: var(--ink-muted); }
.tag i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 550; white-space: nowrap;
  padding: 3px 9px; border-radius: 20px;
}
.status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status--active   { background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--good-text); }
.status--hold     { background: color-mix(in srgb, var(--warning) 18%, transparent); color: #8a5d00; }
.status--done     { background: var(--accent-soft); color: var(--accent); }
.status--off      { background: var(--surface-sunk); color: var(--ink-muted); }
:root[data-theme="dark"] .status--hold { color: var(--warning); }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .status--hold { color: var(--warning); } }

.row-actions { display: flex; gap: 2px; justify-content: flex-end; opacity: .45; transition: opacity .12s var(--ease); }
tr:hover .row-actions, .row-actions:focus-within { opacity: 1; }
.row-actions .icon-btn { width: 28px; height: 28px; }
.row-actions .icon-btn svg { width: 15px; height: 15px; }

.table-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding-top: 14px; margin-top: 4px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-muted);
}
.table-foot strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.foot-stats { display: flex; gap: 18px; flex-wrap: wrap; }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }

/* mini bar inside table cells */
.mini-bar { height: 5px; border-radius: 4px; background: var(--surface-sunk); overflow: hidden; min-width: 60px; }
.mini-bar i { display: block; height: 100%; border-radius: 4px; }

/* ── feed ──────────────────────────────────────────────── */
.feed { display: flex; flex-direction: column; }
.feed li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; padding-bottom: 0; }
.feed-icon {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
}
.feed-icon svg { width: 15px; height: 15px; }
.feed-icon--in { background: var(--flow-in-soft); color: var(--flow-in); }
.feed-icon--out { background: var(--flow-out-soft); color: var(--flow-out); }
.feed-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.feed-body b { font-weight: 550; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-body small { font-size: 11.5px; color: var(--ink-muted); }
.feed-amt { font-size: 13px; font-weight: 590; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── projects ──────────────────────────────────────────── */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.proj-card { display: flex; flex-direction: column; gap: 16px; cursor: pointer; transition: border-color .2s var(--ease), box-shadow .25s var(--ease), transform .2s var(--ease); }
.proj-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line-strong)); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.proj-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.proj-name { font-size: 15px; font-weight: 610; letter-spacing: -.015em; }
.proj-client { font-size: 12px; color: var(--ink-muted); margin-top: 1px; }
.proj-net { display: flex; align-items: baseline; gap: 8px; }
.proj-net strong { font-size: 24px; font-weight: 650; letter-spacing: -.025em; }
.proj-net span { font-size: 12px; color: var(--ink-muted); }
.proj-split { display: flex; height: 6px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--surface-sunk); }
.proj-split i { display: block; height: 100%; border-radius: 3px; }
.proj-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.proj-stat { display: flex; flex-direction: column; gap: 2px; }
.proj-stat span { font-size: 11px; color: var(--ink-muted); }
.proj-stat b { font-size: 13.5px; font-weight: 580; font-variant-numeric: tabular-nums; }

/* ── categories ────────────────────────────────────────── */
.cat-list { display: flex; flex-direction: column; }
.cat-list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.cat-list li:last-child { border-bottom: 0; }
.cat-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cat-info b { font-weight: 550; font-size: 13px; }
.cat-meter { display: flex; align-items: center; gap: 8px; }
.cat-meter .mini-bar { flex: 1; max-width: 160px; }
.cat-meter small { font-size: 11.5px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.cat-amt { font-size: 13px; font-weight: 580; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── empty states ──────────────────────────────────────── */
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 52px 20px; text-align: center; animation: fadeUp .5s var(--ease); }
.empty-icon {
  width: 72px; height: 72px; border-radius: var(--r-lg); display: grid; place-items: center;
  background: var(--surface-sunk); color: var(--accent); margin-bottom: 4px;
}
.empty-icon svg { width: 40px; height: 40px; }
.empty b { font-size: 14.5px; font-weight: 590; }
.empty p { font-size: 12.5px; color: var(--ink-muted); max-width: 320px; }
.empty .primary-btn, .empty .ghost-btn { margin-top: 10px; }
td .empty { padding: 40px 20px; }

/* ── forms ─────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
.field > span { font-size: 12px; font-weight: 545; color: var(--ink-2); }
.field input, .field .csel-trigger, .amount-input {
  height: 40px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  font-size: 13.5px; outline: none;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
  width: 100%;
}
.field .csel-trigger { cursor: pointer; }
.field input[type="date"]::-webkit-calendar-picker-indicator {
  filter: var(--date-icon-filter, none); opacity: .65; cursor: pointer; border-radius: 4px;
}
.field input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
.field input:focus, .amount-input:focus-within {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.amount-input { display: flex; align-items: center; gap: 2px; padding: 0 11px; }
.amount-input b { font-weight: 540; color: var(--ink-muted); font-size: 13.5px; }
.amount-input input { border: 0; box-shadow: none !important; height: 100%; padding: 0 0 0 2px; background: none; }
.field--amount .amount-input input { font-size: 16px; font-weight: 580; }
.hint { font-size: 12px; color: var(--ink-muted); margin-top: 12px; line-height: 1.5; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

.toggle-group { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle span {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 13.5px; font-weight: 550; color: var(--ink-2);
  transition: all .14s var(--ease);
}
.toggle span:hover { border-color: var(--ink-muted); }
.toggle--in input:checked + span { border-color: var(--flow-in); background: var(--flow-in-soft); color: var(--flow-in); }
.toggle--out input:checked + span { border-color: var(--flow-out); background: var(--flow-out-soft); color: var(--flow-out); }
.toggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── modals ────────────────────────────────────────────── */
.modal {
  width: min(600px, calc(100vw - 32px));
  padding: 0; border: 1px solid var(--line); border-radius: var(--r-xl);
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-lg);
  max-height: calc(100dvh - 48px);
  opacity: 0; transform: scale(.96) translateY(10px);
  transition: opacity .28s var(--ease-spring), transform .28s var(--ease-spring),
              overlay .28s allow-discrete, display .28s allow-discrete;
}
/* transform: none (not scale(1)) once settled — any non-"none" transform,
   even a no-op one, would make this dialog the containing block for our
   position:fixed dropdown panels instead of the viewport, mispositioning
   every dropdown opened while a modal is open */
.modal[open] { opacity: 1; transform: none; }
@starting-style { .modal[open] { opacity: 0; transform: scale(.96) translateY(10px); } }
.modal--sm { width: min(500px, calc(100vw - 32px)); }
.modal--xs { width: min(400px, calc(100vw - 32px)); }
.modal::backdrop {
  background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .28s var(--ease), overlay .28s allow-discrete, display .28s allow-discrete;
}
.modal[open]::backdrop { opacity: 1; }
@starting-style { .modal[open]::backdrop { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .modal, .modal::backdrop { transition: none; } }
.modal form { display: flex; flex-direction: column; max-height: calc(100dvh - 48px); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 15.5px; font-weight: 620; letter-spacing: -.015em; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.confirm-body { text-align: left; }
.confirm-body h2 { font-size: 16px; font-weight: 620; margin-bottom: 6px; }
.confirm-body p { font-size: 13px; color: var(--ink-2); }
.modal-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--line);
  background: var(--surface-2); border-radius: 0 0 var(--r-xl) var(--r-xl);
}
.spacer { flex: 1; }

.payroll-list { display: flex; flex-direction: column; margin-top: 12px; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.payroll-list li { display: flex; align-items: center; gap: 11px; padding: 10px 13px; border-bottom: 1px solid var(--line); }
.payroll-list li:last-child { border-bottom: 0; }
.payroll-list input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; flex: none; }
.payroll-list .cell-main { flex: 1; }
.payroll-list .num { font-weight: 560; }
.payroll-list .payroll-amt { max-width: 120px; height: 32px; flex: none; }
.payroll-total {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 3px 0; margin-top: 12px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--ink-2);
}
.payroll-total strong { font-size: 19px; font-weight: 640; color: var(--ink); letter-spacing: -.02em; }

/* ── toasts ────────────────────────────────────────────── */
.toast-stack { position: fixed; bottom: 24px; right: 24px; z-index: 90; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--r-md);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 530;
  animation: toastIn .35s var(--ease-spring);
  max-width: 340px;
}
.toast i { width: 7px; height: 7px; border-radius: 50%; background: var(--good-text); flex: none; box-shadow: 0 0 8px currentColor; }
.toast.is-warn i { background: var(--warning); }
.toast.is-bad i { background: var(--critical); }
.toast.is-out { animation: toastOut .22s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(16px) scale(.96); } }

/* ── responsive ────────────────────────────────────────── */
.only-mobile { display: none; }

@media (max-width: 1180px) {
  .hero-grid { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .grid-2, .grid-2--wide-left { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .32s var(--ease-spring);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: none; }
  .scrim {
    display: block; position: fixed; inset: 0; z-index: 39;
    background: rgba(0,0,0,.5); backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none;
    transition: opacity .3s var(--ease);
  }
  .scrim.is-on { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; }
  .only-mobile { display: grid; }
  .content { padding: 20px 18px 48px; }
  .topbar { padding: 16px 18px; }
  .topbar-title p { display: none; }
  .tiles, .tiles--4 { grid-template-columns: repeat(2, 1fr); }
  .table-scroll { margin: 0 -20px; padding: 0 20px; max-height: 420px; }
  /* shorter stagger on touch devices so nothing feels laggy to react to */
  .view.is-active > * { animation-duration: .35s; }
  .data-table tbody tr { animation-duration: .3s; }
}
@media (max-width: 620px) {
  .topbar-actions .primary-btn span { display: none; }
  .topbar-actions .primary-btn { padding: 9px 11px; }
  .hero-figure { font-size: 40px; }
  .form-grid { grid-template-columns: 1fr; }
  .proj-grid { grid-template-columns: 1fr; }
  .tile-value { font-size: 22px; }
  .filter-bar > * { flex: 1 1 100%; }
  .card { padding: 18px; }
  .table-scroll { margin: 0 -18px; padding: 0 18px; max-height: 360px; }
  .modal-foot { flex-wrap: wrap; }
  .view.is-active > * { animation-delay: 0ms !important; }
}

@media print {
  .sidebar, .topbar-actions, .row-actions, .toast-stack, .scrim { display: none !important; }
  .main { margin-left: 0; }
  .card { break-inside: avoid; box-shadow: none; }
}
