/* ─── CSS Custom Properties (mirroring SvelteKit themes) ─────────────────── */
:root, html[data-theme='light'] {
  color-scheme: light;
  --radius: 0.625rem;
  
  --color-bg: #f6f7ff;
  --color-card: #ffffff;
  --color-surface-soft: #fcfbfe;
  --color-border: #dee1e7;
  --color-border-hover: #c6c2c6;

  --color-text-primary: #111827;
  --color-text-secondary: #475569;
  --color-text-muted: #94a3b8;
  --color-subtle: #c6c2c6;

  --color-primary: #5f8cff;
  --color-primary-hover: #4b76ef;
  --color-primary-soft: #f6f7ff;
  --color-primary-border: #dbe4ff;
  --color-on-primary: #ffffff;

  --color-income: #3b82f6;
  --color-income-soft: #eff6ff;
  --color-expense: #f97316;
  --color-expense-soft: #fff7ed;
  --color-savings: #22c55e;
  --color-savings-soft: #e5fbe0;
  --color-warning: #d97706;
  --color-warning-soft: #fef3c7;
  --color-transfer: #64748b;
  --color-transfer-soft: #f1f5f9;

  --font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-num: ui-monospace, 'SF Mono', Monaco, monospace;
}

html[data-theme='dark'] {
  color-scheme: dark;
  --color-bg: #020617;
  --color-card: #0F172A;
  --color-surface-soft: #1E293B;
  --color-border: #556884;
  --color-border-hover: #7689A8;
  --color-text-primary: #F8FAFC;
  --color-text-secondary: #E2E8F0;
  --color-text-muted: #94A3B8;
  --color-subtle: #64748B;
  --color-primary: #60a5fa;
  --color-primary-hover: #93bbfd;
  --color-primary-soft: rgba(96, 165, 250, 0.12);
  --color-primary-border: rgba(96, 165, 250, 0.25);
  --color-on-primary: #ffffff;
  --color-income: #10b981;
  --color-income-soft: rgba(16, 185, 129, 0.12);
  --color-expense: #F87171;
  --color-expense-soft: rgba(220, 38, 38, 0.14);
  --color-savings: #A78BFA;
  --color-savings-soft: rgba(124, 58, 237, 0.14);
  --color-warning: #FDBA74;
  --color-warning-soft: rgba(217, 119, 6, 0.14);
  --color-transfer: #94a3b8;
  --color-transfer-soft: rgba(148, 163, 184, 0.12);
}

html[data-theme='glass'] {
  --color-bg: rgba(246, 247, 255, 0.8);
  --color-card: rgba(255, 255, 255, 0.6);
  --color-surface-soft: rgba(255, 255, 255, 0.4);
  --color-border: rgba(222, 225, 231, 0.5);
  --color-primary: #5f8cff;
}

html[data-theme='brutalist'] {
  --color-bg: #fafaf9;
  --color-card: #ffffff;
  --color-surface-soft: #f5f5f4;
  --color-border: #292524;
  --color-border-hover: #292524;
  --color-text-primary: #1c1917;
  --color-primary: #dc2626;
  --color-primary-hover: #b91c1c;
  --color-primary-soft: #fef2f2;
  --color-income: #16a34a;
  --color-expense: #dc2626;
}

html[data-theme='minimalist'] {
  --color-bg: #f8f9fa;
  --color-card: #ffffff;
  --color-surface-soft: #f1f3f5;
  --color-border: #dee2e6;
  --color-border-hover: #ced4da;
  --color-text-primary: #212529;
  --color-text-secondary: #495057;
  --color-text-muted: #868e96;
  --color-primary: #1b1f23;
  --color-primary-hover: #343a40;
  --color-primary-soft: #f1f3f5;
  --color-income: #1b1f23;
  --color-expense: #868e96;
}

/* ─── Base Styles ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  background: radial-gradient(circle at top left, rgba(230, 251, 224, 0.5), transparent 28%),
              linear-gradient(180deg, #f6f7ff 0%, #fcfbfe 100%);
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

html[data-theme='dark'] body {
  background: #020617;
}

body { min-height: 100dvh; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  background-color: var(--color-card);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-soft);
}

/* ─── Layout ───────────────────────────────────────────────────────────── */
.app-layout { display: flex; height: 100dvh; overflow: hidden; }
.main-area { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.main-content { flex: 1; overflow-y: auto; min-height: 0; }

/* ─── Sidebar ──────────────────────────────────────────────────────────── */
.sidebar {
  width: 260px; flex-shrink: 0;
  background: var(--color-card);
  border-right: 1px solid var(--color-border);
  display: flex; flex-direction: column;
  overflow-y: auto; padding: 0;
}
.sidebar-brand {
  height: 72px; padding: 0 24px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--color-border);
  box-sizing: border-box;
  flex-shrink: 0;
}
.sidebar-brand-icon {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-primary);
}
.sidebar-brand-icon svg { width: 28px; height: 28px; }
.sidebar-brand-text { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.sidebar-nav { padding: 8px 12px; flex: 1; }
.sidebar-section { margin-bottom: 8px; }
.sidebar-section-title {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--color-text-muted);
  padding: 8px 12px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 10px;
  font-size: 13px; font-weight: 500; color: var(--color-text-secondary);
  transition: all 140ms ease; cursor: pointer;
}
.nav-item:hover { background: var(--color-surface-soft); color: var(--color-text-primary); }
.nav-item.active { background: var(--color-primary-soft); color: var(--color-primary); font-weight: 600; }
.sidebar-footer { padding: 16px 12px; border-top: 1px solid var(--color-border); }

/* ─── Topbar ───────────────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; gap: 16px;
  height: 72px; padding: 0 32px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-card);
  flex-shrink: 0;
}
@media (max-width: 1024px) { .topbar { display: none; } }

/* ─── Bottom Nav ──────────────────────────────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--color-card);
  border-top: 1px solid var(--color-border);
  padding: 6px 0; z-index: 40;
  justify-content: space-around;
}
@media (max-width: 1024px) { .bottom-nav { display: flex; } }
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 12px; font-size: 10px; font-weight: 500;
  color: var(--color-text-muted); transition: color 140ms; cursor: pointer;
}
.bottom-nav-item.active { color: var(--color-primary); }

/* ─── Mobile header ────────────────────────────────────────────────────── */
.mobile-header {
  display: none; height: 56px; align-items: center; gap: 12px;
  padding: 0 16px; border-bottom: 1px solid var(--color-border);
  background: var(--color-card);
}
@media (max-width: 1024px) { .mobile-header { display: flex; } }

/* ─── Page Components ──────────────────────────────────────────────────── */
.page-content { max-width: 1320px; margin: 0 auto; padding: 32px; }
@media (max-width: 1024px) { .page-content { padding: 24px; } }
@media (max-width: 640px) { .page-content { padding: 16px; } }

.panel {
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 18px;
}
.card {
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  transition: transform 180ms ease, box-shadow 180ms, border-color 180ms;
  cursor: pointer;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--color-border-hover);
}

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px; gap: 16px; flex-wrap: wrap;
}
.page-header h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.page-header p { font-size: 13px; color: var(--color-text-muted); margin-top: 2px; }

/* ─── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 18px; border-radius: 12px;
  font-size: 13px; font-weight: 600;
  border: none; cursor: pointer;
  transition: transform 150ms, background-color 150ms;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--color-primary); color: var(--color-on-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-ghost {
  background: transparent; color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}
.btn-ghost:hover { border-color: var(--color-border-hover); color: var(--color-text-primary); }
.btn-danger { background: var(--color-expense); color: white; }
.btn-danger:hover { opacity: 0.9; }

/* ─── Grids ────────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ─── Forms ────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--color-text-secondary); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 14px; font-size: 14px;
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: 12px; color: var(--color-text-primary); outline: none;
  transition: border-color 160ms;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--color-primary); }
.form-error { color: var(--color-expense); font-size: 12px; margin-top: 4px; }

/* ─── Tables ───────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
     color: var(--color-text-muted); text-align: left; padding: 12px 16px;
     background: var(--color-surface-soft); }
td { padding: 12px 16px; font-size: 13px; border-top: 1px solid var(--color-border); }
tr:hover td { background: var(--color-surface-soft); }

/* ─── Modal ────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  padding: 24px;
}
.modal {
  background: var(--color-card); border-radius: 20px; width: 100%; max-width: 500px;
  max-height: 90vh; overflow-y: auto; padding: 28px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.modal-desc { font-size: 13px; color: var(--color-text-muted); margin-bottom: 20px; }
.modal-actions { display: flex; gap: 8px; margin-top: 20px; }
.modal-actions .btn { flex: 1; }

/* ─── KPI Cards ────────────────────────────────────────────────────────── */
.kpi-card { padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.kpi-card .kpi-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted); }
.kpi-card .kpi-value { font-size: 24px; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
.kpi-card .kpi-subtitle { font-size: 12px; color: var(--color-text-muted); }

/* ─── Progress Bar ─────────────────────────────────────────────────────── */
.progress-bar { width: 100%; height: 6px; border-radius: 3px; background: var(--color-surface-soft); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; transition: width 300ms ease; }

/* ─── Empty State ──────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 40px 20px; }

/* ─── Overview Hero ─────────────────────────────────────────────────────── */
.overview-hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 16px;
}
@media (max-width: 640px) {
  .overview-hero { grid-template-columns: 1fr; }
}
.hero-balance { display: flex; flex-direction: column; padding: 24px; }
.hero-icon {
  width: 40px; height: 40px; border-radius: 16px;
  background: var(--color-primary-soft);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-primary);
}
.hero-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--color-text-muted);
}
.hero-value {
  font-size: 18px; font-weight: 700; margin-top: 8px;
}
.hero-networth {
  font-size: 30px; font-weight: 700; margin-top: 24px;
  color: var(--color-warning);
}
.hero-sub-grid {
  margin-top: 24px; padding-top: 24px;
  border-top: 1px solid var(--color-border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 640px) {
  .hero-sub-grid { grid-template-columns: 1fr; }
}

/* ─── Calendar ─────────────────────────────────────────────────────────── */
.cal-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; }
.cal-header h2 { font-size:18px; font-weight:700; letter-spacing:-0.02em; }
.cal-nav { display:flex; gap:4px; }
.cal-nav-btn {
  width:36px; height:36px; border-radius:10px; border:1px solid var(--color-border);
  background:var(--color-card); color:var(--color-text-secondary); cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition:all 140ms ease;
}
.cal-nav-btn:hover { border-color:var(--color-border-hover); color:var(--color-text-primary); }
.cal-nav-btn:active { transform:scale(0.92); }

.cal-grid {
  display:grid; grid-template-columns:repeat(7,1fr); gap:6px;
}
.cal-weekday {
  text-align:center; font-size:11px; font-weight:600; text-transform:uppercase;
  letter-spacing:0.05em; color:var(--color-text-muted); padding:6px 0 4px;
}
.cal-cell {
  position:relative; border-radius:14px; padding:8px; min-height:72px;
  border:1px solid transparent; cursor:pointer;
  transition:transform 150ms ease, box-shadow 150ms, background 150ms, border-color 150ms;
  display:flex; flex-direction:column;
}
.cal-cell:hover { transform:translateY(-2px); box-shadow:0 4px 12px rgba(0,0,0,0.06); z-index:2; }
.cal-cell:active { transform:scale(0.97); }
.cal-cell.today { border-color:var(--color-primary); }
.cal-cell.other-month { opacity:0.3; pointer-events:none; }
.cal-day-num { font-size:13px; font-weight:600; margin-bottom:4px; }
.cal-day-expense { font-size:10px; line-height:1.3; color:var(--color-expense); font-weight:500; }
.cal-day-income { font-size:10px; line-height:1.3; color:var(--color-income); font-weight:500; }
.cal-day-count { font-size:9px; color:var(--color-text-muted); margin-top:1px; }

.cal-detail-overlay {
  position:fixed; inset:0; background:rgba(0,0,0,0.35); z-index:90;
  display:flex; align-items:center; justify-content:center; padding:24px;
  backdrop-filter:blur(2px);
}
.cal-detail-card {
  background:var(--color-card); border-radius:20px; width:100%; max-width:420px;
  padding:24px; box-shadow:0 20px 60px rgba(0,0,0,0.15);
}
.cal-detail-date { font-size:14px; font-weight:600; margin-bottom:16px; }
.cal-detail-row {
  display:flex; justify-content:space-between; align-items:center;
  padding:8px 0; font-size:13px;
}
.cal-detail-row+.cal-detail-row { border-top:1px solid var(--color-border); }
.cal-tx-item {
  display:flex; justify-content:space-between; align-items:center;
  padding:8px 0; font-size:13px;
}
.empty-state-icon { width: 48px; height: 48px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center;
  background: var(--color-surface-soft); border-radius: 16px; color: var(--color-text-muted); }
.empty-state-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.empty-state-desc { font-size: 13px; color: var(--color-text-muted); }

/* ─── Tag / Badge ──────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }

/* ─── Toast ────────────────────────────────────────────────────────────── */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 20px; border-radius: 12px; font-size: 13px; font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  animation: slideIn 200ms ease-out; max-width: 360px;
}
.toast.success { background: #22c55e; color: white; }
.toast.error { background: #ef4444; color: white; }
.toast.info { background: var(--color-primary); color: white; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ─── Donut Chart ──────────────────────────────────────────────────────── */
.donut-chart-wrap { display: flex; align-items: center; gap: 16px; }
.donut-legend { flex: 1; }

/* ─── Utilities ────────────────────────────────────────────────────────── */
.text-primary { color: var(--color-primary); }
.text-income { color: var(--color-income); }
.text-expense { color: var(--color-expense); }
.text-warning { color: var(--color-warning); }
.text-muted { color: var(--color-text-muted); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.tabular-nums { font-variant-numeric: tabular-nums; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.p-5 { padding: 20px; }
.p-6 { padding: 24px; }
.hidden { display: none; }

/* ─── Scrollbar ────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { border-radius: 3px; background: var(--color-subtle); }

/* Skeleton loading - shimmer uses theme vars */
.skeleton { position: relative; overflow: hidden; background: var(--color-surface-soft); border: 1px solid var(--color-border); border-radius: 18px; }
.skeleton::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, var(--color-border), transparent); opacity: .45; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* Content swap fade - smooth page transitions */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
#page-container > .page-content { animation: fadeInUp 180ms ease; }
.skel-hero { height: 220px; }
.skel-card { height: 92px; }
.skel-row { height: 62px; border-radius: 14px; margin-bottom: 8px; border: none; }
.skel-panel { height: 260px; }

/* Mobile nav drawer */
.mobile-menu { position: absolute; left: 0; top: 0; bottom: 0; width: 280px; background: var(--color-card); padding: 24px 16px; overflow-y: auto; border-right: 1px solid var(--color-border); }

/* ─── Loading Spinner ──────────────────────────────────────────────────── */
.spinner { width: 24px; height: 24px; border: 3px solid var(--color-border); border-top-color: var(--color-primary); border-radius: 50%; animation: spin 0.6s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Dashboard Overview ───────────────────────────────────────────────── */
.hero-balance .amount { font-size: 40px; font-weight: 700; line-height: 1; letter-spacing: -0.03em; margin-top: 24px; }
@media (min-width: 640px) { .hero-balance .amount { font-size: 48px; } }
/* Balance visibility toggle */
.balance-eye .eye-open { display: none; }
.balance-eye .eye-closed { display: block; }
.balance-eye[data-shown="1"] .eye-open { display: block; }
.balance-eye[data-shown="1"] .eye-closed { display: none; }
.balance-eye:hover { color: var(--color-text-primary); background: var(--color-bg-soft); }
.insight-box { padding: 20px; }
.insight-list { list-style: none; }
.insight-list li { padding: 4px 0; font-size: 13px; color: var(--color-text-secondary); }
.insight-list li::before { content: '• '; }

/* ─── Transaction list ─────────────────────────────────────────────────── */

/* ─── Settings theme cards ─────────────────────────────────────────────── */
.tx-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.tx-search { flex: 1; min-width: 200px; position: relative; }
.tx-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--color-text-muted); pointer-events: none; }
.tx-search input { width: 100%; padding: 10px 14px 10px 38px; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-card); font-size: 14px; color: var(--color-text-primary); outline: none; transition: all 160ms; }
.tx-search input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-soft); }

.tx-filters { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.tx-chip { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--color-border); background: var(--color-card); font-size: 13px; font-weight: 500; color: var(--color-text-secondary); cursor: pointer; transition: all 160ms; }
.tx-chip:hover { border-color: var(--color-primary); background: var(--color-surface-soft); }
.tx-chip.active { background: var(--color-primary); color: var(--color-on-primary); border-color: var(--color-primary); box-shadow: none; }

.tx-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 24px; }
.tx-summary-item { padding: 16px 18px; border-radius: 16px; background: var(--color-surface-soft); border: 1px solid var(--color-border); text-align: center; }
.tx-summary-label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); margin-bottom: 6px; }
.tx-summary-val { font-size: 18px; font-weight: 700; line-height: 1.2; }
.tx-summary-val.income { color: var(--color-income); }
.tx-summary-val.expense { color: var(--color-expense); }
.tx-summary-val.transfer { color: var(--color-transfer); }

.tx-list { border-radius: 16px; overflow: hidden; background: var(--color-card); border: 1px solid var(--color-border); }
.tx-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.tx-pagination-label { font-size: 13px; color: var(--color-text-muted); }
.tx-pagination .btn[disabled] { opacity: 0.4; pointer-events: none; }
.tx-group { margin-bottom: 2px; }
.tx-group:last-child { margin-bottom: 0; }
.tx-group-header { padding: 12px 18px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-text-muted); background: var(--color-surface-soft); border-bottom: 1px solid var(--color-border); }
.tx-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; cursor: pointer; transition: all 140ms; border-bottom: 1px solid var(--color-border); }
.tx-row:last-child { border-bottom: none; }
.tx-row:hover { background: var(--color-surface-soft); }
.tx-row:active { transform: scale(0.995); }
.tx-row-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 18px; font-weight: 600; }
.tx-row-info { flex: 1; min-width: 0; }
.tx-row-desc { font-size: 14px; font-weight: 500; color: var(--color-text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.4; }
.tx-row-meta { font-size: 12px; color: var(--color-text-muted); margin-top: 3px; line-height: 1.3; }
.tx-row-amount { font-size: 16px; font-weight: 700; white-space: nowrap; }
.tx-row-amount.income { color: var(--color-income); }
.tx-row-amount.expense { color: var(--color-expense); }
.tx-row-amount.transfer { color: var(--color-transfer); }

.theme-card { padding: 20px; border-radius: 18px; cursor: pointer; border: 2px solid transparent; transition: all 160ms; }
.theme-card:hover { border-color: var(--color-border-hover); }
.theme-card.active { border-color: var(--color-primary); background: var(--color-primary-soft); }

/* ─── Account cards ────────────────────────────────────────────────────── */
.account-card { padding: 20px; }
.account-type-icon { width: 44px; height: 44px; border-radius: 16px; display: flex; align-items: center; justify-content: center; }

/* ─── Responsive helpers ───────────────────────────────────────────────── */
@media (max-width: 1024px) { .sidebar { display: none; } }
@media (min-width: 1025px) { .mobile-only { display: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ─── Print / PDF (T-13) ──────────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .bottom-nav, .mobile-header, .mobile-menu, .tx-toolbar, .tx-filters, .tx-pagination, .modal-overlay, #toast-container, #loading-spinner { display: none !important; }
  .app-layout { display: block !important; }
  .main-content { padding: 0 !important; margin: 0 !important; }
  #page-container { display: block !important; padding: 0 !important; }
  .page-content { padding: 0 !important; }
  .panel, .kpi-card { box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; }
  body { background: #fff !important; color: #000 !important; }
}
.print-header { display: none; }
@media print {
  .print-header { display: block; font-size: 18px; font-weight: 700; margin-bottom: 12px; }
  .print-header .print-sub { font-size: 12px; color: #666; font-weight: 400; }
}
