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

:root {
  --bg-deep: #040812;
  --bg-primary: #070d1b;
  --bg-secondary: #0b1326;
  --bg-card: rgba(16, 26, 48, 0.78);
  --bg-card-solid: #101a30;
  --bg-card-hover: rgba(24, 38, 68, 0.9);
  --bg-glass: rgba(11, 19, 38, 0.85);
  --border-subtle: rgba(148, 163, 184, 0.12);
  --border-color: rgba(148, 163, 184, 0.18);
  --border-glow: rgba(56, 189, 248, 0.45);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-sky: #38bdf8;
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #a855f7;

  --eco-color: #10b981;
  --bus-color: #38bdf8;
  --first-color: #f59e0b;
  --cargo-color: #a855f7;

  --brand-color: #38bdf8;
  --brand-secondary: #2563eb;

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 20px 45px -10px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 24px rgba(56, 189, 248, 0.25);

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

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

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(7, 13, 27, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.55);
}

html, body {
  height: 100%;
  width: 100%;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.45;
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  display: grid;
  grid-template-rows: 66px 1fr;
  height: 100vh;
  width: 100vw;
  background: radial-gradient(circle at 15% 0%, #0e1e38 0%, #040812 70%);
}

/* ============================================================================
   TOPBAR — AVIONICS HUD HEADER
   ============================================================================ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: linear-gradient(180deg, rgba(15, 25, 48, 0.95) 0%, rgba(8, 14, 28, 0.95) 100%);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  z-index: 30;
  gap: 14px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-color), var(--brand-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.35);
}

.brand-title {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-zero-paywall {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  letter-spacing: 0.05em;
}

.brand-subtitle {
  font-size: 11.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
}

.kpi-strip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kpi-pill {
  background: linear-gradient(180deg, rgba(20, 32, 58, 0.85) 0%, rgba(12, 20, 38, 0.85) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 6px 13px;
  display: flex;
  flex-direction: column;
  min-width: 135px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: border-color 0.2s;
}

.kpi-pill:hover {
  border-color: rgba(56, 189, 248, 0.4);
}

.kpi-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 2px;
  letter-spacing: -0.02em;
}

.kpi-value.positive { color: #34d399; text-shadow: 0 0 12px rgba(16, 185, 129, 0.3); }
.kpi-value.negative { color: #fb7185; }
.kpi-value.sky { color: #38bdf8; text-shadow: 0 0 12px rgba(56, 189, 248, 0.25); }
.kpi-value.purple { color: #c084fc; }
.kpi-value.amber { color: #fbbf24; }

.time-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(9, 15, 30, 0.9);
  border: 1px solid var(--border-color);
  padding: 6px 11px;
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.clock-display {
  display: flex;
  flex-direction: column;
  padding-right: 11px;
  border-right: 1px solid var(--border-color);
  min-width: 138px;
}

.clock-day {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent-sky);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.clock-time {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
  color: #fff;
}

.speed-btns {
  display: flex;
  gap: 4px;
}

.btn-speed {
  background: rgba(24, 36, 64, 0.8);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  padding: 5px 8.5px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-speed:hover {
  color: var(--text-primary);
  border-color: var(--accent-sky);
  background: rgba(56, 189, 248, 0.12);
}

.btn-speed.active {
  background: linear-gradient(135deg, var(--accent-sky), var(--accent-blue));
  color: #030712;
  border-color: var(--accent-sky);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.45);
}

.btn-skip {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(168, 85, 247, 0.22));
  color: #c7d2fe;
  border: 1px solid rgba(129, 140, 248, 0.45);
  border-radius: var(--radius-xs);
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-skip:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(168, 85, 247, 0.4));
  color: #fff;
  transform: translateY(-1px);
}

/* ============================================================================
   MAIN WORKSPACE & SIDEBAR
   ============================================================================ */
.main-workspace {
  display: grid;
  grid-template-columns: 244px 1fr;
  height: calc(100vh - 66px);
  overflow: hidden;
}

.sidebar {
  background: linear-gradient(180deg, rgba(11, 19, 38, 0.95) 0%, rgba(6, 11, 22, 0.98) 100%);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 12px;
  overflow-y: auto;
  z-index: 15;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 8px 10px 6px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
  position: relative;
}

.nav-btn-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-icon {
  font-size: 16px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  transform: translateX(2px);
}

.nav-btn.active {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.18) 0%, rgba(37, 99, 235, 0.06) 100%);
  color: #fff;
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.nav-btn.active::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: var(--accent-sky);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 8px var(--accent-sky);
}

.nav-btn.active .nav-icon {
  background: rgba(56, 189, 248, 0.22);
  color: var(--accent-sky);
}

.nav-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-primary);
}

.nav-badge.warn {
  background: rgba(244, 63, 94, 0.25);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.company-stats-card {
  background: linear-gradient(180deg, rgba(19, 30, 56, 0.8) 0%, rgba(12, 20, 38, 0.9) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-top: 8px;
  box-shadow: var(--shadow-sm);
}

.stat-bar-row {
  margin-bottom: 9px;
}
.stat-bar-row:last-child { margin-bottom: 0; }

.stat-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.stat-bar-track {
  height: 5.5px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 99px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent-sky), var(--accent-emerald));
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
  transition: width 0.35s ease;
}

/* ============================================================================
   CONTENT AREA & GLASS CARDS
   ============================================================================ */
.content-area {
  position: relative;
  height: 100%;
  overflow-y: auto;
  background:
    radial-gradient(circle at 85% 10%, rgba(37, 99, 235, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 15% 85%, rgba(16, 185, 129, 0.08) 0%, transparent 45%),
    var(--bg-primary);
}

.view-container {
  padding: 22px 26px 48px;
  max-width: 1560px;
  margin: 0 auto;
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.view-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.view-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 3px;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 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: 14px; }

.card {
  background: linear-gradient(165deg, rgba(20, 32, 60, 0.85) 0%, rgba(12, 20, 38, 0.92) 100%);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: rgba(148, 163, 184, 0.3);
}

.card-interactive:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(56, 189, 248, 0.12);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}

/* ============================================================================
   REAL WORLD MAP (LEAFLET + CUSTOM RADAR MARKERS)
   ============================================================================ */
.map-layout {
  display: grid;
  grid-template-columns: 1fr 425px;
  height: calc(100vh - 66px);
  overflow: hidden;
}

.map-stage {
  position: relative;
  width: 100%;
  height: 100%;
  background: #040914;
  overflow: hidden;
}

#real-world-map {
  width: 100%;
  height: 100%;
  background: #050b16;
  z-index: 1;
}

/* Dark theme adjustments for Leaflet controls & 100% OpenStreetMap tiles */
.leaflet-container {
  background: #050b16 !important;
  font-family: var(--font-sans) !important;
}

.osm-dark-tiles .leaflet-tile-pane {
  filter: invert(100%) hue-rotate(185deg) brightness(92%) contrast(94%) saturate(85%);
}

.leaflet-control-attribution {
  background: rgba(8, 14, 28, 0.75) !important;
  color: #64748b !important;
  font-size: 10px !important;
  border-radius: 4px 0 0 0;
}
.leaflet-control-attribution a {
  color: #94a3b8 !important;
}

/* Custom Airport Markers on Real Map */
.lf-airport-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  transform: translate(-6px, -6px);
  cursor: pointer;
}

.lf-airport-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #64748b;
  border: 2px solid #091122;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
  transition: transform 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
}

.lf-airport-wrap:hover .lf-airport-dot {
  transform: scale(1.35);
  background: #fff;
}

.lf-airport-wrap.hub .lf-airport-dot {
  width: 14px;
  height: 14px;
  background: #f59e0b;
  border: 2px solid #fef08a;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.95);
}

.lf-airport-wrap.connected .lf-airport-dot {
  width: 12px;
  height: 12px;
  background: #38bdf8;
  border: 2px solid #bae6fd;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.85);
}

.lf-airport-wrap.selected .lf-airport-dot {
  width: 15px;
  height: 15px;
  background: #f43f5e;
  border: 2.5px solid #ffffff;
  box-shadow: 0 0 16px rgba(244, 63, 94, 1);
}

.lf-airport-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  color: #f1f5f9;
  background: rgba(6, 12, 24, 0.84);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 0px 4.5px;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.lf-airport-wrap.hub .lf-airport-tag {
  color: #fef08a;
  border-color: rgba(245, 158, 11, 0.6);
  background: rgba(24, 16, 4, 0.9);
}

.lf-airport-wrap.selected .lf-airport-tag {
  color: #fff;
  background: #e11d48;
  border-color: #fda4af;
}

/* Live Plane Marker on Real Map */
.lf-plane-marker {
  display: flex;
  align-items: center;
  gap: 3px;
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.95));
}

.lf-plane-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  color: #7dd3fc;
  background: rgba(4, 9, 20, 0.85);
  padding: 0 4px;
  border-radius: 3px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  white-space: nowrap;
}

/* Map HUD Overlays (above Leaflet z-index) */
.map-hud-top {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  gap: 10px;
  flex-wrap: wrap;
  z-index: 500;
}

.map-hud-box {
  pointer-events: auto;
  background: rgba(10, 18, 36, 0.9);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-md);
}

.map-bottom-bar {
  position: absolute;
  bottom: 18px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  gap: 12px;
  z-index: 500;
}

.map-legend {
  pointer-events: auto;
  background: rgba(10, 18, 36, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
  color: var(--text-secondary);
  box-shadow: var(--shadow-md);
  flex-wrap: wrap;
}

.fids-mini-board {
  pointer-events: auto;
  background: rgba(8, 14, 28, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  min-width: 360px;
  max-width: 520px;
  box-shadow: var(--shadow-md);
}

.fids-header {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  color: var(--accent-sky);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 4px;
}

.fids-row {
  display: grid;
  grid-template-columns: 62px 86px 1fr 48px;
  gap: 8px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2.5px 0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.map-inspector {
  background: linear-gradient(180deg, #0b1428 0%, #070d1b 100%);
  border-left: 1px solid var(--border-color);
  height: 100%;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: -8px 0 25px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

/* ============================================================================
   AIRCRAFT SILHOUETTE & FUSELAGE SEATMAP VISUALIZER
   ============================================================================ */
.aircraft-blueprint-box {
  position: relative;
  background:
    linear-gradient(rgba(56, 189, 248, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.04) 1px, transparent 1px),
    radial-gradient(ellipse at center, rgba(14, 30, 62, 0.9) 0%, rgba(7, 13, 27, 0.95) 100%);
  background-size: 16px 16px, 16px 16px, 100% 100%;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
}

.fuselage-seatmap {
  position: relative;
  height: 44px;
  background: #070d1a;
  border: 1.5px solid #334155;
  border-radius: 24px 36px 36px 24px;
  display: flex;
  align-items: center;
  padding: 4px 14px 4px 18px;
  margin: 10px 0;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8);
}

.fuselage-cockpit {
  width: 14px;
  height: 22px;
  border-right: 2px solid #334155;
  margin-right: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3px 0;
  flex-shrink: 0;
}

.cockpit-window {
  width: 6px;
  height: 6px;
  background: #38bdf8;
  border-radius: 2px 6px 2px 2px;
  opacity: 0.75;
}

.cabin-zones-track {
  display: flex;
  flex: 1;
  height: 100%;
  gap: 2px;
  border-radius: 6px;
  overflow: hidden;
}

.cabin-zone-block {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  color: #030712;
  transition: width 0.25s ease;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

.cabin-zone-block.first {
  background: repeating-linear-gradient(90deg, #f59e0b, #f59e0b 9px, #d97706 9px, #d97706 11px);
}
.cabin-zone-block.bus {
  background: repeating-linear-gradient(90deg, #38bdf8, #38bdf8 6px, #0284c7 6px, #0284c7 8px);
}
.cabin-zone-block.eco {
  background: repeating-linear-gradient(90deg, #10b981, #10b981 3.5px, #059669 3.5px, #059669 5px);
}

/* ============================================================================
   BUTTONS, INPUTS & BADGES
   ============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.16s ease;
  font-family: var(--font-sans);
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-sky), var(--accent-blue));
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.btn-emerald {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-emerald:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-amber {
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #090d16;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-amber:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.12);
  border-color: var(--accent-sky);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.35);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(244, 63, 94, 0.28);
  border-color: #f43f5e;
  color: #fff;
}

.btn-sm {
  padding: 5.5px 10.5px;
  font-size: 11.5px;
}

.btn-block {
  width: 100%;
}

.input, .select {
  background: rgba(7, 13, 27, 0.9);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 7.5px 11px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus, .select:focus {
  border-color: var(--accent-sky);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.demand-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.demand-box {
  background: rgba(9, 15, 30, 0.78);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 6px;
  text-align: center;
}

.demand-box .lbl {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.demand-box .val {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 800;
  margin-top: 2px;
}

.c-eco { color: var(--eco-color) !important; }
.c-bus { color: var(--bus-color) !important; }
.c-first { color: var(--first-color) !important; }
.c-cargo { color: var(--cargo-color) !important; }

/* ============================================================================
   7-DAY TIMELINE GANTT SCHEDULER
   ============================================================================ */
.schedule-ruler {
  display: grid;
  grid-template-columns: 105px 1fr;
  gap: 10px;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.schedule-ruler-hours {
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
}

.schedule-day-row {
  display: grid;
  grid-template-columns: 105px 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
}

.schedule-day-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.schedule-track {
  position: relative;
  height: 36px;
  background: linear-gradient(180deg, rgba(6, 11, 22, 0.95) 0%, rgba(11, 19, 38, 0.95) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.schedule-hour-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.05);
}

.flight-block {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border-radius: 5px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.92), rgba(37, 99, 235, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  white-space: nowrap;
  padding: 0 5px;
  cursor: pointer;
  transition: transform 0.12s, filter 0.12s;
}

.flight-block:hover {
  filter: brightness(1.18);
  z-index: 5;
}

/* Tags & Filter Tabs */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 8.5px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-secondary);
}

.tag-cat {
  background: rgba(56, 189, 248, 0.16);
  color: var(--accent-sky);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.tag-emerald {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.tag-amber {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.tag-rose {
  background: rgba(244, 63, 94, 0.16);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.35);
}

.filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  background: rgba(16, 26, 48, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-tab:hover {
  color: var(--text-primary);
  border-color: rgba(56, 189, 248, 0.4);
}

.filter-tab.active {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(37, 99, 235, 0.22));
  color: var(--accent-sky);
  border-color: var(--accent-sky);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.2);
}

/* Modal & Toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 16, 0.82);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  background: linear-gradient(165deg, #111d38 0%, #091122 100%);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 740px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(11, 19, 38, 0.96);
  backdrop-filter: blur(12px);
  border-left: 4px solid var(--accent-sky);
  border-top: 1px solid var(--border-glow);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  animation: slideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ============================================================================
   BOARDING PASS CHARTER CARDS, ROUTE FINDER 24H & HUB INFRASTRUCTURE UI
   ============================================================================ */
.hero-banner {
  background: linear-gradient(135deg, rgba(14, 30, 64, 0.92) 0%, rgba(19, 44, 88, 0.78) 50%, rgba(16, 185, 129, 0.14) 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  position: relative;
  overflow: hidden;
}

.hero-banner::after {
  content: '';
  position: absolute;
  right: -60px;
  top: -60px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.charter-ticket-card {
  background: linear-gradient(160deg, rgba(22, 35, 66, 0.92) 0%, rgba(10, 18, 36, 0.96) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-lg);
  padding: 18px;
  position: relative;
  box-shadow: var(--shadow-md), 0 0 22px rgba(245, 158, 11, 0.08);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.charter-ticket-card:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 158, 11, 0.75);
  box-shadow: var(--shadow-lg), 0 0 28px rgba(245, 158, 11, 0.18);
}

.route-flight-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(6, 11, 23, 0.85);
  border: 1px dashed rgba(148, 163, 184, 0.28);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin: 12px 0;
}

.route-iata-big {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.04em;
}

.route-line-graphic {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 14px;
  position: relative;
  color: var(--accent-sky);
  font-size: 12px;
}

.route-line-graphic::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--accent-sky), transparent);
}

.route-line-plane {
  background: #070d1b;
  padding: 0 8px;
  z-index: 1;
  font-size: 14px;
}

/* Route Finder 24h Table / Cards */
.finder-row-card {
  background: linear-gradient(90deg, rgba(18, 29, 54, 0.9) 0%, rgba(11, 19, 38, 0.94) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 220px 150px 190px 1fr 250px;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  transition: all 0.16s ease;
}

.finder-row-card:hover {
  border-color: var(--accent-sky);
  transform: translateX(3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.finder-row-card.perfect-24h {
  border-left: 4px solid #10b981;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, rgba(15, 25, 48, 0.92) 35%);
}

@keyframes strobePulse {
  0%, 100% { opacity: 1; r: 2.2px; }
  50% { opacity: 0.2; r: 1px; }
}

.aircraft-strobe {
  fill: #38bdf8;
  animation: strobePulse 1.4s infinite;
}

@media (max-width: 1180px) {
  .map-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 56% 44%;
  }
  .grid-3, .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .finder-row-card {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   PROGRESSION, DÉFIS, IMMOBILISATIONS & JOURNAL
   ========================================================================== */
.kpi-clickable { cursor: pointer; transition: border-color 0.15s; }
.kpi-clickable:hover { border-color: var(--accent-sky); }
.kpi-danger { border-color: var(--accent-rose) !important; box-shadow: 0 0 12px rgba(244, 63, 94, 0.35); }

.busy-bar {
  margin: 8px 0;
  padding: 8px 10px;
  background: rgba(9, 15, 30, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}
.busy-bar-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 6px;
}
.busy-bar-head span:last-child { color: var(--text-secondary); font-family: var(--font-mono); }

.hint-banner, .lock-banner {
  font-size: 11.5px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  margin: 6px 0;
}
.hint-banner { background: rgba(56, 189, 248, 0.1); border: 1px dashed rgba(56, 189, 248, 0.45); color: var(--accent-sky); }
.lock-banner { background: rgba(148, 163, 184, 0.08); border: 1px solid var(--border-subtle); color: var(--text-secondary); text-align: center; }

.charter-quote {
  font-size: 11px;
  color: var(--text-secondary);
  background: rgba(9, 15, 30, 0.6);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.week-summary {
  background: rgba(9, 15, 30, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 240px;
}

.challenge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: rgba(9, 15, 30, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}
.challenge-row.ready { border-color: var(--accent-emerald); box-shadow: 0 0 10px rgba(16, 185, 129, 0.25); }
.challenge-row.claimed { opacity: 0.6; }
.challenge-row.failed { opacity: 0.5; }
.challenge-icon { font-size: 22px; width: 30px; text-align: center; }
.challenge-reward { font-size: 11px; font-family: var(--font-mono); color: #34d399; white-space: nowrap; }

.incident-card { border-color: var(--accent-rose); }
.incident-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border-subtle);
}
.incident-row:first-of-type { border-top: none; }

.log-list { max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.log-row { display: flex; gap: 10px; font-size: 12px; padding: 5px 8px; border-left: 3px solid var(--border-subtle); }
.log-row.log-good { border-left-color: var(--accent-emerald); }
.log-row.log-bad { border-left-color: var(--accent-rose); }
.log-time { font-family: var(--font-mono); color: var(--text-muted); white-space: nowrap; font-size: 11px; }

.toast { cursor: pointer; }
.toast.toast-good { border-left: 4px solid var(--accent-emerald); }
.toast.toast-bad { border-left: 4px solid var(--accent-rose); }

button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===================== RAPPORTS FINANCIERS ===================== */
.stat-tile { padding: 14px 16px; }
.stat-tile-value { font-family: var(--font-mono); font-size: 20px; font-weight: 800; margin-top: 6px; color: var(--text-primary); }
.stat-tile-value.positive, .report-table .positive { color: #34d399; }
.stat-tile-value.negative, .report-table .negative { color: #fb7185; }
.report-chart { width: 100%; height: auto; display: block; }
.chart-grid { stroke: rgba(148, 163, 184, 0.1); stroke-width: 1; }
.chart-zero { stroke: rgba(148, 163, 184, 0.35); stroke-width: 1; }
.chart-axis { fill: var(--text-muted); font-size: 10.5px; font-family: var(--font-mono); }
.chart-label { fill: var(--text-secondary); font-size: 11px; font-weight: 700; }
.chart-crosshair { stroke: rgba(248, 250, 252, 0.35); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.chart-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--text-secondary); }
.chart-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.tip-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.chart-tooltip { position: absolute; z-index: 20; min-width: 180px; padding: 8px 10px; background: var(--bg-card-solid); border: 1px solid var(--border-color); border-radius: var(--radius-sm); font-size: 12px; color: var(--text-primary); pointer-events: none; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }
.chart-tooltip .tip-row { display: flex; align-items: center; gap: 4px; color: var(--text-secondary); }
.chart-tooltip .tip-row strong { margin-left: auto; padding-left: 12px; color: var(--text-primary); font-family: var(--font-mono); }
.report-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.report-table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); padding: 6px 8px; border-bottom: 1px solid var(--border-color); white-space: nowrap; }
.report-table td { padding: 7px 8px; border-bottom: 1px solid var(--border-subtle); font-family: var(--font-mono); white-space: nowrap; }
.report-table tr.row-loss td { background: rgba(244, 63, 94, 0.07); }
.alert-card { border-color: rgba(244, 63, 94, 0.45); background: linear-gradient(165deg, rgba(244, 63, 94, 0.1), var(--bg-card)); }

/* ===================== CONCURRENCE ===================== */
.rank-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); margin-bottom: 6px; background: rgba(9, 15, 30, 0.6); border: 1px solid var(--border-subtle); }
.rank-row.rank-player { border-color: var(--brand-color); background: rgba(56, 189, 248, 0.08); }
.rank-pos { width: 22px; font-family: var(--font-mono); font-weight: 800; color: var(--text-secondary); text-align: center; }
.rank-swatch { width: 10px; height: 26px; border-radius: 3px; flex-shrink: 0; }
.contest-row { padding: 9px 0; border-bottom: 1px solid var(--border-subtle); }
.share-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; margin: 7px 0 5px; gap: 2px; background: var(--bg-deep); }
.share-bar > div { height: 100%; min-width: 2px; }

/* ===================== PLANNING GLISSER-DÉPOSER ===================== */
.planner-help { font-size: 11.5px; color: var(--text-secondary); margin-bottom: 10px; }
.schedule-track { cursor: copy; }
.flight-block { cursor: grab; }
.flight-block.dragging { opacity: 0.35; }
.flight-block.flight-other { background: linear-gradient(135deg, rgba(148, 163, 184, 0.75), rgba(71, 85, 105, 0.85)); box-shadow: none; }
.flight-block.flight-tail { border-left: 2px dashed rgba(255, 255, 255, 0.6); border-top-left-radius: 0; border-bottom-left-radius: 0; }
.flight-block.flight-conflict { background: linear-gradient(135deg, rgba(244, 63, 94, 0.95), rgba(190, 18, 60, 0.95)); box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.5); }
.busy-zone { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, rgba(245, 158, 11, 0.22) 0 6px, rgba(245, 158, 11, 0.08) 6px 12px); border-left: 2px solid var(--accent-amber); z-index: 1; pointer-events: none; display: flex; align-items: flex-end; overflow: hidden; }
.busy-zone span { font-size: 9.5px; color: #fcd34d; padding: 0 4px 1px; white-space: nowrap; }
.now-line { position: absolute; top: 0; bottom: 0; width: 2px; background: #fb7185; z-index: 6; pointer-events: none; }
.drop-ghost { position: absolute; top: 3px; bottom: 3px; border-radius: 5px; border: 1.5px dashed; z-index: 7; pointer-events: none; align-items: center; justify-content: center; font-size: 10px; font-family: var(--font-mono); font-weight: 700; white-space: nowrap; overflow: hidden; }
.drop-ghost.ok { border-color: #34d399; background: rgba(16, 185, 129, 0.18); color: #a7f3d0; }
.drop-ghost.bad { border-color: #fb7185; background: rgba(244, 63, 94, 0.18); color: #fecdd3; }

/* ===================== DÉMARRAGE GUIDÉ ===================== */
#tutorial-root { position: fixed; left: 264px; bottom: 20px; z-index: 1900; max-width: 340px; }
.tutorial-card { background: var(--bg-card-solid); border: 1px solid var(--border-glow); border-radius: var(--radius-md); padding: 14px 16px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55); }
.tutorial-progress { display: flex; gap: 4px; margin-bottom: 10px; }
.tutorial-progress span { flex: 1; height: 4px; border-radius: 99px; background: rgba(148, 163, 184, 0.2); }
.tutorial-progress span.done { background: #34d399; }
.tutorial-progress span.current { background: var(--accent-sky); }
.tutorial-title { font-weight: 800; font-size: 14px; margin-bottom: 6px; }
.tutorial-text { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 12px; }
.tutorial-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tutorial-wait { font-size: 11px; color: var(--text-muted); }
.tut-highlight { position: relative; z-index: 5; box-shadow: 0 0 0 2px var(--accent-sky), 0 0 18px rgba(56, 189, 248, 0.6) !important; animation: tutPulse 1.6s ease-in-out infinite; border-radius: var(--radius-sm); }
@keyframes tutPulse { 50% { box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.35), 0 0 26px rgba(56, 189, 248, 0.75); } }

/* ===================== DÉCISIONS ===================== */
#decision-root { position: fixed; top: 86px; right: 20px; z-index: 1950; width: 360px; max-width: calc(100vw - 32px); }
.decision-card { background: var(--bg-card-solid); border: 1px solid rgba(245, 158, 11, 0.55); border-radius: var(--radius-md); padding: 14px 16px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55); }
.decision-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.decision-icon { font-size: 26px; }
.decision-kicker { font-size: 10.5px; color: #fcd34d; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.decision-title { font-weight: 800; font-size: 14px; }
.decision-text { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 12px; }
.decision-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.decision-foot { font-size: 10.5px; color: var(--text-muted); margin-top: 8px; }

@media (max-width: 720px) {
  #tutorial-root { left: 16px; right: 16px; max-width: none; }
  #decision-root { right: 16px; left: 16px; width: auto; }
}

/* ===================== SYNCHRO CLOUD ===================== */
.cloud-text { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }
.cloud-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cloud-code-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 10px; background: rgba(9, 15, 30, 0.75); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); }
.cloud-code-box code { font-family: var(--font-mono); font-size: 17px; font-weight: 800; letter-spacing: 0.08em; color: var(--accent-sky); user-select: all; }
.cloud-status { margin-top: 6px; font-size: 10.5px; color: var(--text-muted); text-align: center; cursor: pointer; }
.cloud-version { padding: 10px 12px; background: rgba(9, 15, 30, 0.75); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); font-size: 12px; color: var(--text-secondary); display: flex; flex-direction: column; gap: 3px; }
.cloud-version strong { color: var(--text-primary); font-size: 13.5px; }
#cloud-root .modal-backdrop { z-index: 3000; }

/* ===================== PLANNING : sélection d'un vol (souris et tactile) ===================== */
.planner-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.flight-block.flight-selected { outline: 2px solid #fde047; outline-offset: 1px; z-index: 8; }
.planner-selbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; margin-bottom: 10px; background: rgba(253, 224, 71, 0.1); border: 1px solid rgba(253, 224, 71, 0.45); border-radius: var(--radius-sm); font-size: 12px; }

/* ===================== VERSION MOBILE / TABLETTE ===================== */
@media (max-width: 900px) {
  html, body { overflow-x: hidden; }
  .app-shell { display: block; height: auto; min-height: 100dvh; width: 100%; }
  .topbar {
    position: sticky; top: 0; flex-wrap: wrap; gap: 8px;
    padding: calc(8px + env(safe-area-inset-top)) 12px 8px; height: auto;
  }
  .brand-group { flex: 1; min-width: 0; gap: 8px; }
  .brand-logo { width: 34px; height: 34px; font-size: 17px; }
  .brand-title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand-subtitle { display: none; }
  .time-controls { padding: 4px 6px; gap: 4px; }
  .clock-display { display: none; }
  .btn-speed, .btn-skip { padding: 6px 7px; font-size: 11px; }
  .kpi-strip { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; scrollbar-width: none; }
  .kpi-strip::-webkit-scrollbar { display: none; }
  .kpi-pill { min-width: 118px; flex-shrink: 0; padding: 5px 10px; }
  .kpi-value { font-size: 13px; }

  .main-workspace { display: block; height: auto; overflow: visible; }
  .content-area { height: auto; overflow: visible; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }

  /* Barre latérale => barre d'onglets en bas de l'écran */
  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
    flex-direction: row; justify-content: flex-start; padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    border-right: none; border-top: 1px solid var(--border-color);
    overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar > div:not(:first-child), .sidebar .nav-section-title, .sidebar .company-stats-card { display: none !important; }
  .sidebar .nav-list { flex-direction: row; gap: 2px; }
  .sidebar .nav-btn { flex-direction: column; justify-content: center; gap: 2px; width: 70px; min-width: 70px; padding: 6px 2px; font-size: 9.5px; text-align: center; }
  .sidebar .nav-btn-left { flex-direction: column; gap: 2px; }
  .sidebar .nav-btn-left > span:last-child { max-width: 66px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
  .sidebar .nav-icon { font-size: 18px; }
  .sidebar .nav-badge { position: absolute; top: 2px; right: 4px; font-size: 8.5px; padding: 0 4px; max-width: 48px; overflow: hidden; }

  .view-container { padding: 14px 12px 24px; }
  .view-title { font-size: 18px; }
  .hero-banner { flex-direction: column; align-items: stretch; padding: 14px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .card-header { flex-wrap: wrap; gap: 8px; }

  /* Carte : plein écran en haut, inspecteur en dessous */
  .map-layout { display: flex; flex-direction: column; height: auto; overflow: visible; }
  .map-stage { height: 58vh; min-height: 320px; }
  .map-inspector { height: auto; overflow: visible; border-left: none; border-top: 1px solid var(--border-color); }
  .map-hud-top { top: 8px; left: 8px; right: 8px; }
  .map-bottom-bar { left: 8px; right: 8px; bottom: 8px; }
  .fids-mini-board { display: none; }
  .map-legend { font-size: 10.5px; padding: 6px 8px; gap: 6px; max-height: 92px; overflow-y: auto; }

  .week-planner, .planner-scroll .schedule-ruler { min-width: 680px; }
  .schedule-day-row, .schedule-ruler { grid-template-columns: 86px 1fr; }

  #tutorial-root { left: 10px; right: 10px; bottom: calc(76px + env(safe-area-inset-bottom)); max-width: none; }
  #decision-root { top: auto; left: 10px; right: 10px; bottom: calc(76px + env(safe-area-inset-bottom)); width: auto; }
  .toast-container { left: 10px; right: 10px; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .modal-backdrop { padding: 10px; }
  .modal-box { padding: 16px; max-height: 92dvh; }
}

@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stat-tile-value { font-size: 17px; }
  .view-header > div:last-child { width: 100%; flex-wrap: wrap; }
  .btn { touch-action: manipulation; }
}

@media (pointer: coarse) {
  .btn-sm { min-height: 34px; }
  .flight-block { cursor: pointer; }
}
@media (max-width: 900px) {
  .map-hud-box { padding: 5px 8px; font-size: 11px; gap: 6px; flex-wrap: wrap; max-width: 100%; }
  .map-hud-box .select { font-size: 12px; padding: 4px 6px; }
  .map-hud-top { flex-direction: column; align-items: stretch; gap: 6px; }
  .map-legend { flex-wrap: nowrap; overflow-x: auto; max-height: none; scrollbar-width: none; }
  .map-legend::-webkit-scrollbar { display: none; }
  .map-legend .legend-item { display: none; }
  .map-legend > div { flex-shrink: 0; border-left: none !important; margin-left: 0 !important; padding-left: 0 !important; }
  .map-legend .btn { flex-shrink: 0; white-space: nowrap; }
}
@media (max-width: 900px) {
  .map-hud-top .map-hud-box:first-child > span { display: none; }
  .map-hud-top .map-hud-box:nth-child(2) span span { display: none; }
}
@media (max-width: 900px) {
  #main-content [style*="display:flex"] { flex-wrap: wrap; min-width: 0; }
  #main-content .card-header > *, #main-content .view-header > * { min-width: 0; max-width: 100%; }
  #main-content select, #main-content .select { max-width: 100%; }
  #main-content .finder-row-card { grid-template-columns: 1fr !important; }
  #main-content .finder-row-card > * { min-width: 0; }
}
@media (max-width: 900px) {
  #main-content [style*="display:flex"] > * { max-width: 100%; }
  .aircraft-blueprint-box { max-width: 100%; overflow: hidden; }
  .aircraft-blueprint-box svg { max-width: 55%; height: auto; flex-shrink: 1; }
  .aircraft-blueprint-box > div { min-width: 0; flex-shrink: 0; }
}
