/* ═══════════════════════════════════════════════════════
   FINANCIER — CLEAN MINIMALIST DESIGN SYSTEM
   Inspired by Apple & Notion · Pure · Structured
   Uses OKLCH colorspace & Native CSS nesting
   Supports Light & Dark modes
   Date: 2026-07-08
═══════════════════════════════════════════════════════ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ══════════════════════════════════════
   TOKENS — DARK THEME (default)
══════════════════════════════════════ */
:root {
  /* Backgrounds */
  --bg-base:       oklch(0.08 0.01 240);       /* Clean deep ink background */
  --bg-subtle:     oklch(0.12 0.01 240);       /* Sidebar background */
  --bg-surface:    oklch(0.14 0.01 240);       /* Panel/card background */
  --bg-elevated:   oklch(0.18 0.01 240);       /* Input/inner container background */
  --bg-overlay:    oklch(0.22 0.01 240);       /* Modals/popups background */
  --bg-hover:      oklch(1.0 0.0 0 / 0.04);
  --bg-active:     oklch(1.0 0.0 0 / 0.08);

  /* Borders (Ultra-thin, low contrast) */
  --border:        oklch(1.0 0.0 0 / 0.06);
  --border-strong: oklch(1.0 0.0 0 / 0.12);
  --border-focus:  oklch(0.60 0.16 240 / 0.5);

  /* Text colors */
  --text-primary:  oklch(0.95 0.01 240);       /* Crisp off-white */
  --text-secondary:oklch(0.70 0.01 240);       /* Muted gray */
  --text-muted:    oklch(0.48 0.01 240);       /* Deeper gray */
  --text-inverse:  oklch(0.08 0.01 240);

  /* Brand (Clean, sophisticated Slate/Indigo) */
  --brand:         oklch(0.60 0.16 240);
  --brand-hover:   oklch(0.55 0.16 240);
  --brand-subtle:  oklch(0.60 0.16 240 / 0.10);
  --brand-glow:    oklch(0.60 0.16 240 / 0.15);

  /* Semantic */
  --green:         oklch(0.70 0.14 140);
  --green-subtle:  oklch(0.70 0.14 140 / 0.10);
  --red:           oklch(0.60 0.16 20);
  --red-subtle:    oklch(0.60 0.16 20 / 0.10);
  --amber:         oklch(0.75 0.12 75);
  --amber-subtle:  oklch(0.75 0.12 75 / 0.10);
  --blue:          oklch(0.65 0.14 220);
  --blue-subtle:   oklch(0.65 0.14 220 / 0.10);
  --purple:        oklch(0.62 0.18 290);
  --purple-subtle: oklch(0.62 0.18 290 / 0.10);

  /* Layout */
  --sidebar-w:     240px;
  --topbar-h:      60px;
  --radius-sm:     4px;
  --radius:        8px;
  --radius-lg:     12px;
  --radius-xl:     16px;
  --radius-full:   9999px;

  /* Typography */
  --font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display:  'Plus Jakarta Sans', var(--font);

  /* Shadows (Very soft, minimal) */
  --shadow-sm:     0 1px 2px rgba(0,0,0,0.2);
  --shadow:        0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg:     0 10px 30px rgba(0,0,0,0.4);

  /* Transitions */
  --ease:          cubic-bezier(0.16, 1, 0.3, 1);
  --ease-fast:     cubic-bezier(0.4, 0, 0.2, 1);
}

/* ══════════════════════════════════════
   TOKENS — LIGHT THEME
══════════════════════════════════════ */
[data-theme="light"] {
  /* Backgrounds */
  --bg-base:       oklch(0.97 0.01 240);       /* Soft light gray */
  --bg-subtle:     oklch(0.99 0.00 0);         /* Sidebar background */
  --bg-surface:    oklch(1.00 0.00 0);         /* Pure white cards */
  --bg-elevated:   oklch(0.95 0.01 240);       /* Light inner background */
  --bg-overlay:    oklch(1.00 0.00 0);
  --bg-hover:      oklch(0.00 0.00 0 / 0.03);
  --bg-active:     oklch(0.00 0.00 0 / 0.06);

  /* Borders */
  --border:        oklch(0.00 0.00 0 / 0.08);  /* Delicate borders */
  --border-strong: oklch(0.00 0.00 0 / 0.14);
  --border-focus:  oklch(0.60 0.16 240 / 0.35);

  /* Text colors */
  --text-primary:  oklch(0.12 0.01 240);       /* Soft black slate */
  --text-secondary:oklch(0.40 0.01 240);       /* Cool charcoal */
  --text-muted:    oklch(0.60 0.01 240);       /* Warm gray */
  --text-inverse:  oklch(0.95 0.01 240);

  /* Shadows */
  --shadow-sm:     0 1px 2px rgba(0,0,0,0.02);
  --shadow:        0 4px 12px rgba(0,0,0,0.04);
  --shadow-lg:     0 10px 30px rgba(0,0,0,0.06);
}

/* ══════════════════════════════════════
   RESET & BASE
══════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0; padding: 0;
  -webkit-font-smoothing: antialiased;
}
html { height: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-base);
  min-height: 100vh;
  overflow-x: hidden;
  letter-spacing: -0.01em;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; color: inherit; }
::selection { background: var(--brand-subtle); color: var(--text-primary); }

/* Minimalist scrollbars */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Utilities */
.hidden { display: none !important; }
.sr-only { position: absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }

/* ══════════════════════════════════════
   LOADER
══════════════════════════════════════ */
.loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-base);
  display: flex; align-items: center; justify-content: center;
}
.loader-inner {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.loader-logo {
  font-family: var(--font-display);
  font-weight: 700; font-size: 16px;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}
.loader-spinner {
  width: 24px; height: 24px;
  border: 1.5px solid var(--border);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════
   AUTH SCREEN
══════════════════════════════════════ */
.auth-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: var(--bg-base);
}
.auth-wrap {
  width: 100%; max-width: 360px;
}
.auth-brand {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 24px;
}
.auth-brand-icon {
  width: 32px; height: 32px;
  background: var(--text-primary);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
}
.auth-brand-icon svg { stroke: var(--bg-base); width: 15px; height: 15px; }
.auth-brand-name {
  font-family: var(--font-display);
  font-weight: 700; font-size: 18px;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}
.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}
.auth-card-title {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.auth-card-sub {
  font-size: 12.5px; color: var(--text-secondary);
  margin-bottom: 24px;
}
.auth-error-box {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--red-subtle);
  border: 1px solid rgba(244,63,94,0.1);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12.5px; color: var(--red);
  margin-bottom: 14px;
}
.auth-switch-row {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 18px; font-size: 12.5px; color: var(--text-secondary);
}

/* ══════════════════════════════════════
   FORM ELEMENTS
══════════════════════════════════════ */
.form-group {
  display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px;
}
.form-label {
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em; text-transform: uppercase;
}
.form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.form-row-3 {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="month"],
select,
textarea {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.12s var(--ease-fast), box-shadow 0.12s var(--ease-fast);
  appearance: none;
  -webkit-appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:hover, select:hover { border-color: var(--text-muted); }
input:focus, select:focus {
  border-color: var(--text-primary);
}

/* Dropdown styling */
select {
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
}
[data-theme="light"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235e6680' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}
select option { background: var(--bg-overlay); color: var(--text-primary); }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 36px; }
.pw-toggle {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  display: flex; align-items: center;
}
.pw-toggle:hover { color: var(--text-secondary); }

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 550;
  transition: all 0.12s var(--ease-fast);
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-base);
}
.btn-primary:hover {
  opacity: 0.9;
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
}
.btn-danger {
  color: var(--red);
}
.btn-danger:hover {
  background: var(--red-subtle);
}
.btn-icon {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all 0.12s;
}
.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.btn-link {
  font-size: 12.5px; font-weight: 600;
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-link:hover { opacity: 0.8; }
.btn-full { width: 100%; }
.btn-spinner {
  width: 14px; height: 14px;
  border: 1.5px solid var(--border);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spin .5s linear infinite;
}

/* ══════════════════════════════════════
   APP LAYOUT
══════════════════════════════════════ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
.sidebar {
  background: var(--bg-subtle);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  height: 100vh;
  position: sticky; top: 0;
  overflow-y: auto;
  z-index: 50;
}
.sidebar-header {
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 8px;
}
.sidebar-logo-icon {
  width: 24px; height: 24px;
  background: var(--text-primary);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-logo-icon svg { stroke: var(--bg-base); width: 12px; height: 12px; }
.sidebar-logo-text {
  font-family: var(--font-display);
  font-weight: 700; font-size: 14.5px;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}
.sidebar-nav {
  flex: 1;
  padding: 12px 6px;
  display: flex; flex-direction: column; gap: 1px;
}
.sidebar-section-label {
  font-size: 9.5px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 10px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.12s var(--ease);
  cursor: pointer;
}
.nav-item svg { flex-shrink: 0; stroke-width: 1.8; width: 15px; height: 15px; }
.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.nav-item.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-weight: 600;
}
.sidebar-footer {
  padding: 8px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.user-card {
  display: flex; align-items: center; gap: 8px;
  padding: 8px;
  border-radius: var(--radius);
}
.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--text-primary);
  color: var(--bg-base);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}
.user-meta { flex: 1; min-width: 0; }
.user-name {
  font-size: 12.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text-primary);
}
.user-email {
  font-size: 11px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ══════════════════════════════════════
   TOPBAR
══════════════════════════════════════ */
.main { display: flex; flex-direction: column; min-height: 100vh; overflow: hidden; }
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
  gap: 16px;
}
.topbar-left { display: flex; align-items: center; gap: 8px; }
.topbar-page-title {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 700;
  letter-spacing: -0.02em;
}
.topbar-badge {
  font-size: 10.5px; font-weight: 600;
  background: var(--bg-base);
  color: var(--text-secondary);
  padding: 2px 8px; border-radius: var(--radius-full);
  border: 1px solid var(--border);
}
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-divider { width: 1px; height: 16px; background: var(--border); }

/* ══════════════════════════════════════
   CONTENT PANELS
══════════════════════════════════════ */
.panels { flex: 1; padding: 24px; overflow-y: auto; }
.panel {
  animation: panelIn 0.18s var(--ease);
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* ══════════════════════════════════════
   DASHBOARD STATS
══════════════════════════════════════ */
.stats-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 12px;
}
.stat-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  border: 1px solid var(--border);
  position: relative;
  transition: border-color 0.15s var(--ease);
}
.stat-card:hover {
  border-color: var(--border-strong);
}
.stat-card-hero {
  background: var(--bg-surface);
  border: 1px solid var(--text-primary);
}
.stat-label {
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text-primary);
}
.stat-card-hero .stat-value {
  color: var(--text-primary);
}
.stat-sub {
  font-size: 11.5px; color: var(--text-muted);
  margin-top: 4px;
}

/* ══════════════════════════════════════
   CARDS
══════════════════════════════════════ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.15s;
}
.card:hover { border-color: var(--border-strong); }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; gap: 6px;
}
.card-title-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--text-primary);
  flex-shrink: 0;
}
.card-body { padding: 14px 16px; }
.section-action {
  font-size: 11.5px; font-weight: 600;
  color: var(--text-secondary);
}
.section-action:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* Grids */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }

/* ══════════════════════════════════════
   MINI LIST (Dashboard)
══════════════════════════════════════ */
.mini-list { display: flex; flex-direction: column; }
.mini-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.mini-item:last-child { border-bottom: none; }
.mini-item:hover { background: var(--bg-hover); }
.mini-icon {
  width: 28px; height: 28px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: var(--bg-elevated);
}
.mini-icon.income { background: var(--green-subtle); color: var(--green); }
.mini-icon.expense { background: var(--red-subtle); color: var(--red); }
.mini-icon.transfer { background: var(--amber-subtle); color: var(--amber); }
.mini-info { flex: 1; min-width: 0; }
.mini-title {
  font-size: 12.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text-primary);
}
.mini-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.mini-right { text-align: right; flex-shrink: 0; }
.mini-amount {
  font-size: 12.5px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.mini-amount.income { color: var(--green); }
.mini-amount.expense { color: var(--red); }
.mini-amount.transfer { color: var(--amber); }

/* ══════════════════════════════════════
   TRANSACTIONS
══════════════════════════════════════ */
.filter-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}
.filter-bar input,
.filter-bar select { width: auto; flex: 1; min-width: 110px; font-size: 12.5px; padding: 6px 10px; }
.filter-search { position: relative; flex: 2; min-width: 150px; }
.filter-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); stroke: var(--text-muted); stroke-width: 2; width: 13px; height: 13px; }
.filter-search input { padding-left: 30px; }

.tx-list { display: flex; flex-direction: column; }
.tx-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.tx-item:last-child { border-bottom: none; }
.tx-item:hover {
  background: var(--bg-hover);
}
.tx-item:hover .tx-actions {
  opacity: 1; transform: none;
}
.tx-type-badge {
  width: 32px; height: 32px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: var(--bg-elevated);
}
.tx-type-badge.income { background: var(--green-subtle); color: var(--green); }
.tx-type-badge.expense { background: var(--red-subtle); color: var(--red); }
.tx-type-badge.transfer { background: var(--amber-subtle); color: var(--amber); }
.tx-body { flex: 1; min-width: 0; }
.tx-note { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.tx-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.tx-right { text-align: right; flex-shrink: 0; }
.tx-amount { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tx-amount.income { color: var(--green); }
.tx-amount.expense { color: var(--red); }
.tx-amount.transfer { color: var(--amber); }
.tx-date { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.tx-actions {
  display: flex; gap: 2px;
  opacity: 0; transform: translateX(2px);
  transition: opacity 0.1s, transform 0.1s;
  flex-shrink: 0;
}

/* ══════════════════════════════════════
   ACCOUNT CARDS (Clean Flat Minimalist)
══════════════════════════════════════ */
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.account-card {
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  position: relative;
  transition: border-color 0.15s, transform 0.15s;
  display: flex; flex-direction: column;
  justify-content: space-between;
  min-height: 120px;
}
.account-card:hover {
  border-color: var(--text-muted);
}
.account-card::before {
  /* Dynamic vertical color accent pill on left */
  content: '';
  position: absolute; left: 0; top: 12px; bottom: 12px;
  width: 3px;
  background: var(--card-color, var(--text-primary));
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.acc-type-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.acc-name {
  font-family: var(--font-display);
  font-size: 14.5px; font-weight: 700;
  color: var(--text-primary);
  margin-top: 2px;
}
.acc-balance {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 10px 0 14px;
}
.acc-footer {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.acc-bank { font-size: 11px; color: var(--text-secondary); }
.acc-actions { display: flex; gap: 4px; }
.acc-actions button {
  font-size: 11px; font-weight: 600;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all 0.1s;
}
.acc-actions button:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ══════════════════════════════════════
   BUDGET CARDS (Clean Minimalist)
══════════════════════════════════════ */
.budgets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.budget-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  position: relative;
  transition: border-color 0.15s;
}
.budget-card:hover { border-color: var(--border-strong); }
.budget-card::before {
  /* Subtle left accent color line */
  content: '';
  position: absolute; left: 0; top: 12px; bottom: 12px;
  width: 3px;
  background: var(--bud-accent, var(--text-primary));
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.bud-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 12px;
}
.bud-name-wrap { display: flex; flex-direction: column; }
.bud-name { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.bud-period { font-size: 10.5px; color: var(--text-muted); }
.bud-numbers {
  display: flex; align-items: baseline; gap: 5px;
  margin-bottom: 8px;
}
.bud-spent {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 800;
  color: var(--text-primary);
}
.bud-of { font-size: 11.5px; color: var(--text-muted); }
.bud-limit { font-size: 11.5px; font-weight: 600; color: var(--text-secondary); }
.progress-track {
  height: 4px; background: var(--bg-elevated);
  border-radius: var(--radius-full); overflow: hidden;
  margin-bottom: 6px;
}
.progress-bar {
  height: 100%; border-radius: var(--radius-full);
  background: var(--bud-accent, var(--text-primary));
  transition: width .4s var(--ease);
}
.progress-bar.over { background: var(--red); }
.bud-meta {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-muted);
}
.bud-pct { font-weight: 700; }
.bud-pct.over { color: var(--red); }
.bud-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.bud-tag {
  font-size: 10px; font-weight: 550;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 1px 6px;
  color: var(--text-secondary);
}

/* ══════════════════════════════════════
   REPORTS
══════════════════════════════════════ */
.chart-container { padding: 12px; min-height: 240px; position: relative; }
.chart-container canvas { max-height: 220px; }

/* ══════════════════════════════════════
   MODALS
══════════════════════════════════════ */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: modalBackdrop .18s var(--ease);
}
[data-theme="dark"] .modal {
  background: rgba(0,0,0,0.65);
}
@keyframes modalBackdrop { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 480px;
  max-height: 85vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlide .2s var(--ease);
}
@keyframes modalSlide { from { opacity: 0; transform: scale(0.98) translateY(6px); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: var(--bg-surface);
  z-index: 1;
}
.modal-head h3 {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 700;
  color: var(--text-primary);
}
.modal-close-icon {
  width: 24px; height: 24px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1;
  color: var(--text-muted);
  transition: all 0.1s;
}
.modal-close-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-body { padding: 16px 18px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  position: sticky; bottom: 0;
  background: var(--bg-surface);
  z-index: 1;
}

/* ══════════════════════════════════════
   SEGMENT TABS
══════════════════════════════════════ */
.seg-tabs {
  display: flex;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 2.5px; gap: 1px;
  margin-bottom: 12px;
}
.seg-tab {
  flex: 1; text-align: center;
  padding: 6px;
  border-radius: var(--radius-sm);
  font-size: 12.5px; font-weight: 600;
  color: var(--text-muted);
  cursor: pointer; user-select: none;
  transition: all 0.1s ease;
}
.seg-tab input { display: none; }
.seg-tab.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* ══════════════════════════════════════
   QUICK ADD MENU
══════════════════════════════════════ */
.quick-menu {
  position: fixed; inset: 0; z-index: 80;
}
.quick-backdrop {
  position: absolute; inset: 0;
}
.quick-list {
  position: absolute;
  bottom: 80px; left: 50%; transform: translateX(-50%);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 4px;
  min-width: 180px;
  box-shadow: var(--shadow-lg);
  animation: quickSlide .12s var(--ease);
}
@keyframes quickSlide { from { opacity:0; transform:translateX(-50%) translateY(4px); } to { opacity:1; transform:translateX(-50%) translateY(0); } }
.quick-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 12.5px; font-weight: 550;
  color: var(--text-secondary);
  transition: all 0.1s;
  width: 100%; text-align: left;
}
.quick-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.quick-icon {
  width: 24px; height: 24px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0;
  background: var(--bg-elevated);
}
.quick-divider { height: 1px; background: var(--border); margin: 3px 0; }

/* ══════════════════════════════════════
   COLOR PICKER
══════════════════════════════════════ */
.color-grid { display: flex; gap: 6px; flex-wrap: wrap; }
.color-swatch {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--c);
  cursor: pointer; position: relative;
  transition: transform .12s, box-shadow .12s;
}
.color-swatch input { display: none; }
.color-swatch:has(input:checked) {
  transform: scale(1.1);
  box-shadow: 0 0 0 1.5px var(--bg-surface), 0 0 0 3px var(--c);
}

/* ══════════════════════════════════════
   CHECKBOX LIST
══════════════════════════════════════ */
.check-list {
  display: flex; flex-direction: column; gap: 1px;
  max-height: 160px; overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: 4px;
  background: var(--bg-surface);
}
.check-item {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 6px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background 0.1s;
}
.check-item:hover { background: var(--bg-hover); }
.check-item input { width: 14px; height: 14px; accent-color: var(--text-primary); cursor: pointer; }
.check-item span { font-size: 12.5px; color: var(--text-secondary); }

/* ══════════════════════════════════════
   BOTTOM NAV (mobile)
══════════════════════════════════════ */
.bottom-nav { display: none; }
.fab-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--text-primary);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
  color: var(--bg-base);
  margin-top: -12px;
  transition: transform .12s;
}
.bnav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  flex: 1; padding: 6px 2px;
  font-size: 9.5px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  cursor: pointer;
}
.bnav-item svg { width: 16px; height: 16px; stroke-width: 2.2; }
.bnav-item.active { color: var(--text-primary); }

/* ══════════════════════════════════════
   RESPONSIVE — TABLET & MOBILE
══════════════════════════════════════ */
@media (max-width: 1024px) {
  :root { --sidebar-w: 200px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stats-row .stat-card-hero { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .app {
    grid-template-columns: 1fr;
    padding-bottom: 64px;
  }
  .sidebar { display: none; }
  .main { min-height: calc(100vh - 64px); }
  .panels { padding: 16px; }
  .stats-row { grid-template-columns: 1fr; }
  .stats-row .stat-card-hero { grid-column: auto; }
  .topbar { padding: 0 16px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .modal-box { max-width: 100%; max-height: 90vh; }
  .modal-body { padding: 12px 14px; }

  .bottom-nav {
    display: flex; align-items: center; justify-content: space-around;
    position: fixed; bottom: 0; left: 0; right: 0;
    height: 64px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    z-index: 50;
    padding: 0 4px;
  }
}

@media (max-width: 420px) {
  .auth-card { padding: 20px 16px; }
}

/* ── Empty State Styles ── */
.empty-msg {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 13px;
  width: 100%;
  grid-column: 1 / -1; /* Spans full width inside grid template */
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-hover);
  min-height: 80px;
}

/* ── Custom Checkbox Styles ── */
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  background-color: var(--bg-surface);
  margin: 0;
  width: 16px !important;
  height: 16px !important;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  vertical-align: middle;
  position: relative;
  outline: none;
}

input[type="checkbox"]::before {
  content: "";
  width: 10px;
  height: 10px;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  background-color: white;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

input[type="checkbox"]:checked {
  background-color: var(--brand);
  border-color: var(--brand);
}

input[type="checkbox"]:checked::before {
  transform: scale(1);
}

input[type="checkbox"]:hover {
  border-color: var(--brand);
}
