/* ==========================================================================
   Finanças Domésticas - Modern UI System
   Vanilla CSS with Theme Tokens, Fluid Grid & Glassmorphism
   ========================================================================== */

:root {
  color-scheme: dark;
  /* Paleta Financeira Premium - Dark Minimalista */
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.45);
  --bg-card-hover: rgba(51, 65, 85, 0.55);
  --bg-input: #090d16;
  --border-color: rgba(148, 163, 184, 0.12);
  --border-light: rgba(148, 163, 184, 0.22);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #10b981;
  --accent-primary-hover: #059669;
  --accent-success: #10b981;
  --accent-success-bg: rgba(16, 185, 129, 0.12);
  --accent-danger: #f43f5e;
  --accent-danger-bg: rgba(244, 63, 94, 0.12);
  --accent-warning: #f59e0b;
  --accent-warning-bg: rgba(245, 158, 11, 0.12);
  --accent-info: #06b6d4;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 28px -6px rgba(0, 0, 0, 0.6);
  --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.36);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  color-scheme: light;
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: #f1f5f9;
  --bg-input: #ffffff;
  --border-color: rgba(148, 163, 184, 0.25);
  --border-light: rgba(148, 163, 184, 0.4);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --accent-primary: #059669;
  --accent-primary-hover: #047857;
  --accent-success: #059669;
  --accent-success-bg: rgba(5, 150, 105, 0.1);
  --accent-danger: #e11d48;
  --accent-danger-bg: rgba(225, 29, 72, 0.1);
  --accent-warning: #d97706;
  --accent-warning-bg: rgba(217, 119, 6, 0.1);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* Tipografia tabular para valores monetários (sem jitter de layout) */
.tabular-nums, .tx-amount, .stat-value, .currency {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* Estilo do Caret e Seleção de Texto */
::selection {
  background-color: rgba(16, 185, 129, 0.3);
  color: #f8fafc;
}

/* Scrollbar com design do sistema */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Focus Ring Elegante e Acessível */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* App Layout Grid */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 24px 8px;
  border-bottom: 1px solid var(--border-color);
}

.brand-icon {
  font-size: 1.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

.brand-text h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 24px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  position: relative;
}

.nav-item:hover {
  background-color: var(--bg-card);
  color: var(--text-primary);
}

.nav-item.active {
  background-color: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

.nav-icon {
  font-size: 1.15rem;
}

.badge-counter {
  margin-left: auto;
  background-color: var(--accent-danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.quick-stats-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.pill-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-success);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent-success);
}

.btn-theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-theme-toggle:hover {
  border-color: var(--border-light);
  background-color: var(--bg-card-hover);
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 24px 36px;
  max-width: 1400px;
  overflow-x: hidden;
}

/* Top Header */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.mobile-toggle {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 1.25rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.page-title {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.page-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.zoom-controls-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 3px;
}

.btn-zoom {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 700;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.btn-zoom:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.btn-zoom-label {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.btn-zoom-label:hover {
  background: var(--bg-card-hover);
  color: var(--accent-primary);
}

.zoom-icon {
  font-size: 0.75rem;
}

.month-selector-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 3px;
}

.btn-month-nav {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.btn-month-nav:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.input-month-picker {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 4px 8px;
  outline: none;
  cursor: pointer;
}

/* Tab Panes */
.tab-pane {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Metric Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition-normal), border-color var(--transition-normal);
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-light);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.metric-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-icon-bg {
  font-size: 1.25rem;
  padding: 6px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.income-card .metric-value { color: var(--accent-success); }
.expense-card .metric-value { color: var(--accent-danger); }
.balance-card .metric-value { color: var(--accent-primary); }

.metric-footer {
  font-size: 0.8rem;
  font-weight: 500;
}

.text-muted { color: var(--text-muted); }

/* Dashboard Grids */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.dashboard-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Generic Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header-title h3 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-body {
  padding: 24px;
}

.card-body.no-padding {
  padding: 0;
}

/* Donut Chart and Legend */
.donut-chart-container {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 220px;
}

.svg-chart-wrapper {
  flex: 0 0 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

.legend-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.legend-name {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
}

.legend-value {
  font-weight: 700;
  color: var(--text-primary);
}

/* History Bar Chart */
.bar-chart-wrapper {
  width: 100%;
  height: 220px;
}

/* Budget & Recent Lists */
.budgets-mini-list, .budgets-full-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.budget-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.budget-item-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 600;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background-color: var(--bg-secondary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.progress-fill-success { background-color: var(--accent-success); }
.progress-fill-warning { background-color: var(--accent-warning); }
.progress-fill-danger { background-color: var(--accent-danger); }

/* Recent Transactions Mini List */
.recent-tx-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mini-tx-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
}

.mini-tx-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mini-tx-icon {
  font-size: 1.1rem;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th {
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.data-table tr:hover td {
  background-color: var(--bg-card-hover);
}

.text-right { text-align: right; }
.text-center { text-align: center; }

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-paid {
  background: var(--accent-success-bg);
  color: var(--accent-success);
}

.badge-pending {
  background: var(--accent-warning-bg);
  color: var(--accent-warning);
}

.badge-overdue {
  background: var(--accent-danger-bg);
  color: var(--accent-danger);
}

.badge-today {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-primary);
}

/* Goals Grid */
.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.goal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.goal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.goal-title-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.goal-icon {
  font-size: 1.4rem;
}

.goal-title {
  font-weight: 700;
  font-size: 0.95rem;
}

/* Action Tiles & Import Dropzone */
.action-tiles-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.action-tile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.tile-icon {
  font-size: 1.75rem;
}

.tile-info {
  flex: 1;
}

.tile-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
}

.tile-info p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.import-dropzone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  text-align: center;
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.dropzone-icon {
  font-size: 2.5rem;
}

.danger-zone-box {
  background: var(--accent-danger-bg);
  border: 1px solid var(--accent-danger);
  border-radius: var(--radius-md);
  padding: 16px;
}

.danger-zone-box h4 {
  color: var(--accent-danger);
  font-weight: 700;
  font-size: 0.95rem;
}

.danger-zone-box p {
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin: 4px 0 12px 0;
}

/* Buttons */
.btn-primary {
  background-color: var(--accent-primary);
  color: #ffffff;
  border: none;
  padding: 9px 18px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.btn-primary:hover {
  background-color: var(--accent-primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  border-color: var(--border-light);
  background-color: var(--bg-card-hover);
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--accent-primary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
}

.btn-ghost:hover {
  text-decoration: underline;
}

.btn-action-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.btn-action-icon:hover {
  color: var(--text-primary);
}

.btn-action-icon.delete:hover {
  color: var(--accent-danger);
}

.btn-danger-outline {
  background: transparent;
  border: 1px solid var(--accent-danger);
  color: var(--accent-danger);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-danger-outline:hover {
  background: var(--accent-danger);
  color: #ffffff;
}

/* Forms & Inputs */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 12px;
  flex: 1;
  max-width: 400px;
}

.search-icon {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.search-input {
  border: none !important;
  background: transparent !important;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input, .form-select {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.form-select, select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  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='%2394a3b8' stroke-width='2.5' 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 12px center;
  background-size: 16px;
  padding-right: 38px;
  color: var(--text-primary);
  background-color: var(--bg-input);
}

/* Explicit high-contrast rules for dropdown options */
select option, .form-select option {
  background-color: var(--bg-card) !important;
  color: var(--text-primary) !important;
  font-size: 0.9rem;
  padding: 10px 12px;
}

select optgroup, .form-select optgroup {
  background-color: var(--bg-secondary) !important;
  color: var(--text-muted) !important;
  font-weight: 700;
}

.form-input:focus, .form-select:focus, select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-input[type="date"]::-webkit-calendar-picker-indicator,
.input-month-picker::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(0.8) brightness(1.2);
}

[data-theme="light"] .form-input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="light"] .input-month-picker::-webkit-calendar-picker-indicator {
  filter: none;
}

.form-row {
  display: flex;
  gap: 12px;
}

.col-6 { flex: 1; }
.mt-3 { margin-top: 14px; }
.mt-4 { margin-top: 18px; }

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalScale 0.2s ease;
}

.modal-card.modal-sm {
  max-width: 400px;
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.15rem;
  cursor: pointer;
}

.modal-body {
  padding: 24px;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Radio button toggle group */
.tx-type-toggle-group {
  display: flex;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
}

.type-btn {
  flex: 1;
  text-align: center;
  padding: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.type-btn input {
  display: none;
}

.type-btn.active {
  background-color: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

#type-btn-expense.active { color: var(--accent-danger); }
#type-btn-income.active { color: var(--accent-success); }

/* Empty States */
.empty-state {
  text-align: center;
  padding: 48px 20px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-state h4 {
  font-size: 1.1rem;
  font-weight: 700;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 6px 0 18px 0;
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 110;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideInRight 0.25s ease;
}

.toast-success { border-left: 4px solid var(--accent-success); }
.toast-error { border-left: 4px solid var(--accent-danger); }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
  .dashboard-grid, .dashboard-bottom-grid, .grid-2-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -260px;
    transition: left var(--transition-normal);
  }
  .sidebar.open {
    left: 0;
  }
  .mobile-toggle {
    display: inline-block;
  }
  .main-content {
    padding: 16px;
  }
  .donut-chart-container {
    flex-direction: column;
  }
  .form-row {
    flex-direction: column;
  }
}

/* Print Styles */
@media print {
  .sidebar, .top-header, .header-actions, .filter-bar, .btn-primary, .btn-secondary, .btn-ghost, .btn-action-icon, .sidebar-footer {
    display: none !important;
  }
  .main-content {
    padding: 0;
    max-width: 100%;
  }
  body {
    background: #fff;
    color: #000;
  }
  .card, .metric-card {
    border: 1px solid #ccc;
    box-shadow: none;
    break-inside: avoid;
  }
}
