/* ============================================================
   Design System
   ============================================================ */
:root {
  --font: 'Inter', system-ui, -apple-system, sans-serif;

  /* Palette */
  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  --blue-50:  #eff6ff;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;

  --green-50:  #f0fdf4;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-100: #dcfce7;

  --red-50:  #fef2f2;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --red-100: #fee2e2;

  --amber-50:  #fffbeb;
  --amber-500: #f59e0b;
  --amber-100: #fef3c7;

  --purple-500: #8b5cf6;
  --purple-100: #ede9fe;
  --indigo-500: #6366f1;

  /* Semantic */
  --bg:           var(--gray-50);
  --surface:      #ffffff;
  --surface-2:    var(--gray-100);
  --border:       var(--gray-200);
  --border-strong:var(--gray-300);
  --text:         var(--gray-900);
  --text-muted:   var(--gray-500);
  --text-subtle:  var(--gray-400);
  --accent:       var(--blue-600);
  --accent-hover: var(--blue-700);

  --income:    var(--green-600);
  --income-bg: var(--green-50);
  --expense:   var(--red-600);
  --expense-bg:var(--red-50);

  /* Spacing */
  --sp-1: 0.25rem; --sp-2: 0.5rem; --sp-3: 0.75rem; --sp-4: 1rem;
  --sp-5: 1.25rem; --sp-6: 1.5rem; --sp-8: 2rem; --sp-10: 2.5rem;
  --sp-12: 3rem;

  /* Radius */
  --r-sm:   0.375rem; --r-md: 0.5rem; --r-lg: 0.75rem;
  --r-xl:   1rem;     --r-2xl: 1.25rem; --r-full: 9999px;

  /* Shadow */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 24px -3px rgba(0,0,0,.1), 0 4px 8px -4px rgba(0,0,0,.06);
  --shadow-xl: 0 20px 40px -8px rgba(0,0,0,.14), 0 8px 16px -8px rgba(0,0,0,.08);

  --sidebar-w: 256px;
  --header-h:  56px;
}

/* ============================================================
   Dark mode overrides
   ============================================================ */
[data-theme="dark"] {
  --bg:            #0f1117;
  --surface:       #1a1d27;
  --surface-2:     #22263a;
  --border:        #2a2f45;
  --border-strong: #363c58;
  --text:          #e8eaf0;
  --text-muted:    #8b91a8;
  --text-subtle:   #555d7a;
  --accent:        #4f8ef7;
  --accent-hover:  #3a7ef0;

  --income:    #34d27a;
  --income-bg: rgba(52,210,122,.1);
  --expense:   #f96b6b;
  --expense-bg:rgba(249,107,107,.1);

  --blue-50:   rgba(79,142,247,.12);
  --blue-600:  #4f8ef7;
  --blue-700:  #3a7ef0;
  --green-50:  rgba(52,210,122,.1);
  --green-100: rgba(52,210,122,.15);
  --green-600: #34d27a;
  --red-50:    rgba(249,107,107,.1);
  --red-100:   rgba(249,107,107,.15);
  --red-600:   #f96b6b;
  --amber-100: rgba(251,191,36,.15);
  --amber-500: #fbbf24;
  --purple-100:rgba(139,92,246,.15);
  --purple-500:#a78bfa;
  --gray-50:   #1a1d27;
  --gray-100:  #22263a;
  --gray-200:  #2a2f45;
  --gray-300:  #363c58;
  --gray-400:  #555d7a;
  --gray-500:  #8b91a8;
  --gray-600:  #b0b7d0;
  --gray-700:  #cdd2e8;
  --gray-800:  #e0e4f0;
  --gray-900:  #e8eaf0;

  --shadow-xs: 0 1px 3px rgba(0,0,0,.4);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.5);
  --shadow-md: 0 4px 12px rgba(0,0,0,.4);
  --shadow-lg: 0 10px 28px rgba(0,0,0,.5);
  --shadow-xl: 0 20px 50px rgba(0,0,0,.6);
}

/* Dark mode toggle button */
.theme-toggle {
  width: 32px; height: 32px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--gray-100);
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  transition: all 0.15s;
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--gray-200); color: var(--text); }

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   Layout
   ============================================================ */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--header-h) 1fr;
  min-height: 100vh;
}

/* ============================================================
   Header
   ============================================================ */
.header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: 0 var(--sp-6);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
}

.header__brand { font-weight: 700; font-size: 1rem; letter-spacing: -0.02em; color: var(--text); white-space: nowrap; }
.header__brand span { color: var(--accent); }
.header__spacer { flex: 1; }

.header__period {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  background: var(--gray-100);
  border-radius: var(--r-full);
  padding: var(--sp-1);
}

.period-btn {
  padding: 0.3rem 0.9rem;
  border: none;
  background: transparent;
  border-radius: var(--r-full);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.period-btn:hover { color: var(--text); }
.period-btn--active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }

.header__user { display: flex; align-items: center; gap: var(--sp-2); font-size: 0.85rem; color: var(--text-muted); }

.header__avatar {
  width: 30px; height: 30px;
  border-radius: var(--r-full);
  background: var(--blue-600);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.75rem; flex-shrink: 0;
}

.header__logout {
  font-size: 0.8rem; color: var(--text-muted);
  padding: 0.25rem 0.6rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: none; cursor: pointer;
  text-decoration: none; transition: all 0.15s;
}
.header__logout:hover { background: var(--gray-100); color: var(--text); text-decoration: none; }

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: var(--sp-5) 0;
  overflow-y: auto;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
}

.sidebar__nav { padding: 0 var(--sp-3); }

.sidebar__section-label {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-subtle);
  padding: var(--sp-4) var(--sp-3) var(--sp-2);
}

.nav-link {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  color: var(--text-muted); font-size: 0.875rem; font-weight: 500;
  text-decoration: none; transition: all 0.15s; margin-bottom: 2px;
}
.nav-link:hover { background: var(--gray-100); color: var(--text); text-decoration: none; }
.nav-link--active { background: var(--blue-50); color: var(--blue-600); }
.nav-link--active:hover { background: var(--blue-50); color: var(--blue-600); }
.nav-link__icon { width: 18px; height: 18px; opacity: 0.7; flex-shrink: 0; }
.nav-link--active .nav-link__icon { opacity: 1; }

.sidebar__summary {
  margin: var(--sp-5) var(--sp-3) 0;
  border-top: 1px solid var(--border);
  padding-top: var(--sp-4);
}

.sidebar__summary-title {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-subtle);
  margin-bottom: var(--sp-3); padding: 0 var(--sp-1);
}

.summary-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-2) var(--sp-1); border-radius: var(--r-sm);
}
.summary-row__label { font-size: 0.8rem; color: var(--text-muted); }
.summary-row__value { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.summary-row__value--income { color: var(--income); }
.summary-row__value--expense { color: var(--expense); }
.summary-row--net { margin-top: var(--sp-2); border-top: 1px solid var(--border); padding-top: var(--sp-3); }
.summary-row--net .summary-row__label { font-weight: 600; color: var(--text); }
.summary-row--net .summary-row__value { font-size: 0.95rem; }

/* ============================================================
   Main content
   ============================================================ */
.main { padding: var(--sp-8); overflow-y: auto; }

.page-header { display: flex; align-items: center; gap: var(--sp-4); margin-bottom: var(--sp-6); }
.page-title { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text); flex: 1; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: 0.5rem 1rem; border: none;
  border-radius: var(--r-md); font-family: var(--font);
  font-size: 0.875rem; font-weight: 500; cursor: pointer;
  transition: all 0.15s; white-space: nowrap; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); }
.btn--secondary { background: var(--gray-100); color: var(--text); border: 1px solid var(--border); }
.btn--secondary:hover { background: var(--gray-200); }
.btn--ghost { background: transparent; color: var(--text-muted); border: 1px solid transparent; }
.btn--ghost:hover { background: var(--gray-100); color: var(--text); border-color: var(--border); }
.btn--danger { color: var(--red-600); }
.btn--danger:hover { background: var(--red-50); border-color: var(--red-100); }
.btn--sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn--xs { padding: 0.2rem 0.55rem; font-size: 0.75rem; border-radius: var(--r-sm); }

/* ============================================================
   Forms
   ============================================================ */
.form-field { display: flex; flex-direction: column; gap: var(--sp-1); }
.form-label { font-size: 0.8rem; font-weight: 500; color: var(--text-muted); }

.form-input, .form-select, .form-textarea {
  width: 100%; padding: 0.55rem 0.75rem;
  border: 1px solid var(--border); border-radius: var(--r-md);
  font-family: var(--font); font-size: 0.875rem; color: var(--text);
  background: var(--surface); transition: border-color 0.15s, box-shadow 0.15s;
  outline: none; appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.form-textarea { resize: vertical; min-height: 70px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }

/* ============================================================
   Modals
   ============================================================ */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 200;
  align-items: center; justify-content: center;
  padding: var(--sp-4); backdrop-filter: blur(3px);
}
.modal-overlay--open { display: flex; }

.modal {
  background: var(--surface); border-radius: var(--r-xl);
  width: 100%; max-width: 480px;
  box-shadow: var(--shadow-xl);
  max-height: 90vh; display: flex; flex-direction: column; overflow: hidden;
}
.modal--lg { max-width: 600px; }

.modal__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-5) var(--sp-6); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.modal__title { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.modal__close {
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  border: none; background: var(--gray-100); border-radius: var(--r-full);
  cursor: pointer; color: var(--text-muted); font-size: 0.9rem; transition: all 0.15s;
}
.modal__close:hover { background: var(--gray-200); color: var(--text); }

.modal__body {
  padding: var(--sp-5) var(--sp-6); display: flex; flex-direction: column;
  gap: var(--sp-4); overflow-y: auto;
}
.modal__footer {
  display: flex; justify-content: flex-end; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--border);
  flex-shrink: 0; background: var(--gray-50);
}

/* ============================================================
   Budget sections
   ============================================================ */
.budget-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); overflow: hidden; margin-bottom: var(--sp-4);
  box-shadow: var(--shadow-xs);
}

.budget-section__header {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border);
  background: var(--gray-50);
}

.budget-section__color { width: 10px; height: 10px; border-radius: var(--r-full); flex-shrink: 0; }
.budget-section__title { font-size: 0.9rem; font-weight: 600; color: var(--text); flex: 1; }
.budget-section__total { font-size: 0.95rem; font-weight: 700; letter-spacing: -0.01em; }
.budget-section__total--income { color: var(--income); }
.budget-section__total--expense { color: var(--expense); }
.budget-section__items { padding: var(--sp-2) 0; }

.budget-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5); transition: background 0.1s;
}
.budget-item:hover { background: var(--gray-50); }
.budget-item + .budget-item { border-top: 1px solid var(--gray-100); }
.budget-item--excluded { opacity: 0.45; }

.budget-item__check { display: flex; align-items: center; flex-shrink: 0; }
.budget-item__check input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.budget-item__name { font-size: 0.875rem; font-weight: 500; color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.budget-item__notes { font-size: 0.75rem; color: var(--text-subtle); cursor: default; flex-shrink: 0; padding: 0 var(--sp-1); }
.budget-item__period { font-size: 0.75rem; color: var(--text-muted); background: var(--gray-100); padding: 0.15rem 0.5rem; border-radius: var(--r-full); flex-shrink: 0; }
.budget-item__amount { font-size: 0.9rem; font-weight: 600; min-width: 90px; text-align: right; letter-spacing: -0.01em; flex-shrink: 0; }
.budget-item__amount--income { color: var(--income); }
.budget-item__amount--expense { color: var(--expense); }
.budget-item__actions { display: flex; gap: var(--sp-1); opacity: 0; transition: opacity 0.15s; flex-shrink: 0; }
.budget-item:hover .budget-item__actions { opacity: 1; }

.empty-state {
  text-align: center; padding: var(--sp-12) var(--sp-8);
  color: var(--text-muted); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-xl);
}
.empty-state p { font-size: 0.9rem; margin-top: var(--sp-2); }

/* ============================================================
   Summary cards
   ============================================================ */
.summary-strip { display: grid; gap: var(--sp-4); margin-bottom: var(--sp-6); }
.summary-strip--4 { grid-template-columns: repeat(4, 1fr); }
.summary-strip--5 { grid-template-columns: repeat(5, 1fr); }
.summary-strip--6 { grid-template-columns: repeat(6, 1fr); }

.summary-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: var(--sp-5); box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column; gap: var(--sp-1);
}
.summary-card__label { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.summary-card__value { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.03em; color: var(--text); line-height: 1.2; }
.summary-card__sub { font-size: 0.75rem; color: var(--text-muted); }
.summary-card--income .summary-card__value { color: var(--income); }
.summary-card--expense .summary-card__value { color: var(--expense); }
.summary-card--positive .summary-card__value { color: var(--income); }
.summary-card--negative .summary-card__value { color: var(--expense); }

/* ============================================================
   Charts
   ============================================================ */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); margin-bottom: var(--sp-4); }
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: var(--sp-5); box-shadow: var(--shadow-xs); }
.chart-card--wide { grid-column: 1 / -1; }
.chart-card__title { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); margin-bottom: var(--sp-4); text-transform: uppercase; letter-spacing: 0.05em; }
.chart-wrap { position: relative; height: 220px; display: flex; align-items: center; justify-content: center; }

/* ============================================================
   Property panels
   ============================================================ */
.property-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); overflow: hidden; margin-bottom: var(--sp-4); box-shadow: var(--shadow-xs);
}

.property-panel__header {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  cursor: pointer; user-select: none; transition: background 0.15s;
}
.property-panel__header:hover { background: var(--gray-50); }

.property-panel__dot { width: 10px; height: 10px; border-radius: var(--r-full); background: var(--indigo-500); flex-shrink: 0; }
.property-panel__name { font-size: 0.95rem; font-weight: 600; flex: 1; }
.property-panel__address { font-size: 0.8rem; color: var(--text-muted); }
.property-panel__badges { display: flex; gap: var(--sp-2); flex-shrink: 0; }
.property-panel__chevron { color: var(--text-subtle); flex-shrink: 0; transition: transform 0.2s; font-size: 0.75rem; }
.property-panel--open .property-panel__chevron { transform: rotate(180deg); }
.property-panel__body { display: none; }
.property-panel--open .property-panel__body { display: block; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border-top: 1px solid var(--border); }
.metric-cell { background: var(--gray-50); padding: var(--sp-4) var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-1); }
.metric-cell__label { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.metric-cell__value { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.metric-cell__value--income { color: var(--income); }
.metric-cell__value--expense { color: var(--expense); }
.metric-cell__value--muted { color: var(--text-muted); font-weight: 600; }

.panel-section { border-top: 1px solid var(--border); padding: var(--sp-4) var(--sp-5); }
.panel-section__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-3); }
.panel-section__title { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

.data-row { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--gray-100); font-size: 0.85rem; }
.data-row:last-child { border-bottom: none; }
.data-row__name { flex: 1; color: var(--text); font-weight: 500; }
.data-row__sub { font-size: 0.75rem; color: var(--text-muted); }
.data-row__amount { font-weight: 600; color: var(--expense); min-width: 80px; text-align: right; }
.data-row__amount--income { color: var(--income); }
.data-row__meta { font-size: 0.75rem; color: var(--text-muted); }
.data-row__actions { display: flex; gap: var(--sp-1); opacity: 0; transition: opacity 0.15s; }
.data-row:hover .data-row__actions { opacity: 1; }

/* ============================================================
   Badges
   ============================================================ */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.2rem 0.55rem; border-radius: var(--r-full);
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap;
}
.badge--green  { background: var(--green-100);  color: var(--green-600); }
.badge--red    { background: var(--red-100);     color: var(--red-600); }
.badge--amber  { background: var(--amber-100);   color: var(--amber-500); }
.badge--blue   { background: var(--blue-50);     color: var(--blue-600); }
.badge--purple { background: var(--purple-100);  color: var(--purple-500); }
.badge--gray   { background: var(--gray-100);    color: var(--gray-600); }

/* ============================================================
   Auth pages
   ============================================================ */
.auth-page { min-height: 100vh; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: var(--sp-6); }

/* new class names */
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-2xl); padding: var(--sp-8); width: 100%; max-width: 380px; box-shadow: var(--shadow-lg); }
.auth-card__title { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.03em; margin-bottom: var(--sp-1); }
.auth-card__subtitle { font-size: 0.875rem; color: var(--text-muted); margin-bottom: var(--sp-6); }
.auth-card__form { display: flex; flex-direction: column; gap: var(--sp-4); }
.auth-card__link { text-align: center; font-size: 0.85rem; color: var(--text-muted); margin-top: var(--sp-5); }
.auth-card__error { background: var(--red-50); border: 1px solid var(--red-100); color: var(--red-600); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); font-size: 0.85rem; }

/* legacy class names used in login/register templates */
.auth-container { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: var(--sp-6); }
.auth-title { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.03em; margin-bottom: var(--sp-1); }
.auth-subtitle { font-size: 0.875rem; color: var(--text-muted); margin-bottom: var(--sp-6); }
.auth-form { display: flex; flex-direction: column; gap: var(--sp-4); }
.auth-link { text-align: center; font-size: 0.85rem; color: var(--text-muted); margin-top: var(--sp-5); }
.auth-error { background: var(--red-50); border: 1px solid var(--red-100); color: var(--red-600); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); font-size: 0.85rem; margin-bottom: var(--sp-4); }
.btn--full { width: 100%; justify-content: center; }

/* ============================================================
   Toast
   ============================================================ */
#toast-container { position: fixed; bottom: var(--sp-6); right: var(--sp-6); z-index: 999; display: flex; flex-direction: column; gap: var(--sp-2); pointer-events: none; }
.toast { background: var(--gray-900); color: #fff; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-lg); font-size: 0.85rem; font-weight: 500; box-shadow: var(--shadow-lg); pointer-events: auto; animation: toast-in 0.2s ease; max-width: 320px; }
.toast--error   { background: var(--red-600); }
.toast--success { background: var(--green-600); }
@keyframes toast-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .summary-strip--4, .summary-strip--5, .summary-strip--6 { grid-template-columns: repeat(2, 1fr); }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .layout { grid-template-columns: 1fr; }
  .main { padding: var(--sp-4); }
  .summary-strip--4, .summary-strip--5, .summary-strip--6 { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
