/* ═══════════════════════════════════════════════
   style.css — Finance Dashboard
   Color Palette: Teal #0F766E accent
   Font: Inter (Google Fonts)
   ═══════════════════════════════════════════════ */

/* ── CSS Custom Properties ── */
:root {
  /* Primary */
  --primary:        #0F766E;
  --primary-light:  #14B8A6;
  --primary-dark:   #0D5F58;
  --primary-bg:     rgba(15, 118, 110, 0.08);

  /* Neutrals */
  --bg:             #F8FAFA;
  --bg-card:        #FFFFFF;
  --bg-sidebar:     #0F1B1A;
  --bg-navbar:      #FFFFFF;

  --text-primary:   #1A1A2E;
  --text-secondary: #5A6170;
  --text-muted:     #8C95A6;
  --text-sidebar:   #C2D0CF;
  --text-sidebar-active: #FFFFFF;

  --border:         #E5E8EB;
  --border-light:   #F0F2F4;

  /* Semantic */
  --income:         #059669;
  --income-bg:      rgba(5, 150, 105, 0.10);
  --expense:        #DC2626;
  --expense-bg:     rgba(220, 38, 38, 0.10);
  --balance:        #0F766E;
  --balance-bg:     rgba(15, 118, 110, 0.10);

  /* Danger */
  --danger:         #DC2626;
  --danger-dark:    #B91C1C;
  --danger-bg:      rgba(220, 38, 38, 0.08);

  /* Shadows */
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:      0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:      0 8px 24px rgba(0,0,0,0.10);

  /* Layout */
  --sidebar-width:  250px;
  --navbar-height:  64px;
  --radius:         12px;
  --radius-sm:      8px;

  /* Transitions */
  --transition:     0.25s ease;
}

/* ── Dark Mode Variables ── */
.dark-mode {
  --bg:             #0F1214;
  --bg-card:        #1A1F25;
  --bg-sidebar:     #0A0E10;
  --bg-navbar:      #1A1F25;

  --text-primary:   #E8EAED;
  --text-secondary: #9AA3B0;
  --text-muted:     #6B7585;

  --border:         #2A3038;
  --border-light:   #222830;

  --shadow-sm:      0 1px 3px rgba(0,0,0,0.20);
  --shadow-md:      0 4px 12px rgba(0,0,0,0.30);
  --shadow-lg:      0 8px 24px rgba(0,0,0,0.35);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
}

select, input {
  font-family: inherit;
  font-size: 0.875rem;
}

table {
  border-collapse: collapse;
  width: 100%;
}


/* ═══════════════════════════════════════════════
   GLOBAL ACCESSIBILITY — Focus Visible
   ═══════════════════════════════════════════════ */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}


/* ═══════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 1.5rem;
  color: var(--primary-light);
}

.logo h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.5px;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-sidebar);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}

.nav-link:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-sidebar-active);
}

.nav-link.active {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.35);
}

.nav-icon {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-credit {
  font-size: 0.75rem;
  color: var(--text-sidebar);
  opacity: 0.6;
}

.sidebar-shortcut-hint {
  font-size: 0.7rem;
  color: var(--text-sidebar);
  opacity: 0.4;
  margin-top: 6px;
}

.sidebar-shortcut-hint kbd {
  background: rgba(255,255,255,0.1);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.68rem;
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 99;
  opacity: 0;
  transition: opacity var(--transition);
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}


/* ═══════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════ */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}


/* ═══════════════════════════════════════════════
   TOP NAVBAR
   ═══════════════════════════════════════════════ */
.top-navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--navbar-height);
  background: var(--bg-navbar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

.menu-toggle {
  display: none;
  font-size: 1.4rem;
  color: var(--text-secondary);
  padding: 6px;
}

.page-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Role Switcher */
.role-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
}

.role-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.role-select {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--transition);
}

.role-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}

/* Dark Mode Toggle */
.dark-mode-toggle {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all var(--transition);
}

.dark-mode-toggle:hover {
  background: var(--primary-bg);
  border-color: var(--primary);
  transform: scale(1.05);
}

.toggle-icon {
  font-size: 1.1rem;
}


/* ═══════════════════════════════════════════════
   CONTENT SECTIONS
   ═══════════════════════════════════════════════ */
.content-section {
  display: none;
  padding: 28px;
  animation: fadeIn 0.3s ease;
}

.content-section.active {
  display: block;
}

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

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

.section-header h2 {
  font-size: 1.15rem;
  font-weight: 600;
}

.section-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}


/* ═══════════════════════════════════════════════
   SUMMARY CARDS
   ═══════════════════════════════════════════════ */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.balance-icon {
  background: var(--balance-bg);
  color: var(--balance);
}

.income-icon {
  background: var(--income-bg);
  color: var(--income);
}

.expenses-icon {
  background: var(--expense-bg);
  color: var(--expense);
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.card-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}


/* ═══════════════════════════════════════════════
   CHARTS ROW
   ═══════════════════════════════════════════════ */
.charts-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.chart-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.chart-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.chart-container canvas {
  width: 100% !important;
  height: 280px !important;
}


/* ═══════════════════════════════════════════════
   FILTERS BAR
   ═══════════════════════════════════════════════ */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.filters-bar-date {
  margin-bottom: 20px;
  align-items: flex-end;
}

.date-range-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-date-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.filter-input,
.filter-select {
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.filter-input {
  flex: 1;
  min-width: 200px;
}

.filter-date {
  min-width: 150px;
  flex: 0;
}

.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}

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


/* ═══════════════════════════════════════════════
   TRANSACTIONS TABLE
   ═══════════════════════════════════════════════ */
.table-wrapper {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.transactions-table {
  min-width: 650px;
}

.transactions-table thead {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.transactions-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.transactions-table td {
  padding: 14px 16px;
  font-size: 0.875rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
}

.transactions-table tbody tr {
  transition: background var(--transition);
}

.transactions-table tbody tr:hover {
  background: var(--primary-bg);
}

.transactions-table tbody tr:last-child td {
  border-bottom: none;
}

/* Type badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-income {
  background: var(--income-bg);
  color: var(--income);
}

.badge-expense {
  background: var(--expense-bg);
  color: var(--expense);
}

/* Amount styling */
.amount-income {
  color: var(--income);
  font-weight: 600;
}

.amount-expense {
  color: var(--expense);
  font-weight: 600;
}

/* Admin Actions Column */
.admin-only-col {
  display: none;
}

.admin-mode .admin-only-col {
  display: table-cell;
}

/* Action buttons in table */
.actions-cell {
  display: flex;
  gap: 6px;
  align-items: center;
}

.btn-edit,
.btn-delete {
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  background: transparent;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
}

.btn-edit {
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-edit:hover {
  background: var(--primary);
  color: #FFFFFF;
}

.btn-delete {
  color: var(--danger);
  border: 1px solid var(--danger);
}

.btn-delete:hover {
  background: var(--danger);
  color: #FFFFFF;
}

/* Empty State */
.empty-state {
  padding: 60px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.empty-state-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 6px;
  opacity: 0.7;
}


/* ═══════════════════════════════════════════════
   INSIGHTS GRID
   ═══════════════════════════════════════════════ */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.insight-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.insight-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* Accent stripe at top */
.insight-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  border-radius: var(--radius) var(--radius) 0 0;
}

.insight-card.insight-positive::before { background: var(--income); }
.insight-card.insight-negative::before { background: var(--expense); }
.insight-card.insight-neutral::before  { background: var(--primary); }

/* Insight Header with Icon */
.insight-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.insight-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.insight-icon.icon-positive { background: var(--income-bg); color: var(--income); }
.insight-icon.icon-negative { background: var(--expense-bg); color: var(--expense); }
.insight-icon.icon-neutral  { background: var(--balance-bg); color: var(--balance); }

.insight-card .insight-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.insight-card .insight-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.insight-card .insight-detail {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}


/* ═══════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-icon {
  font-size: 1.1rem !important;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(15,118,110,0.25);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(15,118,110,0.35);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

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

.btn-danger {
  background: var(--danger);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(220,38,38,0.25);
}

.btn-danger:hover {
  background: var(--danger-dark);
  box-shadow: 0 4px 12px rgba(220,38,38,0.35);
}


/* ═══════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  width: 90%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

.modal-close {
  font-size: 1.2rem;
  color: var(--text-muted);
  padding: 4px;
  transition: color var(--transition), transform var(--transition);
}

.modal-close:hover {
  color: var(--text-primary);
  transform: scale(1.1);
}

.form-group {
  padding: 0 24px;
  margin-top: 16px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-primary);
  transition: border-color var(--transition);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}

/* Form Validation Error */
.form-error {
  display: block;
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: 4px;
  min-height: 1rem;
  transition: opacity var(--transition);
}

.form-group.has-error input,
.form-group.has-error select {
  border-color: var(--danger);
}

.form-group.has-error input:focus,
.form-group.has-error select:focus {
  box-shadow: 0 0 0 3px var(--danger-bg);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px 24px;
}


/* ═══════════════════════════════════════════════
   CONFIRMATION DIALOG
   ═══════════════════════════════════════════════ */
.confirm-overlay {
  z-index: 250;
}

.confirm-dialog {
  background: var(--bg-card);
  border-radius: var(--radius);
  width: 90%;
  max-width: 400px;
  padding: 28px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}

.confirm-icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--expense-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.confirm-icon {
  font-size: 1.6rem;
  color: var(--danger);
}

.confirm-dialog h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.confirm-dialog p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.confirm-warning {
  font-size: 0.8rem !important;
  color: var(--text-muted) !important;
  margin-top: 4px;
}

.confirm-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}


/* ═══════════════════════════════════════════════
   KEYBOARD SHORTCUTS MODAL
   ═══════════════════════════════════════════════ */
.shortcuts-modal {
  max-width: 380px;
}

.shortcuts-body {
  padding: 16px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shortcut-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.shortcut-row kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}


/* ═══════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  font-size: 0.875rem;
  font-weight: 500;
  min-width: 260px;
  max-width: 400px;
  pointer-events: auto;
  animation: toastIn 0.35s ease;
}

.toast-icon {
  font-size: 1.2rem !important;
  flex-shrink: 0;
}

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

.toast-success .toast-icon {
  color: var(--income);
}

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

.toast-error .toast-icon {
  color: var(--danger);
}

.toast-info {
  border-left: 4px solid var(--primary);
}

.toast-info .toast-icon {
  color: var(--primary);
}

.toast-exit {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(60px) scale(0.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(60px) scale(0.95); }
}


/* ═══════════════════════════════════════════════
   RESPONSIVE — Tablet
   ═══════════════════════════════════════════════ */
@media (max-width: 1024px) and (min-width: 769px) {
  .summary-cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .charts-row {
    grid-template-columns: 1fr;
  }

  .insights-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ═══════════════════════════════════════════════
   RESPONSIVE — Mobile
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
  }

  .main-content {
    margin-left: 0;
  }

  .menu-toggle {
    display: block;
  }

  .top-navbar {
    padding: 0 16px;
  }

  .content-section {
    padding: 20px 16px;
  }

  .summary-cards {
    grid-template-columns: 1fr;
  }

  .charts-row {
    grid-template-columns: 1fr;
  }

  .insights-grid {
    grid-template-columns: 1fr;
  }

  .filters-bar {
    flex-direction: column;
  }

  .filter-input {
    min-width: 100%;
  }

  .filter-date {
    min-width: 100%;
  }

  .filter-select {
    width: 100%;
  }

  .date-range-group {
    width: 100%;
  }

  .role-label {
    display: none;
  }

  .card {
    padding: 16px 18px;
  }

  .card-value {
    font-size: 1.35rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-header-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .table-wrapper {
    border-radius: var(--radius-sm);
  }

  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .toast {
    min-width: unset;
    max-width: unset;
  }

  .sidebar-shortcut-hint {
    display: none;
  }
}

@media (max-width: 480px) {
  .navbar-actions {
    gap: 8px;
  }

  .card-value {
    font-size: 1.2rem;
  }

  .insight-card .insight-value {
    font-size: 1.25rem;
  }

  .section-header-actions {
    flex-direction: column;
    width: 100%;
  }

  .section-header-actions .btn {
    width: 100%;
    justify-content: center;
  }
}


/* ═══════════════════════════════════════════════
   EXTRA POLISH
   ═══════════════════════════════════════════════ */
.chart-container {
  transition: box-shadow var(--transition), transform var(--transition);
}

.chart-container:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.content-section.active {
  animation: fadeIn 0.3s ease;
}

.dark-mode .sidebar {
  border-right: 1px solid rgba(255,255,255,0.05);
}

.dark-mode .transactions-table thead {
  background: rgba(255,255,255,0.03);
}

/* Staggered card entrance */
@keyframes cardSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card {
  animation: cardSlideIn 0.4s ease backwards;
}

.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }


/* ═══════════════════════════════════════════════
   PRINT STYLESHEET
   ═══════════════════════════════════════════════ */
@media print {
  .sidebar,
  .sidebar-overlay,
  .top-navbar,
  .modal-overlay,
  .confirm-overlay,
  .toast-container,
  .filters-bar,
  .filters-bar-date,
  .section-header-actions,
  .menu-toggle,
  .btn-edit,
  .btn-delete,
  .admin-only-col {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
  }

  .content-section {
    display: block !important;
    padding: 20px 0;
    animation: none;
    page-break-after: always;
  }

  body {
    background: white;
    color: black;
    font-size: 12pt;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
    animation: none;
  }

  .table-wrapper {
    box-shadow: none;
    border: 1px solid #ddd;
    overflow: visible;
  }

  .transactions-table {
    min-width: unset;
  }

  .chart-container {
    box-shadow: none;
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }
}
/* GOALS CSS */
/* -----------------------------------------------
   GOALS GRID
   ----------------------------------------------- */
.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.goal-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.goal-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* Accent stripe */
.goal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  border-radius: var(--radius) var(--radius) 0 0;
}

.goal-active::before { background: var(--primary); }
.goal-completed::before { background: var(--income); }
.goal-overdue::before { background: var(--expense); }

.goal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.goal-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.goal-category {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.goal-progress {
  margin-bottom: 16px;
}

.progress-bar {
  height: 8px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.goal-completed .progress-fill { background: var(--income); }
.goal-overdue .progress-fill { background: var(--expense); }

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.progress-current {
  font-weight: 600;
  color: var(--text-primary);
}

.goal-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.goal-detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.detail-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.detail-value.overdue {
  color: var(--expense);
}


/* ═══════════════════════════════════════════════
   CLICKABLE LOGO
   ═══════════════════════════════════════════════ */
a.logo {
  cursor: pointer;
  transition: opacity var(--transition);
}

a.logo:hover {
  opacity: 0.85;
}


/* ═══════════════════════════════════════════════
   LANDING PAGE — Hero
   ═══════════════════════════════════════════════ */
.landing-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  min-height: 380px;
  margin-bottom: 48px;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: var(--primary-bg);
  color: var(--primary);
  border: 1px solid rgba(15, 118, 110, 0.2);
  margin-bottom: 20px;
  animation: fadeIn 0.5s ease;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-primary);
  letter-spacing: -1.5px;
  margin-bottom: 18px;
}

.hero-highlight {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 480px;
  margin-bottom: 0;
}

/* Hero Visual — Floating stat cards */
.hero-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  min-height: 340px;
  justify-content: center;
}

.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(15, 118, 110, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
  50%      { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}

.hero-stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 1;
  transition: transform var(--transition), box-shadow var(--transition);
}

.hero-stat-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-lg);
}

.hero-stat-1 {
  animation: heroCardIn 0.6s ease 0.1s backwards;
  align-self: flex-start;
  margin-left: 10px;
}

.hero-stat-2 {
  animation: heroCardIn 0.6s ease 0.25s backwards;
  align-self: center;
}

.hero-stat-3 {
  animation: heroCardIn 0.6s ease 0.4s backwards;
  align-self: flex-end;
  margin-right: 10px;
}

@keyframes heroCardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.hero-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.hero-stat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.hero-stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}


/* ─── Landing Features ─── */
.landing-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.feature-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transform: scaleX(0);
  transition: transform 0.35s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.feature-card:hover::after {
  transform: scaleX(1);
}

.feature-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  transition: background var(--transition), transform var(--transition);
}

.feature-card:hover .feature-icon-wrap {
  background: var(--primary);
  transform: scale(1.1);
}

.feature-icon-wrap .material-icons-outlined {
  font-size: 1.6rem;
  color: var(--primary);
  transition: color var(--transition);
}

.feature-card:hover .feature-icon-wrap .material-icons-outlined {
  color: #FFFFFF;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.feature-card .feature-arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.feature-card:hover .feature-arrow {
  opacity: 1;
  transform: translateX(0);
}

.feature-card .feature-arrow .material-icons-outlined {
  font-size: 1rem;
}


/* ─── Landing Quick Stats Row ─── */
.landing-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 32px 0;
}

.landing-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.landing-stat:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.landing-stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -1px;
}

.landing-stat-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}


/* ─── Landing Page Responsive ─── */
@media (max-width: 1024px) and (min-width: 769px) {
  .landing-hero {
    grid-template-columns: 1fr;
    gap: 32px;
    min-height: auto;
  }

  .hero-visual {
    min-height: 260px;
  }

  .hero-stat-1,
  .hero-stat-2,
  .hero-stat-3 {
    align-self: stretch;
    margin: 0;
  }

  .landing-features {
    grid-template-columns: repeat(2, 1fr);
  }

  .landing-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .landing-hero {
    grid-template-columns: 1fr;
    gap: 24px;
    min-height: auto;
  }

  .hero-visual {
    min-height: 240px;
  }

  .hero-stat-1,
  .hero-stat-2,
  .hero-stat-3 {
    align-self: stretch;
    margin: 0;
  }

  .landing-features {
    grid-template-columns: 1fr;
  }

  .landing-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.6rem;
  }

  .landing-stats-row {
    grid-template-columns: 1fr;
  }
}
