/* ===== landing.css ===== */
/**
 * POCKETSLY LANDING PAGE (landing.css)
 * ====================================
 * 2026 SaaS patterns: dark-mode default, bento feature grid,
 * selective glassmorphism, outcome-first hero, sticky glass nav.
 * WCAG 2.1 AA contrast on all text.
 */

.landing {
  --ld-bg: #0A0F1E;
  --ld-bg-2: #0D1428;
  --ld-surface: #131C33;
  --ld-surface-2: #182242;
  --ld-border: rgba(148, 163, 184, 0.14);
  --ld-border-strong: rgba(124, 58, 237, 0.4);
  --ld-text: #F1F5F9;
  --ld-text-soft: #C7D0E0;
  --ld-text-muted: #8A97B3;
  --ld-primary: #7C3AED;
  --ld-primary-soft: #A78BFA;
  --ld-glow: rgba(124, 58, 237, 0.28);
  --ld-success: #34D399;
  --ld-radius: 18px;
  color: var(--ld-text);
  background: var(--ld-bg);
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.landing *,
.landing *::before,
.landing *::after { box-sizing: border-box; }

.landing a { color: inherit; }

.landing .container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Sticky glass navbar ─────────────────────────────────────────────── */
.ld-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(10, 15, 30, 0.72);
  border-bottom: 1px solid var(--ld-border);
}

.ld-nav-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
}

.ld-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  color: var(--ld-text);
  text-decoration: none;
}

.ld-logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--ld-primary), #A855F7);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 16px;
}

.ld-nav-links {
  display: flex;
  gap: 6px;
  margin-left: 8px;
  flex-wrap: wrap;
}

.ld-nav-links a {
  color: var(--ld-text-soft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease;
}

.ld-nav-links a:hover {
  background: rgba(124, 58, 237, 0.14);
  color: var(--ld-text);
}

.ld-nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ld-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  border-radius: 12px;
  padding: 10px 18px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  min-height: 44px;
}

.ld-btn:focus-visible {
  outline: 2px solid var(--ld-primary-soft);
  outline-offset: 2px;
}

.ld-btn-primary {
  background: var(--ld-primary);
  color: #fff;
  box-shadow: 0 8px 24px var(--ld-glow);
}

.ld-btn-primary:hover { background: #8B5CF6; transform: translateY(-1px); }

.ld-btn-ghost {
  background: transparent;
  color: var(--ld-text-soft);
  border: 1px solid var(--ld-border);
}

.ld-btn-ghost:hover { border-color: var(--ld-border-strong); color: var(--ld-text); }

.ld-btn-big { padding: 14px 26px; font-size: 16px; border-radius: 14px; }

.ld-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ld-text-soft);
  font-weight: 600;
  font-size: 14px;
}

.ld-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ld-primary), #A855F7);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
}

/* ── Hero ────────────────────────────────────────────────────────────── */
.ld-hero {
  position: relative;
  padding: 96px 0 72px;
  text-align: center;
  overflow: hidden;
}

.ld-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 360px at 20% 0%, var(--ld-glow), transparent 70%),
    radial-gradient(560px 320px at 85% 10%, rgba(168, 85, 247, 0.22), transparent 70%);
  pointer-events: none;
}

.ld-hero-inner { position: relative; }

.ld-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--ld-border);
  background: var(--ld-surface);
  color: var(--ld-text-soft);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 22px;
}

.ld-eyebrow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ld-success);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18);
}

.ld-hero h1 {
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 auto 20px;
  max-width: 760px;
  color: var(--ld-text);
}

.ld-hero h1 .accent {
  background: linear-gradient(100deg, var(--ld-primary-soft), #C084FC);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ld-hero p.lede {
  font-size: clamp(16px, 2.4vw, 19px);
  color: var(--ld-text-soft);
  line-height: 1.6;
  max-width: 620px;
  margin: 0 auto 32px;
}

.ld-hero-proof {
  display: flex;
  justify-content: center;
  gap: 36px;
  flex-wrap: wrap;
  margin: 40px auto 0;
}

.ld-proof-item { text-align: center; }

.ld-proof-item b {
  display: block;
  font-size: 26px;
  font-weight: 800;
  color: var(--ld-text);
}

.ld-proof-item span {
  font-size: 13px;
  color: var(--ld-text-muted);
}

/* Hero product mockup — a glass card with faux dashboard */
.ld-mockup {
  margin: 56px auto 0;
  max-width: 860px;
  border-radius: var(--ld-radius);
  border: 1px solid var(--ld-border);
  background: var(--ld-surface);
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  text-align: left;
}

.ld-mockup-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--ld-border);
  background: var(--ld-surface-2);
}

.ld-mockup-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.4);
}

.ld-mockup-body {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 18px;
}

.ld-mock-tile {
  border-radius: 12px;
  padding: 16px;
  background: var(--ld-bg-2);
  border: 1px solid var(--ld-border);
  min-height: 92px;
}

.ld-mock-tile .tile-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 17px;
  margin-bottom: 10px;
  background: rgba(124, 58, 237, 0.18);
}

.ld-mock-tile .tile-line {
  height: 8px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.3);
  margin-bottom: 6px;
}

.ld-mock-tile .tile-line.short { width: 55%; }
.ld-mock-tile .tile-line.success { background: rgba(52, 211, 153, 0.5); }
.ld-mock-tile .tile-line.warn { background: rgba(124, 58, 237, 0.5); }

/* ── Sections ────────────────────────────────────────────────────────── */
.ld-section { padding: 72px 0; }

.ld-section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}

.ld-section-head h2 {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  color: var(--ld-text);
}

.ld-section-head p {
  font-size: 16px;
  color: var(--ld-text-muted);
  line-height: 1.6;
  margin: 0;
}

/* ── Bento grid ──────────────────────────────────────────────────────── */
.ld-bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 190px;
  gap: 14px;
}

.ld-cell {
  border-radius: var(--ld-radius);
  border: 1px solid var(--ld-border);
  background: var(--ld-surface);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.ld-cell:hover { transform: translateY(-2px); border-color: var(--ld-border-strong); }

.ld-cell-glass {
  background: rgba(19, 28, 51, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.ld-cell .cell-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  background: rgba(124, 58, 237, 0.16);
}

.ld-cell h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: var(--ld-text);
}

.ld-cell p {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ld-text-muted);
  margin: 0;
}

.ld-cell .cell-stat {
  margin-top: auto;
  font-size: 26px;
  font-weight: 800;
  color: var(--ld-text);
}

.ld-cell .cell-stat small { font-size: 13px; color: var(--ld-text-muted); font-weight: 600; }

.cell-2x2 { grid-column: span 6; grid-row: span 2; }
.cell-w2 { grid-column: span 6; }
.cell-w4 { grid-column: span 4; }
.cell-w3 { grid-column: span 3; }

/* ── How it works ────────────────────────────────────────────────────── */
.ld-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.ld-step {
  border-radius: var(--ld-radius);
  border: 1px solid var(--ld-border);
  background: var(--ld-surface);
  padding: 24px;
  position: relative;
}

.ld-step-num {
  font-size: 40px;
  font-weight: 800;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ld-primary-soft);
  line-height: 1;
}

.ld-step h3 { font-size: 16px; margin: 14px 0 8px; color: var(--ld-text); }
.ld-step p { font-size: 14px; color: var(--ld-text-muted); line-height: 1.6; margin: 0; }

/* ── Install section ─────────────────────────────────────────────────── */
.ld-hero-cta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.ld-btn svg { flex-shrink: 0; }

.ld-install-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.ld-install-card {
  border-radius: var(--ld-radius);
  border: 1px solid var(--ld-border);
  background: var(--ld-surface);
  padding: 26px 24px;
  text-align: left;
}

.ld-install-card .cell-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(124, 58, 237, 0.12);
  color: var(--ld-primary-soft);
  margin-bottom: 16px;
}

.ld-install-card h3 {
  font-size: 17px;
  margin: 0 0 10px;
  color: var(--ld-text);
}

.ld-install-card ol {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--ld-text-muted);
  font-size: 14px;
  line-height: 1.75;
}

.ld-install-card li { margin-bottom: 4px; }
.ld-install-card b { color: var(--ld-text-soft); font-weight: 700; }

.ld-install-cta { text-align: center; }

.ld-install-note {
  color: var(--ld-text-muted);
  font-size: 13px;
  margin: 14px 0 0;
}

.ld-cta-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* ── Final CTA ───────────────────────────────────────────────────────── */
.ld-cta {
  border-radius: 24px;
  padding: 64px 32px;
  text-align: center;
  background:
    radial-gradient(420px 220px at 50% -20%, rgba(168, 85, 247, 0.35), transparent 70%),
    linear-gradient(135deg, #3B1D78, #1A1240);
  border: 1px solid var(--ld-border-strong);
}

.ld-cta h2 {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
  margin: 0 0 14px;
  color: #fff;
}

.ld-cta p { font-size: 16px; color: rgba(241, 245, 249, 0.8); margin: 0 0 28px; }

/* ── Footer ──────────────────────────────────────────────────────────── */
.ld-footer {
  border-top: 1px solid var(--ld-border);
  padding: 40px 0 28px;
  color: var(--ld-text-muted);
  font-size: 14px;
}

.ld-footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .ld-nav-links { display: none; }
  .ld-mockup-body { grid-template-columns: repeat(2, 1fr); }
  .ld-steps { grid-template-columns: 1fr; }
  .ld-install-grid { grid-template-columns: 1fr; }
  .cell-2x2, .cell-w2, .cell-w4, .cell-w3 { grid-column: span 12; }
  .ld-bento { grid-auto-rows: auto; }
  .ld-hero { padding: 64px 0 48px; }
  .ld-section { padding: 48px 0; }
}

@media (max-width: 480px) {
  .ld-hero-proof { gap: 24px; }
  .ld-btn-big { width: 100%; }
  .ld-nav-actions .ld-btn-ghost { display: none; }
}

/* ===== variables.css ===== */
/**
 * DESIGN TOKENS & COLOR PALETTES (variables.css)
 * ===============================================
 * Principle: Single Responsibility Principle (SRP) & Centralized Source of Truth
 * 
 * Defines all global custom properties (CSS variables) for Light and Dark themes,
 * typography scales, spacing units, elevation/shadows, border radii, and transitions.
 */

:root {
  color-scheme: light;

  /* Color Palette - Light Mode (Minimalist Indigo & Slate) */
  --bg-main: #F4F7FB;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #FFFFFF;
  --bg-surface-alt: #F8FAFC;
  --bg-hover: #EEF2F6;

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #5F7188;

  --primary: #7C3AED;
  --primary-400: #A78BFA;
  --primary-500: #8B5CF6;
  --primary-600: #7C3AED;
  --primary-700: #6D28D9;
  --primary-text: #7C3AED;
  --primary-text-soft: #6D28D9;
  --primary-hover: #6D28D9;
  --primary-light: #F5F3FF;
  --primary-border: #DDD6FE;
  --primary-glow: rgba(124, 58, 237, 0.25);

  --accent-success: #10B981;
  --accent-success-strong: #047857;
  --accent-success-light: #ECFDF5;
  --accent-warning: #F59E0B;
  --accent-warning-strong: #92400E;
  --accent-warning-light: #FFFBEB;
  --accent-danger: #EF4444;
  --accent-danger-strong: #B91C1C;
  --accent-danger-light: #FEF2F2;

  --border-color: #E2E8F0;
  --border-focus: #7C3AED;

  /* Elevation & Depth */
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 4px 0 rgba(15, 23, 42, 0.05), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 12px -2px rgba(15, 23, 42, 0.07), 0 3px 6px -3px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 14px 28px -4px rgba(15, 23, 42, 0.08), 0 6px 10px -4px rgba(15, 23, 42, 0.04);
  --card-inner-glow: inset 0 1px 0 rgba(255, 255, 255, 0.8);

  /* Radii & Transitions */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);

  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Dark Mode Variables - Modern Fintech Slate */
[data-theme="dark"] {
  color-scheme: dark;
  --bg-main: #0B0F19;
  --bg-surface: #151D30;
  --bg-surface-elevated: #1C263F;
  --bg-surface-alt: #1E2943;
  --bg-hover: #263354;

  --text-primary: #F8FAFC;
  --text-secondary: #A1A1AA;
  --text-muted: #94A3B8;

  --primary: #7C3AED;
  --primary-400: #A78BFA;
  --primary-500: #8B5CF6;
  --primary-600: #7C3AED;
  --primary-700: #6D28D9;
  --primary-text: #A78BFA;
  --primary-text-soft: #A78BFA;
  --primary-hover: #6D28D9;
  --primary-light: rgba(124, 58, 237, 0.15);
  --primary-border: rgba(124, 58, 237, 0.35);
  --primary-glow: rgba(124, 58, 237, 0.35);

  --accent-success: #10B981;
  --accent-success-strong: #34D399;
  --accent-success-light: rgba(16, 185, 129, 0.15);
  --accent-warning: #F59E0B;
  --accent-warning-strong: #FBBF24;
  --accent-warning-light: rgba(245, 158, 11, 0.15);
  --accent-danger: #EF4444;
  --accent-danger-strong: #F87171;
  --accent-danger-light: rgba(239, 68, 68, 0.15);

  --border-color: #1E2943;
  --border-focus: #7C3AED;

  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 2px 5px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);
  --card-inner-glow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}


/* ===== base.css ===== */
/**
 * GLOBAL RESETS & BASE TYPOGRAPHY (base.css)
 * ===========================================
 * Principle: Separation of Concerns (SoC) & DRY
 *
 * Normalizes CSS box-sizing, typography rendering, scrollbars, focus rings,
 * global link treatments, and base form element styles.
 */

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

*::-webkit-scrollbar {
  display: none;
}

*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
  -webkit-overflow-scrolling: touch;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* GPU-composited fixed background (zero scroll repaints) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image: radial-gradient(circle at 10% 20%, rgba(124, 58, 237, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.03) 0%, transparent 40%);
  transform: translateZ(0);
  will-change: transform;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition-fast);
  touch-action: manipulation;
}

a:hover {
  color: var(--primary-hover);
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: 0.95rem;
  touch-action: manipulation;
  color: var(--text-primary);
  border-radius: var(--radius-md);
}

/* Global Form Controls & Inputs (Universal Rounded Rectangle) */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="search"],
input[type="tel"],
select,
textarea,
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md) !important;
  background: var(--bg-surface-alt);
  color: var(--text-primary);
  transition: border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease;
  outline: none;
}

input:focus,
select:focus,
textarea:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  background-color: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

option {
  background-color: var(--bg-surface-elevated);
  color: var(--text-primary);
  padding: 0.5rem;
}

/* Global Form Controls */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

/* Base Utility Classes */
.hidden {
  display: none !important;
}

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

.link-btn {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-text);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.link-btn:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.icon-svg {
  width: 1.25em;
  height: 1.25em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ── FLEXBOX & SPACING UTILITIES (DRY Helpers) ─────────────────────────────── */
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-grid { display: grid; }
.d-block { display: block; }
.d-inline-block { display: inline-block; }
.flex-col { display: flex; flex-direction: column; }
.flex-row { display: flex; flex-direction: row; }
.flex-1 { flex: 1 1 0%; }
.flex-auto { flex: 1 1 auto; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }

.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }

.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-start { justify-content: flex-start; }

.gap-xs { gap: 0.25rem; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 0.75rem; }
.gap-lg { gap: 1rem; }
.gap-xl { gap: 1.5rem; }

/* Margins & Paddings */
.m-0 { margin: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-xs { margin-bottom: 0.25rem !important; }
.mb-sm { margin-bottom: 0.5rem !important; }
.mb-md { margin-bottom: 0.75rem !important; }
.mb-lg { margin-bottom: 1rem !important; }
.mb-xl { margin-bottom: 1.5rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-xs { margin-top: 0.25rem !important; }
.mt-sm { margin-top: 0.5rem !important; }
.mt-md { margin-top: 0.75rem !important; }
.mt-lg { margin-top: 1rem !important; }
.mt-xl { margin-top: 1.5rem !important; }

.p-0 { padding: 0 !important; }
.p-xs { padding: 0.25rem !important; }
.p-sm { padding: 0.5rem !important; }
.p-md { padding: 0.75rem !important; }
.p-lg { padding: 1rem !important; }
.p-xl { padding: 1.25rem !important; }
.p-2xl { padding: 1.5rem !important; }

.px-sm { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
.px-md { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
.px-lg { padding-left: 1rem !important; padding-right: 1rem !important; }
.py-sm { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-md { padding-top: 0.75rem !important; padding-bottom: 0.75rem !important; }
.py-lg { padding-top: 1rem !important; padding-bottom: 1rem !important; }

.w-full { width: 100% !important; }
.h-full { height: 100% !important; }
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

/* Typography */
.text-xs { font-size: 0.7rem !important; }
.text-sm { font-size: 0.8rem !important; }
.text-md { font-size: 0.88rem !important; }
.text-base { font-size: 0.95rem !important; }
.text-lg { font-size: 1.05rem !important; }
.text-xl { font-size: 1.25rem !important; }
.text-2xl { font-size: 1.5rem !important; }

.font-medium { font-weight: 500 !important; }
.font-semibold { font-weight: 600 !important; }
.font-bold { font-weight: 700 !important; }
.font-extrabold { font-weight: 800 !important; }
.font-mono { font-family: var(--font-mono) !important; }

.text-uppercase { text-transform: uppercase !important; letter-spacing: 0.05em !important; }
.text-nowrap { white-space: nowrap !important; }
.text-italic { font-style: italic !important; }

/* Colors */
.text-brand { color: var(--primary) !important; }
.text-success { color: var(--accent-success) !important; }
.text-warning { color: var(--accent-warning) !important; }
.text-danger { color: var(--accent-danger) !important; }
.text-purple { color: var(--primary-500) !important; }
.text-pink { color: #EC4899 !important; }

/* Grids */
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.grid-3col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.grid-auto-fit { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.col-span-full { grid-column: 1 / -1; }

/* UI Helpers */
.kbd-key {
  background: var(--bg-surface-alt);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  font-size: 0.72rem;
  font-family: var(--font-mono);
}

.icon-sm { width: 1em; height: 1em; }
.icon-md { width: 1.1em; height: 1.1em; }
.icon-lg { width: 1.35em; height: 1.35em; }
.icon-12 { width: 12px; height: 12px; }
.icon-16 { width: 16px; height: 16px; }
.icon-18 { width: 18px; height: 18px; }
.icon-20 { width: 20px; height: 20px; }
.icon-24 { width: 24px; height: 24px; }
.icon-brand { color: var(--primary); }
.icon-emerald { color: var(--accent-success); }
.icon-amber { color: var(--accent-warning); }
.icon-purple { color: var(--primary-500); }
.icon-pink { color: #EC4899; }




/* ===== layout.css ===== */
/**
 * APP LAYOUT & SHELL (layout.css)
 * ================================
 * Principle: Single Responsibility Principle (SRP) & High Cohesion
 *
 * Defines the application shell, desktop sidebar, collapsible sidebar states,
 * top header, main content layout, user profile panel, and mobile floating action buttons.
 */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR NAVIGATION ─────────────────────────────────────────────────────── */
.sidebar {
  width: 260px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 1.75rem 1.25rem;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), padding 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  padding: 0.25rem 0.5rem;
  margin-bottom: 2rem;
  color: var(--text-primary);
}

.brand-icon-dot {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--accent-success));
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.88rem;
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  transform: translateX(3px);
}

.nav-item.active {
  background: linear-gradient(90deg, var(--primary-light) 0%, rgba(124, 58, 237, 0.04) 100%);
  color: var(--primary-text);
  font-weight: 700;
  border: 1px solid var(--primary-border);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.12);
  transform: translateX(3px);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3.5px;
  border-radius: 0 4px 4px 0;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
}

.nav-counter {
  background: var(--primary);
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
  margin-left: auto;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.4);
}

/* ── SIDEBAR COLLAPSED STATE ───────────────────────────────────────────────── */
@media (min-width: 769px) {
  .sidebar.collapsed {
    width: 72px;
    padding: 1.75rem 0.5rem;
    align-items: center;
  }
  
  .sidebar.collapsed + .main-content {
    margin-left: 72px;
    width: calc(100% - 72px);
  }
  
  .sidebar.collapsed .brand-name,
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .user-info {
    display: none;
  }
  
  .sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0.75rem;
    width: 44px;
    height: 44px;
    margin: 0.2rem auto;
  }
  
  .sidebar.collapsed .nav-icon {
    margin: 0;
  }

  .sidebar.collapsed .user-profile {
    justify-content: center;
    padding: 0.5rem 0;
  }
  
  .sidebar.collapsed .user-profile > div:last-child {
    display: none !important;
  }

  .sidebar.collapsed #sidebar-toggle-btn {
    margin: 0 auto;
    transform: rotate(180deg);
  }

  .sidebar.collapsed .nav-counter {
    position: absolute;
    top: 4px;
    right: 4px;
    margin-left: 0;
    min-width: 8px;
    height: 8px;
    padding: 0;
    border: 1px solid var(--bg-surface);
    text-indent: -9999px;
    overflow: hidden;
  }
}

/* ── USER PROFILE PANEL (Sidebar Footer) ──────────────────────────────────── */
.user-profile {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-top: auto;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-400) 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.username {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── MAIN CONTENT & TOP HEADER ────────────────────────────────────────────── */
.main-content {
  margin-left: 260px;
  flex: 1;
  padding: 2rem 2.5rem;
  width: calc(100% - 260px);
  min-height: 100vh;
  transition: margin-left 0.3s cubic-bezier(0.16, 1, 0.3, 1), width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  gap: 1rem;
}

.header-title h1 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.header-title p {
  font-size: 0.9rem;
  margin-top: 0.2rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Profile pill card */
.dash-profile-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.75rem 0.4rem 0.4rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dash-profile-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.dash-profile-card:active {
  transform: scale(0.97);
}

.dash-profile-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.dash-profile-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-profile-sub {
  font-size: 0.68rem;
  color: var(--primary-text);
  font-weight: 600;
}

/* ── MOBILE FLOATING ACTION BUTTON (FAB) ───────────────────────────────────── */
.mobile-fab {
  display: none;
  position: fixed;
  bottom: 84px;
  right: 1.25rem;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-700) 100%);
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 900;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.45);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-fab:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.55);
}

.mobile-fab:active {
  transform: scale(0.92);
}

.mobile-fab svg {
  width: 24px;
  height: 24px;
  stroke: #FFFFFF;
}

.planner-fab {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-700) 100%);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.schedule-fab {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-700) 100%);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.schedule-fab:hover {
  box-shadow: 0 8px 24px var(--primary-glow);
}

.note-fab {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-700) 100%);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.budget-fab {
  background: linear-gradient(135deg, #10B981 0%, #047857 100%);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.budget-fab:hover {
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.55);
}


/* ===== components.css ===== */
/**
 * REUSABLE UI COMPONENTS (components.css)
 * ========================================
 * Principle: Single Responsibility Principle (SRP) & High Reusability
 *
 * Defines buttons, cards, pills, badges, progress bars, toast notifications,
 * theme toggle pills, and empty states.
 */

/* ── BUTTONS ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  gap: 0.5rem;
}

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

.btn-primary {
  background-color: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.2);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.3);
}

.btn-secondary {
  background-color: var(--bg-surface-alt);
  color: var(--text-primary);
  border-color: var(--border-color);
}

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

.btn-outline {
  background-color: var(--bg-surface-alt);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background-color: var(--bg-hover);
  color: var(--primary);
  border-color: var(--primary);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-md);
}

.btn-danger {
  background: linear-gradient(135deg, #EF4444 0%, #B91C1C 100%);
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.btn-danger:hover {
  background-color: #B91C1C;
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-icon {
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

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

/* ── CARDS ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 1rem;
  box-shadow: var(--shadow-sm), var(--card-inner-glow);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
  overflow: hidden;
  height: 100%;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), var(--card-inner-glow);
  border-color: var(--primary-border);
}

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

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

.card-body {
  padding: 1.25rem;
}

/* ── STAT PILLS & PRIORITY BADGES ─────────────────────────────────────────── */
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  width: fit-content;
}

.priority-badge {
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.priority-high {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-danger-strong);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.priority-medium {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-warning-strong);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.priority-low {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-success-strong);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ── THEME TOGGLE PILL ─────────────────────────────────────────────────────── */
.theme-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-xs);
}

.theme-switch-btn:hover {
  border-color: var(--primary-border);
  color: var(--text-primary);
  background: var(--bg-hover);
}

.theme-switch-pill {
  width: 32px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--border-color);
  position: relative;
  transition: var(--transition-smooth);
}

.theme-switch-pill::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #FFFFFF;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-xs);
}

[data-theme="dark"] .theme-switch-pill {
  background: var(--primary);
}

[data-theme="dark"] .theme-switch-pill::after {
  transform: translateX(14px);
  background: #FFFFFF;
}

/* ── TOAST NOTIFICATIONS ───────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 2000;
}

.toast {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--text-primary);
  color: var(--bg-main);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  animation: toastFade 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast-success {
  background: var(--accent-success);
  color: #FFFFFF;
}

.toast-danger {
  background: var(--accent-danger);
  color: #FFFFFF;
}

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

/* ── EMPTY STATES ─────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2.5rem 1rem;
  text-align: center;
}

.empty-state-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.empty-state-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.empty-state-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 260px;
  line-height: 1.5;
}


/* ===== dashboard.css ===== */
/**
 * DASHBOARD MODULE (dashboard.css)
 * =================================
 * Principle: Single Responsibility Principle (SRP) & High Cohesion
 *
 * Defines the main dashboard hero greeting, KPI analytics grid, stat cards,
 * quick action buttons, bento tiles, and activity streak heatmap visualization.
 */

.dashboard-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 1.5rem;
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* ── WELCOME HERO CARD ─────────────────────────────────────────────────────── */
.welcome-card {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(124, 58, 237, 0.06) 50%, rgba(16, 185, 129, 0.04) 100%);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm), var(--card-inner-glow);
  position: relative;
  overflow: hidden;
}

.welcome-card::after {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 150px;
  height: 150px;
  border-radius: var(--radius-full);
  background: radial-gradient(circle, rgba(124, 58, 237, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.welcome-card h2 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

/* ── 4 KPI SUMMARY ANALYTICS ROW ───────────────────────────────────────────── */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.dash-quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xs), var(--card-inner-glow);
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), var(--card-inner-glow);
  border-color: var(--primary-border);
}

.stat-item-indigo { border-top: 3px solid var(--primary); }
.stat-item-amber { border-top: 3px solid var(--accent-warning); }
.stat-item-purple { border-top: 3px solid var(--primary-500); }
.stat-item-emerald { border-top: 3px solid var(--accent-success); }

.stat-icon-box {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-indigo { background: rgba(124, 58, 237, 0.12); color: var(--primary-text); }
.stat-icon-amber { background: rgba(245, 158, 11, 0.12); color: var(--accent-warning-strong); }
.stat-icon-purple { background: rgba(124, 58, 237, 0.12); color: var(--primary-text-soft); }
.stat-icon-emerald { background: rgba(16, 185, 129, 0.12); color: var(--accent-success-strong); }

.stat-pill-indigo { background: rgba(124, 58, 237, 0.1); color: var(--primary-text); }
.stat-pill-amber { background: rgba(245, 158, 11, 0.1); color: var(--accent-warning-strong); }
.stat-pill-purple { background: rgba(124, 58, 237, 0.1); color: var(--primary-text-soft); }
.stat-pill-emerald { background: rgba(16, 185, 129, 0.1); color: var(--accent-success-strong); }

.stat-value {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--primary-text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-value-amber { color: var(--accent-warning-strong); }
.stat-value-purple { color: var(--primary-text-soft); }
.stat-value-emerald { color: var(--accent-success-strong); }


.stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── BENTO TILES (Curriculum & Study Modules on Dashboard) ─────────────────── */
.bento-section-title {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  color: var(--text-primary);
  font-weight: 700;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.bento-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-surface-alt);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
  color: inherit;
  position: relative;
  min-height: 170px;
}

.bento-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.bento-tile:active {
  transform: scale(0.98);
}

.bento-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.bento-icon-box {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bento-meta-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.bento-arrow {
  font-size: 1rem;
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.2s ease;
}

.bento-tile:hover .bento-arrow {
  transform: translate(2px, -2px);
  color: var(--primary-text);
}

.bento-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.35rem 0;
  line-height: 1.3;
}

.bento-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 0.85rem 0;
  line-height: 1.45;
  flex-grow: 1;
}

.bento-tags-row {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.bento-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

@media (min-width: 900px) {
  .bento-tile-featured {
    grid-column: span 2;
  }
}

/* ── FIRST-RUN ONBOARDING PANEL ────────────────────────────────────────────── */
.dash-onboarding-panel {
  display: none;
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(124, 58, 237, 0.05) 50%, rgba(16, 185, 129, 0.04) 100%);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm), var(--card-inner-glow);
  padding: 1.75rem;
  flex-direction: column;
  gap: 1.5rem;
  animation: onboarding-in 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.onboarding-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.onboarding-hero-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: rgba(124, 58, 237, 0.12);
  color: var(--primary-text);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.onboarding-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.onboarding-subtitle {
  margin: 0.3rem 0 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 640px;
  line-height: 1.5;
}

.onboarding-modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.85rem;
}

.onboarding-module-tile {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface-alt);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

.onboarding-module-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.onboarding-module-tile .tile-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: rgba(124, 58, 237, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.onboarding-module-tile .tile-icon.text-success {
  background: rgba(16, 185, 129, 0.12);
}

.onboarding-module-tile .tile-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
}

.onboarding-module-tile .tile-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
  flex-grow: 1;
}

.onboarding-module-tile .tile-open {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-text);
  transition: transform 0.2s ease, color 0.2s ease;
}

.onboarding-module-tile:hover .tile-open {
  transform: translateX(3px);
}

.onboarding-cta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.onboarding-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* New user mode: show onboarding, hide the live dashboard content */
#view-dashboard.new-user .dash-kpi-grid {
  display: none;
}

#view-dashboard.new-user .dashboard-main-grid {
  display: none;
}

#view-dashboard.new-user .dash-onboarding-panel {
  display: flex;
}

/* ── Dashboard Domain Styles ── */
.dash-financial-gradient { background: linear-gradient(145deg, var(--bg-surface) 0%, rgba(16, 185, 129, 0.04) 100%); }
.dash-curriculum-gradient { background: linear-gradient(145deg, var(--bg-surface) 0%, rgba(124, 58, 237, 0.04) 100%); }
.dash-sandbox-btn { display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 0.85rem; font-size: 0.82rem; }


/* ===== habits_tasks.css ===== */
/**
 * HABITS & TASKS PLANNER (habits_tasks.css)
 * ==========================================
 * Principle: Single Responsibility Principle (SRP) & High Cohesion
 *
 * Defines the combined planner layout, habits streak cards, 7-day mini heatmap,
 * task list items, custom checkboxes, task filtering pills, and priority badges.
 */

/* ── PLANNER SPLIT GRID ────────────────────────────────────────────────────── */
.planner-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1.25rem;
  align-items: start;
}

.planner-column {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

/* ── HABITS MODULE ─────────────────────────────────────────────────────────── */
.habits-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1rem;
}

.habit-card {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 0.95rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-xs);
  transition: var(--transition-smooth);
}

.habit-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--primary-border);
}

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

.habit-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

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

.habit-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
  line-height: 1.25;
}

.habit-streak {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-warning);
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-top: 0.15rem;
}

.habit-toggle-btn {
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-surface-alt);
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.habit-toggle-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.habit-toggle-btn.done {
  background: var(--accent-success-light);
  color: var(--accent-success);
  border-color: var(--accent-success);
}

/* 7-Day Mini Heatmap Grid */
.heatmap-mini {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.heatmap-day {
  height: 26px;
  border-radius: 6px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.heatmap-day.completed {
  background: linear-gradient(135deg, #10B981 0%, #047857 100%);
  color: #FFFFFF;
  border-color: #10B981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.35);
}

/* ── TASKS MODULE ──────────────────────────────────────────────────────────── */
.task-filters {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.filter-btn {
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

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

.filter-btn.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 2px 4px rgba(124, 58, 237, 0.25);
}

.tasks-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.95rem;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

.task-item:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-sm);
}

.task-item.done {
  opacity: 0.65;
  background: var(--bg-surface-alt);
}

.task-item.done .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-left {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border-color);
  background: var(--bg-surface-alt);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 1px;
  flex-shrink: 0;
}

.checkbox-custom:hover {
  border-color: var(--primary);
  transform: scale(1.08);
}

.checkbox-custom.checked {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 0 8px rgba(124, 58, 237, 0.4);
}

.task-details {
  display: flex;
  flex-direction: column;
}

.task-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.task-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.2rem;
}


/* ===== schedule.css ===== */
/**
 * SCHEDULE & TIMETABLE (schedule.css)
 * ====================================
 * Principle: Single Responsibility Principle (SRP) & High Cohesion
 *
 * Defines the 7-day academic/routine timetable grid, day columns, event blocks,
 * mobile day switcher pill carousel, and today indicator highlights.
 */

.timetable-mobile-nav {
  display: none;
}

.timetable-pill-scroll {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.25rem 0.25rem 0.6rem 0.25rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.timetable-pill-scroll::-webkit-scrollbar {
  display: none;
}

.day-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

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

.day-pill-btn.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.3);
}

.day-pill-badge {
  background: var(--bg-hover);
  color: var(--text-primary);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 800;
}

.day-pill-btn.active .day-pill-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

.day-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10B981;
}

/* ── 7-DAY TIMETABLE GRID ──────────────────────────────────────────────────── */
.timetable-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.85rem;
  width: 100%;
}

.day-column {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 420px;
  box-shadow: var(--shadow-xs);
}

.day-column.today {
  border-color: var(--primary);
  background: var(--bg-surface);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.day-header {
  font-weight: 700;
  font-size: 0.85rem;
  text-align: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.35rem;
}

.day-column.today .day-header {
  color: var(--primary-text);
}

.today-tag {
  color: var(--primary-text);
  font-weight: 700;
}

.empty-day-slot:hover {
  border-color: var(--primary) !important;
  background: var(--primary-light) !important;
}

.empty-day-slot:hover span {
  color: var(--primary) !important;
}

/* ── EVENT BLOCKS ─────────────────────────────────────────────────────────── */
.event-block {
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  transition: var(--transition-fast);
}

.event-block:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.event-title {
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.event-time {
  font-size: 0.72rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}


/* ===== notes.css ===== */
/**
 * JOURNAL & NOTES MODULE (notes.css)
 * ===================================
 * Principle: Single Responsibility Principle (SRP) & High Cohesion
 *
 * Defines the master-detail notes layout, note list items, mood accent colors,
 * note editor toolbar, textarea, academic library collection, and citation preview.
 */

.notes-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.25rem;
  height: calc(100vh - 160px);
  min-height: 560px;
}

.notes-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  overflow-y: auto;
  padding-right: 0.25rem;
}

/* ── SUB-NAVIGATION TABS (Notes vs Library) ────────────────────────────────── */
.notes-view-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.65rem;
  overflow-x: auto;
}

/* ── SEARCH BAR WITH INLINE LEFT ICON ─────────────────────────────────────── */
.notes-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
}

.notes-search-wrapper input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.5rem !important;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.notes-search-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.notes-search-wrapper .icon-svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.notes-main-tab {
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.notes-main-tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.notes-main-tab.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.resource-filter-btn {
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-surface-alt);
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition-fast);
}

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

.resource-filter-btn.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

/* ── NOTE LIST ITEM ───────────────────────────────────────────────────────── */
.note-item {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
}

.note-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--border-color);
  border-radius: var(--radius-full) 0 0 var(--radius-full);
  transition: background 0.2s ease;
}

.note-item:hover {
  border-color: var(--primary-border);
  background: var(--bg-surface-alt);
  transform: translateX(2px);
}

.note-item:hover::before {
  background: var(--primary);
}

.note-item.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.note-item.active::before {
  background: var(--primary);
}

/* Mood-specific accents */
.note-item[data-mood="productive"]::before { background: #10B981; }
.note-item.active[data-mood="productive"] { border-color: #10B981; background: rgba(16, 185, 129, 0.08); }

.note-item[data-mood="stressed"]::before { background: var(--accent-danger); }
.note-item.active[data-mood="stressed"] { border-color: var(--accent-danger); background: rgba(239, 68, 68, 0.07); }

.note-item[data-mood="tired"]::before { background: var(--accent-warning); }
.note-item.active[data-mood="tired"] { border-color: var(--accent-warning); background: rgba(245, 158, 11, 0.07); }

.note-item-title {
  font-weight: 700;
  font-size: 0.875rem;
  margin-bottom: 0.2rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note-item-snippet {
  font-size: 0.775rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.note-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.note-item-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  text-transform: capitalize;
}

.note-item-date {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── NOTE EDITOR ───────────────────────────────────────────────────────────── */
.note-editor-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--radius-lg);
}

.notes-mobile-back-btn {
  display: none;
}

.note-title-input {
  width: 100%;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  border: none;
  background: transparent;
  color: var(--text-primary);
  outline: none;
  margin-bottom: 0.75rem;
  font-family: var(--font-family);
}

.note-title-input::placeholder {
  color: var(--text-muted);
  font-weight: 600;
}

#note-mood-select {
  appearance: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-surface-alt);
  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='%237C3AED' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 1em;
  color: var(--text-primary);
  cursor: pointer;
  padding-right: 2.25rem;
  min-height: 40px;
}

#note-mood-select:focus {
  border-color: var(--primary);
  background-color: var(--bg-surface);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
  outline: none;
}

.note-body-textarea {
  width: 100%;
  flex: 1;
  min-height: 300px;
  border: none;
  background: transparent;
  resize: none;
  outline: none;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-primary);
  font-family: var(--font-family);
}

.note-body-textarea::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.editor-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-color);
}

/* ── ACADEMIC CITATION GENERATOR STYLES ────────────────────────────────────── */
.citation-modal-card {
  max-width: 600px;
  width: 100%;
}

.citation-resource-summary {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.citation-resource-title {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.citation-resource-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.citation-style-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  padding-bottom: 4px;
}

.citation-tab-btn {
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
}

.citation-tab-btn.active {
  background: var(--primary);
  color: #FFFFFF !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}

.citation-preview-container {
  position: relative;
}

#citation-preview-box {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  font-family: var(--font-family);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-primary);
  min-height: 90px;
  user-select: all;
  white-space: pre-wrap;
  word-break: break-word;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

#citation-preview-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.citation-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

/* ── ACADEMIC RESOURCES COLLECTION & CARD LAYOUT ───────────────────────────── */
.resources-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

#notes-resources-list-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
}

.resource-card {
  padding: 1.15rem 1.25rem !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-lg) !important;
  background: var(--bg-surface-alt) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease !important;
  box-shadow: var(--shadow-xs);
  margin-bottom: 0 !important;
  overflow: visible !important;
  height: auto !important;
}

.resource-card:hover {
  border-color: var(--primary-border) !important;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.resource-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.library-toolbar-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.academic-resource-modal-card {
  max-width: 540px;
  width: 100%;
}



/* ===== curriculum.css ===== */
/**
 * CURRICULUM LAB MODULE (curriculum.css)
 * =======================================
 * Principle: Single Responsibility Principle (SRP) & High Cohesion
 *
 * Defines the computer science curriculum lab, live SQL playground console,
 * schema viewer, algorithm sorting visualizer, 3D flashcard quiz, and performance analytics.
 */

.curriculum-layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* ── HORIZONTAL TAB NAVIGATION BAR ─────────────────────────────────────────── */
.curriculum-topbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.6rem 0.85rem;
  box-shadow: var(--shadow-xs);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.curriculum-topbar::-webkit-scrollbar {
  display: none;
}

.curr-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
  text-decoration: none;
}

.curr-tab-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--primary-light);
  transform: translateY(-1px);
}

.curr-tab-btn.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-700) 100%);
  color: #FFFFFF !important;
  border-color: var(--primary);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}

.curr-tab-btn .icon-svg {
  width: 1em;
  height: 1em;
  stroke-width: 2.2;
}

.curr-active-pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  background: rgba(124, 58, 237, 0.1);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid rgba(124, 58, 237, 0.25);
  flex-shrink: 0;
}

.curr-active-pill .active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 6px var(--primary);
}

.curriculum-main {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  min-height: 500px;
  width: 100%;
}

.hub-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
}

.hub-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md), 0 8px 30px rgba(124, 58, 237, 0.08);
  border-color: var(--primary) !important;
}

.hub-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--primary);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.hub-card:hover::before {
  opacity: 1;
}

.back-to-hub-btn {
  transition: all 0.2s ease;
}

.back-to-hub-btn:hover {
  background: var(--primary-light) !important;
  color: var(--primary) !important;
  border-color: var(--primary) !important;
}

.panel-header {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.panel-header h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

/* ── LIVE SQL PLAYGROUND CONSOLE ───────────────────────────────────────────── */
.curr-db-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1.5rem;
  transition: grid-template-columns 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.curr-db-grid:has(.schema-card.collapsed) {
  grid-template-columns: 140px 1.5fr;
}

.schema-card,
.query-card {
  padding: 1.25rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.schema-card.collapsed .schema-list-container {
  display: none;
}

.schema-list-container {
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.schema-table-box {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
}

.schema-table-title {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.schema-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.schema-table th,
.schema-table td {
  padding: 0.4rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.schema-table th {
  color: var(--text-secondary);
  font-weight: 600;
}

.sql-textarea {
  width: 100%;
  min-height: 110px;
  height: 120px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-top: 1rem;
  padding: 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-surface-alt);
  color: var(--text-primary);
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sql-textarea:focus {
  outline: none;
  border-color: #F43F5E;
  box-shadow: 0 0 8px rgba(244, 63, 94, 0.6), 0 0 16px rgba(124, 58, 237, 0.4);
}

.sql-symbol-chip {
  padding: 0.35rem 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
}

.sql-symbol-chip:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.sql-symbol-chip:active {
  transform: scale(0.96);
  background: var(--primary);
  color: #FFFFFF;
}

.query-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.sql-results {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  max-height: 320px;
  overflow-y: auto;
  transition: all 0.2s ease;
}

.sql-error-box {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  color: var(--accent-danger);
}

.error-badge {
  font-weight: 700;
  display: block;
  margin-bottom: 0.25rem;
}

.results-table-wrapper {
  overflow-x: auto;
  margin-top: 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  -webkit-overflow-scrolling: touch;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  text-align: left;
  white-space: nowrap;
}

.results-table th,
.results-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
}

.results-table th:last-child,
.results-table td:last-child {
  border-right: none;
}

.results-table th {
  background: var(--bg-surface-alt);
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
  z-index: 1;
}

.results-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .results-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

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

.null-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent-danger);
  letter-spacing: 0.04em;
}

/* ── BACKEND ARCHITECTURE INSPECTOR ────────────────────────────────────────── */
.backend-explorer-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1.5rem;
}

.action-btn-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.backend-trigger-btn {
  text-align: left;
  font-size: 0.825rem;
  font-family: var(--font-mono);
  justify-content: flex-start;
  padding: 0.75rem 1rem;
  background: var(--bg-surface-alt);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.backend-trigger-btn:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--primary);
}

.inspector-output {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
}

.inspector-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.method-badge {
  background: var(--primary);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.endpoint-path {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
}

.status-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.status-badge.success {
  background: var(--accent-success-light);
  color: var(--accent-success);
}

.inspector-divider {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: 0.75rem 0;
}

.inspector-section h5 {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.inspector-section pre {
  margin-bottom: 1rem;
}

/* ── SQL TEMPLATES CAROUSEL ────────────────────────────────────────────────── */
.sql-templates {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.template-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  margin-right: 0.25rem;
}

.template-btn {
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.template-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}

/* ── ALGORITHM SORTING VISUALIZER ──────────────────────────────────────────── */
.algo-controls-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.algo-controls {
  display: flex;
  gap: 0.75rem;
}

.algo-speed-control {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.algo-speed-control input[type="range"] {
  width: 120px;
  accent-color: var(--primary);
  cursor: pointer;
}

#algo-speed-val {
  min-width: 45px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  text-align: center;
}

.algo-visualizer-box {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  height: 250px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.algo-bar {
  width: 28px;
  background: linear-gradient(to top, var(--primary-700), var(--primary-400));
  border-top-left-radius: var(--radius-sm);
  border-top-right-radius: var(--radius-sm);
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: height 0.15s ease, background-color 0.15s ease;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25);
}

.algo-bar.active {
  background: linear-gradient(to top, #fee2e2, var(--accent-danger));
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

.algo-bar.sorted {
  background: linear-gradient(to top, var(--accent-success-light), var(--accent-success));
}

.algo-bar-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-primary);
  position: absolute;
  bottom: -22px;
}

.algo-log {
  background: var(--bg-surface-alt);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary);
  font-size: 0.85rem;
  line-height: 1.5;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
}

/* ── 3D QUIZ FLASHCARDS ────────────────────────────────────────────────────── */
.quiz-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 0.5rem;
}

.quiz-card-wrapper {
  perspective: 1000px;
  -webkit-perspective: 1000px;
  width: 100%;
  max-width: 680px;
  margin: 0 auto 1.5rem auto;
}

.quiz-card-3d {
  position: relative;
  width: 100%;
  min-height: 420px;
  height: 420px;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.4, 0.2, 0.2, 1);
  border-radius: var(--radius-xl);
}

.quiz-card-3d.flipped {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
}

.quiz-card-face {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 2rem !important;
  border-radius: var(--radius-xl) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28) !important;
  background: var(--bg-surface) !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

.quiz-card-front,
.quiz-card-front:hover {
  transform: rotateY(0deg) translateZ(1px) !important;
  -webkit-transform: rotateY(0deg) translateZ(1px) !important;
  z-index: 2;
  pointer-events: auto;
}

.quiz-card-3d.flipped .quiz-card-front,
.quiz-card-3d.flipped .quiz-card-front:hover {
  pointer-events: none;
  z-index: 1;
}

.quiz-card-back,
.quiz-card-back:hover {
  transform: rotateY(180deg) translateZ(1px) !important;
  -webkit-transform: rotateY(180deg) translateZ(1px) !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
  z-index: 1;
  pointer-events: none;
}

.quiz-card-3d.flipped .quiz-card-back,
.quiz-card-3d.flipped .quiz-card-back:hover {
  pointer-events: auto;
  z-index: 3;
}

.quiz-question {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  line-height: 1.45;
  min-height: 60px;
}

.quiz-options-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
  justify-content: center;
}

.quiz-opt-btn {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.opt-letter {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.8rem;
  background: var(--border-color);
  color: var(--text-secondary);
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

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

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

.quiz-badge {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.badge-success {
  color: #10b981;
}

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

.quiz-feedback-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 90%;
}

.explanation-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.wrong-alert {
  font-size: 0.9rem;
  color: var(--accent-danger);
  background: rgba(239, 68, 68, 0.06);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.quiz-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.5rem;
}

#quiz-progress-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

/* ── PERFORMANCE ANALYTICS ─────────────────────────────────────────────────── */
.perf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  align-items: start;
}

.heatmap-container,
#perf-heatmap-grid {
  display: grid !important;
  grid-template-columns: repeat(7, 1fr) !important;
  gap: 5px !important;
  padding: 6px 0 !important;
  width: 100% !important;
}

.heatmap-cell {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  max-height: 28px;
  transition: background-color 0.2s ease;
}

.heatmap-cell.val-0 {
  background: var(--bg-surface-alt);
}

.heatmap-cell.val-1 {
  background: rgba(124, 58, 237, 0.25);
}

.heatmap-cell.val-2 {
  background: rgba(124, 58, 237, 0.5);
}

.heatmap-cell.val-3 {
  background: rgba(124, 58, 237, 0.75);
}

.heatmap-cell.val-4 {
  background: var(--primary);
}

.heatmap-legend-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.heatmap-legend-block {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  margin: 0 1px;
}

.heatmap-legend-0 {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
}

.heatmap-legend-1 {
  background: rgba(124, 58, 237, 0.25);
}

.heatmap-legend-2 {
  background: rgba(124, 58, 237, 0.5);
}

.heatmap-legend-3 {
  background: rgba(124, 58, 237, 0.75);
}

.heatmap-legend-4 {
  background: var(--primary);
}

.perf-area-chart-container {
  position: relative;
  width: 100%;
  height: 85px;
  margin-top: 0.5rem;
}

.perf-area-chart-container svg {
  width: 100%;
  height: 60px;
  display: block;
}

.activity-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.activity-dot.active {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 6px rgba(124, 58, 237, 0.4);
}

.course-progress-bar-container {
  width: 100%;
  height: 6px;
  background: var(--bg-hover);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 0.35rem;
}

.course-progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(to right, var(--primary-light), var(--primary));
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Curriculum Domain Styles ── */
.bento-icon-cyan {
  color: #06B6D4;
  background: rgba(6, 182, 212, 0.15);
}

.bento-icon-pink {
  color: #EC4899;
  background: rgba(236, 72, 153, 0.15);
}

.bento-icon-amber {
  color: #F59E0B;
  background: rgba(245, 158, 11, 0.15);
}

.bento-icon-indigo {
  color: var(--primary-600);
  background: rgba(124, 58, 237, 0.15);
}

.bento-icon-emerald {
  color: #10B981;
  background: rgba(16, 185, 129, 0.15);
}

.bento-icon-purple {
  color: var(--primary-400);
  background: rgba(124, 58, 237, 0.15);
}

.perf-stat-value {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sql-symbol-toolbar {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}

.sql-editor-container {
  position: relative;
  margin-bottom: 0.85rem;
}

.sql-results {
  margin-top: 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  overflow-x: auto;
  min-height: 120px;
}

.gpa-card-score {
  border: 2px solid var(--primary);
  background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(124, 58, 237, 0.08) 100%);
  border-radius: var(--radius-lg);
}

.gpa-score-large {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  margin: 0.5rem 0;
  font-family: var(--font-mono);
}

.gpa-input-control {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
}

/* ── FRONTEND LABS: FLEXBOX & GRID VISUALIZER ──────────────────────────────── */
.flex-lab-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .flex-lab-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.flex-controls-card,
.flex-stage-card,
.flex-code-card {
  border-radius: var(--radius-lg);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.flex-interactive-stage {
  display: flex;
  min-height: 200px;
  max-height: 360px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--bg-surface-alt);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.flex-stage-box {
  min-width: 60px;
  min-height: 60px;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), all 0.25s ease;
  user-select: none;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .flex-interactive-stage {
    min-height: 170px;
    padding: 0.75rem;
  }
  .flex-stage-box {
    min-width: 52px;
    min-height: 52px;
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
  }
}

.flex-stage-box:hover {
  transform: scale(1.06);
}

.flex-stage-box.box-1 { background: linear-gradient(135deg, #7C3AED, #9333EA); }
.flex-stage-box.box-2 { background: linear-gradient(135deg, #06B6D4, #0891B2); }
.flex-stage-box.box-3 { background: linear-gradient(135deg, #10B981, #059669); }
.flex-stage-box.box-4 { background: linear-gradient(135deg, #F59E0B, #D97706); }
.flex-stage-box.box-5 { background: linear-gradient(135deg, #EF4444, #DC2626); }
.flex-stage-box.box-6 { background: linear-gradient(135deg, #EC4899, #DB2777); }

.flex-code-card {
  border-radius: var(--radius-lg);
}

.flex-css-snippet {
  background: var(--bg-surface-alt);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  color: #38BDF8;
  line-height: 1.5;
  overflow-x: auto;
}

/* ── FRONTEND LABS: REGEX VALIDATOR ────────────────────────────────────────── */
.regex-highlight-box {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  min-height: 70px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.regex-match-pill {
  background: rgba(124, 58, 237, 0.35);
  color: #DDD6FE;
  border-bottom: 2px solid var(--primary);
  border-radius: 4px;
  padding: 1px 4px;
  font-weight: 700;
}

/* ===== budget.css ===== */
/**
 * MONTHLY BUDGET & CASH FLOW (budget.css)
 * ========================================
 * Principle: Single Responsibility Principle (SRP) & High Cohesion
 *
 * Defines the monthly budget tracker layout, 3-card balance KPI row,
 * category limit cards, donut chart, currency inputs/selector, transaction rows,
 * and smart receipt scanner modal with laser animation.
 */

.budget-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1.5rem;
  align-items: start;
}

.budget-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.budget-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* ── CATEGORY TARGET CARDS ─────────────────────────────────────────────────── */
.category-card {
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 140px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.06);
}

.category-card.color-teal {
  border-color: rgba(16, 185, 129, 0.25);
  background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(16, 185, 129, 0.03) 100%);
}

.category-card.color-purple {
  border-color: rgba(124, 58, 237, 0.25);
  background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(124, 58, 237, 0.03) 100%);
}

.category-card.color-coral {
  border-color: rgba(239, 68, 68, 0.25);
  background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(239, 68, 68, 0.03) 100%);
}

.micro-bar {
  flex: 1;
  background-color: var(--primary-light);
  border-radius: var(--radius-full) var(--radius-full) 0 0;
  transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 2px;
}

.micro-bar.high {
  background: linear-gradient(to top, var(--primary-400), var(--primary-700));
}

/* ── GLASSMORPHIC PANELS & DRIBBBLE MODERN SAAS STYLING ───────────────────── */
.budget-unified-card,
.budget-glass-panel,
.budget-layout .card {
  background: rgba(15, 23, 42, 0.65) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-xl) !important;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

[data-theme="light"] .budget-unified-card,
[data-theme="light"] .budget-glass-panel,
[data-theme="light"] .budget-layout .card {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 15px 35px rgba(124, 58, 237, 0.08);
}

/* ── PRESET CHIPS & CURRENCY CONTROLS ──────────────────────────────────────── */
.preset-chip {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
}

.preset-chip:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.preset-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}

.currency-formatted-input {
  font-size: 1.05rem !important;
  letter-spacing: -0.01em;
}

.currency-formatted-input::placeholder {
  font-size: 0.88rem;
  opacity: 0.6;
}

.currency-select-wrapper {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.currency-select-wrapper:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

/* ── DIRECTIONAL TREND BADGES & METRICS ────────────────────────────────────── */
.trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.trend-up {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-success-strong);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.trend-down {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-danger-strong);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.trend-savings {
  background: rgba(124, 58, 237, 0.15);
  color: var(--primary-400);
  border: 1px solid rgba(124, 58, 237, 0.25);
}

.tx-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.tx-badge-income {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-success-strong);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.tx-badge-expense {
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent-danger-strong);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ── TRANSACTION ROWS ──────────────────────────────────────────────────────── */
.transaction-row {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, box-shadow 0.2s ease !important;
  border-radius: var(--radius-md) !important;
}

.transaction-row:hover {
  background-color: rgba(124, 58, 237, 0.06) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15) !important;
}

/* ── INTERACTIVE TARGET EMPTY STATE ────────────────────────────────────────── */
.target-empty-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.25rem 1.5rem;
  background: var(--bg-surface-alt);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  grid-column: 1 / -1;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.target-empty-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.target-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: rgba(124, 58, 237, 0.12);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

/* ── RECEIPT SCANNER & OCR ANIMATIONS ──────────────────────────────────────── */
.receipt-modal-card {
  max-width: 600px;
  width: 100%;
}

.receipt-dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-surface-alt);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.receipt-scan-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.receipt-scan-mode-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.receipt-source-seg,
.receipt-scan-mode-seg {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
}

.receipt-source-btn,
.receipt-scan-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.45rem 0.8rem;
  border-radius: calc(var(--radius-md) - 3px);
  cursor: pointer;
  transition: all 0.2s ease;
}

.receipt-source-btn.active,
.receipt-scan-mode-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
}

/* ── Live Camera Viewfinder ─────────────────────────────────────────────────── */
.receipt-camera-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  border: 2px solid var(--border-color);
  margin-bottom: 0.75rem;
}

.receipt-camera-viewfinder {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 360px;
  background: #09090b;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.receipt-camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.receipt-camera-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.25);
}

.receipt-viewfinder-box {
  position: relative;
  width: 75%;
  height: 75%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  overflow: hidden;
}

.viewfinder-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--primary);
  border-style: solid;
}

.viewfinder-corner.top-left { top: 0; left: 0; border-width: 3px 0 0 3px; }
.viewfinder-corner.top-right { top: 0; right: 0; border-width: 3px 3px 0 0; }
.viewfinder-corner.bottom-left { bottom: 0; left: 0; border-width: 0 0 3px 3px; }
.viewfinder-corner.bottom-right { bottom: 0; right: 0; border-width: 0 3px 3px 0; }

.viewfinder-laser-line {
  position: absolute;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #a855f7, #38bdf8, transparent);
  box-shadow: 0 0 10px #a855f7;
  animation: laserScan 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

@keyframes laserScan {
  0% { top: 5%; opacity: 0.4; }
  50% { opacity: 1; }
  100% { top: 95%; opacity: 0.4; }
}

.viewfinder-hint {
  margin-top: 0.75rem;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 12px;
  border-radius: 20px;
}

.receipt-dropzone:hover,
.receipt-dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.15);
}

.receipt-dropzone-inner {
  text-align: center;
  padding: 2rem 1rem;
}

.receipt-dropzone-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.receipt-dropzone:hover .receipt-dropzone-icon {
  transform: scale(1.15) rotate(-5deg);
}

.receipt-dropzone-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.receipt-dropzone-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.35rem 0 1rem;
}

.receipt-dropzone-kbd {
  background: var(--bg-surface-alt);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  font-size: 0.72rem;
}

.receipt-scanning-state {
  text-align: center;
  padding: 2.5rem 1rem;
}

.scanner-laser-box {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto;
  border: 2px dashed var(--primary);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scanner-laser-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #10B981, #7C3AED, transparent);
  box-shadow: 0 0 12px #10B981, 0 0 20px #7C3AED;
  animation: scanLaser 1.6s ease-in-out infinite alternate;
}

@keyframes scanLaser {
  0% {
    top: 5%;
    opacity: 0.8;
  }

  100% {
    top: 92%;
    opacity: 1;
  }
}

.receipt-scanning-title {
  font-weight: 800;
  font-size: 1.1rem;
  margin-top: 1.25rem;
  color: var(--primary);
}

.receipt-scanning-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.receipt-results-view {
  margin-top: 1rem;
}

.receipt-results-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  align-items: start;
}

.receipt-preview-box {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-surface-alt);
  text-align: center;
}

.receipt-preview-img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
}

.receipt-change-btn {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  background: rgba(15, 23, 42, 0.85);
  color: #FFFFFF;
  border: none;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
}

.receipt-fields-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.receipt-ocr-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: #10B981;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.receipt-field-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 2px;
  display: block;
}

.receipt-field-input {
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-surface-alt);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.receipt-field-input:focus {
  border-color: var(--primary);
  background-color: var(--bg-surface);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

#receipt-parsed-category {
  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='%237C3AED' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1em;
  padding-right: 2.1rem;
  cursor: pointer;
}

.receipt-amount-input {
  padding: 0.45rem 0.75rem;
  font-size: 0.95rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent-danger);
  width: 100%;
}

.receipt-actions-footer {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

.receipt-autofill-btn {
  transition: all 0.2s ease;
}

.receipt-autofill-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
}


/* ── UNIFIED 3-IN-1 BALANCE HERO CARD ─────────────────────────────────────── */
.budget-unified-card {
  border: 2px solid var(--primary);
  background: linear-gradient(160deg, var(--bg-surface) 0%, rgba(124, 58, 237, 0.05) 100%);
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.08);
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
}

.budget-kpi-glow {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.budget-balance-header {
  text-align: center;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.budget-income-box {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.budget-expense-box {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.budget-kpi-val-medium {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-family: var(--font-mono);
}

.budget-micro-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 28px;
  margin-top: 0.75rem;
  padding-bottom: 2px;
}

/* ── DONUT RATIO CHART WIDGET ─────────────────────────────────────────────── */
.donut-chart-container {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.25rem;
  align-items: center;
  background: var(--bg-surface-alt);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.donut-chart-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto;
  flex-shrink: 0;
}

.donut {
  width: 100px;
  height: 100px;
  transform: rotate(-90deg);
  display: block;
}

.donut-percent {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.donut-kpi-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.donut-kpi-item {
  padding: 0.55rem 0.85rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: var(--radius-md);
  margin: 0;
  box-shadow: none;
}

.donut-kpi-item-green {
  border-left: 3px solid #10B981 !important;
}

.donut-kpi-item-red {
  border-left: 3px solid var(--accent-danger) !important;
}

.donut-kpi-item-purple {
  border-left: 3px solid var(--primary-500) !important;
}

/* ── MOBILE FIRST QUICK ACTION BUTTONS ─────────────────────────────────────── */
.budget-quick-action-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

@media (max-width: 600px) {
  .budget-quick-action-bar {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }
}

.btn-action-expense {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  color: #ffffff !important;
  font-weight: 700;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  min-height: 48px;
  touch-action: manipulation;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.btn-action-expense:hover,
.btn-action-expense:active {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.45);
}

.btn-action-income {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #ffffff !important;
  font-weight: 700;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  min-height: 48px;
  touch-action: manipulation;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.btn-action-income:hover,
.btn-action-income:active {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.45);
}

.btn-action-budget {
  background: var(--bg-surface-alt);
  color: var(--text-primary);
  font-weight: 700;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  min-height: 48px;
  touch-action: manipulation;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, background 0.2s ease;
}

.btn-action-budget:hover,
.btn-action-budget:active {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
}

/* ── BUDGET DASHBOARD GRID ─────────────────────────────────────────────────── */
.budget-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 900px) {
  .budget-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* ── BUDGET ENTRY MODAL & TABS ─────────────────────────────────────────────── */
.budget-modal-card {
  max-width: 520px;
  width: 100%;
}

.budget-modal-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.3rem;
  background: var(--bg-surface-alt);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.budget-modal-tab-btn {
  flex: 1;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  min-height: 40px;
}

.budget-modal-tab-btn.active-expense {
  background: #EF4444 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.budget-modal-tab-btn.active-income {
  background: #10B981 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.budget-modal-tab-btn.active-budget {
  background: var(--primary) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35);
}

/* ===== modals.css ===== */
/**
 * MODALS, OVERLAYS & AUTHENTICATION (modals.css)
 * ===============================================
 * Principle: Single Responsibility Principle (SRP) & High Cohesion
 *
 * Defines backdrop overlays, dialog modal cards, drag indicators, authentication
 * login/registration cards, command palette (⌘K spotlight), focus timer popup,
 * and mobile more bottom sheet drawers.
 */

/* ── MODAL OVERLAYS & BACKDROPS ────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2500;
  padding: 1rem;
}

body.modal-open {
  overflow: hidden !important;
}

.modal-card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  max-height: calc(100dvh - 2rem);
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  animation: modalSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

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

.modal-drag-indicator-bar {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 0 2px 0;
  cursor: pointer;
  background: var(--bg-surface-alt);
  touch-action: none;
  user-select: none;
}

.modal-drag-pill {
  width: 44px;
  height: 5px;
  border-radius: 99px;
  background: var(--border-color);
  transition: background 0.2s ease, transform 0.2s ease;
}

.modal-drag-indicator-bar:hover .modal-drag-pill,
.modal-drag-indicator-bar:active .modal-drag-pill {
  background: var(--primary);
  transform: scaleX(1.15);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface-alt);
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.modal-body {
  padding: 1.35rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
}

#modal-close-btn {
  width: 44px !important;
  height: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1.5rem !important;
  padding: 0 !important;
  cursor: pointer !important;
  border-radius: var(--radius-full) !important;
}

.modal-option-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem;
  text-align: left;
  border-radius: var(--radius-lg);
  font-weight: 700;
  font-size: 0.95rem;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  width: 100%;
  min-height: 52px;
}

.modal-option-card:active {
  transform: scale(0.98);
  border-color: var(--primary);
}

/* ── AUTHENTICATION UI ─────────────────────────────────────────────────────── */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  background: radial-gradient(circle at 85% 15%, rgba(124, 58, 237, 0.15) 0%, transparent 60%),
    radial-gradient(circle at 15% 85%, rgba(16, 185, 129, 0.1) 0%, transparent 60%),
    var(--bg-main);
}

.auth-card {
  background: var(--bg-surface);
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.auth-logo .brand-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-forgot-link {
  font-size: 0.8rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.auth-forgot-link:hover {
  text-decoration: underline;
}

.auth-label-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: normal;
}

.auth-label-required {
  font-size: 0.75rem;
  color: var(--primary);
}

.auth-switch {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 1.25rem;
}


/* ── HEADER SEARCH BUTTON (DESKTOP & MOBILE COMMAND TRIGGER) ───────────────── */
.header-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-family: var(--font-family);
}

.header-search-btn:hover {
  border-color: var(--primary);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

.header-search-text {
  font-weight: 600;
  color: var(--text-secondary);
}

.header-search-badge {
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg-surface-alt);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

/* ── COMMAND PALETTE (⌘K SPOTLIGHT & MOBILE SPOTLIGHT) ───────────────────────── */
#command-palette-overlay {
  align-items: flex-start !important;
  padding-top: 4.5rem !important;
}

.command-palette-card {
  animation: modalSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 580px !important;
  width: 100% !important;
  max-height: 80vh !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: var(--radius-xl) !important;
  background: var(--bg-surface) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45) !important;
  border: 1px solid var(--border-color) !important;
  margin: 0 auto !important;
}

.palette-input-wrapper {
  padding: 0.95rem 1.25rem !important;
  border-bottom: 1px solid var(--border-color) !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
  background: var(--bg-surface) !important;
  flex-shrink: 0 !important;
}

.palette-input-wrapper input {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  font-family: var(--font-family) !important;
  font-size: 1rem !important;
  color: var(--text-primary) !important;
  padding: 0 !important;
  width: 100% !important;
}

.palette-input-wrapper input::placeholder {
  color: var(--text-muted) !important;
}

.palette-close-btn {
  background: transparent !important;
  border: none !important;
  font-size: 1.35rem !important;
  color: var(--text-muted) !important;
  cursor: pointer !important;
  padding: 4px 8px !important;
  border-radius: var(--radius-full) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  transition: color 0.15s ease !important;
}

.palette-close-btn:hover {
  color: var(--text-primary) !important;
}

.palette-filter-bar {
  padding: 0.55rem 1.15rem !important;
  border-bottom: 1px solid var(--border-color) !important;
  background: var(--bg-surface-alt) !important;
  display: flex !important;
  gap: 0.45rem !important;
  overflow-x: auto !important;
  flex-shrink: 0 !important;
}

.palette-filter-pill {
  padding: 0.28rem 0.75rem !important;
  font-size: 0.76rem !important;
  font-weight: 600 !important;
  border-radius: var(--radius-full) !important;
  border: 1px solid var(--border-color) !important;
  background: var(--bg-surface) !important;
  color: var(--text-secondary) !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  white-space: nowrap !important;
}

.palette-filter-pill:hover {
  background: var(--bg-hover) !important;
  color: var(--text-primary) !important;
}

.palette-filter-pill.active {
  background: var(--primary) !important;
  color: #FFFFFF !important;
  border-color: var(--primary) !important;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3) !important;
}

.palette-results {
  max-height: 360px !important;
  overflow-y: auto !important;
  flex: 1 1 auto !important;
  padding: 0.35rem 0 !important;
  background: var(--bg-surface) !important;
}

.palette-group-title {
  padding: 0.65rem 1.15rem 0.25rem 1.15rem !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  color: var(--text-muted) !important;
}

.palette-item {
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
  padding: 0.65rem 1.15rem !important;
  cursor: pointer !important;
  transition: background 0.15s ease, color 0.15s ease !important;
  user-select: none !important;
  background: transparent !important;
}

.palette-item:hover,
.palette-item.selected {
  background: rgba(124, 58, 237, 0.08) !important;
}

[data-theme="dark"] .palette-item:hover,
[data-theme="dark"] .palette-item.selected {
  background: rgba(124, 58, 237, 0.2) !important;
}

.palette-item-icon {
  width: 28px !important;
  height: 28px !important;
  border-radius: var(--radius-sm) !important;
  background: var(--bg-surface-alt) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  color: var(--primary) !important;
}

.palette-item-icon svg {
  width: 15px !important;
  height: 15px !important;
}

.palette-item-title {
  flex: 1 1 auto !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  color: var(--text-primary) !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.palette-item-cat {
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  color: var(--text-muted) !important;
  background: var(--bg-surface-alt) !important;
  padding: 2px 8px !important;
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--border-color) !important;
  flex-shrink: 0 !important;
}

.palette-footer {
  padding: 0.65rem 1.15rem !important;
  font-size: 0.75rem !important;
  border-top: 1px solid var(--border-color) !important;
  background: var(--bg-surface-alt) !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  flex-shrink: 0 !important;
}

.palette-mobile-hint {
  display: none !important;
}

.palette-desktop-hint {
  display: inline !important;
}

@media (max-width: 768px) {
  #command-palette-overlay {
    padding-top: 1rem !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
  .palette-results {
    max-height: 50vh !important;
  }
  .palette-desktop-hint {
    display: none !important;
  }
  .palette-mobile-hint {
    display: inline !important;
    font-weight: 600 !important;
    color: var(--text-secondary) !important;
  }
  .header-search-badge {
    display: none !important;
  }
}

/* ── MOBILE MORE DRAWER SHEET ──────────────────────────────────────────────── */
.more-sheet-card {
  border-radius: 24px 24px 0 0 !important;
  border: 1px solid var(--border-color) !important;
  border-bottom: none !important;
  background: var(--bg-surface) !important;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  padding: 1.15rem 1.25rem 2.25rem 1.25rem !important;
}

.more-sheet-card .modal-drag-indicator-bar {
  background: transparent !important;
  padding: 0 0 6px 0 !important;
}

.more-sheet-card .modal-header {
  padding: 0 0 0.85rem 0 !important;
  margin: 0 0 1rem 0 !important;
  background: transparent !important;
  border-bottom: 1px solid var(--border-color) !important;
}

.drawer-close-btn {
  min-width: 40px !important;
  min-height: 40px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  border-radius: var(--radius-full);
  cursor: pointer;
}

.more-sheet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.more-menu-tile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg) !important;
  cursor: pointer;
  text-align: left;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
  min-height: 54px;
  width: 100%;
}

.more-menu-tile:active {
  transform: scale(0.97);
  background: var(--bg-surface);
  border-color: var(--primary);
}

.more-menu-tile .tile-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
}

.more-menu-tile .tile-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.more-menu-tile .tile-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.more-menu-tile .tile-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.signout-btn-left {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 0.75rem !important;
  color: #EF4444 !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  background: rgba(239, 68, 68, 0.04) !important;
  font-weight: 700 !important;
  padding: 0.85rem 1rem !important;
  min-height: 48px !important;
  border-radius: var(--radius-lg) !important;
  width: 100% !important;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.signout-btn-left:hover {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: #EF4444 !important;
}

.signout-btn-left:active {
  transform: scale(0.98);
}

.signout-btn-left svg {
  width: 18px;
  height: 18px;
  stroke: #EF4444;
}

/* ── MOBILE FIRST BOTTOM SHEET MODALS (< 640px) ───────────────────────────── */
@media (max-width: 640px) {
  .modal-overlay {
    padding: 0 !important;
    align-items: flex-end !important;
  }

  .modal-card,
  .budget-modal-card,
  .receipt-modal-card,
  .citation-modal-card,
  .more-sheet-card {
    max-width: 100% !important;
    width: 100% !important;
    border-radius: 24px 24px 0 0 !important;
    max-height: 88dvh !important;
    max-height: 88vh !important;
    animation: bottomSheetSlide 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    margin: 0 !important;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px)) !important;
    border-bottom: none !important;
  }

  .modal-body {
    padding: 1.15rem !important;
    max-height: calc(88vh - 70px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
}

@keyframes bottomSheetSlide {
  from {
    opacity: 0.5;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}



/* ===== responsive.css ===== */
/**
 * RESPONSIVE & MOBILE DESIGN SYSTEM (responsive.css)
 * ===================================================
 * Principle: Single Responsibility Principle (SRP) & Mobile-First Excellence
 *
 * Defines all responsive media queries (1200px, 992px, 850px, 768px, 600px, 480px),
 * bottom floating navigation dock, bottom sheets, mobile back buttons, and print stylesheet.
 */

/* ── VIEWPORT CLEARANCE & DOCK OVERLAYS ────────────────────────────────────── */
/* Desktop: natural bottom rhythm. The 96px dock/FAB clearance is scoped to
   mobile below, where the floating dock and FAB actually exist. */
.main-content,
.view-panel,
.tab-pane,
.notes-content,
#tab-db-lab,
#curr-performance,
.planner-grid,
.budget-layout {
  padding-bottom: 2rem;
}

.notes-tag-filter-bar,
.timetable-mobile-nav,
.sql-templates-scroll,
.income-preset-chips,
.expense-preset-chips {
  -webkit-mask-image: linear-gradient(to right, white 80%, transparent 100%);
  mask-image: linear-gradient(to right, white 80%, transparent 100%);
}

.notes-tag-filter-bar {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.notes-tag-filter-bar::-webkit-scrollbar {
  display: none;
}

.desktop-only-btn {
  display: inline-flex;
}

.desktop-only-card {
  display: block;
}

.nav-item-mobile-only {
  display: none !important;
}

.mobile-more-btn {
  display: none !important;
}

.print-only {
  display: none;
}

/* ── BREAKPOINT: 1200PX (Large Tablets / Small Laptops) ────────────────────── */
@media (max-width: 1200px) {
  .timetable-grid {
    overflow-x: auto;
    padding-bottom: 0.5rem;
    grid-template-columns: repeat(7, minmax(160px, 1fr));
  }
}

/* ── BREAKPOINT: 992PX - 900PX (Tablets) ──────────────────────────────────── */
@media (max-width: 992px) {
  .dashboard-main-grid {
    grid-template-columns: 1fr !important;
  }

  .budget-kpi-grid,
  .perf-grid {
    grid-template-columns: 1fr;
  }

  .curr-db-grid,
  .backend-explorer-grid,
  .academic-grid,
  .resources-grid,
  .budget-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: 220px;
    padding: 1.25rem 1rem;
  }

  .main-content {
    margin-left: 220px;
    width: calc(100% - 220px);
    padding: 1.5rem;
  }

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

  .welcome-card {
    grid-column: span 1;
  }

  .notes-layout {
    grid-template-columns: 240px 1fr;
    height: 520px;
  }

  .gpa-calc-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ── BREAKPOINT: 850PX (Mid-sized mobile & tablet) ─────────────────────────── */
@media (max-width: 850px) {
  .timetable-mobile-nav {
    display: block;
  }

  .timetable-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    overflow-x: visible;
  }

  .day-column.mobile-hidden {
    display: none !important;
  }

  .day-column.mobile-visible {
    display: flex !important;
    min-height: auto;
  }

  .curriculum-topbar {
    gap: 0.5rem;
  }

  .curr-active-pill {
    width: 100%;
    justify-content: center;
    margin-left: 0;
  }
}

/* ── BREAKPOINT: 768PX (Mobile Phone Default) ──────────────────────────────── */
@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
  }

  /* Floating Bottom Glassmorphism Navigation Dock */
  .sidebar {
    position: fixed;
    top: auto;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: calc(12px + env(safe-area-inset-left));
    right: calc(12px + env(safe-area-inset-right));
    width: auto;
    height: 60px;
    border-radius: var(--radius-full);
    background: rgba(21, 29, 42, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    flex-direction: row;
    padding: 0.25rem 0.75rem;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
  }

  .brand,
  .user-profile {
    display: none;
  }

  .nav-menu {
    flex-direction: row;
    justify-content: space-around;
    width: 100%;
    gap: 0.25rem;
  }

  .nav-item {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.6rem 0.25rem;
    border-radius: var(--radius-full);
    transition: background-color 0.2s ease, color 0.2s ease;
    min-height: 48px !important;
    min-width: 48px !important;
  }

  .nav-item:hover {
    transform: none !important;
  }

  .nav-item.active {
    transform: none !important;
    background: rgba(124, 58, 237, 0.15) !important;
    color: var(--primary) !important;
    border: 1px solid rgba(124, 58, 237, 0.25) !important;
    box-shadow: 0 2px 10px rgba(124, 58, 237, 0.1) !important;
  }

  .nav-item.active::before {
    content: '' !important;
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    top: auto !important;
    bottom: 4px !important;
    width: 6px !important;
    height: 6px !important;
    border-radius: var(--radius-full) !important;
    background: var(--primary) !important;
    box-shadow: 0 0 10px var(--primary) !important;
  }

  .nav-label {
    display: none;
  }

  .nav-item .icon-svg {
    width: 1.35rem;
    height: 1.35rem;
  }

  .nav-item-mobile-only {
    display: flex !important;
  }

  .desktop-only-nav {
    display: none !important;
  }

  .mobile-more-btn {
    display: flex !important;
    cursor: pointer;
    background: transparent;
    border: none;
    color: var(--text-secondary);
  }

  .mobile-more-btn:active {
    transform: scale(0.92);
  }

  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 1.25rem 1rem 96px 1rem;
  }

  /* Dock & FAB clearance is mobile-only: keep content scrollable clear of the
     floating bottom dock and floating action button. */
  .view-panel,
  .tab-pane,
  .notes-content,
  #tab-db-lab,
  #curr-performance,
  .planner-grid,
  .budget-layout {
    padding-bottom: 96px !important;
  }

  .top-header {
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }

  .header-title h1 {
    font-size: 1.5rem;
  }

  .header-actions {
    gap: 0.5rem;
  }

  .view-panel {
    padding-bottom: 1rem;
  }

  .desktop-only-btn {
    display: none !important;
  }

  .desktop-only-card {
    display: none !important;
  }

  .card {
    height: auto;
    border-radius: var(--radius-md);
    padding: 0;
  }

  .card:not(:has(.card-body)):not(:has(.card-header)) {
    padding: 1rem;
  }

  .card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
  }

  .card-header {
    padding: 0.75rem 1rem;
  }

  .card-header h3 {
    font-size: 0.92rem;
  }

  .card-body {
    padding: 0.75rem 1rem;
  }

  /* Dashboard mobile header cleanup */
  .main-content.dashboard-active .top-header {
    display: none !important;
  }

  .dashboard-wrapper {
    gap: 0.75rem !important;
  }

  .welcome-card {
    border-radius: var(--radius-md) !important;
  }

  .welcome-card .card-body {
    padding: 1rem !important;
  }

  .welcome-card h2#dash-greeting {
    font-size: 1.2rem !important;
  }

  .welcome-card .cozy-quote {
    display: none !important;
  }

  .welcome-card::after {
    display: none;
  }

  .dash-kpi-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
    margin-top: 0.75rem !important;
  }

  .stat-item {
    padding: 0.6rem 0.75rem !important;
    border-radius: var(--radius-sm) !important;
  }

  .stat-label {
    font-size: 0.65rem !important;
  }

  .stat-value {
    font-size: 1.15rem !important;
    margin-top: 0.15rem !important;
  }

  .stat-item>span:last-child {
    font-size: 0.68rem !important;
    display: none;
  }

  .dashboard-main-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  .dash-quick-actions {
    gap: 0.35rem !important;
  }

  .dash-quick-actions .btn-sm {
    font-size: 0.75rem !important;
    padding: 0.35rem 0.65rem !important;
  }

  .toast-container {
    bottom: 85px;
    right: 0.75rem;
    left: 0.75rem;
    align-items: stretch;
  }

  .toast {
    font-size: 0.78rem;
    padding: 0.65rem 0.85rem;
  }

  .transaction-filter-tabs {
    width: 100%;
  }

  .transaction-filter-tabs .btn-sm {
    flex: 1;
    text-align: center;
    justify-content: center;
  }

  /* Modal Bottom Sheet on Mobile */
  .modal-overlay {
    padding: 0 !important;
    align-items: flex-end !important;
    z-index: 2500 !important;
  }

  .modal-card {
    max-width: 100% !important;
    width: 100% !important;
    max-height: 92vh !important;
    max-height: 92dvh !important;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
    animation: mobileSheetSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  @keyframes mobileSheetSlide {
    from {
      opacity: 0;
      transform: translateY(100%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .modal-header {
    padding: 1rem 1.15rem !important;
    position: relative;
  }

  .modal-header::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--border-color);
  }

  .modal-body {
    padding: 1rem 1.15rem 6rem 1.15rem !important;
  }

  .modal-body input,
  .modal-body select,
  .modal-body textarea,
  .auth-form input {
    font-size: 16px !important;
  }

  /* Planner & Notes mobile optimizations */
  .planner-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  .planner-column {
    padding: 1rem !important;
  }

  .habits-container {
    grid-template-columns: 1fr;
  }

  .notes-layout {
    display: block !important;
    height: auto !important;
    min-height: unset !important;
  }

  .notes-sidebar {
    display: flex !important;
    flex-direction: column !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
    padding-right: 0 !important;
    gap: 0.65rem !important;
    margin-bottom: 1rem !important;
  }

  .note-item {
    min-width: 100% !important;
    width: 100% !important;
    padding: 0.9rem 1rem !important;
    border-radius: var(--radius-md) !important;
  }

  .note-editor-card {
    display: none !important;
  }

  .notes-layout.mobile-editor-active .notes-sidebar {
    display: none !important;
  }

  .notes-layout.mobile-editor-active .note-editor-card {
    display: block !important;
    min-height: 480px !important;
    border-radius: var(--radius-lg) !important;
  }

  .notes-mobile-back-btn {
    display: inline-flex !important;
  }

  .note-body-textarea {
    min-height: 320px !important;
    font-size: 16px !important;
  }

  .note-title-input {
    font-size: 1.35rem !important;
  }

  .notes-search-wrapper {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  .notes-search-wrapper input {
    font-size: 16px !important; /* >=16px prevents iOS auto-zoom on focus */
    padding: 0.55rem 0.75rem 0.55rem 2.25rem !important;
  }

  /* Note editor mood select lives in-page (not a modal) — same iOS zoom guard */
  #note-mood-select {
    font-size: 16px !important;
  }

  .notes-add-btn {
    display: inline-flex !important;
    flex-shrink: 0 !important;
    padding: 0.55rem 0.85rem !important;
    font-size: 0.82rem !important;
    min-height: 40px !important;
  }

  .mobile-fab {
    display: flex !important;
  }

  .notes-layout.mobile-editor-active ~ .mobile-fab,
  .notes-layout.mobile-editor-active ~ .note-fab {
    display: none !important;
  }

  /* Academic Library mobile optimizations */
  .resources-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  #notes-resources-list-container {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.85rem !important;
  }

  .resource-card {
    padding: 1.15rem 1rem !important;
    margin-bottom: 0 !important;
    border-radius: var(--radius-md) !important;
  }

  .resource-card-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
  }

  /* Profile modal mobile padding */
  .profile-modal-card {
    max-height: 90vh !important;
    overflow-y: auto !important;
    padding: 1.25rem !important;
  }

  /* Budget mobile layout */
  .budget-income-expense-grid {
    grid-template-columns: 1fr !important;
  }

  .budget-action-tabs {
    gap: 0.35rem !important;
  }

  .budget-action-tabs .btn {
    flex: 1;
    font-size: 0.78rem !important;
    padding: 0.45rem 0.5rem !important;
    text-align: center;
    justify-content: center;
  }

  .budget-category-grid {
    grid-template-columns: 1fr !important;
  }

  .budget-layout {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .budget-kpi-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  .budget-form-container {
    padding-bottom: 1.5rem !important;
  }

  .budget-fab {
    display: none !important;
  }

  /* Budget mobile refinements: stack donut, full-width actions, bigger touch targets */
  .donut-chart-container {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
    text-align: center;
  }

  .budget-top-bar {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .budget-top-bar .btn {
    min-height: 44px;
    justify-content: center;
  }

  .budget-unified-card .grid-2col {
    grid-template-columns: 1fr !important;
  }

  /* Curriculum Lab mobile */
  .curriculum-main {
    padding: 1rem;
    min-height: unset;
  }

  .quiz-card-3d {
    min-height: 420px;
    height: 420px;
  }

  .algo-controls-wrapper {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }

  .algo-controls {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .algo-controls .btn {
    flex: 1;
    min-width: 100px;
  }

  .algo-speed-control {
    width: 100%;
    justify-content: space-between;
  }

  .algo-speed-control input[type="range"] {
    flex: 1;
    width: auto;
  }

  .hub-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .hub-card {
    width: 100%;
  }

  .hub-card .card-body {
    padding: 1.1rem !important;
  }

  .hub-card h4 {
    font-size: 1rem !important;
  }

  .curriculum-topbar {
    flex-wrap: nowrap !important;
    padding-bottom: 0.6rem !important;
  }

  .curriculum-topbar .curr-tab-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0.5rem 0.85rem;
    font-size: 0.8rem;
  }

  .curr-db-grid,
  .backend-explorer-grid {
    grid-template-columns: 1fr;
    gap: 1rem !important;
  }

  .curr-db-grid .card {
    border: 1px solid var(--border-color) !important;
    padding: 1rem !important;
    margin-bottom: 0 !important;
  }

  .sql-templates-scroll {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .sql-templates-scroll::-webkit-scrollbar {
    display: none;
  }

  .sql-symbol-chip {
    padding: 0.4rem 0.65rem;
    font-size: 0.75rem;
    min-height: 32px;
  }

  .sql-textarea {
    min-height: 110px !important;
    height: 125px !important;
    font-size: 14px !important;
    padding: 0.75rem !important;
    margin-bottom: 0.75rem !important;
  }

  .query-actions .btn {
    min-height: 44px !important;
    font-size: 0.88rem !important;
  }

  .sql-results {
    max-height: 280px !important;
    padding: 0.75rem !important;
  }

  #tab-db-lab {
    padding-bottom: 90px !important;
  }

  .academic-grid,
  .resources-grid,
  .perf-grid {
    grid-template-columns: 1fr;
  }

  .back-to-hub-btn {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-surface) !important;
    border-color: var(--border-color) !important;
  }
}

/* ── BREAKPOINT: 520PX (Compact Phones) ───────────────────────────────────── */
@media (max-width: 520px) {
  /* Keep the dashboard greeting readable on small phones: the profile pill
     (avatar + name + subtitle) squeezes the greeting column down to ~100px,
     wrapping "Good evening" and the date across multiple lines. Collapse it
     to a 44px circular avatar so the greeting always fits on one line. */
  .dash-profile-card {
    padding: 0.25rem;
    border: none;
    background: transparent;
    border-radius: var(--radius-full);
    box-shadow: none;
  }

  .dash-profile-meta {
    display: none !important;
  }

  .welcome-card .d-flex.justify-between.items-start {
    gap: 0.75rem !important;
  }
}

/* ── BREAKPOINT: 600PX (Compact Phones) ────────────────────────────────────── */
@media (max-width: 600px) {
  .curriculum-topbar {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 0.4rem;
    padding: 0.5rem 0.65rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .curriculum-topbar::-webkit-scrollbar {
    display: none;
  }

  .curr-tab-btn {
    flex-shrink: 0;
    padding: 0.4rem 0.7rem;
    font-size: 0.75rem;
  }

  .curr-tab-btn span {
    display: none;
  }

  .curr-active-pill {
    display: none;
  }

  .library-toolbar-card .card-body {
    padding: 0.85rem !important;
  }

  .resource-card {
    padding: 0.9rem !important;
  }

  .resource-card-actions {
    width: 100%;
    justify-content: flex-start;
    margin-top: 0.5rem;
  }
}

/* ── BREAKPOINT: 480PX (Extra Small Mobile) ────────────────────────────────── */
@media (max-width: 480px) {
  #kpi-total-balance {
    font-size: 2rem !important;
  }

  .budget-income-expense-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  .budget-form-row-grid,
  .bento-grid {
    grid-template-columns: 1fr !important;
  }

  .curriculum-main {
    padding: 0.85rem 0.75rem;
  }

  .quiz-card-3d {
    min-height: 440px;
    height: 440px;
  }

  .quiz-card-face {
    padding: 1.25rem;
  }

  .quiz-question {
    font-size: 1rem;
    min-height: 50px;
  }

  .quiz-opt-btn {
    padding: 0.65rem 0.85rem;
    font-size: 0.85rem;
  }

  .panel-header h3 {
    font-size: 1.1rem;
  }

  .sql-textarea {
    height: 100px;
    font-size: 0.8rem;
  }
}

@media (max-width: 768px), (hover: none) {
  .header-search-badge,
  .cmd-shortcut-tag,
  .kbd-shortcut {
    display: none !important;
  }
}

body.modal-open .mobile-fab,
body.modal-open .note-fab,
body.modal-open .planner-fab,
body.modal-open .schedule-fab,
body.modal-open .budget-fab {
  display: none !important;
}

/* ── Mobile Scroll & Render Performance ───────────────────────────────────── */
@media (max-width: 768px) {
  .main-content,
  .view-panel,
  .modal-body,
  .notes-sidebar,
  .timetable-grid {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }

  .habit-card,
  .task-item,
  .note-item,
  .resource-card,
  .event-card,
  .transaction-item,
  .category-card {
    content-visibility: auto;
    contain-intrinsic-size: 1px 65px;
    transform: translateZ(0);
  }

  .mobile-bottom-dock {
    padding-bottom: calc(0.6rem + env(safe-area-inset-bottom, 0px)) !important;
    transform: translateZ(0);
    will-change: transform;
  }
}

/* ── PRINT STYLESHEET ──────────────────────────────────────────────────────── */
@media print {
  body > *:not(#financial-print-statement),
  .app-container,
  .sidebar,
  .top-header,
  .view-container,
  .mobile-fab,
  .note-fab,
  .toast-container,
  .modal-overlay,
  button {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #financial-print-statement.print-only {
    display: block !important;
    position: static !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

