/* ─────────────────────────────────────────────────────────────────────────────
   Heo Finance — night-sakura theme (matches Hub Heo).
   Dark by default; [data-theme="light"] on <html> flips to a soft day-sakura palette.
   ───────────────────────────────────────────────────────────────────────────── */

:root {
  --bg: #1d1030;
  --bg-2: #120a20;
  --panel: rgba(44, 24, 50, 0.94);
  --panel-solid: #26162e;
  --panel-line: rgba(255, 196, 222, 0.16);
  --grid: rgba(255, 196, 222, 0.04);
  --text: #fbeef4;
  --text-dim: #d3b6cd;
  --text-faint: #ad8fac;
  --cyan: #f26fa6;   /* rose — the primary accent */
  --amber: #f3d6a0;  /* warm gold */
  --green: #8fe3b3;  /* mint */
  --red: #ff86a6;    /* rose-red */
  --violet: #cbb4ff; /* lavender */
  --shadow: 0 8px 40px rgba(18, 6, 22, 0.5);
  --radius: 14px;
  /* was a terminal monospace — now a clean sans (labels feel elegant, numbers stay
     aligned via font-variant-numeric: tabular-nums where it matters) */
  --mono: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: 'Iowan Old Style','Palatino Linotype','Book Antiqua',Palatino,Georgia,serif;
}

html[data-theme="light"] {
  --bg: #fdf3f7;
  --bg-2: #f8e7f0;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --panel-line: rgba(210, 130, 165, 0.24);
  --grid: rgba(210, 130, 165, 0.06);
  --text: #3a2436;
  --text-dim: #7a5a6e;
  --text-faint: #a98ba0;
  --cyan: #d24d86;   /* deeper rose for light-mode contrast */
  --amber: #c9891f;
  --green: #2f9e63;
  --red: #d83a5c;
  --violet: #8a5fd0;
  --shadow: 0 8px 30px rgba(150, 90, 120, 0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  overflow: hidden;
}

body {
  background:
    radial-gradient(1000px 640px at 82% -8%, rgba(255, 226, 210, 0.10), transparent 60%),
    radial-gradient(1100px 720px at 50% 118%, rgba(242, 111, 166, 0.14), transparent 58%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  background-attachment: fixed;
}

body::before {
  /* faint blueprint grid */
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

/* ambient flowing glow — a soft light beam drifting left → right behind the UI */
body::after {
  content: "";
  position: fixed;
  top: -10%;
  bottom: -10%;
  left: 0;
  width: 46vw;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(242, 111, 166, 0.16) 42%,
    rgba(183, 148, 255, 0.14) 58%,
    transparent 100%
  );
  filter: blur(38px);
  will-change: transform, opacity;
  animation: ambient-sweep 16s linear infinite;
}
html[data-theme="light"] body::after {
  background: linear-gradient(
    100deg,
    transparent 0%,
    rgba(10, 139, 176, 0.10) 42%,
    rgba(122, 82, 214, 0.08) 58%,
    transparent 100%
  );
}
@keyframes ambient-sweep {
  0% { transform: translateX(-55vw); opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { transform: translateX(165vw); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  body::after { animation: none; opacity: 0; }
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* ── top bar ─────────────────────────────────────────────────────────────────── */
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 58px;
  padding: 0 18px;
  border-bottom: 1px solid var(--panel-line);
  background: linear-gradient(180deg, rgba(34, 18, 42, 0.96), rgba(26, 14, 32, 0.92));
  backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: baseline; gap: 8px; user-select: none; }
.brand-mark { color: var(--cyan); font-size: 18px; text-shadow: 0 0 12px var(--cyan); }
.brand-name { font-family: var(--serif); font-weight: 600; letter-spacing: 1.5px; }
.brand-accent { color: var(--cyan); }
.brand-sub {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--text-faint);
  border: 1px solid var(--panel-line);
  border-radius: 6px;
  padding: 2px 6px;
  margin-left: 4px;
}

.person-tabs { display: flex; gap: 8px; flex: 1; overflow-x: auto; }
.person-tab {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--panel-line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.person-tab:hover { color: var(--text); border-color: var(--cyan); }
.person-tab.active {
  color: var(--text);
  border-color: var(--accent, var(--cyan));
  background: color-mix(in srgb, var(--accent, var(--cyan)) 14%, var(--panel-solid));
  box-shadow: inset 0 0 16px -10px var(--accent, var(--cyan));
}
.person-tab .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent, var(--cyan)); box-shadow: 0 0 8px var(--accent, var(--cyan)); }
.person-tab .ws-count {
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--text-faint);
  background: rgba(255, 196, 222, 0.09);
  border: 1px solid var(--panel-line);
  font-variant-numeric: tabular-nums;
}
.person-tab.active .ws-count { color: var(--text-dim); border-color: transparent; background: rgba(255, 196, 222, 0.14); }

.topbar-actions { display: flex; gap: 8px; }

/* ── buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  border: 1px solid var(--panel-line);
  background: var(--panel);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn:hover { border-color: var(--cyan); box-shadow: 0 0 16px -6px var(--cyan); }
.btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--cyan), #ff9fc6);
  color: #3a0f24;
  font-weight: 700;
}
.btn.primary:hover { box-shadow: 0 0 22px -4px var(--cyan); }
.btn.danger { color: var(--red); border-color: rgba(255, 92, 124, 0.35); }
.btn.danger:hover { border-color: var(--red); box-shadow: 0 0 16px -6px var(--red); }
.btn.ghost { background: transparent; }
.btn.icon { padding: 8px 10px; }
.btn.tiny { padding: 2px 10px; border-radius: 8px; font-size: 16px; line-height: 1.2; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── layout ──────────────────────────────────────────────────────────────────── */
.layout { position: relative; z-index: 1; display: flex; height: calc(100% - 58px); }

.sidebar {
  width: 244px;
  flex-shrink: 0;
  border-right: 1px solid var(--panel-line);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(28, 15, 36, 0.92);
}
.sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--mono); font-size: 10px; letter-spacing: 2px; color: var(--text-faint);
  padding: 4px 6px 8px;
}
/* workspace strip — horizontal tabs above the work area */
.workspace-nav { display: flex; align-items: center; gap: 8px; padding: 12px 18px 0; }
.workspace-list { display: flex; gap: 8px; overflow-x: auto; min-width: 0; }
.workspace-item {
  text-align: left;
  border: 1px solid var(--panel-line);
  background: var(--panel);
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex: none;
}
.workspace-item:hover { border-color: var(--cyan); }
.workspace-item.active { border-color: var(--cyan); box-shadow: inset 0 -3px 0 var(--cyan), 0 0 16px -8px var(--cyan); }
.workspace-item .ws-name { font-weight: 600; }
.workspace-item .ws-meta { font-family: var(--mono); font-size: 10px; color: var(--text-faint); margin-top: 3px; }
.sidebar-foot { font-family: var(--mono); font-size: 10px; color: var(--text-faint); padding: 8px 6px 0; margin-top: auto; border-top: 1px solid var(--panel-line); }

/* a calm plum backing for the work area so the sakura backdrop stays a whisper,
   not a distraction, behind the dense finance content */
.content { flex: 1; display: flex; flex-direction: column; min-width: 0; background: rgba(26, 14, 32, 0.88); }

/* ── rewards rail (right) ───────────────────────────────────────────────────────── */
.rail {
  width: 256px; flex-shrink: 0; overflow-y: auto;
  border-left: 1px solid var(--panel-line);
  background: rgba(28, 15, 36, 0.94);
  padding: 14px; display: flex; flex-direction: column; gap: 14px;
}
.rail-head { display: flex; align-items: center; justify-content: space-between; font-family: var(--mono); font-size: 10px; letter-spacing: 2px; color: var(--text-faint); }
.level-block { display: flex; align-items: center; gap: 14px; }
.level-ring { position: relative; width: 76px; height: 76px; flex-shrink: 0; }
.level-ring .lv { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.level-ring .lv b { font-size: 24px; font-weight: 800; line-height: 1; color: var(--cyan); text-shadow: 0 0 12px var(--cyan); }
.level-ring .lv span { font-family: var(--mono); font-size: 8px; letter-spacing: 1px; color: var(--text-faint); }
.level-info .title { font-weight: 800; font-size: 16px; letter-spacing: 0.5px; }
.level-info .sub { font-family: var(--mono); font-size: 10px; color: var(--text-dim); margin-top: 3px; }

.credit-box { border: 1px solid var(--panel-line); border-radius: 12px; padding: 12px; background: var(--panel); position: relative; overflow: hidden; }
.credit-box .big { font-size: 26px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.credit-box .big .coin { filter: drop-shadow(0 0 8px var(--amber)); }
.credit-box .cap { font-family: var(--mono); font-size: 10px; color: var(--text-faint); letter-spacing: 0.5px; }
.mini-bar { height: 6px; border-radius: 999px; background: rgba(120,150,200,0.15); overflow: hidden; margin-top: 8px; }
.mini-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--amber)); box-shadow: 0 0 8px var(--cyan); transition: width 0.5s ease; }
.mini-cap { font-family: var(--mono); font-size: 9px; color: var(--text-faint); margin-top: 4px; display: flex; justify-content: space-between; }

.streak-chip { display: flex; align-items: center; gap: 8px; border: 1px solid rgba(255,180,84,0.4); border-radius: 10px; padding: 8px 10px; background: rgba(255,180,84,0.08); }
.streak-chip .n { font-weight: 800; font-size: 16px; color: var(--amber); }
.streak-chip .lbl { font-family: var(--mono); font-size: 10px; color: var(--text-dim); }

.next-reward { border: 1px dashed var(--panel-line); border-radius: 12px; padding: 10px 12px; }
.next-reward .nr-head { font-family: var(--mono); font-size: 9px; letter-spacing: 1.5px; color: var(--text-faint); }
.next-reward .nr-name { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-weight: 600; }

.badge-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.badge {
  aspect-ratio: 1; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; border: 1px solid var(--panel-line); background: var(--panel);
  cursor: default; position: relative; transition: transform 0.12s;
}
.badge:hover { transform: translateY(-2px); border-color: var(--cyan); }
.badge.locked { filter: grayscale(1) brightness(0.5); opacity: 0.55; }
.badge.unlocked { box-shadow: 0 0 14px -4px var(--cyan), inset 0 0 12px -8px var(--cyan); border-color: rgba(242,111,166,0.5); }
.rail-foot { font-family: var(--mono); font-size: 10px; color: var(--text-faint); text-align: center; margin-top: auto; padding-top: 6px; }

/* ── celebration toasts ─────────────────────────────────────────────────────────── */
.toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  min-width: 240px; max-width: 320px; border-radius: 12px; padding: 12px 14px;
  background: var(--panel-solid); border: 1px solid var(--cyan);
  box-shadow: 0 0 30px -6px var(--cyan), var(--shadow);
  display: flex; align-items: center; gap: 12px;
  animation: toast-pop 0.4s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}
.toast.leaving { animation: toast-out 0.4s ease forwards; }
.toast .ic { font-size: 26px; filter: drop-shadow(0 0 8px var(--cyan)); }
.toast .tx b { display: block; font-size: 13px; }
.toast .tx span { font-size: 11px; color: var(--text-dim); }
.toast.levelup { border-color: var(--amber); box-shadow: 0 0 36px -4px var(--amber), var(--shadow); }
.toast.levelup .ic { filter: drop-shadow(0 0 10px var(--amber)); }
@keyframes toast-pop { from { transform: translateX(40px) scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-out { to { transform: translateX(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .toast, .toast.leaving { animation: none; } }
/* view menu — vertical list in the sidebar (MENU + SYSTEM groups) */
.view-nav { display: flex; flex-direction: column; gap: 4px; }
.view-nav + .sidebar-head { margin-top: 12px; }
.view-tab {
  text-align: left;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1px;
}
.view-tab:hover { color: var(--text); background: var(--panel); }
.view-tab.active { color: var(--text); border-color: var(--panel-line); background: var(--panel); box-shadow: inset 3px 0 0 var(--cyan), 0 0 16px -8px var(--cyan); }
.view { flex: 1; overflow-y: auto; padding: 18px; }

/* ── panels & cards ───────────────────────────────────────────────────────────── */
.panel {
  border: 1px solid var(--panel-line);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  position: relative;
}
.panel-title {
  font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--text-dim);
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
}
.panel-title .accent-bar { width: 28px; height: 2px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }

.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card {
  border: 1px solid var(--panel-line);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: ""; position: absolute; right: -20px; top: -20px; width: 80px; height: 80px;
  background: radial-gradient(circle, var(--glow, var(--cyan)), transparent 70%); opacity: 0.18;
}
.stat-label { font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px; color: var(--text-faint); }
.stat-value { font-size: 26px; font-weight: 800; margin-top: 6px; letter-spacing: -0.5px; }
.stat-sub { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.stat-value.cyan { color: var(--cyan); } .stat-value.amber { color: var(--amber); }
.stat-value.green { color: var(--green); } .stat-value.red { color: var(--red); }
.stat-value.violet { color: var(--violet); }

.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1100px) { .cols-2 { grid-template-columns: 1fr; } }

/* ── tables ──────────────────────────────────────────────────────────────────── */
table.data { width: 100%; border-collapse: collapse; }
table.data th {
  text-align: left; font-family: var(--mono); font-size: 10px; letter-spacing: 1px;
  color: var(--text-faint); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--panel-line);
}
table.data td { padding: 10px; border-bottom: 1px solid rgba(120, 150, 200, 0.08); }
table.data tr:hover td { background: rgba(242, 111, 166, 0.04); }
.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.pos { color: var(--green); } .neg { color: var(--red); } .muted { color: var(--text-faint); }

.tag {
  display: inline-block; font-family: var(--mono); font-size: 9px; letter-spacing: 1px;
  padding: 2px 8px; border-radius: 6px; border: 1px solid var(--panel-line); color: var(--text-dim);
}
.tag.w2 { color: var(--cyan); border-color: rgba(242, 111, 166, 0.4); }
.tag.self { color: var(--amber); border-color: rgba(255, 180, 84, 0.4); }
.tag.passive { color: var(--violet); border-color: rgba(183, 148, 255, 0.4); }

.bar { height: 8px; border-radius: 999px; background: rgba(120, 150, 200, 0.14); overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--amber)); }

.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.link-btn { background: none; border: none; color: var(--text-dim); cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.link-btn:hover { color: var(--cyan); background: rgba(242, 111, 166, 0.08); }
.link-btn.del:hover { color: var(--red); background: rgba(255, 92, 124, 0.08); }

/* ── empty states ─────────────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 50px 20px; color: var(--text-dim); }
.empty .big { font-size: 40px; opacity: 0.5; }
.empty h3 { margin: 10px 0 6px; color: var(--text); }

/* ── forms / modal ────────────────────────────────────────────────────────────── */
/* NOTE: do NOT put `display` on the base rule — an author `display` value overrides
   the `[hidden]` attribute, leaving this blurred, click-blocking overlay on top of the
   whole app at all times. Only show it when not hidden. */
.modal-root { position: fixed; inset: 0; z-index: 50; align-items: center; justify-content: center; background: rgba(4, 8, 16, 0.66); backdrop-filter: blur(3px); }
.modal-root:not([hidden]) { display: flex; }
.modal {
  width: min(560px, 92vw); max-height: 88vh; overflow-y: auto;
  border: 1px solid var(--panel-line); border-radius: 16px;
  background: var(--panel-solid); box-shadow: var(--shadow);
  padding: 22px;
}
.modal h2 { margin: 0 0 4px; font-size: 18px; }
.modal .sub { color: var(--text-dim); font-size: 12px; margin-bottom: 16px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 1px; color: var(--text-faint); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--panel-line); background: rgba(26, 14, 30, 0.7); color: var(--text);
  outline: none; transition: border 0.15s;
}
html[data-theme="light"] .field input, html[data-theme="light"] .field select, html[data-theme="light"] .field textarea { background: #f4f8fe; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(242, 111, 166, 0.12); }
.field .hint { font-size: 11px; color: var(--text-faint); margin-top: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── custom dropdown (styled replacement for <select>) ──────────────────────── */
.csel { position: relative; }
.csel-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--panel-line); background: rgba(26, 14, 30, 0.7); color: var(--text);
  cursor: pointer; font: inherit; text-align: left; transition: border 0.15s;
}
html[data-theme="light"] .csel-btn { background: #f4f8fe; }
.csel-btn:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(242, 111, 166, 0.12); }
.csel-btn.open { border-color: var(--cyan); }
.csel-caret { color: var(--text-faint); font-size: 11px; transition: transform 0.15s; }
.csel-btn.open .csel-caret { transform: rotate(180deg); }
.csel-list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  background: var(--panel-solid); border: 1px solid var(--panel-line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 6px; max-height: 240px; overflow-y: auto;
}
.csel-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 8px; cursor: pointer; color: var(--text-dim);
}
.csel-opt:hover { background: rgba(242, 111, 166, 0.12); color: var(--text); }
.csel-opt.on { color: var(--text); }
.csel-check { width: 14px; flex: none; color: var(--cyan); visibility: hidden; }
.csel-opt.on .csel-check { visibility: visible; }
.paycheck-net {
  margin: 4px 0 2px; padding: 10px 12px; border-radius: 8px;
  background: rgba(74, 222, 128, 0.08); border: 1px solid rgba(74, 222, 128, 0.3);
  font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--green);
}
.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-faint); }
.input-prefix input { padding-left: 24px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.modal-actions .spacer { flex: 1; }

.boot-error {
  position: fixed; z-index: 99; left: 0; right: 0; top: 0;
  background: var(--red); color: #fff; padding: 10px 16px; font-family: var(--mono); font-size: 12px;
}

/* ── charts ──────────────────────────────────────────────────────────────────── */
.chart-donut-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.chart-donut-stage { position: relative; flex-shrink: 0; }
.chart-donut-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none;
}
.chart-donut-center .dc-value { font-size: 18px; font-weight: 800; letter-spacing: -0.5px; }
.chart-donut-center .dc-label { font-family: var(--mono); font-size: 9px; letter-spacing: 1px; color: var(--text-faint); }
.chart-legend { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 6px; }
.legend-row { display: grid; grid-template-columns: 14px 1fr auto auto; gap: 8px; align-items: center; font-size: 12px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }
.legend-label { color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-val { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.legend-pct { font-family: var(--mono); color: var(--text-faint); width: 36px; text-align: right; }

.chart-line { display: block; }

/* sparklines under stat cards */
.spark-wrap { position: relative; margin-top: 10px; width: 100%; }
.spark-svg { display: block; overflow: visible; cursor: crosshair; }
.spark-empty { display: flex; align-items: center; justify-content: center; }
.spark-empty span { font-family: var(--mono); font-size: 9px; color: var(--text-faint); opacity: 0.7; }
.spark-tip {
  position: absolute; bottom: 100%; transform: translateX(-50%); margin-bottom: 4px;
  display: none; white-space: nowrap; pointer-events: none; z-index: 3;
  font-family: var(--mono); font-size: 10px; color: var(--text);
  background: var(--panel-solid); border: 1px solid var(--panel-line);
  border-radius: 6px; padding: 3px 7px; box-shadow: var(--shadow);
}

.cmp-bars { display: flex; flex-direction: column; gap: 12px; }
.cmp-row { display: grid; grid-template-columns: 120px 1fr auto; gap: 12px; align-items: center; }
.cmp-label { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.cmp-track { height: 14px; border-radius: 999px; background: rgba(120,150,200,0.12); overflow: hidden; }
.cmp-track > span { display: block; height: 100%; border-radius: 999px; }
.cmp-val { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; }

/* budget progress bars */
.budget-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(120,150,200,0.08); }
.budget-cat { display: flex; align-items: center; gap: 8px; }
.budget-meta { font-family: var(--mono); font-size: 11px; text-align: right; }
.budget-bar { grid-column: 1 / -1; height: 7px; border-radius: 999px; background: rgba(120,150,200,0.12); overflow: hidden; }
.budget-bar > span { display: block; height: 100%; }
.cat-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* ── dashboard section headers (Estimated / Actual) ──────────────────────────────── */
.section-head { display: flex; align-items: baseline; gap: 12px; margin: 6px 0 12px; }
.section-head:not(:first-child) { margin-top: 24px; }
.sh-label {
  font-family: var(--mono); font-size: 12px; letter-spacing: 3px; font-weight: 700;
  color: var(--cyan); text-shadow: 0 0 10px rgba(242, 111, 166, 0.4);
}
.sh-sub { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }
.sh-rule { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(242,111,166,0.35), transparent); align-self: center; }

/* ── collapsible shift log (Year › Month › Week) ─────────────────────────────────── */
.shift-log { margin-top: 6px; }
.shift-log details.grp { border-bottom: 1px solid rgba(120, 150, 200, 0.08); }
.shift-log details.grp:last-child { border-bottom: none; }
.shift-log summary {
  list-style: none; cursor: pointer; padding: 9px 6px; display: flex; align-items: center;
  border-radius: 8px; transition: background 0.12s;
}
.shift-log summary::-webkit-details-marker { display: none; }
.shift-log summary:hover { background: rgba(242, 111, 166, 0.05); }
.shift-log summary::before {
  content: '▸'; font-size: 10px; color: var(--text-faint); margin-right: 10px;
  transition: transform 0.15s; flex-shrink: 0;
}
.shift-log details[open] > summary::before { transform: rotate(90deg); color: var(--cyan); }
.grp-sum { display: flex; align-items: baseline; gap: 12px; flex: 1; min-width: 0; }
.grp-label { font-family: var(--mono); color: var(--text); }
.grp-meta { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }
.grp-gross { margin-left: auto; font-family: var(--mono); font-weight: 700; font-variant-numeric: tabular-nums; }
/* year is the boldest tier; month and week indent + soften */
.grp-year > summary .grp-label { letter-spacing: 2px; color: var(--cyan); font-size: 13px; }
.grp-month { margin-left: 18px; }
.grp-month > summary .grp-label { font-size: 12px; }
.grp-week { margin-left: 18px; }
.grp-week > summary .grp-label { font-size: 12px; color: var(--text-dim); }
.shift-rows { margin-left: 26px !important; width: calc(100% - 26px); }
.shift-rows th { font-size: 9px; }

/* ── invest tab ──────────────────────────────────────────────────────────────── */
.invest-head { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.field.inline { display: flex; align-items: center; gap: 8px; margin: 0; }
.field.inline label { margin: 0; }
.field.inline select { min-width: 220px; }
.seg { display: inline-flex; gap: 6px; }
.invest-fresh { margin-left: auto; display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 11px; color: var(--text-faint); }

.assume-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 18px; }
@media (max-width: 1100px) { .assume-grid { grid-template-columns: 1fr 1fr; } }
.assume-grid .field { margin: 0; }

/* projection chart */
.proj-wrap { position: relative; width: 100%; }
.proj-svg { display: block; }
.proj-yhint { position: absolute; top: 6px; right: 8px; bottom: 22px; left: auto;
  display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.proj-yhint span { font-family: var(--mono); font-size: 10px; color: var(--text-faint); text-align: right; }
.proj-tip {
  position: absolute; bottom: 100%; transform: translateX(-50%); margin-bottom: 6px;
  display: none; white-space: nowrap; pointer-events: none; z-index: 3; text-align: center;
  font-family: var(--mono); color: var(--text);
  background: var(--panel-solid); border: 1px solid var(--cyan);
  border-radius: 7px; padding: 5px 10px; box-shadow: 0 0 14px rgba(242,111,166,0.25);
}
.proj-tip b { display: block; font-size: 13px; color: var(--cyan); }
.proj-tip span { font-size: 10px; color: var(--text-dim); }

/* watchlist chips */
.wl-block { padding: 10px 0; border-bottom: 1px solid rgba(120,150,200,0.08); }
.wl-block:last-child { border-bottom: none; }
.wl-name { font-family: var(--mono); font-size: 12px; letter-spacing: 0.5px; color: var(--text); margin-bottom: 8px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-family: var(--mono); font-size: 11px; padding: 4px 9px; border-radius: 7px;
  border: 1px solid var(--panel-line); background: rgba(242,111,166,0.05); color: var(--text-dim);
}
.chip-y { color: var(--green); }

/* ── calendar ────────────────────────────────────────────────────────────────── */
/* calendar (left, flexible) + weekly gross panel (right, fixed) */
.cal-layout { display: grid; grid-template-columns: 1fr 250px; gap: 18px; align-items: start; }
@media (max-width: 1150px) { .cal-layout { grid-template-columns: 1fr; } }
.week-panel { align-self: start; }
.week-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid rgba(120, 150, 200, 0.08); }
.week-row.current { background: rgba(242, 111, 166, 0.06); border-radius: 8px; padding: 9px 8px; margin: 0 -8px; border-bottom-color: transparent; }
.week-range { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.week-now { color: var(--cyan); }
.week-hrs { font-family: var(--mono); font-size: 10px; color: var(--text-faint); margin-top: 2px; }
.week-amt { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; }
.week-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--panel-line); font-family: var(--mono); font-size: 12px; font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; user-select: none; }
.cal-head { font-family: var(--mono); font-size: 10px; letter-spacing: 1px; color: var(--text-faint); text-align: center; padding: 4px 0; }
.cal-cell {
  min-height: 92px; border: 1px solid var(--panel-line); border-radius: 10px; padding: 6px;
  background: rgba(30, 16, 38, 0.55); display: flex; flex-direction: column; gap: 4px;
  transition: border 0.12s, background 0.12s; cursor: pointer; overflow: hidden;
}
html[data-theme="light"] .cal-cell { background: rgba(255,255,255,0.5); }
.cal-cell:hover { border-color: var(--cyan); background: rgba(242, 111, 166, 0.06); }
.cal-cell.empty { background: transparent; border-color: transparent; cursor: default; }
.cal-cell.empty:hover { background: transparent; border-color: transparent; }
.cal-cell.today { border-color: var(--cyan); box-shadow: inset 0 0 0 1px var(--cyan), 0 0 16px -8px var(--cyan); }
.cal-day { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.cal-cell.today .cal-day { color: var(--cyan); font-weight: 700; }
.cal-event {
  font-size: 10px; padding: 2px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; border-left: 3px solid;
}
.cal-event.shift { background: rgba(74, 222, 128, 0.14); border-color: var(--green); color: var(--text); }
/* due-date payment states: unpaid (red) · partial/amber (paid < minimum) · paid (green ✓) */
.cal-event.due { color: var(--text); cursor: pointer; }
.cal-event.due.unpaid { background: rgba(255, 92, 124, 0.14); border-color: var(--red); }
.cal-event.due.unpaid:hover { background: rgba(255, 92, 124, 0.28); }
.cal-event.due.partial { background: rgba(245, 178, 64, 0.16); border-color: var(--amber); }
.cal-event.due.partial:hover { background: rgba(245, 178, 64, 0.3); }
.cal-event.due.paid { background: rgba(74, 222, 128, 0.16); border-color: var(--green); }
.cal-event.due.paid:hover { background: rgba(74, 222, 128, 0.3); }

/* ── accents (formerly animated HUD light bars — now quiet & static) ──────────── */
/* The flowing sci-fi light bars are gone; a couple of soft static accents remain. */
.topbar::after, .sidebar::after, .rail::before { display: none; }

/* small panel accent bar (in panel titles) — a soft static rose tick */
.accent-bar {
  background: var(--cyan) !important;
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .topbar::after, .sidebar::after, .rail::before, .accent-bar { animation: none; }
}

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(120, 160, 220, 0.2); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(120, 160, 220, 0.35); }
