/* ============================================================================
   Singularity — design system, aligned to the Shinka Labs brand (light theme).
   Brand tokens taken from shinka-labs.com: green #3FCF91, Inter, flat surfaces
   defined by 1px borders (no shadows), 8px radius, big light-weight headings.
   Every page links this file; components are class-based so markup restyles free.
   ========================================================================= */
:root {
  /* surfaces — light canvas, white cards, borders do the work (Shinka-flat) */
  --bg:        #f6f6f5;
  --bg-2:      #fbfbfa;
  --panel:     #ffffff;   /* card */
  --panel-2:   #f3f3f2;   /* inset / raised control */
  --panel-3:   #ebebe9;   /* hover */
  --line:      #e4e4e1;
  --line-soft: #ededeb;

  /* ink */
  --text:    #191a19;
  --text-2:  #3d3f3d;
  --muted:   #6b6d6a;
  --muted-2: #9a9c98;

  /* Shinka brand green + semantics */
  --accent:        #3fcf91;   /* brand green — fills, borders, tints */
  --accent-strong: #2bbe7e;   /* hover fill */
  --accent-deep:   #0e7a4e;   /* readable green text on white */
  --accent-ink:    #05221a;   /* text on a green fill */
  --accent-soft:   rgba(63,207,145,0.14);
  --accent-line:   rgba(63,207,145,0.50);

  --blue:      #3772cf;   /* Shinka secondary — info */
  --blue-soft: rgba(55,114,207,0.12);
  --amber:     #b8770e;   /* caution */
  --amber-soft:rgba(184,119,14,0.12);
  --red:       #d64545;   /* negative / danger */
  --red-soft:  rgba(214,69,69,0.10);
  --gold:      #c68a17;
  --green:     #0e7a4e;   /* alias for legacy references (payroll) */

  --input-bg: #ffffff;

  --radius:    10px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  /* shadows: cards are flat (borders only). Shadows reserved for overlays. */
  --shadow-sm: none;
  --shadow:    0 1px 2px rgba(20,22,20,.04), 0 8px 24px -12px rgba(20,22,20,.14);
  --shadow-lg: 0 12px 32px -8px rgba(20,22,20,.18), 0 4px 12px rgba(20,22,20,.08);
  --ring:      0 0 0 3px var(--accent-soft);

  --sans:    "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* every numeral on the platform speaks in this voice — the "ledger" texture */
  --mono:    "Spline Sans Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, "Cascadia Mono", monospace;

  --sb-w: 236px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1100px 560px at 88% -12%, rgba(63,207,145,0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent-deep); text-decoration: none; }
a:hover { color: var(--accent-strong); }
::selection { background: var(--accent-soft); color: var(--text); }

* { scrollbar-width: thin; scrollbar-color: #d4d4d0 transparent; }
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-thumb { background: #d6d6d2; border-radius: 20px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: #c4c4bf; }

.num, .mono, td.num, th.num, .tnum { font-variant-numeric: tabular-nums; }

/* ============================ typography ============================ */
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; color: var(--text); }
.display { font-family: var(--display); font-weight: 500; letter-spacing: -0.03em; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .13em; color: var(--muted-2); font-weight: 600; }
.muted  { color: var(--muted); }
.muted2 { color: var(--muted-2); }

/* ============================ platform nav (legacy top nav) ============================ */
.platform-nav {
  display: flex; align-items: center; gap: 4px;
  padding: 12px 22px; margin: -24px -20px 22px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255,255,255,0.7); backdrop-filter: blur(8px);
}
.platform-nav .brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 16px; color: var(--text); margin-right: 20px; letter-spacing: -0.02em;
}
.platform-nav .brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.platform-nav a.nav-link { color: var(--muted); font-size: 13px; padding: 7px 13px; border-radius: var(--radius-xs); transition: .15s; }
.platform-nav a.nav-link:hover { color: var(--text); background: var(--panel-2); }
.platform-nav a.nav-link.active { color: var(--accent-deep); background: var(--accent-soft); }
.platform-nav .nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ============================ buttons ============================ */
button, .btn {
  font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  background: var(--panel); color: var(--text-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 14px; display: inline-flex; align-items: center; gap: 7px;
  transition: background .14s, border-color .14s, color .14s, transform .05s, box-shadow .14s;
  white-space: nowrap;
}
button:hover, .btn:hover { background: var(--panel-2); color: var(--text); border-color: #d6d6d2; }
button:active, .btn:active { transform: translateY(0.5px); }
button:focus-visible, .btn:focus-visible { outline: none; box-shadow: var(--ring); }
button:disabled, .btn:disabled { opacity: .5; cursor: not-allowed; }

button.primary, .btn.primary {
  background: var(--accent); border-color: transparent; color: var(--accent-ink); font-weight: 600;
}
button.primary:hover, .btn.primary:hover { background: var(--accent-strong); color: var(--accent-ink); }
button.dark { background: var(--text); border-color: var(--text); color: #fff; font-weight: 600; }
button.dark:hover { background: #000; color: #fff; border-color: #000; }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.ghost:hover { background: var(--panel-2); color: var(--text); border-color: transparent; }
button.tiny { padding: 4px 10px; font-size: 12px; border-radius: var(--radius-xs); }
button.danger { color: var(--red); }
button.danger:hover { background: var(--red-soft); border-color: rgba(214,69,69,.35); color: var(--red); }
button.icon { padding: 8px; }

/* ============================ form controls ============================ */
input, select, textarea {
  font-family: inherit; font-size: 13px; color: var(--text);
  background: var(--input-bg); border: 1px solid var(--line); border-radius: var(--radius-xs);
  padding: 9px 11px; transition: border-color .14s, box-shadow .14s; width: 100%;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-line); box-shadow: var(--ring); }
input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: #d3d3cf; }
select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M3 4.5L6 7.5L9 4.5' stroke='%236b6d6a' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px;
}
textarea { resize: vertical; }
textarea.csv, textarea.mono { font-family: var(--mono); font-size: 12px; line-height: 1.55; min-height: 130px; }
label.f { display: block; color: var(--muted); font-size: 11.5px; font-weight: 500; margin: 0 0 5px; }
input[type="date"] { color-scheme: light; }
input[type="file"] { padding: 7px; cursor: pointer; }
input[type="file"]::file-selector-button {
  font-family: inherit; font-size: 12px; margin-right: 10px; padding: 6px 12px;
  background: var(--panel-2); color: var(--text-2); border: 1px solid var(--line); border-radius: var(--radius-xs); cursor: pointer;
}

/* ============================ cards ============================ */
section.card, .card {
  background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 16px; overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--line-soft);
}
.card-head h2 { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; display: flex; align-items: center; gap: 9px; }
.card-head .hint { color: var(--muted-2); font-size: 12px; }
.card-body { padding: 16px 18px; }

/* ============================ tables ============================ */
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
thead th {
  color: var(--muted-2); font-weight: 600; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 1;
}
tbody tr { transition: background .1s; }
tbody tr:hover td { background: #fafaf9; }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
td.mono, .mono { font-family: var(--mono); }
td.mono { font-size: 12px; color: var(--muted); }
.scroll-x { overflow-x: auto; }
.clickable { cursor: pointer; }
/* click-to-edit convention: a whole row opens its editor; workflow CTAs live in
   a right-aligned actions cell and stop the row click. Editors close with a
   shared footer (Save primary · Delete danger · Cancel). */
tbody tr.row-edit { cursor: pointer; }
tbody tr.row-edit:hover td { background: var(--accent-soft); }
td.row-actions { text-align: right; white-space: nowrap; }
/* journal register data-quality highlights: amber = missing data, red = missing receipt */
tbody tr.jrow-warn   td { background: var(--amber-soft); }
tbody tr.jrow-danger td { background: var(--red-soft); }
tbody tr.jrow-warn   td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
tbody tr.jrow-danger td:first-child { box-shadow: inset 3px 0 0 var(--red); }
tbody tr.row-edit.jrow-warn:hover td   { background: var(--amber-soft); filter: brightness(0.97); }
tbody tr.row-edit.jrow-danger:hover td { background: var(--red-soft);   filter: brightness(0.97); }
.drawer-foot, .editor-foot { display: flex; align-items: center; gap: 10px; margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--line-soft); }
.drawer-foot .spacer, .editor-foot .spacer { flex: 1; }
.amount-pos { color: var(--accent-deep); }
.amount-neg { color: var(--text); }
.amount-red { color: var(--red); }

/* ============================ chips / badges ============================ */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 500; border: 1px solid var(--line); color: var(--muted);
  background: var(--panel-2); line-height: 1.6; white-space: nowrap;
}
.chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .85; }
.chip.plain::before { display: none; }
.chip.ok   { color: var(--accent-deep); border-color: var(--accent-line); background: var(--accent-soft); }
.chip.warn { color: var(--amber);  border-color: rgba(184,119,14,.35); background: var(--amber-soft); }
.chip.bad  { color: var(--red);    border-color: rgba(214,69,69,.35); background: var(--red-soft); }
.chip.info { color: var(--blue);   border-color: rgba(55,114,207,.35); background: var(--blue-soft); }
.chip.gold { color: var(--gold);   border-color: rgba(198,138,23,.35); background: rgba(198,138,23,.10); }

/* ============================ KPI ============================ */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 15px 16px; position: relative; overflow: hidden; }
.kpi .k { color: var(--muted-2); font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; font-weight: 600; }
.kpi .v { font-family: var(--mono); font-size: 24px; font-weight: 500; margin-top: 7px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--text); }
.kpi .s { color: var(--muted); font-size: 11.5px; margin-top: 4px; }
.kpi.accent { border-color: var(--accent-line); background: var(--accent-soft); }
.kpi.accent .v { color: var(--accent-deep); }
/* hairline brand tick — the one place the green underlines a number */
.kpi::after { content: ""; position: absolute; left: 16px; bottom: 0; width: 26px; height: 2px; background: var(--accent); opacity: 0; transition: opacity .2s, width .25s cubic-bezier(.3,.9,.3,1); }
.kpi:hover::after { opacity: 1; width: 42px; }

/* ============================ inline messages ============================ */
.msg {
  font-size: 12.5px; padding: 11px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--panel-2); margin-top: 12px; white-space: pre-wrap; line-height: 1.55;
}
.msg.err { color: var(--red);         border-color: rgba(214,69,69,.35); background: var(--red-soft); }
.msg.ok  { color: var(--accent-deep); border-color: var(--accent-line);  background: var(--accent-soft); }
.msg.warn{ color: var(--amber);       border-color: rgba(184,119,14,.35); background: var(--amber-soft); }

/* ============================ layout helpers ============================ */
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.toolbar-row { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.row { display: flex; gap: 10px; align-items: center; }
.spacer { flex: 1; }

/* ============================ segmented control ============================ */
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg button, .seg .seg-item { border: none; background: transparent; color: var(--muted); padding: 6px 13px; border-radius: 6px; font-size: 12.5px; cursor: pointer; }
.seg .seg-item.on, .seg button.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }

/* shared filter/control kit: multi-select filter + lucide toggle buttons */
.ms { position: relative; display: inline-block; }
.ms-trigger { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; font-size: 12.5px; color: var(--text-2); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; max-width: 220px; }
.ms-trigger:hover { border-color: #d3d3cf; }
.ms-trigger.on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-deep); }
.ms-trigger.ms-excl { border-color: rgba(214,69,69,.4); background: var(--red-soft); color: var(--red); }
.ms-trigger .ms-sum { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-pop { position: absolute; top: calc(100% + 4px); left: 0; z-index: 1200; width: 232px; padding: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }
.ms-list { max-height: 240px; overflow: auto; margin: 2px 0; }
.ms-opt { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; cursor: pointer; font-size: 12.5px; }
.ms-opt:hover { background: var(--panel-2); }
.ms-opt input { width: auto; margin: 0; flex: none; }
.ms-actions { display: flex; gap: 6px; margin-top: 6px; border-top: 1px solid var(--line-soft); padding-top: 6px; }
.icon-btn { display: inline-flex; align-items: center; gap: 5px; }
.icon-btn.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-deep); }

/* grouped filter bar: logical clusters, consistent control widths, tight within a
   group, roomier between groups */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.fgroup { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fgroup + .fgroup { position: relative; }
.filter-bar .ms-trigger { width: 140px; }
.filter-bar select { width: 140px; }
.filter-bar input[type="date"] { width: 138px; }
.filter-bar .f-wide { width: 200px; }
.filter-bar .f-narrow { width: 118px; }

/* ============================ tooltip ============================ */
.tip { position: relative; cursor: help; border-bottom: 1px dotted var(--muted-2); }
.tip:hover::after {
  content: attr(data-tip); position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 40;
  width: max-content; max-width: 280px; padding: 8px 11px; font-size: 12px; font-weight: 400; line-height: 1.45;
  color: #fff; background: #24261f; border-radius: var(--radius-xs); box-shadow: var(--shadow); white-space: normal;
}

/* ============================ app shell (sidebar) ============================ */
.shell { display: grid; grid-template-columns: var(--sb-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--panel); border-right: 1px solid var(--line);
  padding: 18px 14px; display: flex; flex-direction: column; gap: 3px;
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px;
  font-weight: 700; font-size: 18px; color: var(--text); letter-spacing: -0.03em;
}
.sidebar .brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.sidebar .sect-label { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted-2); font-weight: 600; padding: 14px 10px 6px; }
/* divider where app-wide nav (Platform anchors) ends and module nav begins:
   the first module section-label immediately follows the last platform link */
.sidebar a.nav-item + .sect-label { margin-top: 12px; padding-top: 18px; border-top: 1px solid var(--line); }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: 13.5px; font-weight: 500; cursor: pointer; user-select: none;
  border: 1px solid transparent; transition: .12s;
}
.nav-item .ico { width: 17px; height: 17px; flex: none; opacity: .7; display: inline-flex; }
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.on { background: var(--accent-soft); color: var(--accent-deep); border-color: var(--accent-line); }
.nav-item.on .ico { opacity: 1; }
.nav-item .badge-count { margin-left: auto; font-size: 10.5px; font-family: var(--mono); background: var(--panel-2); color: var(--muted); border-radius: 999px; padding: 1px 7px; }
.nav-item.on .badge-count { background: #fff; color: var(--accent-deep); }
.sidebar .side-foot { margin-top: auto; padding: 12px 8px 4px; border-top: 1px solid var(--line-soft); font-size: 11.5px; color: var(--muted-2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 16px 28px; border-bottom: 1px solid var(--line-soft);
  background: rgba(246,246,245,0.82); backdrop-filter: blur(10px) saturate(1.1);
}
.topbar .page-title { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.topbar .page-sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.topbar .actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.content { padding: 24px 28px 100px; max-width: none; width: 100%; }
.tabpage { animation: fade .22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* one orchestrated entrance: direct children of the active tab settle in with
   a soft stagger (capped — deep pages shouldn't ripple forever) */
.tabpage > * { animation: rise .34s cubic-bezier(.22,.9,.3,1) both; }
.tabpage > *:nth-child(1) { animation-delay: 0s; }
.tabpage > *:nth-child(2) { animation-delay: .045s; }
.tabpage > *:nth-child(3) { animation-delay: .09s; }
.tabpage > *:nth-child(4) { animation-delay: .135s; }
.tabpage > *:nth-child(5) { animation-delay: .18s; }
.tabpage > *:nth-child(n+6) { animation-delay: .21s; }
@keyframes rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: none; border-bottom: 1px solid var(--line); }
  .sidebar .sect-label, .sidebar .side-foot { display: none; }
  .sidebar .brand { padding: 4px 8px; }
  .nav-item { padding: 7px 10px; }
  .content { padding: 18px 16px 80px; }
  .topbar { padding: 14px 16px; }
}

/* ============================ modal + wizard ============================ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; padding: 24px;
  background: rgba(20,22,20,.34); backdrop-filter: blur(3px); animation: fade .16s ease;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: min(680px, 96vw); max-height: 90vh; overflow: hidden; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  animation: pop .2s cubic-bezier(.2,.8,.3,1);
}
.modal.wide { width: min(900px, 96vw); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 22px 14px; border-bottom: 1px solid var(--line-soft); }
.modal-head .mh-title { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.modal-head .mh-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.modal-head .mh-close { margin-left: auto; background: transparent; border: none; color: var(--muted); font-size: 18px; padding: 4px 8px; cursor: pointer; border-radius: 6px; }
.modal-head .mh-close:hover { background: var(--panel-2); color: var(--text); }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line-soft); background: var(--bg-2); }
.modal-foot .spacer { flex: 1; }

/* stepper */
.stepper { display: flex; align-items: center; gap: 0; padding: 14px 22px 2px; }
.stepper .step { display: flex; align-items: center; gap: 9px; color: var(--muted-2); font-size: 12.5px; font-weight: 500; }
.stepper .step .dot {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); font-family: var(--mono); flex: none;
}
.stepper .step.on { color: var(--text); }
.stepper .step.on .dot { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-deep); }
.stepper .step.done .dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.stepper .bar { flex: 1; height: 1.5px; background: var(--line); margin: 0 12px; min-width: 18px; }
.stepper .bar.done { background: var(--accent-line); }

/* ============================ toasts ============================ */
.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
.toast {
  display: flex; align-items: flex-start; gap: 11px; padding: 13px 15px; border-radius: var(--radius-sm);
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-lg); color: var(--text-2);
  font-size: 13px; animation: toastin .28s cubic-bezier(.2,.9,.3,1); border-left: 3px solid var(--muted-2);
}
.toast.ok  { border-left-color: var(--accent); }
.toast.err { border-left-color: var(--red); }
.toast.warn{ border-left-color: var(--amber); }
.toast .t-ico { flex: none; font-size: 15px; line-height: 1.3; }
.toast .t-body { min-width: 0; }
.toast .t-title { font-weight: 600; color: var(--text); }
.toast .t-msg { color: var(--muted); margin-top: 2px; white-space: pre-wrap; }
.toast.out { animation: toastout .2s ease forwards; }
@keyframes toastin { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes toastout { to { opacity: 0; transform: translateX(24px); } }

/* ============================ checklist ============================ */
.checklist { display: flex; flex-direction: column; gap: 2px; }
.check-item { display: flex; align-items: center; gap: 13px; padding: 12px 6px; border-bottom: 1px solid var(--line-soft); }
.check-item:last-child { border-bottom: none; }
.check-item .mark { width: 22px; height: 22px; border-radius: 50%; flex: none; display: grid; place-items: center; border: 1.5px solid var(--line); color: transparent; font-size: 12px; font-weight: 700; }
.check-item.done .mark { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.check-item .ci-body { flex: 1; min-width: 0; }
.check-item .ci-title { font-size: 13.5px; font-weight: 500; color: var(--text); }
.check-item.done .ci-title { color: var(--muted); }
.check-item .ci-sub { font-size: 12px; color: var(--muted-2); margin-top: 1px; }
.progress-track { height: 6px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 999px; transition: width .5s cubic-bezier(.3,.9,.3,1); }

/* ============================ empty state ============================ */
.empty { text-align: center; padding: 44px 24px; color: var(--muted); }
.empty .e-ico { font-size: 30px; margin-bottom: 12px; opacity: .85; }
.empty .e-title { font-size: 17px; color: var(--text); font-weight: 600; margin-bottom: 5px; letter-spacing: -0.01em; }
.empty .e-sub { font-size: 13px; color: var(--muted); max-width: 400px; margin: 0 auto 16px; line-height: 1.55; }

/* ============================ skeleton ============================ */
.skel { background: linear-gradient(90deg, var(--panel-2) 25%, var(--panel-3) 37%, var(--panel-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ============================ mini charts (dashboards) ============================ */
.barchart { display: flex; align-items: flex-end; gap: 10px; height: 168px; padding-top: 8px; }
.barchart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; min-width: 0; }
/* Two anatomies: a bare .bar directly under .col keeps the classic column
   width; bars inside a .bars wrapper (dual-series) flex inside it — a
   percentage width there would resolve against the auto-width wrapper → 0 */
.barchart .col .bar { background: linear-gradient(180deg, var(--accent), var(--accent-strong)); border-radius: 5px 5px 0 0; min-height: 3px; transition: height .55s cubic-bezier(.3,.9,.3,1); }
.barchart .col > .bar { width: 66%; max-width: 40px; }
.barchart .col .bars { width: 66%; max-width: 40px; display: flex; gap: 2px; align-items: flex-end; justify-content: center; }
.barchart .col .bars .bar { flex: 1; min-width: 6px; }
.barchart .col.dim .bar { background: var(--panel-3); }
.barchart .col .lbl { font-size: 10.5px; color: var(--muted-2); white-space: nowrap; }
.barchart .col .val { font-size: 10px; color: var(--muted); font-family: var(--mono); font-variant-numeric: tabular-nums; }

.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar { display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: center; font-size: 12.5px; }
.hbar .name { color: var(--text-2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { height: 10px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.hbar .fill { height: 100%; background: linear-gradient(90deg, var(--accent-strong), var(--accent)); border-radius: 999px; min-width: 2px; transition: width .55s cubic-bezier(.3,.9,.3,1); }
.hbar .amt { font-family: var(--mono); font-size: 12px; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }

.split-bar { display: flex; height: 18px; border-radius: 999px; overflow: hidden; background: var(--panel-2); }
.split-bar > span { display: block; min-width: 2px; transition: width .55s cubic-bezier(.3,.9,.3,1); }
.legend { display: flex; gap: 18px; margin-top: 12px; font-size: 12px; flex-wrap: wrap; }
.legend .li { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend b { color: var(--text); font-family: var(--mono); font-weight: 600; }

/* statement-style mini rows (P&L snapshot) */
.stmt-row { display: flex; align-items: baseline; justify-content: space-between; padding: 9px 2px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.stmt-row:last-child { border-bottom: none; }
.stmt-row .lab { color: var(--muted); }
.stmt-row .amt { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--text); }
.stmt-row.milestone { font-weight: 600; }
.stmt-row.milestone .lab { color: var(--text); }
.stmt-row.milestone .amt { color: var(--accent-deep); }

/* dashboard grid */
.dash-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }
@media (max-width: 900px) { .dash-2 { grid-template-columns: 1fr; } }


/* ============================ right detail drawer ============================
   One drawer anatomy for every module: lists open records here first. */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(20,22,20,.34); backdrop-filter: blur(3px); z-index: 70; display: none; }
.drawer-backdrop.open { display: flex; justify-content: flex-end; }
.drawer { width: min(760px, 96vw); height: 100%; overflow: auto; background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); padding: 22px 24px; animation: drawerin .24s cubic-bezier(.2,.8,.3,1); }
@keyframes drawerin { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer h3 { margin: 0 0 4px; font-size: 17px; letter-spacing: -0.02em; }

/* ============================ misc ============================ */
.divider { height: 1px; background: var(--line-soft); margin: 14px 0; }
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.dim { opacity: .6; }
