/**
 * Cascade Nexus — Base Styles
 * Variables, layout, typography, grid systems, and page-specific styles.
 */

/* ─── Fonts ──────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ─── CSS Custom Properties (Dark Theme — Default) ───────────────────── */
:root {
  /* Colors */
  --forest-green: #2d5a40;
  --forest-dark: #0a1a12;
  --forest-medium: #1a3a28;
  --slate-bg: #111318;
  --slate-surface: #1a1d24;
  --slate-elevated: #2a2e38;
  --slate-muted: #3d4350;
  --pacific-blue: #5b8fa8;
  --pacific-light: #a8d1e3;
  --aurora-cyan: #2dd4bf;
  --aurora-light: #5eead4;
  --snow: #e8edf0;
  --snow-soft: #d0d9df;
  --emerald: #34d399;
  --gold: #fbbf24;
  --gold-soft: #fcd34d;
  --electric: #60a5fa;
  --red: #f87171;
  --violet: #8b5cf6;

  /* Surface & Glass */
  --bg-primary: var(--slate-bg);
  --bg-secondary: var(--forest-dark);
  --card-bg: rgba(26, 35, 30, 0.55);
  --sidebar-bg: rgba(26, 35, 30, 0.55);
  --glass-highlight: rgba(255, 255, 255, 0.04);
  --chart-bg: rgba(10, 26, 18, 0.5);

  /* Text */
  --text-primary: var(--snow);
  --text-secondary: var(--snow-soft);
  --text-tertiary: var(--pacific-blue);
  --text-quaternary: var(--slate-muted);

  /* Borders */
  --border: rgba(93, 143, 168, 0.12);
  --border-light: rgba(93, 143, 168, 0.06);
  --border-hover: rgba(93, 143, 168, 0.3);

  /* Glows */
  --glow-cyan: rgba(45, 212, 191, 0.2);
  --glow-cyan-subtle: rgba(45, 212, 191, 0.05);
  --glow-blue: rgba(91, 143, 168, 0.15);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);

  /* Badges */
  --badge-green-bg: rgba(45, 212, 191, 0.06);
  --badge-green-border: rgba(45, 212, 191, 0.12);
  --badge-blue-bg: rgba(96, 165, 250, 0.08);
  --badge-blue-border: rgba(96, 165, 250, 0.12);
  --badge-gold-bg: rgba(251, 191, 36, 0.08);
  --badge-gold-border: rgba(251, 191, 36, 0.15);
  --badge-red-bg: rgba(248, 113, 113, 0.08);
  --badge-red-border: rgba(248, 113, 113, 0.15);
  --badge-gray-bg: rgba(61, 67, 80, 0.3);

  /* Hover states */
  --hover-bg: rgba(255, 255, 255, 0.03);
  --active-bg: rgba(45, 212, 191, 0.06);

  /* Misc */
  --scrollbar: var(--slate-muted);
  --sidebar-width: 280px;
  --card-radius: 16px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
}

/* ─── Light Theme Overrides ──────────────────────────────────────────── */
[data-theme="light"] {
  --forest-green: #2d5a40;
  --forest-dark: #f0f3ee;
  --forest-medium: #e2ebe5;
  --slate-bg: #f5f5f0;
  --slate-surface: #ffffff;
  --slate-elevated: #e8e8e3;
  --slate-muted: #b0b0a8;
  --pacific-blue: #3b7d9a;
  --pacific-light: #7ab3cc;
  --aurora-cyan: #2a9d8f;
  --aurora-light: #4db8aa;
  --snow: #1a1a1a;
  --snow-soft: #4a4a4a;
  --gold: #c8962e;

  --bg-primary: var(--slate-bg);
  --bg-secondary: var(--forest-dark);
  --card-bg: rgba(255, 255, 255, 0.8);
  --sidebar-bg: rgba(255, 255, 255, 0.72);
  --glass-highlight: rgba(255, 255, 255, 0.6);
  --chart-bg: #eef5f0;

  --text-primary: var(--snow);
  --text-secondary: var(--snow-soft);
  --text-tertiary: #7a7a72;
  --text-quaternary: #b8b8b0;

  --border: rgba(0, 0, 0, 0.08);
  --border-light: rgba(0, 0, 0, 0.04);
  --border-hover: rgba(0, 0, 0, 0.15);

  --glow-cyan: rgba(42, 157, 143, 0.12);
  --glow-cyan-subtle: rgba(42, 157, 143, 0.04);
  --glow-blue: rgba(59, 125, 154, 0.08);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.1);

  --badge-green-bg: #eef5f0;
  --badge-green-border: #d8e8d8;
  --badge-blue-bg: #eef4f7;
  --badge-blue-border: #d0e0e8;
  --badge-gold-bg: #faf5ea;
  --badge-gold-border: #e8dcc8;
  --badge-red-bg: #fef2f2;
  --badge-red-border: #f0d8d8;
  --badge-gray-bg: #f0f0ec;

  --hover-bg: rgba(0, 0, 0, 0.03);
  --active-bg: rgba(42, 157, 143, 0.06);

  --scrollbar: #c0c0b8;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  font-weight: 400;
}

/* ─── Selection ──────────────────────────────────────────────────────── */
::selection {
  background: var(--aurora-cyan);
  color: #fff;
}

/* ─── Scrollbar ──────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--pacific-blue); }

/* ─── Ambient Background ─────────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(45, 90, 64, 0.1) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(91, 143, 168, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(45, 212, 191, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(45, 90, 64, 0.03) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(91, 143, 168, 0.03) 0%, transparent 60%);
}

/* ─── App Layout ─────────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.main-content {
  flex: 1;
  padding: 0;
  position: relative;
  z-index: 1;
  min-width: 0;
}

/* ─── Page Container ─────────────────────────────────────────────────── */
.page {
  display: none;
  padding: 40px 48px 60px;
  max-width: 1440px;
  margin: 0 auto;
}

.page.active {
  display: block;
}

/* ─── Page Header ────────────────────────────────────────────────────── */
.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-primary);
}

.page-header p {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* ─── Greeting ───────────────────────────────────────────────────────── */
.greeting {
  margin-bottom: 40px;
}

.greeting h1 {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary) 40%, var(--aurora-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.greeting .sub {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-top: 4px;
  font-weight: 300;
}

/* ─── Grid Systems ───────────────────────────────────────────────────── */
.grid-2  { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3  { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-4  { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 20px; }
.grid-span-2 { grid-column: span 2; }

/* ─── Homepage Specific Grids ────────────────────────────────────────── */
.home-hero {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.home-second {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.home-third {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 20px;
  margin-bottom: 24px;
}

/* ─── Weather Big (Homepage Hero) ────────────────────────────────────── */
.weather-card-home {
  background: linear-gradient(135deg, rgba(15, 35, 24, 0.7), rgba(26, 35, 30, 0.5));
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.weather-card-home::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 120% 80% at 30% 20%, var(--glow-blue) 0%, transparent 60%);
  pointer-events: none;
}

/* ─── Weather Page ───────────────────────────────────────────────────── */
.weather-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.weather-current-big {
  background: linear-gradient(135deg, rgba(15, 35, 24, 0.8), rgba(26, 26, 35, 0.5));
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 32px;
  position: relative;
  overflow: hidden;
}

.weather-current-big::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 100% 80% at 20% 20%, var(--glow-blue) 0%, transparent 60%),
    radial-gradient(ellipse 60% 60% at 80% 80%, var(--glow-cyan-subtle) 0%, transparent 50%);
  pointer-events: none;
}

.weather-current-big .weather-temp {
  font-size: 5rem;
}

.weather-current-big .weather-icon-big {
  font-size: 4.5rem;
}

.forecast-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

/* ─── Earthquake Page ────────────────────────────────────────────────── */
.eq-list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.25s ease;
  cursor: pointer;
}

.eq-list-item:last-child { border-bottom: none; }
.eq-list-item:hover { background: var(--hover-bg); }

.eq-depth {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-left: auto;
  flex-shrink: 0;
}

/* ─── Economy Page ───────────────────────────────────────────────────── */
.econ-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

/* ─── Financial Page ─────────────────────────────────────────────────── */
.financial-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.market-table-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}

.market-table-row:last-child { border-bottom: none; }

.market-table-row .asset-name { font-weight: 500; }
.market-table-row .asset-price { font-weight: 600; }
.market-table-row .asset-change.up { color: var(--emerald); }
.market-table-row .asset-change.down { color: var(--red); }

/* ─── Search Overlay ─────────────────────────────────────────────────── */
.search-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  backdrop-filter: blur(40px) saturate(1.5);
  -webkit-backdrop-filter: blur(40px) saturate(1.5);
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}

.search-overlay.open {
  display: flex;
}

.search-container {
  width: 100%;
  max-width: 680px;
}

.search-input-wrapper {
  position: relative;
}

.search-input-wrapper input {
  width: 100%;
  padding: 20px 24px 20px 48px;
  font-size: 22px;
  font-family: var(--font-serif);
  font-weight: 400;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text-primary);
  outline: none;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    background 0.3s ease;
}

.search-input-wrapper input:focus {
  border-color: var(--aurora-cyan);
  background: var(--card-bg);
  box-shadow: var(--shadow-lg), 0 0 40px var(--glow-cyan);
}

.search-input-wrapper input::placeholder {
  color: var(--text-quaternary);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 300;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--text-quaternary);
}

.search-categories {
  display: flex;
  gap: 6px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.search-cat {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.25s ease;
}

.search-cat.active,
.search-cat:hover {
  background: var(--active-bg);
  border-color: var(--aurora-cyan);
  color: var(--aurora-cyan);
}

.search-shortcuts {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.search-shortcut {
  padding: 5px 14px;
  border-radius: 8px;
  background: var(--hover-bg);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.25s ease;
}

.search-shortcut:hover {
  background: var(--active-bg);
  border-color: var(--aurora-cyan);
  color: var(--aurora-cyan);
}

.search-recent {
  margin-top: 24px;
}

.search-recent h4 {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-quaternary);
  margin-bottom: 12px;
}

.search-recent-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  transition: color 0.25s ease;
}

.search-recent-item:hover {
  color: var(--aurora-cyan);
}

/* ─── Keyboard Shortcuts Help Overlay ─────────────────────────────────── */
.help-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 19, 24, 0.85);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.help-overlay.open {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.help-container {
  width: 100%;
  max-width: 640px;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--slate-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(0, 0, 0, 0.3);
  animation: scaleIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.help-container::-webkit-scrollbar {
  width: 4px;
}

.help-container::-webkit-scrollbar-thumb {
  background: var(--slate-muted);
  border-radius: 4px;
}

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

.help-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-sans);
}

.help-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--hover-bg);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-tertiary);
  transition: all 0.25s ease;
}

.help-close:hover {
  background: var(--active-bg);
  border-color: var(--aurora-cyan);
  color: var(--aurora-cyan);
}

.help-sections {
  padding: 12px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.help-section h3 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-quaternary);
  font-family: var(--font-sans);
}

.help-shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.help-keys {
  display: flex;
  gap: 4px;
  align-items: center;
  min-width: 120px;
}

.help-keys kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-sans);
  background: var(--slate-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  min-width: 22px;
  min-height: 22px;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.help-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-quaternary);
  text-align: center;
}

.help-footer kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-sans);
  background: var(--slate-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  min-width: 18px;
  line-height: 1.4;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ─── Chord Indicator ──────────────────────────────────────────────────── */
.chord-indicator {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  padding: 8px 20px;
  background: var(--slate-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-sans);
  color: var(--aurora-cyan);
  box-shadow: var(--shadow-lg), 0 0 30px var(--glow-cyan);
  z-index: 1200;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.chord-indicator.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Theme Toggle (top bar) ─────────────────────────────────────────── */
.theme-toggle-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.theme-toggle-btn:hover {
  border-color: var(--aurora-cyan);
  box-shadow: var(--shadow-md);
}

/* ─── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--aurora-cyan);
  background: var(--active-bg);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--forest-green), var(--aurora-cyan));
  border: none;
  color: #fff;
  font-weight: 600;
}

.btn-primary:hover {
  box-shadow: 0 0 30px var(--glow-cyan);
  transform: translateY(-1px);
}

/* ─── Quick Action Bar ───────────────────────────────────────────────── */
.quick-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 32px;
  flex-wrap: wrap;
  align-items: center;
}

.quick-actions .search-trigger {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
  justify-content: flex-start;
  color: var(--text-quaternary);
  font-weight: 400;
}

.quick-actions .search-trigger .kbd {
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--border);
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-sans);
}

/* ─── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .home-hero,
  .home-second,
  .home-third {
    grid-template-columns: 1fr 1fr;
  }
  .grid-4,
  .econ-summary-grid,
  .financial-overview {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 992px) {
  .page {
    padding: 32px 24px;
  }
  .home-hero,
  .home-second,
  .home-third {
    grid-template-columns: 1fr;
  }
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  .grid-span-2 {
    grid-column: span 1;
  }
  .weather-hero {
    grid-template-columns: 1fr;
  }
  .forecast-row {
    grid-template-columns: repeat(4, 1fr);
  }
  .weather-detail-grid {
    grid-template-columns: 1fr 1fr;
  }
  .weather-current-big .weather-temp {
    font-size: 3.5rem;
  }
  .econ-summary-grid,
  .financial-overview {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .page {
    padding: 24px 16px;
  }
  .greeting h1 {
    font-size: 2rem;
  }
  .page-header h1 {
    font-size: 1.8rem;
  }
  .forecast-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .weather-detail-grid {
    grid-template-columns: 1fr 1fr;
  }
  .econ-summary-grid,
  .financial-overview {
    grid-template-columns: 1fr;
  }
  .search-overlay {
    padding-top: 10vh;
  }
  .search-input-wrapper input {
    font-size: 18px;
    padding: 16px 18px 16px 42px;
  }
  .quick-actions .search-trigger {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .greeting h1 {
    font-size: 1.6rem;
  }
  .forecast-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
}

/* ─── Utility Classes ──────────────────────────────────────────────────── */
/* Spacing (4px grid) */
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.ml-2 { margin-left: 8px; }
.mr-2 { margin-right: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

/* Typography */
.text-xs  { font-size: 10px; }
.text-sm  { font-size: 11px; }
.text-s   { font-size: 12px; }
.text-m   { font-size: 13px; }
.text-base{ font-size: 14px; }
.text-lg  { font-size: 16px; }
.text-xl  { font-size: 18px; }
.text-2xl { font-size: 22px; }
.text-3xl { font-size: 28px; }
.text-primary    { color: var(--text-primary); }
.text-secondary  { color: var(--text-secondary); }
.text-tertiary   { color: var(--text-tertiary); }
.text-quaternary { color: var(--text-quaternary); }
.text-aurora     { color: var(--aurora-cyan); }
.text-emerald    { color: var(--emerald); }
.text-gold       { color: var(--gold); }
.text-red        { color: var(--red); }
.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.lh-1  { line-height: 1; }
.lh-14 { line-height: 1.4; }
.lh-16 { line-height: 1.6; }
.ttu   { text-transform: uppercase; }
.letter-sp-1 { letter-spacing: 0.8px; }

/* Layout */
.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.flex-wrap  { flex-wrap: wrap; }
.flex-1     { flex: 1; }
.items-center { align-items: center; }
.items-baseline { align-items: baseline; }
.justify-between  { justify-content: space-between; }
.justify-center   { justify-content: center; }
.justify-end      { justify-content: flex-end; }
.w-full   { width: 100%; }
.h-full   { height: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-span-2 { grid-column: span 2; }

/* Status colors */
.text-up    { color: var(--emerald); }
.text-down  { color: var(--red); }
.text-flat  { color: var(--text-tertiary); }

/* Interactive */
.cursor-pointer { cursor: pointer; }
.no-select { user-select: none; }

/* Error state */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-tertiary);
}
.error-state .error-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}
.error-state .error-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.error-state .error-msg {
  font-size: 13px;
  margin-bottom: 16px;
  max-width: 360px;
}

/* Toast notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
  max-width: 380px;
  color: var(--text-primary);
}
.toast.info    { background: var(--slate-surface); }
.toast.success { background: rgba(52, 211, 153, 0.12); border-color: var(--emerald); }
.toast.error   { background: rgba(248, 113, 113, 0.12); border-color: var(--red); }
.toast.removing { animation: fadeOut 0.25s ease both; }

/* Dynamic page container */
.page-content {
  width: 100%;
}

/* Skeleton variants */
.skeleton-card {
  height: 160px;
  border-radius: var(--card-radius);
}
.skeleton-row {
  height: 40px;
  border-radius: 8px;
  margin-bottom: 8px;
}
.skeleton-map {
  height: 200px;
  border-radius: var(--card-radius);
}

/* Summary stat bar */
.stat-bar {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.stat-item {
  display: flex;
  flex-direction: column;
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}
.stat-label {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* Leaflet map wrapper */
.map-wrapper {
  width: 100%;
  border-radius: var(--card-radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.map-wrapper .leaflet-container {
  border-radius: var(--card-radius);
}

/* Search results in overlay */
.search-results {
  margin-top: 16px;
  max-height: 50vh;
  overflow-y: auto;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.search-result-item:hover {
  background: var(--hover-bg);
}
.search-result-item .sr-icon {
  font-size: 22px;
  flex-shrink: 0;
}
.search-result-item .sr-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}
.search-result-item .sr-meta {
  font-size: 11px;
  color: var(--text-tertiary);
}
.search-no-results {
  text-align: center;
  padding: 32px;
  color: var(--text-quaternary);
  font-size: 14px;
}

/* Sidebar badge */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--gold);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  margin-left: auto;
  line-height: 1;
}

/* Back button */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-bottom: 20px;
}
.btn-back:hover {
  border-color: var(--aurora-cyan);
  color: var(--aurora-cyan);
}

/* Retry button inside error state */
.btn-retry {
  padding: 8px 20px;
  border: 1px solid var(--aurora-cyan);
  border-radius: 8px;
  background: transparent;
  color: var(--aurora-cyan);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: var(--font-sans);
}
.btn-retry:hover {
  background: var(--active-bg);
  box-shadow: 0 0 20px var(--glow-cyan);
}
