:root {
  /* Premium Dark Theme Palette (Surgical Levels) */
  --bg-color: #080C14;           /* Level 0 Background */
  --bg-surface: #0D1526;         /* Level 1 Surgical Card Background */
  --bg-elevated: #16223b;        /* Level 2 Floating Layer */
  --bg-container: #0D1526;
  --bg-container-high: #16223b;
  --bg-container-low: #090e1a;
  --bg-lowest: #05080d;
  
  --text-main: #d3e4fe;
  --text-muted: #8c909f;
  --text-variant: #c2c6d6;
  
  --accent: #adc6ff;
  --accent-glow: rgba(173, 198, 255, 0.15);
  --accent-container: #4d8eff;
  
  --danger: #ff516a;
  --danger-soft: #ffb2b7;
  --success: #4edea3;
  --success-container: #00a572;
  
  --border-color: rgba(255,255,255,0.07);
  --border-active: rgba(173,198,255,0.3);
  
  /* Typography specifications */
  --font-mono: 'DM Mono', monospace;
  --font-heading: 'DM Mono', monospace;
  --font-body: 'DM Mono', monospace;
  
  /* Metrics */
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --bottom-nav-height: 64px;
  --header-height: 56px;
  --max-width: 430px;
  --edge-margin: 20px;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 200ms ease;
  --transition-slow: 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 15px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  opacity: 0.02;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 0),
                    radial-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 0);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
}

/* Ambient Background Blobs for ultra-premium depth */
.ambient-blobs {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.12;
}
.blob-1 {
  top: -10%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #adc6ff 0%, transparent 70%);
}
.blob-2 {
  bottom: 10%;
  left: -15%;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, #4edea3 0%, transparent 70%);
}
.blob-3 {
  top: 40%;
  right: 10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #ff516a 0%, transparent 70%);
}

/* Global Glass Surface Overrides for Frosted Glassmorphism */
.card-surface, .hero-card, .stat-card, .chart-card, .budget-card, .habit-card, .tx-row, .drawer-nav, .sheet, .ghost-card, .reconciliation-alert, .filters-bar {
  background: rgba(11, 28, 48, 0.45) !important;
  backdrop-filter: blur(24px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(160%) !important;
  border: 1px solid rgba(173, 198, 255, 0.08) !important;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25) !important;
}
.card-surface:hover, .hero-card:hover, .stat-card:hover, .chart-card:hover, .budget-card:hover, .habit-card:hover, .tx-row:hover, .ghost-card:hover {
  border-color: rgba(173, 198, 255, 0.16) !important;
}

/* Typography Classes */
h1, h2, h3, .greeting {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.03em;
}

.mono {
  font-family: var(--font-mono);
}

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400;
  vertical-align: middle;
}

.amber { color: var(--accent); }
.coral { color: var(--danger); }
.sage { color: var(--success); }
.muted { color: var(--text-muted); }

/* Buttons & Inputs */
button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  font-size: 15px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-normal);
}

.primary-btn {
  background: var(--accent);
  color: #002e6a;
  font-weight: 600;
  padding: 12px 20px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius-md);
}
.primary-btn:active { transform: scale(0.98); }
 
.secondary-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 12px 20px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius-md);
}
.secondary-btn:active { background: var(--bg-surface); }
 
.danger-btn {
  background: rgba(255, 81, 106, 0.1);
  color: var(--danger);
  border: 1px solid rgba(255, 81, 106, 0.2);
  padding: 12px 20px;
  border-radius: var(--radius-md);
}

.text-btn {
  color: var(--accent);
  padding: 4px 8px;
  font-size: 14px;
}

.full-width { width: 100%; display: block; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }
.mt-4 { margin-top: 32px; }

input, select, textarea {
  width: 100%;
  background: var(--bg-container);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: var(--radius-md);
  padding: 12px;
  font-family: var(--font-body);
  font-size: 16px;
  outline: none;
  transition: border-color var(--transition-fast);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

.form-row {
  margin-bottom: 16px;
  position: relative;
}
.form-row label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Radio Tabs Segmented Control */
.tabs-row {
  display: flex !important;
  flex-direction: row;
  background: var(--bg-container);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
}
.tabs-row input[type="radio"] {
  display: none;
}
.tabs-row label {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  text-transform: none;
  letter-spacing: 0;
}
.tabs-row input[type="radio"]:checked + label {
  background: var(--bg-elevated);
  color: var(--text-main);
}
.tabs-row input[value="Expense"]:checked + label {
  color: var(--danger);
}
.tabs-row input[value="Income"]:checked + label {
  color: var(--success);
}

/* Layout Shell */
#app-container {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
}

/* Desktop: Spotify-style side rail */
@media (min-width: 769px) {
  body { display: block; }
  #app-container {
    max-width: 100%;
    flex-direction: row;
    width: 100%;
  }
  #bottom-nav {
    position: fixed !important;
    left: 0 !important; top: 0 !important; bottom: 0 !important;
    width: 80px !important;
    height: 100vh !important;
    flex-direction: column !important;
    border-top: none !important;
    border-right: 1px solid var(--border-color) !important;
    padding: 24px 0 !important;
    transform: none !important;
    max-width: none !important;
    gap: 8px;
    border-radius: 0 !important;
  }
  #bottom-nav .nav-add-btn { order: -1; margin: 0 auto 16px; }
  #top-app-bar {
    position: fixed !important;
    left: 80px !important;
    top: 0 !important;
    right: 0 !important;
    width: calc(100% - 80px) !important;
    z-index: 30 !important;
  }
  #main-content {
    margin-left: 80px;
    padding-top: var(--header-height) !important;
    width: calc(100% - 80px);
    max-width: 100%;
    box-sizing: border-box;
  }
}

#desktop-sidebar { display: none; }

#main-content {
  flex: 1;
  position: relative;
  overflow-y: auto;
  padding-bottom: calc(var(--bottom-nav-height) + 24px);
}

/* Top App Bar */
#top-app-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--header-height);
  padding: 0 var(--edge-margin);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(3, 20, 39, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}
#top-app-bar .logo {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
}
#top-app-bar .icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-variant);
  border-radius: 50%;
  transition: all var(--transition-fast);
}
#top-app-bar .icon-btn:hover { color: var(--accent); }
#top-app-bar .profile-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-container-high);
  color: var(--text-muted);
  font-size: 16px;
}
#top-app-bar .profile-avatar img {
  width: 100%; height: 100%; object-fit: cover;
}

/* Old mobile header — hidden */
#mobile-header { display: none; }

/* Hamburger Drawer */
#hamburger-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(2px);
  z-index: 50;
  opacity: 0;
  transition: opacity var(--transition-normal);
}
#hamburger-overlay.show { opacity: 1; }

#hamburger-drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 280px;
  background: rgba(11, 28, 48, 0.95);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  z-index: 51;
  transform: translateX(-100%);
  transition: transform var(--transition-slow);
  display: flex; flex-direction: column;
  padding: 24px 0;
}
#hamburger-drawer.show { transform: translateX(0); }

.drawer-header {
  padding: 16px 24px 24px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 8px;
}
.drawer-header .logo {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
}

.drawer-nav { list-style: none; padding: 8px 12px; flex: 1; }
.drawer-nav .drawer-item {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  color: var(--text-variant);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 15px;
  font-weight: 500;
}
.drawer-nav .drawer-item:hover {
  background: rgba(173, 198, 255, 0.08);
  color: var(--text-main);
}
.drawer-nav .drawer-item .material-symbols-outlined { font-size: 22px; color: var(--text-muted); }

/* Bottom Nav (Mobile) */
#bottom-nav {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  height: var(--bottom-nav-height);
  background: rgba(3, 20, 39, 0.8);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  z-index: 20;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom);
}
#bottom-nav .nav-slot {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; cursor: pointer;
  color: var(--text-muted);
  transition: color var(--transition-fast);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
#bottom-nav .nav-slot .material-symbols-outlined { font-size: 24px; }
#bottom-nav .nav-slot.active { color: var(--accent); }
#bottom-nav .nav-slot.active .material-symbols-outlined { font-variation-settings: 'FILL' 1; }

.nav-add-btn {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #002e6a;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 20px rgba(173, 198, 255, 0.25);
  transition: transform var(--transition-fast);
  border: none; cursor: pointer;
  margin-top: -8px;
}
.nav-add-btn:active { transform: scale(0.9); }
.nav-add-btn .material-symbols-outlined { font-size: 28px; font-variation-settings: 'FILL' 1; }

/* Old mobile nav + fab — hidden */
#mobile-nav { display: none; }
.fab { display: none; }

/* Views Container */
.view {
  display: none;
  padding: 32px;
  max-width: 900px;
  margin: 0 auto;
  opacity: 0;
  animation: fadeIn 0.15s forwards;
}
.view.active {
  display: block;
}
@keyframes fadeIn {
  to { opacity: 1; }
}

.view-header {
  margin-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

/* View Specifics */
/* 1. Dashboard */
.hero-card {
  position: relative;
  padding: 40px 20px;
  text-align: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  margin-bottom: 24px;
  overflow: hidden;
  transition: box-shadow var(--transition-normal);
}
.hero-card:hover {
  box-shadow: inset 0 0 0 1px rgba(173, 198, 255, 0.1);
}
.hero-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}
.hero-balance {
  font-family: var(--font-mono);
  font-size: 48px;
  font-weight: 500;
  color: var(--accent);
  position: relative;
  z-index: 1;
}
.hero-sub {
  position: relative;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 12px;
  display: flex;
  gap: 16px;
  justify-content: center;
}
.hero-inc { color: var(--success); }
.hero-exp { color: var(--danger); }

.quick-stats-row {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  overflow-x: auto;
  padding-bottom: 8px; /* For scrollbar */
}
.stat-card {
  flex: 1;
  min-width: 80px;
  padding: 14px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}
.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.stat-value {
  font-family: var(--font-mono);
  font-size: 17px;
  margin-top: 6px;
  font-weight: 500;
}

.charts-row {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
}
.chart-card {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.chart-card h3 {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.ring-container, .spark-container, .bar-chart-container {
  width: 100%;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Nudge System */
#nudge-strip-container {
  padding: 0 32px;
  margin-top: 24px;
}
.nudge-strip {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
}
.nudge-sage { background: rgba(78, 222, 163, 0.08); color: var(--success); }
.nudge-neutral { background: var(--bg-surface); color: var(--text-muted); border: 1px solid var(--border-color); }
.nudge-amber { background: rgba(173, 198, 255, 0.08); color: var(--accent); }
.nudge-coral { background: rgba(255, 81, 106, 0.08); color: var(--danger); border: 1px solid var(--danger); }

.streak-banner {
  margin-top: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Modules Specific CSS will be added here, continuing layout... */

/* Mobile view overrides */
@media (max-width: 768px) {
  #desktop-sidebar { display: none; }
  .view { padding: var(--edge-margin); }
  #nudge-strip-container { padding: 0 var(--edge-margin); margin-top: 16px; }
  .charts-row { flex-direction: column; }
}

/* Hidden Class */
.hidden { display: none !important; }

/* Modals & Sheets */
#modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(2px);
  z-index: 40;
  opacity: 0;
  transition: opacity var(--transition-normal);
}
.bottom-sheet {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 90%;
  max-width: 400px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  max-height: 90dvh;
}

@media (max-width: 768px) {
  .bottom-sheet {
    top: auto;
    bottom: 0;
    left: 0;
    transform: translateY(100%);
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    border: none;
    border-top: 1px solid var(--border-color);
  }
  .bottom-sheet::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2.5px;
  }
}

.bottom-sheet.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
@media (max-width: 768px) {
  .bottom-sheet.show {
    transform: translateY(0);
  }
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}
.sheet-body {
  padding: 20px;
  overflow-y: auto;
}

/* Lists */
.tx-list {
  list-style: none;
}
.tx-row {
  display: flex;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.tx-row:hover { background: var(--bg-elevated); }
.tx-date { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); width: 60px; }
.tx-cat { font-size: 20px; margin: 0 12px; }
.tx-note { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.tx-amt { font-family: var(--font-mono); font-size: 15px; text-align: right; margin-left: 12px; }
.tx-source { font-size: 10px; padding: 2px 6px; border-radius: 4px; background: var(--bg-surface); margin-left: 8px; color: var(--text-muted); text-transform: uppercase;}

/* Specific styles will be populated below... */
.tx-row.splitwise-tx { border-left: 3px solid rgba(127, 191, 123, 0.4); }

.tx-actions-bar {
  background: var(--bg-surface);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
}
.filters-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  position: sticky;
  top: 0;
  background: var(--bg-color);
  padding: 16px 0;
  z-index: 5;
}

/* Tabs */
.tabs-nav {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}
.tab-btn {
  padding: 12px 24px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  border-radius: 0;
}
.tab-btn.active {
  color: var(--text-main);
  border-bottom-color: var(--accent);
}
.tab-pane { display: none; animation: fadeIn 0.15s; }
.tab-pane.active { display: block; }

/* Import */
.upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  transition: all var(--transition-fast);
}
.upload-zone.dragover { border-color: var(--accent); background: rgba(245, 166, 35, 0.05); }

/* Switch Toggle */
.toggle-switch {
  appearance: none;
  width: 44px;
  height: 24px;
  background: var(--border-color);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  outline: none;
  transition: var(--transition-fast);
}
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: var(--transition-fast);
}
.toggle-switch:checked { background: var(--success); }
.toggle-switch:checked::after { left: 22px; background: #fff; }

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Onboarding */
.full-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-color);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.onboarding-card {
  width: 90%; max-width: 400px;
  background: var(--bg-surface);
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  text-align: center;
}
.onboarding-card h2 { margin-bottom: 12px; font-size: 28px; }
.onboarding-card p { color: var(--text-muted); margin-bottom: 24px; }

/* Ghost List & Collapsible */
.collapsible-card { margin-bottom: 24px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); }
.card-header { padding: 16px; cursor: pointer; background: var(--bg-surface); }
.card-body { padding: 16px; border-top: 1px solid var(--border-color); }

/* Toasts */
#toast-container {
  position: fixed;
  bottom: 100px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px;
  z-index: 200; pointer-events: none;
}
.toast {
  background: var(--bg-elevated);
  color: var(--text-main);
  padding: 12px 20px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  font-size: 14px;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Chart Table */
.report-table { width: 100%; border-collapse: collapse; text-align: left; }
.report-table th { padding: 12px; border-bottom: 1px solid var(--border-color); color: var(--text-muted); font-weight: normal; font-size: 13px; }
.report-table td { padding: 12px; border-bottom: 1px solid var(--border-color); font-size: 14px; }
.report-table td:nth-child(n+2) { font-family: var(--font-mono); }

/* Habits Grid */
.habits-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-bottom: 24px; }
.habit-card { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 20px; }
.habit-header { display: flex; justify-content: space-between; margin-bottom: 16px; }
.habit-streak { color: var(--accent); font-weight: bold; font-family: var(--font-mono); }
.heatmap { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-bottom: 12px; }
.heat-cell { aspect-ratio: 1; border-radius: 2px; background: rgba(255,255,255,0.05); }
.heat-cell.active { background: var(--accent); }
.heat-cell.today { border: 1px solid rgba(255,255,255,0.5); }
.habit-motivation { font-size: 12px; color: var(--text-muted); font-style: italic; }

/* Budget Cards */
.budget-list { display: grid; gap: 16px; margin-bottom: 24px; }
.budget-card { background: var(--bg-surface); padding: 20px; border-radius: var(--radius-md); border: 1px solid var(--border-color); }
.bdg-header { display: flex; justify-content: space-between; margin-bottom: 12px; }
.bdg-track { height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.bdg-fill { height: 100%; background: var(--success); transition: width 0.3s; }
.bdg-stats { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }

/* Preview & Map Grid */
.mapper-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 24px; }
.preview-table-container { overflow-x: auto; margin-bottom: 24px; }
.preview-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.preview-table th, .preview-table td { padding: 8px; border: 1px solid var(--border-color); }

.reconciliation-alert { border-left: 4px solid var(--accent); background: rgba(245, 166, 35, 0.05); padding: 16px; border-radius: var(--radius-sm); display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.alert-text { font-size: 14px; }

.ghost-list { display: flex; flex-direction: column; gap: 12px; }
.ghost-card { background: var(--bg-surface); padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-color); }
.ghost-text { font-size: 14px; margin-bottom: 12px; }
.ghost-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.dashboard-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.dash-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ==========================================
   Desktop Screen Optimization (min-width: 769px)
   ========================================== */
@media (min-width: 769px) {
  .view {
    max-width: 1200px !important;
    padding: 40px !important;
  }

  /* 1. Dashboard Desktop Grid */
  .dashboard-grid {
    display: grid !important;
    grid-template-columns: 1.1fr 1fr !important;
    gap: 32px !important;
    align-items: start !important;
  }
  .dash-col {
    gap: 24px !important;
  }

  /* 2. Budgets Grid */
  .budget-list {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
    gap: 24px !important;
  }

  /* 3. Reports Desktop Grid */
  #view-reports.active {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 32px !important;
    align-items: start !important;
  }
  #view-reports > :nth-child(1), /* month selector */
  #view-reports > .quick-stats-row,
  #view-reports > #rep-sec-1-runway,
  #view-reports > #btn-export-report {
    grid-column: span 2 !important;
  }

  /* 4. Settings Desktop Grid */
  #view-settings.active {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 32px !important;
    align-items: start !important;
  }
  #view-settings > .view-header {
    grid-column: span 2 !important;
  }
}

/* ==========================================
   Premium UI/UX Core Classes (Surgical Overhaul)
   ========================================== */

/* Circular Gauge Visuals */
.clip-arc {
  clip-path: polygon(0 0, 100% 0, 100% 50%, 0 50%);
}

.bg-grid-pattern {
  background-size: 20px 20px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
}

.neon-glow {
  box-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent);
}

.ai-glow {
  box-shadow: 0 0 20px rgba(77, 142, 255, 0.15);
}

.chart-grid-line {
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

/* Bento Breakdown Grids & Cards */
.bento-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 24px;
}
.bento-card {
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.bento-card-full {
  grid-column: span 2;
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
}

/* Extra premium card enhancements */
.p-stack_md {
  padding: 16px !important;
}
.gap-stack_sm {
  gap: 8px !important;
}
.ai-glow-card {
  background: #0D1526;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  box-shadow: 0 0 20px rgba(77, 142, 255, 0.12);
}

/* Unified Vector List Rows */
.tx-row-v2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background var(--transition-fast);
}
.tx-row-v2:hover {
  background: rgba(173, 198, 255, 0.05);
}
.tx-vector-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(173, 198, 255, 0.08);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Premium Transaction Filter Bar */
.filters-bar {
  display: flex !important;
  gap: 12px !important;
  margin-bottom: 24px !important;
  flex-wrap: wrap !important;
  padding: 16px !important;
  border-radius: var(--radius-lg) !important;
  background: rgba(11, 28, 48, 0.45) !important;
  backdrop-filter: blur(24px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(160%) !important;
  border: 1px solid rgba(173, 198, 255, 0.08) !important;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25) !important;
}
.filter-input {
  flex: 1 1 140px !important;
  min-width: 140px !important;
  width: auto !important;
  background: var(--bg-lowest) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-main) !important;
  border-radius: var(--radius-md) !important;
  padding: 10px 16px !important;
  font-family: var(--font-body) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  transition: all var(--transition-fast) !important;
  cursor: pointer;
  outline: none !important;
}
.filter-input:focus {
  border-color: var(--accent) !important;
  background: var(--bg-elevated) !important;
  box-shadow: 0 0 0 2px rgba(173,198,255,0.15) !important;
}

/* Custom Transactions Premium UI Overhaul */
.tx-pills-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 4px 16px 4px;
  scrollbar-width: none; /* Hide scrollbar Firefox */
  -ms-overflow-style: none; /* Hide scrollbar IE */
  margin-bottom: 8px;
}
.tx-pills-scroll::-webkit-scrollbar {
  display: none; /* Hide scrollbar Chrome/Safari */
}

.tx-pill {
  flex-shrink: 0;
  padding: 8px 20px;
  border-radius: 24px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #8c9ba5;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}
.tx-pill:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-main);
}
.tx-pill.active {
  background: #adc6ff;
  border-color: #adc6ff;
  color: #0b1a30;
  box-shadow: 0 4px 12px rgba(173, 198, 255, 0.25);
}

/* Group date headers styling */
.tx-group-header {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5d6f7e;
  margin-bottom: 8px;
  margin-left: 4px;
  text-align: left;
}

/* Premium Row Container card */
.tx-group-container {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: rgba(11, 28, 48, 0.45) !important;
  border: 1px solid rgba(173, 198, 255, 0.06) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px !important;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
}

/* Squirclish transaction rows */
.tx-row-premium {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}
.tx-row-premium:last-child {
  border-bottom: none;
}
.tx-row-premium:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Left accent vertical indicator matching the type */
.tx-row-premium::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: transparent;
  transition: background 0.25s ease;
}
.tx-row-premium.income-row::before {
  background: var(--success); /* vibrant green Left accent line for income rows */
}

/* Left date layout stacked vertically */
.tx-date-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  text-align: center;
  margin-right: 16px;
  user-select: none;
}
.tx-date-day {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1;
}
.tx-date-month {
  font-family: var(--font-heading);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 3px;
  text-transform: uppercase;
}

/* Notes & Category Dot */
.tx-details-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}
.tx-details-title {
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--text-main);
  font-size: 15px;
  line-height: 1.25;
}
.tx-details-category {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 5px;
}
.tx-category-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

/* Monospace amount display */
.tx-amount-block {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  text-align: right;
  margin-left: 16px;
}
.tx-amount-block.income-amt {
  color: var(--success);
}
.tx-amount-block.expense-amt {
  color: var(--danger);
}

/* ==========================================
   Pending Review Card Deck Styles
   ========================================== */
.review-carousel-viewport {
  overflow: hidden;
  width: 100%;
  position: relative;
}

.review-card-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.review-card {
  background: var(--bg-surface);
  border: 1px solid rgba(245, 166, 35, 0.15); /* amber tint border */
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 16px rgba(245, 166, 35, 0.03);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: cardSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.review-card:hover {
  border-color: rgba(245, 166, 35, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 20px rgba(245, 166, 35, 0.06);
}

.review-card .card-main-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.review-card .card-merchant-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.review-card .card-icon {
  font-size: 24px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.review-card .card-merchant-name {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.2;
}

.review-card .card-meta-line {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  font-family: var(--font-mono);
}

.review-card .card-amount {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  text-align: right;
}

.review-card .card-amount.expense {
  color: var(--danger);
}

.review-card .card-amount.income {
  color: var(--success);
}

.review-card .card-details-tray {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  padding-top: 10px;
}

.review-card .card-category-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.review-card .card-subject-source {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  max-width: 60%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-card .card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 8px;
  margin-top: 4px;
}

.review-card .btn-card-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.review-card .btn-dismiss {
  background: rgba(234, 67, 53, 0.05);
  border-color: rgba(234, 67, 53, 0.15);
  color: var(--danger);
}
.review-card .btn-dismiss:hover {
  background: rgba(234, 67, 53, 0.12);
  border-color: rgba(234, 67, 53, 0.3);
}

.review-card .btn-edit {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}
.review-card .btn-edit:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.review-card .btn-confirm {
  background: var(--success);
  color: #000;
  font-weight: 600;
}
.review-card .btn-confirm:hover {
  box-shadow: 0 0 12px rgba(52, 168, 83, 0.3);
  transform: translateY(-1px);
}

/* Nav badging for transactions tab notifications */
.nav-badge {
  position: absolute;
  top: 4px;
  right: 18px;
  background: var(--amber);
  color: #000;
  font-size: 9px;
  font-weight: 700;
  font-family: var(--font-mono);
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.5);
  animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 166, 35, 0.4); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 5px rgba(245, 166, 35, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 166, 35, 0); }
}

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

.review-card.slide-out-confirm {
  transform: translateX(100%);
  opacity: 0;
  height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin: 0;
  overflow: hidden;
  border: none;
}

.review-card.slide-out-dismiss {
  transform: translateX(-100%);
  opacity: 0;
  height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin: 0;
  overflow: hidden;
  border: none;
}


