/* =============================================================================
   Del Rio EDC Data Center Feasibility Platform — Design System
   Themed after InTandem (sam-gov) — Clean Slate & Royal Blue Light Executive Theme
   ============================================================================= */

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

:root {
  /* Colors — DS Light Theme (Charcoal Slate + Blue Accent) from sam-gov */
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --bg-input: #ffffff;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-blue-glow: rgba(59, 130, 246, 0.12);
  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #ef4444;

  /* Priority & Status Tokens */
  --priority-high: #22c55e;
  --priority-high-bg: rgba(34, 197, 94, 0.1);
  --priority-medium: #eab308;
  --priority-medium-bg: rgba(234, 179, 8, 0.1);
  --priority-low: #f97316;
  --priority-low-bg: rgba(249, 115, 22, 0.1);
  --priority-disqualified: #ef4444;
  --priority-disqualified-bg: rgba(239, 68, 68, 0.1);

  --border-subtle: #e2e8f0;
  --border-active: #3b82f6;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.05), 0 4px 16px rgba(0, 0, 0, 0.03);
  --shadow-elevated: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 4px 20px rgba(59, 130, 246, 0.12);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  background-image: radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.03) 0%, transparent 40%),
                    radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.03) 0%, transparent 40%);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* App Header */
.app-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0.85rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo-badge {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 1.15rem;
  color: #ffffff;
}

.brand-title-wrap h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.55rem;
  background: var(--priority-high-bg);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: var(--radius-full);
  color: #15803d;
  font-weight: 600;
  font-size: 0.7rem;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--priority-high);
}

/* InTandem Style Header KPI Pills */
.top-kpis-ribbon {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 4px 12px;
  box-shadow: var(--shadow-card);
}

.kpi-mini-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 14px;
  gap: 1px;
}

.kpi-mini-divider {
  width: 1px;
  height: 28px;
  background: var(--border-subtle);
  flex-shrink: 0;
}

.kpi-mini-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--text-muted);
}

.kpi-mini-value {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
}

.kpi-mini-value.accent-cyan {
  color: #0284c7;
}

.kpi-mini-value.accent-emerald {
  color: #16a34a;
}

.kpi-mini-value.accent-amber {
  color: #d97706;
}

/* Tabs Bar */
.tabs-nav-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.15rem 2rem 0;
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.75rem 1.25rem;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--duration-fast) var(--ease-out);
  position: relative;
  white-space: nowrap;
}

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

.tab-btn.active {
  color: var(--accent-blue);
  background: #eff6ff;
  font-weight: 600;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-blue);
}

/* Main Container */
.app-container {
  padding: 1.5rem 2rem 3rem;
  max-width: 1680px;
  margin: 0 auto;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

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

/* Grid Layouts */
.dashboard-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.dashboard-grid-sidebar {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.5rem;
}

@media (max-width: 1200px) {
  .dashboard-grid-sidebar,
  .dashboard-grid-2col {
    grid-template-columns: 1fr;
  }
}

/* InTandem Style Cards */
.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: all var(--duration-normal) var(--ease-out);
}

.panel-card:hover {
  box-shadow: var(--shadow-elevated);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
}

.panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.01em;
}

.panel-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

/* KPI Grid */
.kpi-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .kpi-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

.kpi-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all 0.2s;
}

.kpi-stat-card:hover {
  border-color: var(--accent-blue);
  transform: translateY(-1px);
}

.kpi-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border-subtle);
}

.kpi-stat-card.emerald::before { background: var(--accent-emerald); }
.kpi-stat-card.cyan::before { background: var(--accent-blue); }
.kpi-stat-card.amber::before { background: var(--accent-amber); }
.kpi-stat-card.purple::before { background: var(--accent-purple); }

.kpi-stat-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.kpi-stat-number {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.kpi-stat-subtext {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Controls & Sliders */
.control-group {
  margin-bottom: 1.25rem;
}

.control-label-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.control-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.control-val-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-blue);
  background: #eff6ff;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid #bfdbfe;
}

.range-slider {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-blue);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  border: 2px solid #ffffff;
  transition: transform 0.1s ease;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: var(--accent-blue-hover);
}

select.input-field,
input[type="text"].input-field,
input[type="number"].input-field {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  transition: border-color var(--duration-fast);
}

select.input-field:focus,
input.input-field:focus {
  border-color: var(--accent-blue);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

/* Switch / Toggle */
.toggle-switch-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  border: 1px solid var(--border-subtle);
  transition: .25s;
  border-radius: 24px;
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .25s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input:checked + .slider-round {
  background-color: var(--accent-blue);
}

input:checked + .slider-round:before {
  transform: translateX(20px);
}

/* Candidate Site Cards */
.site-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.site-score-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  cursor: pointer;
  transition: all 0.18s var(--ease-out);
  position: relative;
  box-shadow: var(--shadow-card);
}

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

.site-score-card.selected {
  border-color: var(--accent-blue);
  background: #f8faff;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.site-score-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.site-name-wrap h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.site-tag {
  display: inline-block;
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.site-tag.zoned-ready {
  background: var(--priority-high-bg);
  color: #15803d;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.site-tag.annex-needed {
  background: var(--priority-medium-bg);
  color: #b45309;
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.site-rank-badge {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent-blue);
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
}

.site-rank-badge small {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.site-spec-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.site-spec-item {
  font-size: 0.72rem;
}

.site-spec-item .label {
  color: var(--text-muted);
  display: block;
}

.site-spec-item .val {
  color: var(--text-primary);
  font-weight: 600;
}

/* Map Container */
.map-wrapper {
  position: relative;
  height: 560px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
}

#map {
  width: 100%;
  height: 100%;
}

.map-floating-legend {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  z-index: 500;
  box-shadow: var(--shadow-elevated);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.legend-item:last-child { margin-bottom: 0; }

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

/* Light Popup Leaflet */
.leaflet-popup-content-wrapper {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12) !important;
}
.leaflet-popup-tip {
  background: #ffffff !important;
}

/* Water & Flow Visualization */
.water-flow-diagram {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.flow-node-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
}

.flow-node-icon {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.flow-node-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.flow-node-metric {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0.4rem 0;
}

.flow-node-metric.cyan { color: #0284c7; }
.flow-node-metric.emerald { color: #16a34a; }
.flow-node-metric.amber { color: #d97706; }
.flow-node-metric.rose { color: #dc2626; }

/* Partner Cards Grid */
.partner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.5rem;
}

.partner-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  transition: all 0.2s var(--ease-out);
}

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

.partner-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.partner-category-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.partner-fit-score {
  font-size: 1.2rem;
  font-weight: 800;
  color: #16a34a;
}

.partner-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0.25rem 0;
}

.partner-examples {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.partner-meta-list {
  font-size: 0.78rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.partner-meta-row {
  display: flex;
  justify-content: space-between;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-subtle);
}

.partner-meta-row span:first-child { color: var(--text-secondary); }
.partner-meta-row span:last-child { color: var(--text-primary); font-weight: 600; }

.partner-value-pitch {
  background: #f8fafc;
  border-left: 3px solid var(--accent-blue);
  padding: 0.75rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-top: auto;
}

/* Fiscal Data Table */
.data-table-container {
  overflow-x: auto;
  margin-top: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.data-table th {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.data-table tr:hover td {
  background: #f8fafc;
}

/* Clawback Risk Alerts */
.clawback-alert-card {
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.clawback-alert-card.CRITICAL {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.clawback-alert-card.HIGH {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.clawback-alert-card.MODERATE {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.clawback-icon {
  font-size: 1.25rem;
}

.clawback-info h5 {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.clawback-info p {
  font-size: 0.75rem;
  line-height: 1.4;
}

.clawback-amount-badge {
  display: inline-block;
  margin-top: 0.4rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.06);
}

/* InTandem Style Buttons */
.btn-primary {
  background: var(--accent-blue);
  color: #ffffff;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--duration-fast) var(--ease-out);
  box-shadow: 0 1px 3px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  background: var(--accent-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.btn-secondary {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--duration-fast) var(--ease-out);
}

.btn-secondary:hover {
  border-color: var(--accent-blue);
  color: var(--text-primary);
  background: #f8fafc;
}

/* Executive Brief Container */
.executive-memo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-card);
}

.executive-memo-card h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
}

.executive-memo-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0284c7;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

/* =============================================================================
   Glossary Tooltips & Modal System (InTandem Slate Style)
   ============================================================================= */

/* Inline Glossary Term */
.glossary-term {
  border-bottom: 1.5px dotted var(--accent-blue);
  cursor: help;
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  position: relative;
  transition: color 0.15s ease;
}

.glossary-term:hover {
  color: var(--accent-blue) !important;
}

.term-info-icon {
  font-size: 10px;
  font-family: var(--font-sans);
  font-weight: 700;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #eff6ff;
  color: var(--accent-blue);
  border: 1px solid #bfdbfe;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  vertical-align: middle;
  transform: translateY(-1px);
}

/* Floating Tooltip Bubble */
.glossary-tooltip-popup {
  position: absolute;
  z-index: 10000;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 14px 16px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.18s var(--ease-out), transform 0.18s var(--ease-out);
  font-family: var(--font-sans);
}

.glossary-tooltip-popup.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.tooltip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.tooltip-category {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-blue);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 2px 6px;
  border-radius: 4px;
}

.tooltip-close-btn {
  background: transparent;
  border: none;
  font-size: 16px;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.tooltip-close-btn:hover {
  color: #0f172a;
}

.tooltip-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.3;
}

.tooltip-short {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 10px;
}

.tooltip-del-rio-badge {
  background: #f8fafc;
  border-left: 3px solid #10b981;
  padding: 7px 10px;
  border-radius: 0 6px 6px 0;
  font-size: 11px;
  color: #334155;
  line-height: 1.4;
}

.tooltip-del-rio-badge strong {
  color: #047857;
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

/* Full Glossary Modal */
.glossary-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.glossary-modal-backdrop.active {
  display: flex;
}

.glossary-modal-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 780px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.glossary-modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-secondary);
}

.glossary-modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.glossary-search-bar {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  background: #ffffff;
}

.glossary-search-input {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  outline: none;
}

.glossary-search-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

.glossary-modal-list {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.glossary-modal-item {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  transition: border-color 0.15s ease;
}

.glossary-modal-item:hover {
  border-color: var(--accent-blue);
}

.modal-item-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.modal-item-badge {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--accent-blue);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 2px 6px;
  border-radius: 4px;
}

.modal-item-term {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-item-def {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.modal-item-impact {
  background: #f8fafc;
  border-left: 3px solid #10b981;
  padding: 0.5rem 0.75rem;
  border-radius: 0 4px 4px 0;
  font-size: 0.78rem;
  color: #334155;
  line-height: 1.45;
}

.modal-item-impact strong {
  color: #047857;
}

/* Print Optimization for Board Briefings */
@media print {
  @page {
    margin: 1.2cm;
    size: letter portrait;
  }

  body {
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 10.5pt !important;
    line-height: 1.45 !important;
  }

  .app-header,
  .tabs-nav-bar,
  .top-kpis-ribbon,
  .range-slider,
  button,
  .btn-primary,
  .btn-secondary,
  .map-floating-legend,
  .tab-content:not(#tab-executive),
  #tab-sites,
  #tab-water,
  #tab-power,
  #tab-partners,
  #tab-tax {
    display: none !important;
  }

  .app-container {
    padding: 0 !important;
    max-width: 100% !important;
  }

  #tab-executive {
    display: block !important;
    width: 100% !important;
  }

  .panel-card,
  .executive-memo-card {
    border: none !important;
    background: #ffffff !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .panel-header {
    border-bottom: 2px solid #0284c7 !important;
    margin-bottom: 1rem !important;
    padding-bottom: 0.5rem !important;
  }

  .panel-title {
    color: #0369a1 !important;
    font-size: 14pt !important;
  }

  .executive-memo-card h2 {
    color: #0c4a6e !important;
    font-size: 16pt !important;
  }

  .executive-memo-card h3 {
    color: #0284c7 !important;
    font-size: 12pt !important;
    border-bottom: 1px solid #e2e8f0 !important;
  }
}
