/* ============================================================
   PlaneMaster – Global CSS
   Dark Aviation Theme | Modern Glassmorphism
   ============================================================ */

:root {
  --bg:          #0a0e1a;
  --bg2:         #0f1422;
  --surface:     #161b2e;
  --surface2:    #1c2338;
  --border:      rgba(255,255,255,0.08);
  --border2:     rgba(255,255,255,0.15);
  --glass:       rgba(15, 20, 34, 0.88);
  --glass2:      rgba(22, 27, 46, 0.92);
  --amber:       #f59e0b;
  --amber-light: #fbbf24;
  --amber-dark:  #d97706;
  --blue:        #3b82f6;
  --blue-light:  #60a5fa;
  --green:       #22c55e;
  --red:         #ef4444;
  --orange:      #f97316;
  --purple:      #a855f7;
  --cyan:        #06b6d4;
  --text:        #e2e8f0;
  --text2:       #94a3b8;
  --text3:       #64748b;
  --radius:      10px;
  --radius-lg:   16px;
  --shadow:      0 8px 32px rgba(0,0,0,0.5);
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.3);
  --trans:       all 0.2s ease;
}

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

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ========== Layout ========== */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
}

/* ========== Header ========== */
#header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: 56px;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

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

.logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}

.logo-text span { color: var(--amber); }

/* Search Bar */
.search-wrap {
  flex: 1;
  max-width: 480px;
  position: relative;
}

#search-input {
  width: 100%;
  height: 36px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 18px;
  color: var(--text);
  padding: 0 40px 0 16px;
  font-size: 13px;
  outline: none;
  transition: var(--trans);
}

#search-input:focus {
  border-color: var(--amber);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}

#search-input::placeholder { color: var(--text3); }

.search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  pointer-events: none;
}

#search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--glass2);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  overflow: hidden;
  display: none;
  z-index: 2000;
  box-shadow: var(--shadow);
  max-height: 480px;
  overflow-y: auto;
}

.search-section { padding: 6px 0; }
.search-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text3);
  padding: 4px 14px;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: var(--trans);
  border-radius: 0;
}
.search-item:hover { background: var(--surface2); }
.search-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.search-item-icon.flight { background: rgba(245,158,11,0.15); color: var(--amber); }
.search-item-icon.airport { background: rgba(59,130,246,0.15); color: var(--blue-light); }
.search-item-icon.airline { background: rgba(34,197,94,0.15); color: var(--green); }
.search-item-main { font-weight: 600; font-size: 13px; }
.search-item-sub { font-size: 11px; color: var(--text2); }

/* Header Nav */
.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  background: transparent;
  border: none;
  transition: var(--trans);
  text-decoration: none;
  white-space: nowrap;
}
.nav-btn:hover { background: var(--surface2); color: var(--text); }
.nav-btn.active { background: var(--surface2); color: var(--amber); }

.live-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: 12px;
  font-size: 12px;
  color: var(--green);
  font-weight: 600;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-green 1.5s infinite;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.8); }
}

/* ========== Map ========== */
#map {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1;
}

/* ========== Left Toolbar ========== */
#toolbar-left {
  position: absolute;
  top: 72px;
  left: 12px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tool-group {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
  color: var(--text2);
  background: transparent;
  border: none;
  transition: var(--trans);
  position: relative;
}
.tool-btn:hover { background: var(--surface2); color: var(--text); }
.tool-btn.active { color: var(--amber); background: rgba(245,158,11,0.1); }
.tool-btn + .tool-btn { border-top: 1px solid var(--border); }

.tool-btn[title]::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface2);
  color: var(--text);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  border: 1px solid var(--border);
}
.tool-btn:hover[title]::after { opacity: 1; }

/* ========== Sidebar ========== */
#sidebar {
  position: absolute;
  top: 56px;
  right: 0;
  bottom: 0;
  width: 360px;
  z-index: 800;
  background: var(--glass2);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

#sidebar.open { transform: translateX(0); }

.sidebar-close {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--glass2);
  border-bottom: 1px solid var(--border);
}

.sidebar-title {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.close-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: var(--surface2);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--trans);
}
.close-btn:hover { background: var(--border2); color: var(--text); }

.sidebar-body { padding: 16px; flex: 1; }

/* Aircraft Card */
.ac-header {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.ac-reg {
  font-size: 22px;
  font-weight: 800;
  color: var(--amber);
  letter-spacing: -0.5px;
  line-height: 1;
}

.ac-type {
  font-size: 13px;
  color: var(--text2);
  margin-top: 2px;
}

.ac-airline {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-top: 8px;
}

.ac-flags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}
.badge-amber  { background: rgba(245,158,11,0.15); color: var(--amber); border: 1px solid rgba(245,158,11,0.3); }
.badge-blue   { background: rgba(59,130,246,0.15); color: var(--blue-light); border: 1px solid rgba(59,130,246,0.3); }
.badge-green  { background: rgba(34,197,94,0.15);  color: var(--green); border: 1px solid rgba(34,197,94,0.3); }
.badge-red    { background: rgba(239,68,68,0.15);  color: var(--red); border: 1px solid rgba(239,68,68,0.3); }
.badge-gray   { background: var(--surface2); color: var(--text2); border: 1px solid var(--border); }

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}

.stat-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--amber);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-value.green  { color: var(--green); }
.stat-value.blue   { color: var(--blue-light); }
.stat-value.red    { color: var(--red); }
.stat-value.orange { color: var(--orange); }

.stat-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text3);
  margin-top: 2px;
}

/* Route Info */
.route-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.route-airport { flex: 1; }
.route-airport .iata { font-size: 24px; font-weight: 800; color: var(--text); line-height: 1; }
.route-airport .name { font-size: 11px; color: var(--text2); margin-top: 2px; }
.route-arrow { color: var(--amber); font-size: 20px; flex-shrink: 0; }

/* Photos */
.photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}

.photo-item {
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: pointer;
  position: relative;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.photo-item:hover img { transform: scale(1.05); }

.photo-item .photo-credit {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 8px;
  font-size: 10px;
  color: white;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
}

/* Chart */
.chart-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
}

.chart-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text3);
  margin-bottom: 10px;
}

/* Action Buttons */
.action-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.action-btn {
  flex: 1;
  min-width: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  transition: var(--trans);
  text-decoration: none;
}
.action-btn:hover { background: var(--surface2); color: var(--text); border-color: var(--border2); }
.action-btn.primary { background: rgba(245,158,11,0.15); color: var(--amber); border-color: rgba(245,158,11,0.3); }
.action-btn.primary:hover { background: rgba(245,158,11,0.25); }

/* Section Header */
.section-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text3);
  margin-bottom: 8px;
  margin-top: 4px;
}

/* Info List */
.info-list { list-style: none; }
.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.info-item:last-child { border-bottom: none; }
.info-key { color: var(--text2); }
.info-val { font-weight: 600; color: var(--text); }

/* ========== Filters Panel ========== */
#filters-panel {
  position: absolute;
  top: 72px;
  left: 60px;
  z-index: 850;
  background: var(--glass2);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  width: 280px;
  display: none;
  box-shadow: var(--shadow);
}

#filters-panel.visible { display: block; }

.filter-group { margin-bottom: 14px; }
.filter-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text3);
  margin-bottom: 8px;
  display: block;
}

.filter-row { display: flex; gap: 8px; align-items: center; }

.filter-input {
  width: 80px;
  height: 30px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0 8px;
  font-size: 12px;
  outline: none;
  text-align: center;
}
.filter-input:focus { border-color: var(--amber); }
.filter-sep { color: var(--text3); font-size: 11px; }

.filter-select {
  width: 100%;
  height: 30px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0 8px;
  font-size: 12px;
  outline: none;
}

.filter-tag-list { display: flex; flex-wrap: wrap; gap: 4px; }
.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  cursor: pointer;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  transition: var(--trans);
}
.filter-tag.active { background: rgba(245,158,11,0.15); border-color: rgba(245,158,11,0.3); color: var(--amber); }

.filter-actions { display: flex; gap: 6px; margin-top: 12px; }
.filter-btn {
  flex: 1;
  height: 32px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  transition: var(--trans);
}
.filter-btn.apply { background: var(--amber); border-color: var(--amber); color: #000; }
.filter-btn.apply:hover { background: var(--amber-light); }
.filter-btn:hover:not(.apply) { background: var(--surface); color: var(--text); }

/* ========== Playback Bar ========== */
#playback-bar {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  background: var(--glass2);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 16px;
  display: none;
  align-items: center;
  gap: 12px;
  min-width: 600px;
  box-shadow: var(--shadow);
}
#playback-bar.visible { display: flex; }

.playback-time {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  min-width: 140px;
}

#playback-slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--surface2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
#playback-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--amber);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(245,158,11,0.5);
}

.playback-controls { display: flex; align-items: center; gap: 4px; }
.play-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--amber);
  color: #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: var(--trans);
}
.play-btn:hover { background: var(--amber-light); }
.speed-btn {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--trans);
}
.speed-btn.active { background: rgba(245,158,11,0.15); color: var(--amber); border-color: rgba(245,158,11,0.3); }

/* ========== Map Counter ========== */
#map-counter {
  position: absolute;
  bottom: 60px;
  left: 12px;
  z-index: 900;
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  box-shadow: var(--shadow-sm);
}

.counter-item { display: flex; align-items: center; gap: 5px; color: var(--text2); }
.counter-item strong { color: var(--text); font-weight: 700; }

/* ========== Layer Controls ========== */
#layer-controls {
  position: absolute;
  bottom: 60px;
  right: 12px;
  z-index: 900;
  background: var(--glass2);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  width: 200px;
  display: none;
  box-shadow: var(--shadow);
}
#layer-controls.visible { display: block; }

.layer-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text3);
  margin-bottom: 10px;
}

.layer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
}
.layer-item:hover { color: var(--text); }

/* Toggle Switch */
.toggle {
  width: 32px;
  height: 18px;
  background: var(--surface2);
  border-radius: 9px;
  position: relative;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle.on { background: var(--amber); border-color: var(--amber); }
.toggle::after {
  content: '';
  position: absolute;
  top: 1px; left: 1px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: white;
  transition: left 0.2s;
}
.toggle.on::after { left: 15px; }

/* ========== Airport Popup ========== */
.airport-popup-inner {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 200px;
}
.airport-popup-head {
  padding: 10px 14px;
  background: var(--surface2);
}
.airport-popup-iata { font-size: 28px; font-weight: 800; color: var(--amber); line-height: 1; }
.airport-popup-name { font-size: 12px; color: var(--text2); }
.airport-popup-body { padding: 10px 14px; }
.airport-popup-body a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
}
.airport-popup-body a:hover { color: var(--amber); }

/* ========== Toast Notifications ========== */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--glass2);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 3.7s forwards;
  pointer-events: all;
}
.toast.success { border-color: rgba(34,197,94,0.4); }
.toast.error { border-color: rgba(239,68,68,0.4); }
.toast.info { border-color: rgba(59,130,246,0.4); }

@keyframes slideIn {
  from { transform: translateX(100px); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; transform: translateX(20px); }
}

/* ========== Lightbox ========== */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
#lightbox.open { display: flex; }
#lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 8px;
  object-fit: contain;
}

/* ========== Altitude Color Legend ========== */
#altitude-legend {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text2);
  font-weight: 600;
}
.alt-swatch {
  width: 18px;
  height: 6px;
  border-radius: 3px;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .logo-text { display: none; }
  .header-nav .nav-btn span { display: none; }
  #sidebar { width: 100%; top: auto; bottom: 0; max-height: 70vh; }
  #sidebar.open { transform: translateY(0); }
  #playback-bar { min-width: calc(100vw - 24px); }
  .search-wrap { max-width: 200px; }
}

/* ========== Pages (non-map) ========== */
.page-body {
  overflow: auto;
  position: absolute;
  top: 56px;
  left: 0; right: 0; bottom: 0;
  padding: 24px;
  z-index: 5;
}

.page-container {
  max-width: 1100px;
  margin: 0 auto;
}

.page-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.page-sub {
  font-size: 14px;
  color: var(--text2);
  margin-bottom: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  text-align: left;
  padding: 8px 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
}
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
}
.status-dot.green { background: var(--green); }
.status-dot.amber { background: var(--amber); }
.status-dot.red { background: var(--red); }
.status-dot.gray { background: var(--text3); }

/* Grid layouts */
.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: 12px; }

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .page-body { padding: 16px; }
}

/* Loading spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text2);
  gap: 12px;
}

/* Leaflet overrides */
.leaflet-container { background: #0a0e1a; }
.leaflet-popup-content-wrapper {
  background: var(--glass2) !important;
  backdrop-filter: blur(20px) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
  color: var(--text) !important;
}
.leaflet-popup-tip { background: var(--surface2) !important; }
.leaflet-popup-content { margin: 0 !important; }
.leaflet-bar a {
  background: var(--glass) !important;
  color: var(--text) !important;
  border-bottom-color: var(--border) !important;
  backdrop-filter: blur(10px) !important;
}
.leaflet-bar a:hover { background: var(--surface2) !important; }
.leaflet-control-attribution {
  background: var(--glass) !important;
  color: var(--text3) !important;
  font-size: 10px !important;
}
.leaflet-control-attribution a { color: var(--text2) !important; }

/* 3D View */
#view3d {
  position: fixed;
  inset: 0;
  z-index: 9990;
  background: var(--bg);
  display: none;
  flex-direction: column;
}
#view3d.open { display: flex; }
#view3d-header {
  height: 56px;
  background: var(--glass2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
}
#view3d-canvas { flex: 1; }

/* Squawk Alert Badge */
.squawk-alert {
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.4);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--red);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 10px;
}

/* 3D Aircraft Display */
.aircraft-3d-container {
  perspective: 1000px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}

.aircraft-3d {
  transform-style: preserve-3d;
  animation: rotate3d 8s linear infinite;
  font-size: 80px;
  filter: drop-shadow(0 0 20px rgba(245,158,11,0.3));
}

@keyframes rotate3d {
  from { transform: rotateY(0deg) rotateX(10deg); }
  to   { transform: rotateY(360deg) rotateX(10deg); }
}
