/* Quiet Ledger — LedgerLens visual system
   Appearance-only layer. It intentionally preserves Quiet Ledger's DOM, data flow,
   authentication, scanner and Supabase behavior. Load after dual-world.css. */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700&display=swap');

:root {
  color-scheme: light;
  --paper: #f5f7f9;
  --paper-2: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --faint: #e4e7ec;
  --line: #d0d5dd;
  --copper: #155eef;
  --sage: #067647;
  --sage-bg: #ecfdf3;
  --amber: #b54708;
  --amber-bg: #fffaeb;
  --red: #b42318;
  --red-bg: #fef3f2;
  --white: #ffffff;
  --shadow: 0 16px 44px rgba(16, 24, 40, .06);

  --dw-paper: #f5f7f9;
  --dw-sheet: #ffffff;
  --dw-ink: #101828;
  --dw-muted: #667085;
  --dw-rule: #d0d5dd;
  --dw-rule-soft: #e4e7ec;
  --dw-copper: #155eef;
  --dw-sage: #067647;
  --dw-scan: #0b1220;
  --dw-scan-panel: #101828;
  --dw-scan-ink: #f8fafc;
  --dw-scan-muted: #98a2b3;
  --dw-scan-line: #344054;
  --dw-scan-signal: #17b26a;
  --dw-danger: #b42318;
  --dw-radius-sm: 9px;
  --dw-radius: 14px;
  --dw-radius-lg: 20px;
  --dw-shadow-paper: 0 1px 2px rgba(16, 24, 40, .04), 0 16px 44px rgba(16, 24, 40, .05);
  --dw-shadow-modal: 0 28px 80px rgba(16, 24, 40, .28);
}

html,
body {
  background: #f5f7f9;
  color: #101828;
  font-family: 'DM Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body { font-size: 14px; line-height: 1.5; }
h1, h2, h3, .brand, .page-title, .metric-value, .panel-title {
  font-family: 'Manrope', 'DM Sans', ui-sans-serif, system-ui, sans-serif;
}

/* Application shell */
.sidebar {
  width: 248px;
  padding: 26px 18px 20px;
  background: #0b1220;
  color: #f8fafc;
  border-right: 1px solid #1d2939;
}
.main {
  margin-left: 248px;
  width: calc(100% - 248px);
  background: #f5f7f9;
}
.brand {
  gap: 10px;
  padding: 0 8px 26px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.03em;
}
.brand-mark {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 0;
  border-radius: 9px;
  background: #155eef;
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15);
}
.workspace-switcher {
  min-height: 60px;
  margin: 0 0 28px;
  padding: 11px 12px;
  border: 1px solid #344054;
  border-radius: 12px;
  background: #101828;
}
.workspace-switcher .eyebrow { color: #84adff; }
.workspace-switcher strong { color: #fff; font-size: 12px; }
.chevron { color: #98a2b3; }
.nav-list { gap: 5px; }
.nav-link {
  min-height: 42px;
  gap: 11px;
  padding: 10px 11px;
  border-radius: 9px;
  color: #98a2b3;
  font-size: 13px;
  font-weight: 500;
}
.nav-link:hover { background: #182230; color: #f2f4f7; }
.nav-link.active {
  background: #eff4ff;
  color: #175cd3;
  box-shadow: none;
}
.nav-icon { color: currentColor; font-size: 17px; }
.nav-count {
  min-width: 26px;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #d1e0ff;
  color: #175cd3;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
}
.plan-card {
  padding: 14px;
  border: 1px solid #233554;
  border-radius: 12px;
  background: #101c2e;
}
.plan-card .eyebrow { color: #75e0a7; }
.plan-card strong { color: #fff; font-family: 'Manrope', sans-serif; font-size: 15px; }
.plan-card small, .user-chip small { color: #98a2b3; }
.avatar { background: #182230; color: #84adff; }

.topbar {
  min-height: 72px;
  padding: 0 22px 0 38px;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid rgba(208,213,221,.92);
  backdrop-filter: blur(18px);
}
.crumb { color: #667085; font-size: 10px; letter-spacing: .08em; }
.crumb b { color: #344054; }
.icon-button, .modal-close, .drawer-close, .nav-close {
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: #fff;
  color: #475467;
}
.mobile-menu {
  display: none;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  background: #fff;
  color: #475467;
}
.icon-button:hover, .mobile-menu:hover, .modal-close:hover, .drawer-close:hover {
  background: #f9fafb;
  border-color: #d0d5dd;
}
.capture-button {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 10px;
  background: #155eef;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: 0 1px 2px rgba(16,24,40,.08);
}
.capture-button:hover { background: #004eeb; transform: none; }
.capture-button:active { background: #0040c1; transform: none; }

/* Page hierarchy */
.content-wrap {
  width: min(100%, 1510px);
  padding: 44px 42px 72px;
}
.hero-row { margin-bottom: 32px; align-items: flex-end; }
.kicker, .eyebrow {
  color: #175cd3;
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .11em;
}
.page-title {
  max-width: 840px;
  margin: 10px 0 10px;
  color: #101828;
  font-size: clamp(38px, 4.4vw, 62px);
  line-height: 1.02;
  font-weight: 650;
  letter-spacing: -.055em;
}
.page-subtitle {
  max-width: 680px;
  color: #475467;
  font-size: 16px;
  line-height: 1.65;
}
.date-control {
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid #d0d5dd;
  border-radius: 9px;
  background: #fff;
  color: #344054;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(16,24,40,.03);
}
.date-control:hover { background: #f9fafb; border-color: #98a2b3; }

/* Data surfaces */
.metric-grid { gap: 12px; margin-bottom: 16px; }
.metric,
.panel,
.settings-section,
.settings-aside,
.tax-year-card,
.insight-card {
  border: 1px solid #e4e7ec;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16,24,40,.03);
}
.metric {
  min-height: 144px;
  padding: 20px;
}
.metric.primary {
  background: #fff;
  color: #101828;
  border-color: #b2ccff;
  box-shadow: inset 0 2px 0 #7f56d9, 0 1px 2px rgba(16,24,40,.03);
}
.label, .metric-note { color: #667085; }
.label { font-size: 12px; font-weight: 500; }
.metric-value {
  margin: 22px 0 12px;
  color: #101828;
  font-size: clamp(28px, 2.3vw, 38px);
  line-height: 1;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}
.metric-note { font-size: 11px; }
.section-grid, .insight-grid { gap: 16px; }
.panel { padding: 22px; }
.panel-head {
  min-height: 34px;
  padding-bottom: 15px;
  border-bottom: 1px solid #f2f4f7;
}
.panel-title { color: #101828; font-size: 15px; font-weight: 700; letter-spacing: -.025em; }
.panel-link, .text-link, .text-button { color: #175cd3; font-size: 11px; font-weight: 700; }
.panel-link:hover, .text-link:hover, .text-button:hover { color: #004eeb; }
.category-row { gap: 12px; }
.category-track, .evidence-meter { background: #eaecf0; }
.category-track i, .evidence-meter i { background: #155eef; }
.receipt-row { border-color: #eaecf0; }
.receipt-row:hover, .receipt-button:hover, .review-card:hover { background: #f9fafb; }
.receipt-thumb {
  border-radius: 9px;
  background: #f2f4f7;
  color: #475467;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
}
.receipt-main small { color: #98a2b3; }
.receipt-amount { color: #101828; font-weight: 700; font-variant-numeric: tabular-nums; }
.status {
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
}
.status.verified, .status.accepted { background: #ecfdf3; color: #067647; }
.status.review, .status.processing { background: #fffaeb; color: #b54708; }
.status.rejected, .status.duplicate { background: #fef3f2; color: #b42318; }

/* Ledger, filters and forms */
.ledger-toolbar {
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  background: #fff;
}
.field, .select, .settings-select {
  min-height: 42px;
  border: 1px solid #d0d5dd;
  border-radius: 9px;
  background: #fff;
  color: #101828;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  box-shadow: 0 1px 2px rgba(16,24,40,.03);
}
.field::placeholder { color: #98a2b3; }
.field:focus, .select:focus, .settings-select:focus {
  border-color: #84adff;
  outline: 0;
  box-shadow: 0 0 0 4px #eff4ff;
}
.table-panel { padding: 0; overflow: hidden; }
.data-table th {
  padding: 12px 16px;
  background: #f9fafb;
  border-color: #eaecf0;
  color: #667085;
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
}
.data-table td { padding: 14px 16px; border-color: #eaecf0; color: #475467; }
.data-table tr:hover td { background: #f9fafb; }

/* Insights and chart */
.trend-chart, .category-chart, .chart-panel { border-color: #e4e7ec; background: #fff; }
.trend-summary, .chart-summary { color: #101828; }
.bar-a { background: #155eef !important; }
.bar-b { background: #12b76a !important; }
.chart-gridline, .monthly-chart-gridline { stroke: #eaecf0; }
.chart-axis-label, .monthly-chart-y, .monthly-chart-x { fill: #98a2b3; color: #98a2b3; }
.chart-legend .dot:first-child { background: #155eef; }
.chart-legend .dot:last-child { background: #12b76a; }

/* Settings */
.settings-shell { gap: 16px; }
.settings-aside { padding: 18px; }
.settings-profile { border-bottom-color: #eaecf0; }
.settings-avatar { background: #eff4ff; color: #175cd3; }
.settings-aside nav a { color: #667085; border-radius: 8px; }
.settings-aside nav a:hover, .settings-aside nav a.active { background: #eff4ff; color: #175cd3; }
.settings-stack { gap: 14px; }
.settings-section { overflow: hidden; }
.settings-section > header { padding: 20px; border-bottom: 1px solid #eaecf0; background: #fff; }
.settings-section h2 { color: #101828; font-size: 17px; }
.settings-section p { color: #667085; }
.settings-icon { background: #eff4ff; color: #155eef; border-radius: 9px; }
.setting-row { padding: 18px 20px; border-color: #eaecf0; }
.switch[aria-checked='true'] { background: #155eef; }
.settings-status { background: #ecfdf3; color: #067647; }
.settings-status i { background: #17b26a; }

/* Dedicated authentication threshold */
body.threshold-active { overflow: hidden; }
body .auth-threshold {
  position: fixed;
  inset: 0;
  z-index: 2000;
  width: 100vw;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(18px, 2.4vw, 36px);
  display: grid;
  place-items: center;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 10% 8%, rgba(21,94,239,.12), transparent 32%),
    radial-gradient(circle at 92% 86%, rgba(127,86,217,.09), transparent 28%),
    #eef2f6;
  box-shadow: none;
  backdrop-filter: none;
}
.threshold-frame {
  width: min(1320px, 100%);
  min-height: calc(100dvh - clamp(36px, 4.8vw, 72px));
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(420px, .82fr);
  overflow: hidden;
  border: 1px solid rgba(16,24,40,.12);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 32px 90px rgba(16,24,40,.16), 0 2px 6px rgba(16,24,40,.06);
}
.threshold-narrative {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(34px, 4.6vw, 68px);
  overflow: hidden;
  color: #f8fafc;
  background:
    radial-gradient(circle at 14% 10%, rgba(21,94,239,.48), transparent 35%),
    radial-gradient(circle at 92% 75%, rgba(127,86,217,.28), transparent 32%),
    #0b1220;
}
.threshold-narrative::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .28;
  background-image: linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom right, #000, transparent 78%);
}
.threshold-narrative::after {
  content: '';
  position: absolute;
  right: -90px;
  bottom: -100px;
  z-index: -1;
  width: 360px;
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  box-shadow: 0 0 0 54px rgba(255,255,255,.025), 0 0 0 108px rgba(255,255,255,.018);
}
.threshold-brand { display: flex; align-items: center; gap: 12px; font: 700 18px 'Manrope', sans-serif; letter-spacing: -.02em; }
.threshold-brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 12px;
  background: linear-gradient(145deg, #2e90fa, #155eef);
  box-shadow: 0 12px 30px rgba(21,94,239,.32);
  font-size: 13px;
  letter-spacing: .08em;
}
.threshold-story { max-width: 700px; margin: auto 0; padding: 56px 0 42px; }
.threshold-kicker, .threshold-route, .threshold-lock {
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .16em;
}
.threshold-kicker { color: #84adff; }
.threshold-story h2 {
  max-width: 680px;
  margin: 18px 0 18px;
  color: #fff;
  font: 600 clamp(42px, 4.7vw, 68px)/1.02 'Manrope', sans-serif;
  letter-spacing: -.055em;
  text-wrap: balance;
}
.threshold-story p { max-width: 600px; margin: 0; color: #b9c2d0; font-size: clamp(15px, 1.25vw, 18px); line-height: 1.65; }
.threshold-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid rgba(255,255,255,.13); }
.threshold-step { display: grid; gap: 18px; padding: 24px 22px 0 0; }
.threshold-step + .threshold-step { padding-left: 22px; border-left: 1px solid rgba(255,255,255,.13); }
.threshold-step-number { color: #84adff; font: 700 10px 'DM Sans', sans-serif; letter-spacing: .14em; }
.threshold-step-copy { display: grid; gap: 6px; }
.threshold-step-copy strong { color: #fff; font: 600 14px 'Manrope', sans-serif; }
.threshold-step-copy small { color: #98a2b3; font-size: 12px; line-height: 1.5; }
.threshold-assurance { display: flex; align-items: center; gap: 9px; margin-top: 34px; color: #b9c2d0; font-size: 12px; }
.threshold-assurance-dot { width: 8px; height: 8px; border-radius: 50%; background: #17b26a; box-shadow: 0 0 0 5px rgba(23,178,106,.13); }
.threshold-panel {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(42px, 5vw, 74px);
  background: #fff;
}
.threshold-panel-head { position: absolute; inset: 30px 34px auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.threshold-route { color: #667085; }
.threshold-lock { display: inline-flex; align-items: center; gap: 7px; color: #067647; }
.threshold-lock::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #17b26a; }
.threshold-panel .auth-copy { display: grid; gap: 0; max-width: 520px; margin-bottom: 30px; }
.threshold-panel .auth-copy .eyebrow { width: max-content; margin-bottom: 16px; padding: 7px 9px; border-radius: 6px; color: #175cd3; background: #eff4ff; }
.threshold-panel .auth-copy strong { color: #101828; font: 600 clamp(29px, 2.55vw, 40px)/1.12 'Manrope', sans-serif; letter-spacing: -.04em; text-wrap: balance; }
#thresholdTitle:focus { outline: none; }
.threshold-panel .auth-copy small { margin-top: 16px; color: #667085; font-size: 14px; line-height: 1.65; }
.threshold-panel .waitlist-form, .threshold-panel .otp-form { width: 100%; min-width: 0; gap: 12px; }
.threshold-panel .field-label { margin: 0 0 -4px; color: #475467; }
.threshold-panel .field { width: 100%; min-height: 50px; border-color: #d0d5dd; border-radius: 10px; background: #fff; font-size: 14px; }
.threshold-panel .field:focus { border-color: #84adff; box-shadow: 0 0 0 4px #eff4ff; }
.threshold-panel .auth-actions { display: grid; grid-template-columns: 1fr; gap: 10px; width: 100%; margin-top: 6px; }
.threshold-panel .auth-actions .capture-button, .threshold-panel > .capture-button { width: 100%; min-height: 48px; justify-content: center; }
.threshold-panel .auth-actions .date-control, .threshold-panel > .date-control { width: 100%; min-height: 46px; margin: 0; justify-content: center; }

@media (max-width: 800px) {
  body.threshold-active { overflow: auto; }
  body .auth-threshold { position: absolute; inset: 0 0 auto; min-height: 100dvh; height: auto; padding: 0; place-items: stretch; overflow: visible; }
  .threshold-frame { min-height: 100dvh; display: block; border: 0; border-radius: 0; box-shadow: none; }
  .threshold-narrative { min-height: 300px; padding: 28px 24px 32px; }
  .threshold-story { margin: 38px 0 0; padding: 0; }
  .threshold-story h2 { margin: 14px 0; font-size: clamp(32px, 9vw, 43px); }
  .threshold-story p { font-size: 14px; line-height: 1.55; }
  .threshold-steps { display: none; }
  .threshold-assurance { margin-top: 24px; }
  .threshold-panel { min-height: calc(100dvh - 300px); padding: 72px 24px 54px; justify-content: flex-start; }
  .threshold-panel-head { inset: 26px 24px auto; }
  .threshold-panel .auth-copy { margin-bottom: 24px; }
  .threshold-panel .auth-copy strong { font-size: clamp(28px, 8vw, 36px); }
}
@media (max-width: 420px) {
  .threshold-narrative { min-height: 282px; }
  .threshold-brand-mark { width: 38px; height: 38px; }
  .threshold-kicker { font-size: 9px; }
  .threshold-story { margin-top: 28px; }
  .threshold-story h2 { font-size: 31px; }
  .threshold-panel { min-height: calc(100dvh - 282px); }
  .threshold-lock { font-size: 9px; }
}
.capture-modal { background: rgba(11,18,32,.74); }
.capture-dialog {
  border: 1px solid #344054;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(16,24,40,.32);
}
.capture-head h2 { color: #101828; font-family: 'Manrope', sans-serif; letter-spacing: -.04em; }
.capture-head p { color: #667085; }
.capture-source {
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  background: #fff;
}
.capture-source:hover, .capture-source:focus-within {
  border-color: #84adff;
  box-shadow: 0 0 0 4px #eff4ff;
}
.capture-source span { color: #667085; }
.scanner-stage {
  border: 1px solid #1d2939;
  border-radius: 14px;
  background: #101828;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.capture-preview { background: #101828; border-color: #344054; color: #98a2b3; }
.scanner-status {
  border-color: #344054;
  background: #101828;
  color: #84adff;
}
.scanner-toolbar { border-color: #e4e7ec; }
.crop-outline polygon { fill: rgba(21,94,239,.14); stroke: #528bff; }
.crop-handle { border-color: #fff; background: #155eef; box-shadow: 0 0 0 3px rgba(21,94,239,.26); }
.ai-extraction { border-color: #b2ccff; background: #f5f8ff; }
.ai-extraction-mark { color: #155eef; }
.capture-error { color: #b42318; background: #fef3f2; }
.review-drawer { background: #fff; color: #101828; }
.toast { background: #101828; color: #fff; }

/* Focus and motion */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
[role='button']:focus-visible, .capture-source:focus-within, .crop-handle:focus-visible {
  outline: 3px solid #84adff;
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media (max-width: 1000px) {
  .sidebar { width: 224px; }
  .main { margin-left: 224px; width: calc(100% - 224px); }
  .content-wrap { padding: 38px 28px 64px; }
  .page-title { font-size: 48px; }
}

@media (max-width: 700px) {
  .sidebar { width: min(286px, 86vw); transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; width: 100%; }
  .topbar { min-height: 64px; padding: 0 14px; }
  .mobile-menu { display: inline-grid; }
  .top-actions { align-items: center; }
  .topbar .capture-button { width: auto; height: 42px; min-height: 42px; white-space: nowrap; line-height: 1; }
  .content-wrap { padding: 28px 16px 56px; }
  .hero-row { display: block; margin-bottom: 24px; }
  .hero-row > .date-control { margin-top: 16px; }
  .page-title { font-size: clamp(34px, 11vw, 44px); }
  .page-subtitle { font-size: 14px; }
  .metric-grid { gap: 8px; }
  .metric { min-height: 116px; padding: 15px; }
  .metric-value { margin: 15px 0 8px; font-size: 27px; }
  .panel { padding: 16px; }
  .ledger-toolbar { padding: 10px; }
  .settings-shell { grid-template-columns: 1fr; }
  .settings-aside { display: none; }
  .capture-dialog { border-radius: 20px 20px 0 0; }
}

@media (max-width: 420px) {
  .top-actions { gap: 6px; }
  .topbar .crumb { display: none; }
  .capture-button { padding-inline: 12px; }
  .crumb span { display: none; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric.primary { grid-column: 1 / -1; }
  .section-grid, .insight-grid { grid-template-columns: 1fr; }
  .capture-source-grid, .capture-workspace, .capture-field-row { grid-template-columns: 1fr; }
}

/* Reference sidebar navigation — functional LedgerLens-inspired composition */
.sidebar {
  width: 292px;
  padding: 34px 20px 22px;
  overflow-y: auto;
  scrollbar-width: none;
  background: #0a1120;
}
.sidebar::-webkit-scrollbar { display: none; }
.main { margin-left: 292px; width: calc(100% - 292px); }
.brand { gap: 14px; padding: 0 10px 34px; font-size: 21px; letter-spacing: -.04em; }
.brand-mark {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, #2d74ff, #155eef);
  box-shadow: 0 8px 20px rgba(21,94,239,.24), inset 0 1px 0 rgba(255,255,255,.22);
}
.brand-mark i { position: absolute; width: 6px; height: 22px; border-radius: 999px; background: #fff; transform: rotate(38deg); }
.brand-mark i:first-child { left: 13px; top: 12px; height: 15px; opacity: .76; }
.brand-mark i:last-child { left: 22px; top: 7px; }
.workspace-switcher {
  width: 100%;
  min-height: 74px;
  display: grid;
  grid-template-columns: 44px 1fr 20px;
  align-items: center;
  gap: 12px;
  margin: 0 0 34px;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid #344054;
  border-radius: 14px;
  background: #101828;
  color: #fff;
}
.workspace-switcher:hover { border-color: #475467; background: #152033; }
.workspace-avatar { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 11px; background: #155eef; color: #fff; font-weight: 700; }
.workspace-copy { min-width: 0; display: grid; gap: 2px; }
.workspace-switcher .workspace-copy strong { margin: 0; overflow: hidden; color: #fff; font: 700 13px 'Manrope', sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.workspace-copy small { color: #98a2b3; font-size: 11px; }
.workspace-switcher .chevron { position: static; justify-self: end; color: #f2f4f7; font-size: 19px; }
.nav-list { display: grid; gap: 3px; }
.nav-section-label {
  display: block;
  margin: 0 11px 10px;
  color: #667085;
  font: 700 10px 'DM Sans', sans-serif;
  letter-spacing: .16em;
}
.nav-section-label:not(:first-child) { margin-top: 25px; }
.nav-link {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 11px;
  color: #98a2b3;
  font-size: 13px;
  font-weight: 500;
}
.nav-link > span:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-icon { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; color: currentColor; }
.nav-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-icon svg rect { fill: none; }
.nav-link:hover { background: #151f31; color: #f2f4f7; }
.nav-link.active { background: #f1f5ff; color: #175cd3; box-shadow: 0 1px 2px rgba(16,24,40,.06); }
.nav-count { margin-left: auto; min-width: 32px; padding: 3px 8px; background: #d1e0ff; color: #175cd3; font-size: 10px; text-align: center; }
.nav-count-warn { background: #fef0c7; color: #b54708; }
.sidebar-bottom { display: grid; gap: 4px; margin-top: 18px; }
.sidebar-status-card {
  display: grid;
  grid-template-columns: 38px 1fr 22px;
  align-items: center;
  gap: 10px;
  margin: 0 0 15px;
  padding: 15px 13px;
  border: 1px solid #233554;
  border-radius: 14px;
  background: #101c2e;
  color: #fff;
}
.sidebar-status-card > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.sidebar-status-card strong { font: 700 13px 'Manrope', sans-serif; }
.sidebar-status-card small { color: #98a2b3; font-size: 10.5px; line-height: 1.45; }
.status-shield { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: #053321; color: #75e0a7; font-weight: 800; }
.status-check { width: 20px; height: 20px; display: grid; place-items: center; border: 2px solid #067647; border-radius: 50%; color: #17b26a; font-size: 10px; }
.sidebar-status-card.attention { border-color: #5f3d18; background: #291f14; }
.sidebar-status-card.attention .status-shield { background: #4e2d0e; color: #fec84b; }
.sidebar-status-card.attention .status-check { border-color: #b54708; color: #f79009; }

/* Added operational destinations */
.panel-meta { color: #667085; font-size: 11px; }
.vault-panel, .audit-panel, .category-manage-list { padding: 0; overflow: hidden; }
.vault-panel .panel-head, .audit-panel .panel-head, .category-manage-list .panel-head { padding: 20px 22px; border-bottom: 1px solid #e4e7ec; }
.vault-list, .audit-list { display: grid; }
.vault-row, .audit-row {
  width: 100%;
  display: grid;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  border-bottom: 1px solid #eaecf0;
  background: #fff;
  color: #101828;
  text-align: left;
}
.vault-row { grid-template-columns: 48px minmax(180px,1fr) 150px auto; }
.audit-row { grid-template-columns: 38px minmax(180px,1fr) auto; }
.vault-row:last-child, .audit-row:last-child { border-bottom: 0; }
.vault-row:hover, .audit-row:hover { background: #f9fafb; }
.vault-file-icon { width: 42px; height: 48px; display: grid; place-items: center; border: 1px solid #b2ccff; border-radius: 8px; background: #f5f8ff; color: #175cd3; font-size: 9px; font-weight: 800; }
.vault-file-main, .vault-file-meta, .audit-main { min-width: 0; display: grid; gap: 3px; }
.vault-file-main strong, .audit-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vault-file-main small, .vault-file-meta small, .audit-main small, .category-manage-row small { color: #667085; }
.vault-file-meta b { color: #344054; font-size: 10px; letter-spacing: .08em; }
.category-summary { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; margin-bottom: 18px; }
.category-summary .insight-callout { min-height: 145px; }
.category-manage-row { display: grid; grid-template-columns: 12px minmax(170px,1fr) 100px 170px auto; align-items: center; gap: 14px; padding: 15px 22px; border-bottom: 1px solid #eaecf0; }
.category-manage-row:last-child { border-bottom: 0; }
.category-manage-row > span { min-width: 0; display: grid; gap: 3px; }
.category-swatch { width: 10px; height: 34px; border-radius: 999px; background: #528bff; }
.audit-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #ecfdf3; color: #067647; font-weight: 800; }
.audit-entity { padding: 4px 8px; border-radius: 999px; background: #f2f4f7; color: #475467; font-size: 10px; text-transform: uppercase; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.help-card { min-height: 120px; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 14px; padding: 20px; border: 1px solid #e4e7ec; border-radius: 14px; background: #fff; color: #101828; text-align: left; box-shadow: 0 1px 2px rgba(16,24,40,.03); }
.help-card:hover { border-color: #b2ccff; box-shadow: 0 8px 24px rgba(16,24,40,.07); }
.help-card > span:nth-child(2) { display: grid; gap: 5px; }
.help-card small { color: #667085; line-height: 1.5; }
.help-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; background: #eff4ff; color: #175cd3; font-size: 19px; }
.support-note { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.support-note h2 { margin: 8px 0 6px; }
.support-note p { max-width: 650px; margin: 0; color: #667085; }

@media (max-width: 1100px) and (min-width: 701px) {
  .sidebar { width: 258px; padding-inline: 16px; }
  .main { margin-left: 258px; width: calc(100% - 258px); }
  .brand { padding-bottom: 26px; }
  .workspace-switcher { margin-bottom: 25px; }
}
@media (max-width: 760px) {
  .vault-row { grid-template-columns: 42px 1fr auto; padding: 13px 15px; }
  .vault-file-meta { display: none; }
  .category-summary, .help-grid { grid-template-columns: 1fr; }
  .category-manage-row { grid-template-columns: 10px 1fr auto; padding: 14px 15px; }
  .category-manage-row > span:nth-child(3), .category-manage-row > span:nth-child(4) { display: none; }
  .support-note { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 700px) {
  .sidebar { width: min(304px, 88vw); padding: 28px 18px 22px; }
  .main { margin-left: 0; width: 100%; }
  .brand { padding-bottom: 24px; }
  .workspace-switcher { margin-bottom: 26px; }
}
@media (max-height: 820px) and (min-width: 701px) {
  .sidebar { padding-top: 22px; }
  .brand { padding-bottom: 20px; }
  .workspace-switcher { min-height: 64px; margin-bottom: 20px; }
  .nav-link { min-height: 40px; padding-block: 8px; }
  .nav-section-label:not(:first-child) { margin-top: 16px; }
  .sidebar-status-card { padding-block: 11px; }
}

/* 2026 navigation system — compact product identity, clear workflow groups */
.sidebar {
  display: flex;
  flex-direction: column;
  padding: 22px 16px 16px;
  overflow: hidden;
}
.brand {
  min-height: 42px;
  gap: 11px;
  padding: 0 8px 14px;
  font-size: 18px;
  letter-spacing: -.025em;
}
.brand-mark {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 10px;
}
.brand-mark i { width: 5px; height: 18px; }
.brand-mark i:first-child { left: 10px; top: 10px; height: 13px; }
.brand-mark i:last-child { left: 18px; top: 6px; }
.workspace-context-label {
  display: block;
  margin: 2px 10px 7px;
  color: #667085;
  font: 700 9px 'DM Sans', sans-serif;
  letter-spacing: .16em;
}
.workspace-switcher {
  min-height: 56px;
  grid-template-columns: 34px minmax(0, 1fr) 16px;
  gap: 10px;
  margin: 0 0 14px;
  padding: 8px 10px;
  border-color: #293a55;
  border-radius: 11px;
  background: #0f1929;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}
.workspace-switcher:hover,
.workspace-switcher.open { border-color: #49658d; background: #142238; }
.workspace-avatar { width: 34px; height: 34px; border-radius: 9px; font-size: 12px; }
.workspace-switcher .workspace-copy strong { font-size: 12.5px; font-weight: 600; }
.workspace-copy small { color: #a5b4c8; font-size: 10.5px; }
.workspace-switcher .chevron { font-size: 16px; transition: transform .18s ease; }
.workspace-switcher.open .chevron { transform: rotate(180deg); }
.workspace-menu { margin: -7px 0 12px; border-radius: 12px; }
.nav-list {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 0 3px 10px 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #344866 transparent;
}
.nav-section-label { margin: 0 10px 5px; color: #6f8099; font-size: 9px; letter-spacing: .14em; }
.nav-section-label:not(:first-child) { margin-top: 13px; }
.nav-link {
  position: relative;
  min-height: 38px;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  color: #a9b5c7;
  font-size: 12.5px;
  font-weight: 550;
}
.nav-icon { width: 19px; height: 19px; flex-basis: 19px; }
.nav-icon svg { width: 18px; height: 18px; stroke-width: 1.7; }
.nav-link:hover { background: rgba(255,255,255,.055); color: #f7f9fc; }
.nav-link.active {
  background: rgba(45,116,255,.16);
  color: #f8fbff;
  box-shadow: inset 3px 0 0 #528bff, inset 0 0 0 1px rgba(82,139,255,.12);
}
.nav-link:focus-visible,
.workspace-switcher:focus-visible,
.brand:focus-visible { outline: 2px solid #84adff; outline-offset: 2px; }
.nav-count { min-width: 27px; padding: 2px 7px; }
.sidebar-bottom {
  flex: 0 0 auto;
  gap: 2px;
  margin-top: 0;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.sidebar-status-card {
  grid-template-columns: 30px minmax(0,1fr) 18px;
  gap: 9px;
  margin: 0 0 7px;
  padding: 9px 10px;
  border-radius: 10px;
}
.status-shield { width: 30px; height: 30px; border-radius: 8px; }
.sidebar-status-card strong { font-size: 11.5px; }
.sidebar-status-card small { font-size: 9.5px; }
@media (max-width: 700px) {
  .sidebar { width: min(304px, 90vw); padding: 18px 14px 14px; }
  .brand { padding-bottom: 12px; }
  .workspace-switcher { margin-bottom: 12px; }
  .nav-link { min-height: 44px; font-size: 14px; }
  .nav-section-label:not(:first-child) { margin-top: 15px; }
}
@media (max-height: 720px) and (min-width: 701px) {
  .sidebar-status-card { display: none; }
  .workspace-switcher { min-height: 52px; }
}

/* Added operational destinations */
.panel-meta { color: #667085; font-size: 11px; }
.vault-panel, .audit-panel, .category-manage-list { padding: 0; overflow: hidden; }
.vault-panel .panel-head, .audit-panel .panel-head, .category-manage-list .panel-head { padding: 20px 22px; border-bottom: 1px solid #e4e7ec; }
.vault-list, .audit-list { display: grid; }
.vault-row, .audit-row {
  width: 100%;
  display: grid;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  border-bottom: 1px solid #eaecf0;
  background: #fff;
  color: #101828;
  text-align: left;
}
.vault-row { grid-template-columns: 48px minmax(180px,1fr) 150px auto; }
.audit-row { grid-template-columns: 38px minmax(180px,1fr) auto; }
.vault-row:last-child, .audit-row:last-child { border-bottom: 0; }
.vault-row:hover, .audit-row:hover { background: #f9fafb; }
.vault-file-icon { width: 42px; height: 48px; display: grid; place-items: center; border: 1px solid #b2ccff; border-radius: 8px; background: #f5f8ff; color: #175cd3; font-size: 9px; font-weight: 800; }
.vault-file-main, .vault-file-meta, .audit-main { min-width: 0; display: grid; gap: 3px; }
.vault-file-main strong, .audit-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vault-file-main small, .vault-file-meta small, .audit-main small, .category-manage-row small { color: #667085; }
.vault-file-meta b { color: #344054; font-size: 10px; letter-spacing: .08em; }
.category-summary { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; margin-bottom: 18px; }
.category-summary .insight-callout { min-height: 145px; }
.category-manage-row { display: grid; grid-template-columns: 12px minmax(170px,1fr) 100px 170px auto; align-items: center; gap: 14px; padding: 15px 22px; border-bottom: 1px solid #eaecf0; }
.category-manage-row:last-child { border-bottom: 0; }
.category-manage-row > span { min-width: 0; display: grid; gap: 3px; }
.category-swatch { width: 10px; height: 34px; border-radius: 999px; background: #528bff; }
.audit-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #ecfdf3; color: #067647; font-weight: 800; }
.audit-entity { padding: 4px 8px; border-radius: 999px; background: #f2f4f7; color: #475467; font-size: 10px; text-transform: uppercase; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.help-card { min-height: 120px; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 14px; padding: 20px; border: 1px solid #e4e7ec; border-radius: 14px; background: #fff; color: #101828; text-align: left; box-shadow: 0 1px 2px rgba(16,24,40,.03); }
.help-card:hover { border-color: #b2ccff; box-shadow: 0 8px 24px rgba(16,24,40,.07); }
.help-card > span:nth-child(2) { display: grid; gap: 5px; }
.help-card small { color: #667085; line-height: 1.5; }
.help-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; background: #eff4ff; color: #175cd3; font-size: 19px; }
.support-note { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.support-note h2 { margin: 8px 0 6px; }
.support-note p { max-width: 650px; margin: 0; color: #667085; }

/* Focused Spending view */
.spending-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; color: #667085; font-size: 12px; }
.spending-toolbar .period-filter { margin: 0; }
.spending-focus { display: flex; align-items: end; justify-content: space-between; gap: 30px; min-height: 210px; margin-bottom: 18px; padding: 34px 38px; overflow: hidden; border: 1px solid #1d2939; border-radius: 18px; background: radial-gradient(circle at 85% 15%, rgba(82,139,255,.25), transparent 32%), #101828; color: #fff; box-shadow: 0 12px 32px rgba(16,24,40,.12); }
.spending-focus .kicker { color: #84adff; }
.spending-focus h2 { margin: 12px 0 10px; color: #fff; font: 700 clamp(42px, 6vw, 70px)/.96 'Manrope', sans-serif; letter-spacing: -.055em; }
.spending-focus p { max-width: 560px; margin: 0; color: #b9c2d0; font-size: 14px; }
.spending-facts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.spending-facts span { min-width: 122px; padding: 13px 15px; border: 1px solid rgba(255,255,255,.13); border-radius: 11px; background: rgba(255,255,255,.06); color: #d0d5dd; font-size: 11px; }
.spending-facts b { display: block; margin-bottom: 3px; color: #fff; font: 700 18px 'Manrope', sans-serif; }
.spending-trend-panel { margin-bottom: 18px; overflow-x: auto; }
.spending-trend-panel .panel-head > div, .spending-breakdown .panel-head > div, .attention-panel .panel-head > div { display: grid; gap: 4px; }
.spending-trend-panel .panel-head p, .spending-breakdown .panel-head p, .attention-panel .panel-head p { margin: 0; color: #667085; font-size: 11px; }
.spend-trend { min-width: 650px; height: 235px; display: grid; grid-template-columns: repeat(12, minmax(34px, 1fr)); align-items: end; gap: 8px; padding-top: 22px; }
.spend-month { min-width: 0; height: 205px; display: grid; grid-template-rows: 24px 1fr 20px; gap: 7px; align-items: end; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #667085; font-size: 10px; text-align: center; }
.spend-month-value { overflow: hidden; color: #667085; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; opacity: 0; transition: opacity .15s ease; }
.spend-month:hover .spend-month-value, .spend-month:focus-visible .spend-month-value, .spend-month.active .spend-month-value { opacity: 1; }
.spend-column { height: 145px; display: flex; align-items: end; justify-content: center; border-bottom: 1px solid #eaecf0; }
.spend-column i { width: min(26px, 72%); min-height: 2px; border-radius: 6px 6px 2px 2px; background: #b2ccff; transition: height .2s ease, background .15s ease; }
.spend-month:hover .spend-column i, .spend-month:focus-visible .spend-column i { background: #84adff; }
.spend-month.active .spend-column i { background: #175cd3; }
.spend-month.active b { color: #175cd3; }
.spending-breakdown { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 18px; margin-bottom: 18px; }
.merchant-list, .attention-list { display: grid; }
.merchant-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid #eaecf0; }
.merchant-row:last-child { border-bottom: 0; }
.merchant-rank { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: #f2f4f7; color: #667085; font-size: 10px; font-weight: 700; }
.merchant-row > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.merchant-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.merchant-row small { color: #667085; }
.merchant-row > b { color: #344054; font-size: 12px; }
.attention-panel { padding-bottom: 8px; }
.attention-row { width: 100%; min-height: 64px; display: grid; grid-template-columns: 36px minmax(0,1fr) auto; align-items: center; gap: 13px; padding: 11px 0; border: 0; border-top: 1px solid #eaecf0; background: transparent; color: #101828; text-align: left; }
.attention-row:hover { background: #f9fafb; }
.attention-row > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.attention-row small { color: #667085; }
.attention-row > b { color: #175cd3; font-size: 11px; }
.attention-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; font-weight: 800; }
.attention-mark.warning { background: #fffaeb; color: #b54708; }
.attention-mark.danger { background: #fef3f2; color: #b42318; }
.attention-clear { display: flex; align-items: center; gap: 14px; min-height: 88px; border-top: 1px solid #eaecf0; }
.attention-clear > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #ecfdf3; color: #067647; font-weight: 800; }
.attention-clear strong { display: block; margin-bottom: 4px; }
.attention-clear p { margin: 0; color: #667085; }


/* Recovered focused-Spending and restored-destination responsive rules. */
@media (max-width: 1024px) {
  body.nav-open { overflow: hidden; }
  .sidebar { z-index: 40; width: min(88vw, 320px); padding-top: max(76px, calc(env(safe-area-inset-top) + 64px)); transform: translateX(-102%); box-shadow: 20px 0 50px rgba(0,0,0,.3); }
  .sidebar.open, .sidebar[data-open='true'] { transform: translateX(0); }
  .nav-close, .mobile-menu { display: inline-grid; }
  .main { width: 100%; margin-left: 0; margin-inline-start: 0; }
  .topbar { min-height: 68px; padding-inline: 12px; }
  .mobile-menu { margin-inline-end: 4px; background: transparent; color: #101828; }
  .spending-toolbar { align-items: stretch; flex-direction: column; gap: 10px; }
  .spending-toolbar .period-filter { width: 100%; grid-template-columns: 1fr 1fr; }
  .spending-focus { min-height: 0; align-items: flex-start; flex-direction: column; padding: 27px 24px; }
  .spending-focus h2 { font-size: clamp(42px, 13vw, 58px); }
  .spending-facts { width: 100%; justify-content: flex-start; }
  .spending-facts span { flex: 1; }
  .spending-breakdown { grid-template-columns: 1fr; }
  .spending-trend-panel { padding-inline: 16px; }
  .spend-trend { min-width: 0; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; }
  .spend-month { font-size: 8.5px; }
  .spend-column i { width: min(18px, 76%); }
  .vault-row { grid-template-columns: 42px 1fr auto; padding: 13px 15px; }
  .vault-file-meta { display: none; }
  .category-summary, .help-grid { grid-template-columns: 1fr; }
  .category-manage-row { grid-template-columns: 10px 1fr auto; padding: 14px 15px; }
  .category-manage-row > span:nth-child(3), .category-manage-row > span:nth-child(4) { display: none; }
  .support-note { align-items: flex-start; flex-direction: column; }
}
