/* Mission Control — style per Docs/dashboard-style.md (authoritative).
   Flat, dense, near-black. Components reference tokens, never raw hex. */

/* ---------- fonts (self-hosted, no runtime CDN) ---------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/static/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- tokens ---------- */
:root {
  --bg-app: #0a0a0f;
  --bg-surface: #121218;
  --bg-raised: #1a1a22;
  --bg-hover: #22222c;
  --border: #26262f;

  --text-primary: #e8e8ec;
  --text-secondary: #9a9aa5;
  --text-muted: #5c5c68;

  --acc-money: #34d399;
  --acc-debt: #f87171;
  --acc-bill: #60a5fa;
  --acc-cron: #a78bfa;
  --acc-warn: #fbbf24;
  --acc-project: #22d3ee;
  --acc-chore: #fb923c;
  --acc-hygiene: #e879f9;

  --radius-card: 8px;
  --radius-badge: 5px;
  --radius-pill: 999px;

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg-app);
  color: var(--text-primary);
  font: 400 13px/1.4 var(--font-sans);
}
button, input { transition: background-color 120ms ease, border-color 120ms ease; }
a { transition: background-color 120ms ease, border-color 120ms ease; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.small { font-size: 11px; font-weight: 400; }

.shell { display: flex; min-height: 100vh; }

/* ---------- icons ---------- */
.icon {
  width: 16px; height: 16px; flex-shrink: 0;
  stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round; fill: none;
}

/* ---------- sidebar ---------- */
.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: 16px 10px;
  display: flex; flex-direction: column; gap: 16px;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 14px; letter-spacing: .2px;
  padding: 0 10px; color: var(--text-primary);
}
.brand .icon { color: var(--acc-cron); }
nav { display: flex; flex-direction: column; gap: 2px; }
.nav-btn {
  display: flex; align-items: center; gap: 10px;
  height: 32px; padding: 0 10px;
  background: none; border: 0; border-left: 2px solid transparent;
  color: var(--text-secondary);
  font: 400 13px/1 var(--font-sans); text-align: left; cursor: pointer;
  border-radius: var(--radius-badge);
}
.nav-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-btn.active {
  background: var(--bg-raised); color: var(--text-primary); font-weight: 600;
  border-left-color: var(--acc-cron);
  border-top-left-radius: 0; border-bottom-left-radius: 0;
}

.status-card {
  margin-top: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--acc-cron);
  border-radius: var(--radius-card);
  padding: 10px 12px;
  font-size: 11px; color: var(--text-secondary);
}
.status-title {
  font-size: 11px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px;
}
.status-body div { margin-bottom: 4px; }
.label {
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em;
  font-size: 10px; font-weight: 600; margin-right: 4px;
}
.dot {
  display: inline-block; width: 7px; height: 7px;
  border-radius: var(--radius-pill); margin-right: 6px;
}
.dot-ok { background: var(--acc-money); }
.dot-bad { background: var(--acc-debt); }
.dot-warn { background: var(--acc-warn); }
.dot-muted { background: var(--text-muted); }
.signout {
  display: block; text-align: center;
  color: var(--text-muted); text-decoration: none;
  font-size: 11px; padding: 6px; border-radius: var(--radius-badge);
}
.signout:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ---------- main ---------- */
.main { flex: 1; padding: 20px 24px; min-width: 0; }
h1 {
  font-size: 20px; font-weight: 600; line-height: 1.2;
  margin-bottom: 14px; display: flex; align-items: center; gap: 10px;
}
h2 {
  font-size: 11px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted);
  line-height: 1.2; margin-bottom: 10px;
}
.view { display: none; }
.view.active { display: block; }

.grid { display: grid; gap: 12px; }
.money-grid { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px;
}
.card.hero { grid-column: 1 / -1; }
.accent-money { border-left: 2px solid var(--acc-money); }
.accent-debt { border-left: 2px solid var(--acc-debt); }
.accent-bill { border-left: 2px solid var(--acc-bill); }
.accent-cron { border-left: 2px solid var(--acc-cron); }
.accent-warn { border-left: 2px solid var(--acc-warn); }
.accent-project { border-left: 2px solid var(--acc-project); }
.accent-vault { border-left: 2px solid var(--text-secondary); }

/* ---------- badges ---------- */
.badge {
  display: inline-block; padding: 2px 8px;
  border-radius: var(--radius-badge);
  font-size: 11px; font-weight: 500; letter-spacing: .04em;
  text-transform: uppercase; line-height: 1.4; white-space: nowrap;
}
.badge-money { background: color-mix(in srgb, var(--acc-money) 12%, transparent); color: var(--acc-money); }
.badge-debt { background: color-mix(in srgb, var(--acc-debt) 12%, transparent); color: var(--acc-debt); }
.badge-bill { background: color-mix(in srgb, var(--acc-bill) 12%, transparent); color: var(--acc-bill); }
.badge-cron { background: color-mix(in srgb, var(--acc-cron) 12%, transparent); color: var(--acc-cron); }
.badge-warn { background: color-mix(in srgb, var(--acc-warn) 12%, transparent); color: var(--acc-warn); }
.badge-project { background: color-mix(in srgb, var(--acc-project) 12%, transparent); color: var(--acc-project); }
.badge-muted { background: color-mix(in srgb, var(--text-muted) 12%, transparent); color: var(--text-secondary); }
.badge-done { background: color-mix(in srgb, var(--text-muted) 12%, transparent); color: var(--text-muted); text-decoration: line-through; }
.badge-chore { background: color-mix(in srgb, var(--acc-chore) 12%, transparent); color: var(--acc-chore); }
.badge-hygiene { background: color-mix(in srgb, var(--acc-hygiene) 12%, transparent); color: var(--acc-hygiene); }

/* ---------- progress bars ---------- */
.bar {
  height: 4px; border-radius: var(--radius-pill);
  background: var(--bg-raised); overflow: hidden; margin: 6px 0 4px;
}
.bar > i { display: block; height: 100%; border-radius: var(--radius-pill); background: var(--acc-money); }
.bar-label {
  text-align: right; font-family: var(--font-mono); font-size: 11px;
  color: var(--text-secondary); font-variant-numeric: tabular-nums;
}

/* ---------- rows (table-like) ---------- */
.row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  min-height: 32px; padding: 4px 0;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.row:last-child { border-bottom: 0; }
.row .amt {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  white-space: nowrap; text-align: right;
}
.bignum {
  font-size: 26px; font-weight: 700; line-height: 1.2;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
}
.bignum .cur { font-size: 13px; color: var(--text-muted); font-weight: 500; font-family: var(--font-sans); }
.breathing { font-size: 13px; margin-top: 4px; color: var(--text-secondary); }
.breathing b { color: var(--acc-money); font-family: var(--font-mono); }
.due-today { color: var(--acc-warn); font-weight: 600; }
.warn { color: var(--acc-warn); font-size: 11px; margin-top: 8px; }
.note { color: var(--text-muted); font-size: 11px; margin-top: 8px; }

.debt-item { margin-bottom: 12px; }
.debt-item .row { border: 0; padding: 2px 0; min-height: 0; }
.combined { border-top: 1px solid var(--border); padding-top: 8px; font-size: 13px; }
.combined b { font-family: var(--font-mono); }

/* ---------- projects ---------- */
.projects-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.proj-card { cursor: pointer; }
.proj-card:hover { background: var(--bg-hover); }
.proj-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 8px; margin-bottom: 6px;
}
.proj-title { font-size: 14px; font-weight: 600; line-height: 1.2; }
.proj-badges { display: flex; gap: 4px; flex-shrink: 0; }
.proj-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.proj-next { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-raised); border: 1px solid var(--border);
  color: var(--text-secondary); border-radius: var(--radius-badge);
  height: 26px; padding: 0 10px;
  cursor: pointer; font: 400 11px/1 var(--font-sans);
}
.btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn .icon { width: 14px; height: 14px; }

/* ---------- kanban board ---------- */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 20px;
}
.kanban-col {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 10px;
  min-height: 60px;
}
.kanban-col.drag-over {
  border-color: var(--acc-cron);
  background: color-mix(in srgb, var(--acc-cron) 6%, var(--bg-surface));
}
.kanban-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.kanban-col-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
[data-status="In Progress"] .kanban-col-title { color: var(--acc-bill); }
[data-status="Review"] .kanban-col-title { color: var(--acc-warn); }
[data-status="Done"] .kanban-col-title { color: var(--acc-money); }
.kanban-col-count {
  background: var(--bg-raised);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
}
.kanban-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-badge);
  padding: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  user-select: none;
}
.kanban-card:hover { background: var(--bg-hover); }
.kanban-card.dragging { opacity: 0.35; cursor: grabbing; }
.kanban-card-title { font-size: 13px; line-height: 1.3; margin-bottom: 6px; }
.kanban-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.kanban-notes {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 5px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.owner-chip {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
}
.owner-serj {
  background: color-mix(in srgb, var(--acc-bill) 15%, transparent);
  color: var(--acc-bill);
}
.owner-scottier {
  background: color-mix(in srgb, var(--acc-hygiene) 15%, transparent);
  color: var(--acc-hygiene);
}
.priority-dot {
  width: 8px; height: 8px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
  display: inline-block;
}
.priority-high { background: var(--acc-debt); }
.priority-medium { background: var(--acc-warn); }
.priority-low { background: var(--text-muted); }
.board-error {
  background: color-mix(in srgb, var(--acc-debt) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--acc-debt) 30%, transparent);
  border-radius: var(--radius-badge);
  color: var(--acc-debt);
  font-size: 12px;
  padding: 6px 10px;
  margin-bottom: 10px;
}
.project-tasks-section { margin-top: 20px; }
.project-tasks-group { margin-bottom: 10px; }

/* ---------- tasks ---------- */
.task-group { margin-bottom: 12px; }
.task-row {
  display: flex; align-items: center; gap: 10px;
  min-height: 32px; padding: 4px 0;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.task-row:last-child { border-bottom: 0; }
.task-check {
  width: 12px; height: 12px; flex-shrink: 0;
  border: 1px solid var(--text-muted); border-radius: 3px;
}
.task-text { flex: 1; min-width: 0; }
.task-notes { color: var(--text-muted); font-size: 11px; }
.task-side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.task-due {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 11px; color: var(--text-secondary); white-space: nowrap;
}
.task-due.overdue { color: var(--acc-debt); font-weight: 600; }

/* ---------- memory ---------- */
.memory-doc { margin-bottom: 12px; max-width: 780px; }

/* ---------- schedule ---------- */
.week-nav { display: inline-flex; gap: 4px; }
.week-nav button {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-raised); border: 1px solid var(--border);
  color: var(--text-secondary); border-radius: var(--radius-badge);
  height: 26px; min-width: 26px; padding: 0 8px;
  cursor: pointer; font: 400 11px/1 var(--font-sans);
}
.week-nav button:hover { background: var(--bg-hover); color: var(--text-primary); }
.week-nav .icon { width: 14px; height: 14px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; align-items: start; }
.day {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 10px;
}
.day.today { border-color: var(--acc-bill); }
.day h3 {
  font-size: 11px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted);
  line-height: 1.2; margin-bottom: 8px;
}
.day.today h3 { color: var(--acc-bill); }
.ev {
  font-size: 11px; padding: 4px 6px; margin-bottom: 4px;
  background: var(--bg-raised); border-radius: var(--radius-badge);
  border-left: 2px solid var(--text-muted); color: var(--text-secondary);
}
.ev .t { color: var(--text-muted); font-family: var(--font-mono); font-size: 10px; margin-right: 2px; }
.ev-cron { border-left-color: var(--acc-cron); }
.ev-bin { border-left-color: var(--acc-warn); }
.ev-bill { border-left-color: var(--acc-bill); }
.ev-chore { border-left-color: var(--acc-chore); background: color-mix(in srgb, var(--acc-chore) 14%, var(--bg-raised)); color: var(--acc-chore); }
.ev-hygiene { border-left-color: var(--acc-hygiene); background: color-mix(in srgb, var(--acc-hygiene) 14%, var(--bg-raised)); color: var(--acc-hygiene); }
.ev-chore .t, .ev-hygiene .t { color: inherit; opacity: 0.7; }
.sched-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}
.sched-tasks-h {
  margin: 32px 0 14px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.sched-chip {
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1.5px solid currentColor;
  background: transparent;
  opacity: 0.35;
  text-decoration: line-through;
  transition: opacity 0.15s, background 0.15s;
}
.sched-chip.active {
  opacity: 1;
  text-decoration: none;
  background: color-mix(in srgb, currentColor 18%, transparent);
}
.sched-chip.ev-cron  { color: var(--acc-cron); }
.sched-chip.ev-bill  { color: var(--acc-bill); }
.sched-chip.ev-chore { color: var(--acc-chore); }
.sched-chip.ev-hygiene { color: var(--acc-hygiene); }

/* ---------- vault ---------- */
.vault-layout { display: grid; grid-template-columns: 260px 1fr; gap: 12px; align-items: start; }
.vault-side { display: flex; flex-direction: column; gap: 12px; }
.search-input {
  width: 100%; height: 32px; padding: 0 10px;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius-badge); color: var(--text-primary);
  font: 400 13px/1 var(--font-sans);
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { outline: none; border-color: var(--text-secondary); }
.vault-results .file {
  font-size: 11px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted); margin: 10px 0 2px;
}
.vault-results .file:first-child { margin-top: 0; }
.vault-results a {
  display: block; height: auto; min-height: 28px; padding: 4px 8px;
  color: var(--text-secondary); text-decoration: none;
  border-radius: var(--radius-badge); font-size: 12px; line-height: 1.4;
}
.vault-results a:hover { background: var(--bg-hover); color: var(--text-primary); }
.vault-results .ln {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text-muted); margin-right: 4px;
}
.vault-results mark {
  background: color-mix(in srgb, var(--acc-warn) 15%, transparent);
  color: var(--acc-warn);
}
.vault-tree { font-size: 13px; max-height: 75vh; overflow-y: auto; }
.vault-tree .folder {
  font-size: 11px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted); margin: 12px 0 4px;
}
.vault-tree .folder:first-child { margin-top: 0; }
.vault-tree a {
  display: flex; align-items: center; height: 28px; padding: 0 8px;
  color: var(--text-secondary); text-decoration: none;
  border-radius: var(--radius-badge);
}
.vault-tree a:hover { background: var(--bg-hover); color: var(--text-primary); }
.vault-tree a.active { background: var(--bg-raised); color: var(--text-primary); }
.vault-content { min-height: 300px; overflow-x: auto; }

/* rendered markdown (vault + memory + project notes) */
.md h1, .md h2, .md h3 {
  margin: 14px 0 8px; display: block; text-transform: none;
  letter-spacing: 0; color: var(--text-primary); line-height: 1.2;
}
.md h1:first-child, .md h2:first-child { margin-top: 0; }
.md h1 { font-size: 18px; font-weight: 600; }
.md h2 { font-size: 15px; font-weight: 600; }
.md h3 { font-size: 13px; font-weight: 600; }
.md p, .md ul, .md ol { margin-bottom: 8px; font-size: 13px; }
.md li { margin-left: 18px; margin-bottom: 2px; }
.md table { border-collapse: collapse; margin: 8px 0; font-size: 13px; width: 100%; }
.md th, .md td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; height: 32px; }
.md th {
  background: var(--bg-raised); font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted);
}
.md code {
  background: var(--bg-raised); padding: 1px 5px;
  border-radius: var(--radius-badge); font-size: 12px; font-family: var(--font-mono);
}
.md pre {
  background: var(--bg-raised); padding: 10px; border-radius: var(--radius-card);
  overflow-x: auto; margin-bottom: 8px;
}
.md pre code { background: none; padding: 0; }
.md blockquote { border-left: 2px solid var(--border); padding-left: 10px; color: var(--text-secondary); margin-bottom: 8px; }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 10px 0; }
.md a { color: var(--acc-bill); }

/* ---------- payday summary ---------- */
.payday-header { margin-bottom: 12px; }
.payday-cols { display: grid; grid-template-columns: 1fr 200px; gap: 16px; align-items: start; }
.payday-alloc { min-width: 0; }
.payday-row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  min-height: 30px; padding: 3px 0;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.payday-row:last-child { border-bottom: 0; }
.payday-left {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 12px;
  text-align: center;
}
.payday-leftnum {
  font-size: 28px; font-weight: 700; font-family: var(--font-mono);
  font-variant-numeric: tabular-nums; line-height: 1.2; margin: 6px 0 4px;
}

/* ---------- fortez tracker ---------- */
.fortez-card { max-width: 100%; }
.fortez-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.fortez-body { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 10px; }
.fortez-section { min-width: 0; }
.fortez-blocker {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}
.fortez-blocker:last-child { border-bottom: 0; }
.blocker-num {
  font-size: 10px; font-weight: 700; background: var(--acc-debt);
  color: #fff; border-radius: var(--radius-pill);
  width: 16px; height: 16px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.fortez-win { font-size: 12px; color: var(--text-secondary); padding: 3px 0; }

/* ---------- docs ---------- */
.docs-toolbar { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.docs-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-pill {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 999px; color: var(--text-secondary);
  font: inherit; font-size: 12px; padding: 3px 10px; cursor: pointer;
}
.cat-pill:hover { background: var(--bg-hover); color: var(--text-primary); }
.cat-pill.active { background: var(--bg-hover); border-color: var(--text-secondary); color: var(--text-primary); font-weight: 600; }
.docs-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px; align-items: start;
}
.doc-card { cursor: pointer; }
.doc-card:hover { background: var(--bg-hover); }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.doc-title { font-weight: 600; font-size: 14px; }
.doc-preview { margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-date { text-align: right; }

/* ---------- card detail modal ---------- */
.card-modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.card-modal-box {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-left: 3px solid var(--acc-cron);
  border-radius: var(--radius-card);
  padding: 20px;
  max-width: 560px; width: 100%;
  max-height: 80vh; overflow-y: auto;
  position: relative;
}
.card-modal-close {
  position: absolute; top: 10px; right: 10px;
  background: none; border: 0; cursor: pointer;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: var(--radius-badge);
  padding: 0;
}
.card-modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.card-modal-close .icon { width: 14px; height: 14px; }
.card-modal-title {
  font-size: 15px; font-weight: 600; line-height: 1.3;
  margin-bottom: 10px; padding-right: 30px;
  color: var(--text-primary);
}
.card-modal-meta {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap; margin-bottom: 14px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.card-modal-notes-label {
  font-size: 10px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px;
}
.card-modal-notes {
  font-size: 13px; line-height: 1.65;
  color: var(--text-secondary);
  white-space: pre-wrap; word-break: break-word;
}
.card-modal-empty { color: var(--text-muted); font-size: 13px; }

/* ---------- mobile ---------- */
@media (max-width: 820px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%; height: auto; position: static;
    flex-direction: column; padding: 10px;
  }
  nav { flex-direction: row; flex-wrap: wrap; }
  .nav-btn { flex: 1 1 30%; justify-content: center; border-left: 0; }
  .nav-btn.active { border-left: 0; border-radius: var(--radius-badge); }
  .nav-btn span { display: none; }
  .nav-btn .icon { width: 18px; height: 18px; }
  .status-card { margin-top: 0; }
  .main { padding: 14px 10px; }
  .money-grid { grid-template-columns: 1fr; }
  .week { grid-template-columns: 1fr; }
  .day { min-height: 0; }
  .day.empty-mobile { display: none; }
  .vault-layout { grid-template-columns: 1fr; }
  .vault-tree { max-height: 200px; }
  .kanban-board { grid-template-columns: 1fr 1fr; }
}

/* ---------- habits heatmap ---------- */
.habits-grid { grid-template-columns: 1fr; }
.hm-wrap { display: flex; flex-direction: column; gap: 16px; }
.hm-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.hm-label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.hm-streak { font-size: 11px; font-weight: 700; color: var(--acc-money); }
.hm-streak.hm-zero { color: var(--text-muted); }
.hm-scroll { overflow-x: auto; padding-bottom: 2px; }
.hm-months { display: grid; grid-auto-flow: column; grid-auto-columns: 13px; gap: 3px; height: 12px; margin-bottom: 3px; font-size: 9px; color: var(--text-muted); }
.hm-months span { grid-row: 1; white-space: nowrap; }
.hm-grid { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 13px); grid-auto-columns: 13px; gap: 3px; }
.hm-cell { width: 13px; height: 13px; border-radius: 3px; background: var(--bg-hover); }
.hm-done { background: var(--acc-money); }
.hm-skipped { background: var(--acc-debt); opacity: 0.5; }
.hm-none { background: var(--bg-hover); }
.hm-future { background: transparent; }
.hm-blank { background: transparent; }
.hm-today { box-shadow: 0 0 0 1.5px var(--text-secondary); }
.hm-legend { display: flex; align-items: center; gap: 4px; margin-top: 14px; }
.hm-legend .hm-cell { width: 12px; height: 12px; }
