/* ============================================================
   Energy-Transit | style.css
   Diseño: Cyber-Corporate / Modern Fintech
   Fuentes: Syne (display) + JetBrains Mono (datos)
   ============================================================ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=JetBrains+Mono:wght@300;400;500;700&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── Variables CSS ────────────────────────────────────────── */
:root {
  --font-display:  'Syne', sans-serif;
  --font-mono:     'JetBrains Mono', monospace;
  --font-body:     'DM Sans', sans-serif;

  /* Dark Mode (default) */
  --bg-primary:    #060b14;
  --bg-secondary:  #0d1526;
  --bg-card:       rgba(15, 23, 42, 0.85);
  --bg-card-hover: rgba(20, 31, 56, 0.95);
  --border-color:  rgba(56, 189, 248, 0.12);
  --border-hover:  rgba(56, 189, 248, 0.35);
  --text-primary:  #e2e8f0;
  --text-secondary:#94a3b8;
  --text-muted:    #475569;
  --glass-bg:      rgba(13, 21, 38, 0.72);
  --glass-blur:    20px;

  /* Accent Colors */
  --green-neon:    #10ffb1;
  --green-dim:     #059669;
  --red-crimson:   #ff3b5c;
  --red-dim:       #dc2626;
  --amber:         #f59e0b;
  --cyan:          #22d3ee;
  --cyan-dim:      #0891b2;
  --purple-accent: #a855f7;

  /* Shadows */
  --shadow-card:   0 4px 32px rgba(0,0,0,0.45), 0 0 0 1px var(--border-color);
  --shadow-glow:   0 0 24px rgba(34,211,238,0.15);
  --shadow-green:  0 0 18px rgba(16,255,177,0.2);
  --shadow-red:    0 0 18px rgba(255,59,92,0.2);

  /* Transitions */
  --trans-fast:    150ms cubic-bezier(0.4,0,0.2,1);
  --trans-med:     300ms cubic-bezier(0.4,0,0.2,1);
  --trans-slow:    500ms cubic-bezier(0.4,0,0.2,1);

  /* Layout */
  --sidebar-w:     260px;
  --header-h:      64px;
  --radius:        12px;
  --radius-lg:     18px;
}

/* ── Light Mode Override ──────────────────────────────────── */
.light-mode {
  --bg-primary:    #f0f4f8;
  --bg-secondary:  #dde6f0;
  --bg-card:       rgba(255,255,255,0.88);
  --bg-card-hover: rgba(255,255,255,0.98);
  --border-color:  rgba(14, 165, 233, 0.18);
  --border-hover:  rgba(14, 165, 233, 0.5);
  --text-primary:  #0f172a;
  --text-secondary:#334155;
  --text-muted:    #64748b;
  --glass-bg:      rgba(240,244,248,0.80);
  --shadow-card:   0 4px 24px rgba(0,0,0,0.10), 0 0 0 1px var(--border-color);
  --shadow-glow:   0 0 20px rgba(14,165,233,0.12);
  --green-neon:    #059669;
  --red-crimson:   #dc2626;
  --cyan:          #0891b2;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color var(--trans-slow), color var(--trans-slow);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ── Background Pattern ───────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse 80% 60% at 20% -10%, rgba(34,211,238,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(168,85,247,0.05) 0%, transparent 60%),
    linear-gradient(180deg, transparent 0%, rgba(6,11,20,0.3) 100%);
  pointer-events: none;
  z-index: 0;
}

.light-mode body::before {
  background-image:
    radial-gradient(ellipse 80% 60% at 20% -10%, rgba(14,165,233,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(99,102,241,0.04) 0%, transparent 60%);
}

/* ── HEADER ──────────────────────────────────────────────── */
#main-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
  transition: background var(--trans-slow), border-color var(--trans-slow);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  text-decoration: none;
}

.header-logo .logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--cyan), var(--green-neon));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

.header-logo span.accent {
  color: var(--cyan);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--green-neon);
  background: rgba(16,255,177,0.08);
  border: 1px solid rgba(16,255,177,0.2);
  border-radius: 20px;
  padding: 3px 10px;
  letter-spacing: 0.5px;
  animation: pulse-badge 3s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Theme Toggle Button */
#theme-toggle {
  width: 44px; height: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: background var(--trans-med), border-color var(--trans-med);
  outline: none;
}

#theme-toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: var(--cyan);
  border-radius: 50%;
  transition: transform var(--trans-med), background var(--trans-med);
  box-shadow: 0 0 8px var(--cyan);
}

.light-mode #theme-toggle::after {
  transform: translateX(20px);
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
}

/* Hamburger */
#hamburger-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  background: none;
  border: none;
  outline: none;
}

#hamburger-btn span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all var(--trans-med);
}

/* ── TICKER TAPE ─────────────────────────────────────────── */
#ticker-wrap {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  height: 36px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  overflow: hidden;
  z-index: 999;
  display: flex;
  align-items: center;
}

.ticker-inner {
  display: flex;
  white-space: nowrap;
  animation: ticker-scroll 60s linear infinite;
  will-change: transform;
}

.ticker-inner:hover { animation-play-state: paused; }

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  border-right: 1px solid var(--border-color);
  cursor: default;
}

.ticker-item .t-sym { color: var(--text-primary); font-weight: 700; }
.ticker-item .t-price { color: var(--text-primary); }
.ticker-item .t-up   { color: var(--green-neon); }
.ticker-item .t-down { color: var(--red-crimson); }

/* ── SIDEBAR NAV ─────────────────────────────────────────── */
#sidebar {
  position: fixed;
  top: calc(var(--header-h) + 36px);
  left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--header-h) - 36px);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 900;
  padding: 20px 12px;
  transition: transform var(--trans-med), background var(--trans-slow);
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.nav-section-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 16px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--trans-fast);
  text-decoration: none;
  margin-bottom: 2px;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: rgba(34,211,238,0.06);
  color: var(--cyan);
  border-color: rgba(34,211,238,0.12);
}

.nav-item.active {
  background: rgba(34,211,238,0.1);
  color: var(--cyan);
  border-color: rgba(34,211,238,0.2);
}

.nav-item .nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* ── MAIN CONTENT ────────────────────────────────────────── */
#main-content {
  margin-left: var(--sidebar-w);
  padding-top: calc(var(--header-h) + 36px + 24px);
  padding-right: 24px;
  padding-bottom: 48px;
  padding-left: 24px;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── SECTION ─────────────────────────────────────────────── */
.section {
  margin-bottom: 40px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.section-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title .section-icon {
  font-size: 20px;
}

.section-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.badge-cyan   { background: rgba(34,211,238,0.1); color: var(--cyan); border: 1px solid rgba(34,211,238,0.2); }
.badge-green  { background: rgba(16,255,177,0.08); color: var(--green-neon); border: 1px solid rgba(16,255,177,0.18); }
.badge-amber  { background: rgba(245,158,11,0.1); color: var(--amber); border: 1px solid rgba(245,158,11,0.2); }
.badge-red    { background: rgba(255,59,92,0.1); color: var(--red-crimson); border: 1px solid rgba(255,59,92,0.2); }

/* ── GRID SYSTEM ─────────────────────────────────────────── */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-1 { display: grid; grid-template-columns: 1fr; gap: 16px; }
.grid-3-1 { display: grid; grid-template-columns: 3fr 1fr; gap: 16px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.grid-1-1-2 { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 16px; }

/* ── CARDS ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  transition: all var(--trans-med);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0;
  transition: opacity var(--trans-med);
}

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

.card:hover::before { opacity: 0.6; }

.card-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.card-value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: -1px;
}

.card-value.large { font-size: 36px; }
.card-value.small { font-size: 20px; }

.card-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* Metric Cards */
.metric-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  width: fit-content;
}

.metric-badge.up   { background: rgba(16,255,177,0.1); color: var(--green-neon); }
.metric-badge.down { background: rgba(255,59,92,0.1);  color: var(--red-crimson); }
.metric-badge.flat { background: rgba(148,163,184,0.1); color: var(--text-muted); }

/* ── CARD GLOW VARIANTS ──────────────────────────────────── */
.card-glow-green { box-shadow: var(--shadow-card), var(--shadow-green); border-color: rgba(16,255,177,0.2); }
.card-glow-red   { box-shadow: var(--shadow-card), var(--shadow-red);   border-color: rgba(255,59,92,0.2); }
.card-glow-cyan  { box-shadow: var(--shadow-card), var(--shadow-glow);  border-color: rgba(34,211,238,0.2); }

/* ── TRADINGVIEW WIDGETS ─────────────────────────────────── */
.tv-widget-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  min-height: 300px;
}

/* ── CHART.JS CONTAINERS ─────────────────────────────────── */
.chart-container {
  position: relative;
  padding: 16px;
}

.chart-container canvas {
  max-width: 100%;
}

/* ── DATA TABLE ──────────────────────────────────────────── */
.data-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.data-table thead tr {
  background: rgba(34,211,238,0.06);
}

.data-table th {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(30,41,59,0.5);
  white-space: nowrap;
  vertical-align: middle;
}

.data-table tbody tr:hover td {
  background: rgba(34,211,238,0.04);
  color: var(--text-primary);
}

.data-table .mono { font-family: var(--font-mono); }
.data-table .positive { color: var(--green-neon); font-family: var(--font-mono); }
.data-table .negative { color: var(--red-crimson); font-family: var(--font-mono); }

/* ── MAP ─────────────────────────────────────────────────── */
#latam-map {
  height: 420px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
  z-index: 1;
}

/* ── LEAFLET CUSTOM MARKERS ──────────────────────────────── */
.leaflet-popup-content-wrapper {
  background: var(--bg-card) !important;
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color) !important;
  border-radius: 10px !important;
  box-shadow: var(--shadow-card) !important;
  color: var(--text-primary) !important;
  font-family: var(--font-body) !important;
  font-size: 13px !important;
}

.leaflet-popup-tip { background: var(--bg-card) !important; }

.map-marker-ring {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  animation: ring-pulse 2s ease-in-out infinite;
}

@keyframes ring-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* ── SEVERITY INDICATORS ─────────────────────────────────── */
.severity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.severity-critical { background: #ef4444; box-shadow: 0 0 6px #ef4444; animation: blink 1s infinite; }
.severity-high     { background: #f97316; box-shadow: 0 0 6px #f97316; }
.severity-medium   { background: #eab308; box-shadow: 0 0 6px #eab308; }
.severity-low      { background: #22c55e; box-shadow: 0 0 6px #22c55e; }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── SIMULATOR ───────────────────────────────────────────── */
.simulator-card { background: linear-gradient(135deg, rgba(34,211,238,0.05), rgba(168,85,247,0.05)); }

.sim-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  padding: 12px 16px;
  text-align: right;
  outline: none;
  transition: border-color var(--trans-fast);
}

.sim-input:focus { border-color: var(--cyan); }

.sim-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--cyan-dim), var(--cyan));
  color: #000;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: none;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: all var(--trans-fast);
  margin-top: 12px;
}

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

.sim-result {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--green-neon);
  text-align: center;
  padding: 16px 0 8px;
  text-shadow: var(--shadow-green);
}

/* ── RSS HEADLINES ───────────────────────────────────────── */
.rss-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.rss-item:last-child { border-bottom: none; }
.rss-item:hover { padding-left: 6px; }

.rss-source {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 4px;
}

.rss-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 3px;
}

.rss-date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

/* ── ESG RATING BADGES ───────────────────────────────────── */
.esg-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.esg-aaa  { background: rgba(16,185,129,0.15); color: #10b981; }
.esg-aa   { background: rgba(52,211,153,0.12); color: #34d399; }
.esg-a    { background: rgba(34,211,238,0.12); color: var(--cyan); }
.esg-bbb  { background: rgba(245,158,11,0.12); color: var(--amber); }
.esg-bb   { background: rgba(249,115,22,0.12); color: #f97316; }
.esg-b    { background: rgba(239,68,68,0.12);  color: #ef4444; }

/* ── GAUGE / FLARING ─────────────────────────────────────── */
.gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.gauge-ring {
  width: 120px; height: 120px;
  position: relative;
}

.gauge-ring svg { transform: rotate(-90deg); }

.gauge-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: rotate(0deg);
}

/* ── FUND CARD ───────────────────────────────────────────── */
.fund-card {
  border-left: 3px solid var(--cyan);
  padding-left: 16px;
  margin-bottom: 14px;
}

.fund-card:last-child { margin-bottom: 0; }

.fund-name { font-weight: 600; font-size: 13px; color: var(--text-primary); margin-bottom: 3px; }
.fund-manager { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.fund-meta { display: flex; gap: 12px; flex-wrap: wrap; }
.fund-meta span { font-family: var(--font-mono); font-size: 11px; }

/* ── LOADING SKELETON ────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-card) 50%, var(--bg-secondary) 75%);
  background-size: 400% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── AOS FALLBACK (custom fade-slide) ────────────────────── */
[data-aos] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-aos].aos-animate {
  opacity: 1;
  transform: translateY(0);
}

/* ── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── UTILITY ─────────────────────────────────────────────── */
.text-green  { color: var(--green-neon) !important; }
.text-red    { color: var(--red-crimson) !important; }
.text-amber  { color: var(--amber) !important; }
.text-cyan   { color: var(--cyan) !important; }
.text-muted  { color: var(--text-muted) !important; }
.text-mono   { font-family: var(--font-mono) !important; }
.text-display { font-family: var(--font-display) !important; }
.fw-700      { font-weight: 700 !important; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.flex  { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.w-full { width: 100%; }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.col-span-full { grid-column: 1 / -1; }

/* ── RESPONSIVE ──────────────────────────────────────────── */

/* Tablet ≤ 1200px */
@media (max-width: 1200px) {
  .grid-4   { grid-template-columns: repeat(2, 1fr); }
  .grid-3   { grid-template-columns: repeat(2, 1fr); }
  .grid-3-1 { grid-template-columns: 1fr; }
  .grid-1-1-2 { grid-template-columns: 1fr 1fr; }
}

/* Tablet ≤ 900px */
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }

  #sidebar {
    transform: translateX(-260px);
    width: 260px;
  }

  #sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0,0,0,0.4);
  }

  #main-content {
    margin-left: 0;
    padding: calc(var(--header-h) + 36px + 16px) 16px 48px;
  }

  #hamburger-btn { display: flex; }

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

/* Mobile ≤ 768px */
@media (max-width: 768px) {
  :root {
    --header-h: 56px;
  }

  .header-logo { font-size: 17px; }
  .header-badge { display: none; }

  .grid-4,
  .grid-3,
  .grid-2,
  .grid-3-1,
  .grid-2-1,
  .grid-1-1-2 {
    grid-template-columns: 1fr !important;
  }

  .col-span-2,
  .col-span-3 { grid-column: auto; }

  .card { padding: 16px; }
  .card-value { font-size: 22px; }
  .card-value.large { font-size: 28px; }

  #latam-map { height: 300px; }
  .section-title { font-size: 15px; }

  .tv-widget-wrap { min-height: 240px; }

  .data-table th,
  .data-table td { padding: 8px 10px; }

  .sim-result { font-size: 24px; }
}

/* Very small ≤ 480px */
@media (max-width: 480px) {
  #main-content { padding: calc(var(--header-h) + 36px + 12px) 12px 40px; }
  .section { margin-bottom: 28px; }
}

/* ── OVERLAY (mobile sidebar close) ──────────────────────── */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 850;
  backdrop-filter: blur(2px);
}

#sidebar-overlay.show { display: block; }

/* ── TICKER PAUSE on reduced motion ──────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ticker-inner { animation: none; }
  [data-aos] { opacity: 1; transform: none; }
}
