/* ============================================================================
   Complete — Unified farm management design system
   Clear Creek Pastoral Co
   ============================================================================ */

:root {
  --paper: #FAFAFA;
  --paper-alt: #F4F4F5;
  --card: #FFFFFF;
  --ink: #0A0A0A;
  --ink-2: #18181B;
  --soft: #3F3F46;
  --muted: #71717A;
  --faint: #A1A1AA;
  --border: #E4E4E7;
  --border-light: #F4F4F5;
  --accent: #0E2E20;
  --accent-soft: #E8F0EB;
  --accent-dark: #051811;
  --accent-glow: rgba(14,46,32,0.08);
  --bronze: #B07A30;
  --bronze-soft: #FAF1E0;
  --warn: #B45309;
  --warn-soft: #FEF3C7;
  --error: #B91C1C;
  --error-soft: #FEE2E2;
  --info: #1E40AF;
  --info-soft: #DBEAFE;
  --green: #059669;
  --green-soft: #D1FAE5;
  --font-body: "Inter Tight", "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Inter Tight", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.02);
  --shadow-pop: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-modal: 0 20px 60px rgba(0,0,0,0.18), 0 8px 16px rgba(0,0,0,0.08);
  --sidebar-width: 260px;
  --sidebar-bg: #0E2E20;
  --sidebar-bg-2: #143A2C;
  --sidebar-text: rgba(255,255,255,0.65);
  --sidebar-text-hover: #FFFFFF;
  --sidebar-text-active: #FFFFFF;
  --sidebar-active-bg: rgba(255,255,255,0.08);
  --sidebar-border: rgba(255,255,255,0.10);
  --sidebar-section: rgba(255,255,255,0.45);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.005em;
}

/* ═══════════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════════ */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-width); height: 100vh;
  background: linear-gradient(180deg, #0d2a1f 0%, #0e2e20 50%, #143a2c 100%);
  color: var(--sidebar-text);
  display: flex; flex-direction: column;
  z-index: 50;
  border-right: 1px solid var(--sidebar-border);
  font-family: var(--font-body);
}
.sb-header { padding: 22px 20px 18px; border-bottom: 1px solid var(--sidebar-border); }
.sb-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--sidebar-text-active);
}
.sb-wordmark {
  font-size: 20px; font-weight: 800; letter-spacing: -0.03em;
}
.hq-badge {
  font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(74,222,128,0.15); color: #4ADE80;
  padding: 3px 8px; border-radius: 4px;
}

.sb-farm {
  margin: 14px 12px 6px; padding: 10px 12px;
  background: transparent;
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius);
  color: var(--sidebar-text-active);
  font-size: 13px; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  font-weight: 500; width: calc(100% - 24px);
  text-align: left; font-family: inherit;
  transition: all 0.15s;
}
.sb-farm:hover { background: var(--sidebar-bg-2); }
.sb-farm .pip { width: 6px; height: 6px; border-radius: 50%; background: #4ADE80; flex-shrink: 0; }
.sb-farm .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-farm .caret { color: var(--sidebar-text); font-size: 10px; }

.sb-nav { flex: 1; overflow-y: auto; padding: 8px 0 14px; }
.sb-nav::-webkit-scrollbar { width: 4px; }
.sb-nav::-webkit-scrollbar-thumb { background: var(--sidebar-border); border-radius: 2px; }

.sb-section {
  padding: 16px 20px 4px;
  font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--sidebar-section);
  font-weight: 600;
}
.sb-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 18px; margin: 1px 8px;
  color: var(--sidebar-text);
  text-decoration: none; font-size: 13px; font-weight: 500;
  border-radius: 6px; transition: all 0.12s;
}
.sb-link:hover { background: var(--sidebar-bg-2); color: var(--sidebar-text-hover); }
.sb-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text-active);
  font-weight: 600;
  padding-left: 6px;
}
.sb-link.active::before {
  content: ""; width: 3px; height: 14px;
  background: #4ADE80; border-radius: 2px;
  margin-right: 9px;
}
.sb-link:not(.active) { padding-left: 18px; }
.sb-icon { width: 16px; height: 16px; opacity: 0.7; flex-shrink: 0; }
.sb-link.active .sb-icon { opacity: 1; }
.badge-count {
  margin-left: auto;
  font-size: 10px; font-weight: 700;
  background: rgba(245,158,11,0.2); color: #FBBF24;
  padding: 1px 7px; border-radius: 999px;
}
.sb-tag {
  font-size: 8.5px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--sidebar-section);
  margin-left: auto; opacity: 0;
  transition: opacity 0.15s;
}
.sb-link:hover .sb-tag { opacity: 1; }

.sb-footer {
  padding: 14px 16px 18px;
  border-top: 1px solid var(--sidebar-border);
  display: flex; align-items: center; gap: 10px; font-size: 12.5px;
}
.sb-footer .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #4ADE80);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 11.5px; font-weight: 600;
}
.sb-footer .info { flex: 1; min-width: 0; }
.sb-footer .name { color: var(--sidebar-text-active); font-weight: 500; font-size: 12.5px; }
.sb-footer .email { color: var(--sidebar-text); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Mobile */
.mobile-toggle {
  display: none; position: fixed; top: 14px; left: 14px; z-index: 60;
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--card); border: 1px solid var(--border);
  cursor: pointer; align-items: center; justify-content: center;
  box-shadow: var(--shadow-card);
}
.mobile-toggle svg { width: 18px; height: 18px; color: var(--ink); }
.mobile-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.4); z-index: 49; backdrop-filter: blur(2px);
}

@media (max-width: 900px) {
  .main { margin-left: 0 !important; padding-top: 60px !important; }
  .sidebar { transform: translateX(-100%); transition: transform 0.25s cubic-bezier(0.2,0,0,1); width: 280px; }
  .sidebar.open { transform: translateX(0); }
  .mobile-toggle { display: inline-flex; }
  .mobile-backdrop.open { display: block; }
}

/* ═══════════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════════ */
.main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: 28px 32px 80px;
}
.main-inner { max-width: 1320px; margin: 0 auto; }

/* ── Hero ──────────────────────────────────────────────────────── */
.hero {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-bottom: 22px; flex-wrap: wrap;
}
.hero h1 {
  font-family: var(--font-display); font-weight: 700; font-size: 28px;
  margin: 0 0 2px; letter-spacing: -0.02em; color: var(--ink-2);
}
.hero .meta {
  font-size: 13px; color: var(--soft); margin: 0;
  display: flex; gap: 16px; align-items: center;
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  animation: live-pulse 2.4s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(5,150,105,0.4); }
  50% { opacity: 0.6; box-shadow: 0 0 0 4px rgba(5,150,105,0); }
}
.hero-actions { display: flex; gap: 10px; }

/* ── Buttons ───────────────────────────────────────────────────── */
.btn-sm {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 7px;
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  text-decoration: none; cursor: pointer; border: none;
  transition: all 0.12s;
}
.btn-sm.primary { background: var(--accent); color: #fff; }
.btn-sm.primary:hover { background: var(--accent-dark); }
.btn-sm.secondary { background: var(--card); color: var(--soft); border: 1px solid var(--border); }
.btn-sm.secondary:hover { border-color: var(--accent); color: var(--ink); }

/* ── Weather bar ───────────────────────────────────────────────── */
.weather-bar {
  display: flex; align-items: center; gap: 20px;
  background: var(--card); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 12px 18px;
  margin-bottom: 18px; font-size: 13px;
  box-shadow: var(--shadow-card); overflow-x: auto;
}
.w-item { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.w-icon { font-size: 18px; }
.w-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.w-val { font-weight: 600; color: var(--ink); }
.w-val.good { color: var(--green); }
.w-val.warn { color: var(--warn); }
.w-divider { width: 1px; height: 24px; background: var(--border); flex-shrink: 0; }
.w-forecast { margin-left: auto; display: flex; gap: 12px; }
.w-day { text-align: center; font-size: 11px; color: var(--muted); }
.w-day .temp { font-weight: 600; color: var(--ink); font-size: 12px; }
.w-day .rain { color: var(--info); font-size: 10px; }
@media (max-width: 800px) { .w-forecast { display: none; } .w-divider:last-of-type { display: none; } }

/* ── Financial strip ───────────────────────────────────────────── */
.fin-strip {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 14px; margin-bottom: 20px;
}
@media (max-width: 1100px) { .fin-strip { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .fin-strip { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .fin-strip { grid-template-columns: 1fr; } }

.fin-card {
  background: var(--card); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 18px 20px;
  box-shadow: var(--shadow-card); transition: all 0.2s;
  cursor: pointer; text-decoration: none; color: inherit; display: block;
}
.fin-card:hover { box-shadow: var(--shadow-pop); transform: translateY(-1px); }
.fin-card.highlight {
  background: linear-gradient(135deg, var(--card) 0%, var(--accent-soft) 100%);
  border-color: color-mix(in oklab, var(--accent) 20%, var(--border-light));
}
.fc-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 600; margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.source-dot { width: 5px; height: 5px; border-radius: 50%; display: inline-block; }
.fc-value {
  font-family: var(--font-display); font-size: 28px; font-weight: 700;
  color: var(--ink); line-height: 1; letter-spacing: -0.02em;
}
.fin-card.highlight .fc-value { font-size: 32px; }
.fc-sub { margin-top: 6px; font-size: 12px; color: var(--soft); display: flex; align-items: center; gap: 8px; }

.trend-pill {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
}
.trend-up { background: var(--green-soft); color: var(--green); }
.trend-down { background: var(--error-soft); color: var(--error); }
.trend-flat { background: var(--paper-alt); color: var(--muted); }

/* ── Grid layouts ──────────────────────────────────────────────── */
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 20px; }
@media (max-width: 1000px) { .grid-3, .grid-2-1 { grid-template-columns: 1fr; } }

/* ── Card ──────────────────────────────────────────────────────── */
.cd {
  background: var(--card); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 20px 22px;
  box-shadow: var(--shadow-card);
}
.cd-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.cd-header h2 {
  font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--muted); margin: 0;
  display: flex; align-items: center; gap: 8px;
}
.platform-badge {
  font-size: 8px; letter-spacing: 0.08em; padding: 2px 6px;
  border-radius: 3px; font-weight: 700; text-transform: uppercase;
}
.badge-genemap { background: var(--accent-soft); color: var(--accent); }
.badge-farmos { background: #DBEAFE; color: #1E40AF; }
.badge-rationos { background: #FEF3C7; color: #92400E; }
.badge-paddockos { background: #D1FAE5; color: #065F46; }
.cd-link { font-size: 11.5px; color: var(--accent); text-decoration: none; font-weight: 500; }
.cd-link:hover { text-decoration: underline; }

/* ── AI card ───────────────────────────────────────────────────── */
.ai-card {
  background: linear-gradient(135deg, #0E2E20 0%, #1a4a35 100%);
  border: 1px solid rgba(74,222,128,0.15);
  border-radius: var(--radius-lg); padding: 22px 24px;
  color: #fff; box-shadow: var(--shadow-pop);
}
.ai-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.ai-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(74,222,128,0.15);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.ai-header h2 { font-size: 14px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.ai-powered { font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: #4ADE80; font-weight: 700; }
.ai-insight { font-size: 13.5px; line-height: 1.6; color: rgba(255,255,255,0.88); margin-bottom: 14px; }
.ai-insight strong { color: #fff; font-weight: 600; }
.ai-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-btn {
  padding: 7px 14px; border-radius: 6px; font-size: 12px; font-weight: 600;
  border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.08);
  color: #fff; cursor: pointer; transition: all 0.12s;
  text-decoration: none; font-family: inherit;
}
.ai-btn:hover { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.3); }
.ai-btn-primary { background: #4ADE80; color: #0E2E20; border-color: #4ADE80; }
.ai-btn-primary:hover { background: #86EFAC; }
.ai-ask-row { margin-top: 14px; display: flex; gap: 8px; }
.ai-ask-input {
  flex: 1; padding: 9px 14px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: #fff; font-family: inherit; font-size: 13px; outline: none;
}
.ai-ask-input::placeholder { color: rgba(255,255,255,0.35); }
.ai-ask-input:focus { border-color: #4ADE80; background: rgba(255,255,255,0.1); }
.ai-ask-send {
  padding: 9px 16px; border-radius: 8px;
  background: #4ADE80; color: #0E2E20;
  border: none; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.ai-ask-send:hover { background: #86EFAC; }

/* ── Cashflow bars ─────────────────────────────────────────────── */
.cf-bars { display: flex; gap: 3px; height: 170px; padding-top: 10px; align-items: flex-end; }
.cf-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.cf-pair { display: flex; gap: 2px; width: 100%; align-items: flex-end; flex: 1; }
.cf-bar { flex: 1; border-radius: 3px 3px 0 0; min-height: 2px; transition: height 0.4s ease; }
.cf-bar.income { background: var(--accent); opacity: 0.75; }
.cf-bar.expense { background: var(--error); opacity: 0.45; }
.cf-month { font-size: 10px; color: var(--muted); font-family: var(--font-mono); text-transform: uppercase; }
.cf-month.cf-warn { color: var(--warn); font-weight: 700; }
.cf-legend { display: flex; gap: 16px; margin-top: 10px; font-size: 11px; color: var(--muted); align-items: center; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.cf-alert { margin-left: auto; font-weight: 600; color: var(--warn); }

/* ── Stock table ───────────────────────────────────────────────── */
.stock-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.stock-table th {
  text-align: left; font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted); font-weight: 600;
  padding: 6px 10px; border-bottom: 1px solid var(--border);
}
.stock-table th.r { text-align: right; }
.stock-table td { padding: 10px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
.stock-table tr:hover { background: var(--paper); }
.ent { font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.ent-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.num { font-family: var(--font-mono); text-align: right; font-variant-numeric: tabular-nums; }
.num.pos { color: var(--green); }
.num.neg { color: var(--error); }
.num.mute { color: var(--muted); }

/* ── Feed balance ──────────────────────────────────────────────── */
.feed-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.feed-item:last-child { border-bottom: 0; }
.feed-gauge {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; font-family: var(--font-mono); flex-shrink: 0;
}
.gauge-good { background: var(--green-soft); color: var(--green); }
.gauge-ok { background: var(--accent-soft); color: var(--accent); }
.gauge-tight { background: var(--warn-soft); color: var(--warn); }
.gauge-critical { background: var(--error-soft); color: var(--error); }
.feed-detail { flex: 1; min-width: 0; }
.fd-name { font-weight: 600; font-size: 13px; }
.fd-sub { font-size: 12px; color: var(--muted); }
.fd-bar { height: 4px; background: var(--border-light); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.fd-fill { height: 100%; border-radius: 2px; }
.fill-good { background: var(--green); }
.fill-ok { background: var(--accent); }
.fill-tight { background: var(--warn); }
.fill-critical { background: var(--error); }

/* ── Paddock grid ──────────────────────────────────────────────── */
.paddock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 6px; }
.pc {
  aspect-ratio: 1.4; border-radius: 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; cursor: pointer; transition: all 0.12s;
  border: 1px solid transparent;
}
.pc:hover { transform: scale(1.05); border-color: var(--ink); }
.p-name { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.p-head { font-family: var(--font-mono); font-size: 12px; font-weight: 700; }
.p-dse { font-size: 8px; opacity: 0.7; }
.pc-lush { background: #D1FAE5; color: #065F46; }
.pc-good { background: #E8F0EB; color: #0E2E20; }
.pc-dry { background: #FEF3C7; color: #92400E; }
.pc-bare { background: #FEE2E2; color: #991B1B; }
.pc-rest { background: var(--paper-alt); color: var(--muted); border: 1px dashed var(--border); }
.paddock-legend { display: flex; gap: 12px; margin-top: 10px; font-size: 10px; color: var(--muted); }

/* ── Genetic merit ─────────────────────────────────────────────── */
.merit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 600px) { .merit-grid { grid-template-columns: 1fr; } }
.merit-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-bottom: 8px; }
.merit-value { font-family: var(--font-display); font-size: 32px; font-weight: 700; color: var(--ink); line-height: 1; margin-bottom: 8px; }
.merit-unit { font-size: 12px; color: var(--muted); font-weight: 400; }
.merit-detail { font-size: 12px; color: var(--soft); line-height: 1.6; margin-top: 10px; }

/* ── Timeline ──────────────────────────────────────────────────── */
.tl-item { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border-light); font-size: 12.5px; }
.tl-item:last-child { border-bottom: 0; }
.tl-icon {
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.tl-fin { background: #DBEAFE; color: #1E40AF; }
.tl-gen { background: var(--accent-soft); color: var(--accent); }
.tl-feed { background: #FEF3C7; color: #92400E; }
.tl-pad { background: #D1FAE5; color: #065F46; }
.tl-weather { background: #E0E7FF; color: #3730A3; }
.tl-text { color: var(--ink); line-height: 1.4; }
.tl-meta { color: var(--muted); font-size: 11px; }
.tl-when { color: var(--faint); font-family: var(--font-mono); font-size: 10.5px; align-self: center; }

/* ── Quick actions ─────────────────────────────────────────────── */
.quick-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.qa {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 10px;
  background: var(--card); border: 1px solid var(--border-light);
  border-radius: var(--radius); text-decoration: none; color: var(--ink);
  font-size: 11.5px; font-weight: 600; text-align: center;
  transition: all 0.15s; cursor: pointer;
}
.qa:hover { border-color: var(--accent); background: var(--accent-soft); }
.qa-icon { font-size: 20px; }

/* ── Footer ────────────────────────────────────────────────────── */
.site-footer {
  text-align: center; font-size: 11.5px; color: var(--muted);
  padding: 24px 0; margin-top: 40px;
  border-top: 1px solid var(--border-light);
  display: flex; justify-content: center; gap: 8px; flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════════════════════════════════ */
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0A0A0A; --paper-alt: #18181B; --card: #141416;
    --ink: #FAFAFA; --ink-2: #F4F4F5;
    --soft: #A1A1AA; --muted: #71717A; --faint: #52525B;
    --border: #27272A; --border-light: #1E1E22;
    --accent: #4ADE80; --accent-soft: rgba(74,222,128,0.10);
    --accent-dark: #86EFAC; --accent-glow: rgba(74,222,128,0.12);
    --green: #34D399; --green-soft: rgba(52,211,153,0.12);
    --warn: #F59E0B; --warn-soft: rgba(245,158,11,0.12);
    --error: #EF4444; --error-soft: rgba(239,68,68,0.12);
    --info: #60A5FA; --info-soft: rgba(96,165,250,0.12);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-pop: 0 4px 12px rgba(0,0,0,0.4);
  }
  .fin-card.highlight { background: linear-gradient(135deg, var(--card) 0%, rgba(74,222,128,0.06) 100%); }
  .ai-card { border-color: rgba(74,222,128,0.2); }
}

/* ═══════════════════════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════════════════════ */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
