/* ==========================================================================
   AEROROTATION â€” Modern Airline Fleet & Schedule Design System
   ========================================================================== */

:root {
  /* Surface Colors */
  --bg-app: #121212;
  --bg-sidebar: #18181b;
  --bg-panel: #27272a;
  --bg-card: #3f3f46;
  --bg-card-hover: #52525b;
  --bg-input: #18181b;

  /* Borders & Dividers */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --grid-line: rgba(255, 255, 255, 0.04);
  --border-medium: #3f3f46;
  --border-focus: #6366f1;

  /* Typography Colors */
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-inverse: #18181b;

  /* Semantic Brand & Accents */
  --brand-primary: #6366f1;
  --brand-primary-hover: #4f46e5;
  --accent-blue: #38bdf8;
  --accent-teal: #14b8a6;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-green: #10b981;

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Timeline Metric Variables */
  --tl-row-height: 36px;
  --tl-tail-col-width: 150px;
  --tl-ground-bg: rgba(24, 34, 60, 0.9);
  --tl-ground-text: #94a3b8;
}

:root[data-theme="light"] {
  /* Surface Colors */
  --bg-app: #f1f5f9;
  --bg-sidebar: #ffffff;
  --bg-panel: #ffffff;
  --bg-card: #f8fafc;
  --bg-card-hover: #e2e8f0;
  --bg-input: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-2: #f8fafc;
  --bg-surface-3: #e2e8f0;

  /* Borders & Dividers */
  --border-subtle: rgba(0, 0, 0, 0.08);
  --grid-line: rgba(0, 0, 0, 0.05);
  --border-medium: #cbd5e1;
  --border-color: #cbd5e1;
  --border-focus: #6366f1;

  /* Typography Colors */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-tertiary: #94a3b8;
  --text-inverse: #ffffff;

  /* Timeline Metric Variables */
  --tl-ground-bg: rgba(226, 232, 240, 0.85);
  --tl-ground-text: #475569;
}

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

html,
body {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  /* Prevent horizontal scrollbar */
  max-width: 100vw;
}

/* App Shell Container */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* ==========================================================================
   Navigation Row 1: Brand, Upload & View Tabs (Top Bar)
   ========================================================================== */
.app-sub-navbar {
  background-color: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-medium);
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0.85rem;
  flex-shrink: 0;
  z-index: 30;
  gap: 0.75rem;
  overflow: hidden;
}

@media (min-width: 1024px) {
  .app-sub-navbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    height: auto;
    padding: 0 0.85rem;
  }
}

/* ==========================================================================
   Navigation Row 2: Secondary Controls Header (Search & Filters)
   ========================================================================== */
.app-header {
  padding: 0.5rem 0.85rem;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-medium);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  flex-shrink: 0;
  z-index: 25;
  overflow: hidden;
}

@media (min-width: 768px) {
  .app-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 0.5rem 0.85rem;
  }
}

@media (min-width: 1024px) {
  .app-header {
    height: 42px;
    min-height: 42px;
    padding: 0 0.85rem;
    flex-direction: row;
    flex-wrap: nowrap;
  }
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1;
}

@media (min-width: 768px) {
  .header-left {
    flex: 0 1 auto;
  }

  .header-right {
    flex: 1;
    justify-content: flex-end;
  }
}

@media (min-width: 1024px) {
  .header-left,
  .header-right {
    gap: 0.75rem;
    flex-wrap: nowrap;
  }
}

/* Logo Branding */
.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.logo-icon {
  width: 22px;
  height: 22px;
  color: var(--accent-blue);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.logo-highlight {
  color: var(--accent-blue);
}

.logo-sub {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--text-muted);
}

.nav-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 0.35rem;
  width: 100%;
  flex-shrink: 1;
  overflow: hidden;
}

@media (min-width: 768px) {
  .nav-tabs {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  .nav-tabs {
    display: flex;
    flex-wrap: nowrap;
    width: auto;
    overflow-x: auto;
    scrollbar-width: none;
    white-space: nowrap;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }
}

.nav-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-sans);
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  min-width: 0;
}

@media (min-width: 768px) {
  .nav-tab {
    padding: 0.5rem 0.65rem;
    font-size: 0.75rem;
  }
}

@media (min-width: 1024px) {
  .nav-tab {
    padding: 0.38rem 0.65rem;
    font-size: 0.76rem;
    justify-content: flex-start;
  }
}

.nav-tab:hover {
  color: #f8fafc;
  background-color: rgba(255, 255, 255, 0.04);
}

.nav-tab.active {
  background-color: rgba(37, 99, 235, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.tab-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* Header Right Toolbar */
.header-divider {
  width: 1px;
  height: 22px;
  background-color: var(--border-medium);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  width: 15px;
  height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  background-color: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 0.45rem 2rem 0.45rem 2rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-primary);
  width: 100%;
  max-width: 180px;
  transition: all 0.2s ease;
}

@media (min-width: 768px) {
  .search-box input {
    max-width: 220px;
  }
}

@media (min-width: 1024px) {
  .search-box input {
    width: 220px;
    max-width: 260px;
  }
}

.search-box input:focus {
  outline: none;
  border-color: var(--border-focus);
  width: 260px;
}

.search-clear {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
}

.search-clear:hover {
  color: var(--text-primary);
}

/* Fleet Chips */
.fleet-filter-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;
}

@media (min-width: 1024px) {
  .fleet-filter-wrapper {
    flex-wrap: nowrap;
  }
}

.filter-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.fleet-chips {
  display: flex;
  gap: 0.25rem;
}

.fleet-chip {
  background-color: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.fleet-chip:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.fleet-chip.active {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #ffffff;
}

/* Zoom Toolbar */
.zoom-toolbar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background-color: var(--bg-input);
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid var(--border-medium);
}

.tool-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.tool-btn svg {
  width: 14px;
  height: 14px;
}

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

.zoom-display {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 42px;
  text-align: center;
}

/* Export Dropdown */
.export-dropdown {
  position: relative;
}

.btn-export {
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-export:hover {
  background-color: var(--bg-card-hover);
}

.btn-export svg {
  width: 14px;
  height: 14px;
}

.export-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 210px;
  background-color: var(--bg-panel);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  padding: 4px;
  z-index: 50;
  display: flex;
  flex-direction: column;
}

.export-menu button {
  background: transparent;
  border: none;
  padding: 0.6rem 0.8rem;
  text-align: left;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  color: var(--text-primary);
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.export-menu button:hover {
  background-color: var(--brand-primary);
  color: #fff;
}

/* ==========================================================================
   Workspace Layout (Sidebar + Center Content)
   ========================================================================== */
/* Sidebar Collapse Toggle Button */
.btn-sidebar-toggle {
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-right: 0.75rem;
}

.btn-sidebar-toggle:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: #38bdf8;
  color: #38bdf8;
}

.btn-sidebar-toggle.collapsed {
  background-color: rgba(37, 99, 235, 0.2);
  border-color: var(--accent-blue);
  color: #38bdf8;
}

/* Floating Expand Trigger Button on Workspace */
.btn-floating-expand {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 100;
  background-color: #0b1120;
  border: 1px solid var(--border-medium);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  color: #38bdf8;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  animation: expandFadeIn 0.2s ease-out;
}

@keyframes expandFadeIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.btn-floating-expand:hover {
  background-color: #1e293b;
  border-color: #38bdf8;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

.workspace-layout {
  display: flex;
  flex-grow: 1;
  overflow: hidden;
  position: relative;
}

/* Sidebar */
.sidebar {
  width: 320px;
  min-width: 320px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-medium);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive Sidebar - Hide on small screens, show on tablet and above */
@media (max-width: 768px) {
  .sidebar {
    width: 0;
    min-width: 0;
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-100%);
    border-right: none;
  }

  .workspace-layout.sidebar-visible .sidebar {
    width: 280px;
    min-width: 280px;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
  }

  .workspace-layout.sidebar-visible::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 35;
  }
}

/* Sidebar Collapsed State (Full Screen Gantt / Workspace) */
.workspace-layout.sidebar-collapsed .sidebar {
  width: 0 !important;
  min-width: 0 !important;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  border-right: none;
  transform: translateX(-20px);
}

.sidebar-scroll {
  padding: 1.25rem;
  overflow-y: auto;
  flex-grow: 1;
}

.panel-section {
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-section:last-of-type {
  border-bottom: none;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.section-heading {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.section-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.status-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: 4px;
}

.status-badge.idle {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-muted);
}

.status-badge.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.unit-tag {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* Upload Dropzone */
.upload-dropzone {
  border: 2px dashed var(--border-focus);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  padding: 1.5rem 1rem;
  text-align: center;
  background-color: var(--bg-card);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
  border-color: var(--border-focus);
  background-color: rgba(37, 99, 235, 0.08);
}

.upload-icon {
  width: 32px;
  height: 32px;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.upload-primary-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.upload-sub-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* File Loaded Card */
.file-loaded-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
}

.file-icon-box {
  width: 32px;
  height: 32px;
  background-color: var(--bg-app);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-blue);
}

.file-icon-box svg {
  width: 18px;
  height: 18px;
}

.file-details {
  flex-grow: 1;
  overflow: hidden;
}

.file-name {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  display: block;
  font-size: 0.7rem;
  color: var(--accent-green);
}

.btn-icon-danger {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px;
}

.btn-icon-danger:hover {
  color: var(--accent-red);
}

/* Strategy Radio Cards */
.strategy-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.radio-card:hover {
  border-color: var(--text-muted);
}

.radio-card input {
  margin-top: 2px;
  accent-color: var(--brand-primary);
}

.radio-card-content {
  display: flex;
  flex-direction: column;
}

.radio-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

.radio-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-top: 2px;
}

/* Turnaround Grid */
.turnaround-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.turnaround-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.turnaround-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.turnaround-fleet-tag {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.turnaround-input {
  background-color: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.4rem;
  width: 100%;
}

.turnaround-input:focus {
  outline: none;
  border-color: var(--border-focus);
}

/* Buttons */
.btn {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.15s ease;
}

.btn-icon {
  width: 14px;
  height: 14px;
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background-color: var(--brand-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--brand-primary-hover);
}

.btn-secondary {
  background-color: var(--bg-card);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: var(--bg-card-hover);
}

.btn-large {
  padding: 0.75rem 1.4rem;
  font-size: 0.9rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-3 {
  margin-top: 0.75rem;
}

.mt-4 {
  margin-top: 1rem;
}

/* Validation Card */
.validation-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border-medium);
}

.validation-card.valid {
  background-color: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}

.validation-card.warning {
  background-color: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
}

.validation-status-icon {
  font-weight: 800;
  font-size: 1rem;
}

.validation-card.valid .validation-status-icon {
  color: var(--accent-green);
}

.validation-card.warning .validation-status-icon {
  color: var(--accent-red);
}

.validation-status-text {
  display: flex;
  flex-direction: column;
}

.validation-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.validation-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--bg-app);
}

.footer-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.footer-indicator.online {
  background-color: var(--accent-green);
}

.footer-text {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Main Workspace Area
   ========================================================================== */
.main-workspace {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--bg-app);
}

/* KPI Banner */
.kpi-banner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background-color: var(--bg-panel);
  border-bottom: 1px solid var(--border-medium);
  flex-shrink: 0;
  align-items: center;
}

.kpi-banner .kpi-card {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, background-color 0.2s;
}

.kpi-banner .kpi-card:last-child {
  border-right: none;
}

.kpi-banner .kpi-val {
  font-size: 1.1rem;
  font-weight: 700;
}

.kpi-banner .kpi-label {
  font-size: 0.65rem;
}

.kpi-banner .kpi-sub {
  font-size: 0.65rem;
  display: none;
}

.kpi-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.kpi-val {
  font-size: 1.4rem;
  font-weight: 800;
  font-family: var(--font-sans);
  color: var(--text-primary);
  margin: 0.15rem 0;
}

.kpi-sub {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* Empty State */
.empty-state-view {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.empty-state-box {
  max-width: 480px;
  text-align: center;
  background-color: var(--bg-panel);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 3rem 2.5rem;
}

.empty-illustration {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  color: var(--text-muted);
}

.empty-state-box h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.empty-state-box p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

/* Loading State */
.loading-state-view {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.spinner-orbit {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-medium);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.loading-state-view h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.loading-state-view p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Gantt Timeline Engine
   ========================================================================== */
.timeline-view-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.timeline-viewport {
  flex-grow: 1;
  overflow: auto;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--border-medium) transparent;
}

.timeline-chart {
  position: relative;
  min-width: max-content;
  padding-bottom: 3rem;
}

/* Timeline Header */
.tl-tier-date,
.tl-tier-time {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: var(--bg-panel);
}

.tl-tier-date {
  border-bottom: 1px solid var(--border-subtle);
  height: 26px;
}

.tl-tier-time {
  border-bottom: 2px solid var(--border-medium);
  z-index: 19;
  top: 26px;
  height: 26px;
}

.tl-corner-cell {
  width: var(--tl-tail-col-width);
  flex-shrink: 0;
  position: sticky;
  left: 0;
  background-color: var(--bg-panel);
  z-index: 25;
  border-right: 2px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.tl-date-cell,
.tl-time-cell {
  text-align: center;
  font-size: 0.75rem;
  border-right: 1px solid var(--border-subtle);
  box-sizing: border-box;
  line-height: 26px;
}

.tl-date-cell {
  font-weight: 700;
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.02);
}

.tl-time-cell {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Timeline Rows */
.tl-row {
  display: flex;
  position: relative;
  height: var(--tl-row-height);
  border-bottom: 1px solid var(--border-subtle);
}

.tl-row:hover {
  background-color: rgba(255, 255, 255, 0.015);
}

.tl-row.drag-target {
  background-color: rgba(37, 99, 235, 0.12);
  border-top: 1px solid var(--brand-primary);
  border-bottom: 1px solid var(--brand-primary);
}

.tl-tail-header {
  width: var(--tl-tail-col-width);
  flex-shrink: 0;
  position: sticky;
  left: 0;
  background-color: var(--bg-sidebar);
  border-right: 2px solid var(--border-medium);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.75rem;
}

.tl-tail-name {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.tl-tail-equip-badge {
  font-size: 0.65rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Background Grid */
.tl-grid-layer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--tl-tail-col-width);
  right: 0;
  display: flex;
  pointer-events: none;
  z-index: 1;
}

.tl-grid-col {
  border-right: 1px dashed var(--grid-line);
  height: 100%;
}

/* Content Blocks */
.tl-blocks-layer {
  position: relative;
  flex-grow: 1;
  z-index: 5;
}

.tl-flight-block {
  position: absolute;
  top: 4px;
  height: 28px;
  box-sizing: border-box;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #ffffff;
  cursor: grab;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s, filter 0.15s;
  overflow: hidden;
  white-space: nowrap;
  z-index: 5;
}

.tl-flight-block:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  filter: brightness(1.15);
  z-index: 80 !important;
}

.tl-flight-block:active {
  cursor: grabbing;
}

.tl-flight-block.is-dragging {
  opacity: 0.35;
  z-index: 100 !important;
}

.tl-flight-block.is-search-match {
  box-shadow: 0 0 0 2px var(--accent-blue), 0 0 14px var(--accent-blue);
  z-index: 9;
}

.flight-content {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  overflow: hidden;
}

.flight-num {
  font-family: var(--font-mono);
  font-weight: 700;
  flex-shrink: 0;
  font-size: 0.72rem;
}

.flight-route {
  font-size: 0.68rem;
  opacity: 0.92;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flight-dur {
  font-size: 0.65rem;
  opacity: 0.8;
  font-family: var(--font-mono);
  margin-left: auto;
  flex-shrink: 0;
}

/* Ground Buffer Connector Blocks (No Overlap) */
.tl-ground-block {
  position: absolute;
  top: 7px;
  height: 22px;
  box-sizing: border-box;
  border-radius: 4px;
  background-color: var(--tl-ground-bg);
  border: 1px dashed var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-family: var(--font-mono);
  color: var(--tl-ground-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 4px;
  cursor: default;
  z-index: 3;
  transition: transform 0.15s, border-color 0.15s;
}

.tl-ground-block:hover {
  border-color: var(--text-muted);
  transform: translateY(-1px);
  z-index: 30;
}

.tl-ground-block.gap-warning {
  background-color: rgba(239, 68, 68, 0.2);
  border: 1px solid var(--accent-red);
  color: #fca5a5;
  font-weight: 700;
}

/* Station Hub Turn & Event Blocks */
.tl-station-turn-block {
  position: absolute;
  box-sizing: border-box;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.18);
  overflow: hidden;
  white-space: nowrap;
  z-index: 5;
  transition: transform 0.15s, box-shadow 0.15s;
}

.tl-station-turn-block:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
  z-index: 40 !important;
}

.tl-station-event-block {
  position: absolute;
  box-sizing: border-box;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  overflow: hidden;
  white-space: nowrap;
  z-index: 4;
  transition: transform 0.15s, box-shadow 0.15s;
}

.tl-station-event-block:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
  z-index: 40 !important;
}

.turn-in-chip,
.turn-out-chip {
  font-size: 0.65rem;
  opacity: 0.9;
  white-space: nowrap;
}

.turn-mid-info {
  display: flex;
  align-items: center;
  gap: 4px;
}

.turn-tail-name {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.72rem;
}

.turn-duration-tag {
  font-size: 0.65rem;
  opacity: 0.85;
  font-family: var(--font-mono);
}

/* Floating Interactive Puck Tooltip */
.puck-tooltip {
  position: fixed;
  z-index: 1000;
  background-color: rgba(15, 23, 42, 0.97);
  border: 1px solid #334155;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(14px);
  padding: 0.85rem 1.1rem;
  color: #f8fafc;
  pointer-events: none;
  width: max-content;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: opacity 0.12s ease;
}

.puck-tooltip.hidden {
  opacity: 0;
  visibility: hidden;
}

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

.tt-flight-badge {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.95rem;
  color: #38bdf8;
}

.tt-equip-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.tt-route {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.tt-arrow {
  color: #38bdf8;
}

.tt-times-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  background-color: var(--bg-card-hover);
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
}

.tt-time-item {
  display: flex;
  flex-direction: column;
}

.tt-time-lbl {
  font-size: 0.65rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.tt-time-val {
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #f8fafc;
}

.tt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #94a3b8;
  padding-top: 0.2rem;
}

.tt-tail {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #cbd5e1;
}

.tt-hint {
  font-size: 0.65rem;
  color: #64748b;
  font-style: italic;
}

/* ==========================================================================
   Analytics View
   ========================================================================== */
/* ==========================================================================
   Analytics View
   ========================================================================== */
.analytics-view-wrapper {
  flex-grow: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

.analytics-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Analytics Hero KPI Grid */
.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.analytics-kpi-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.kpi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-card-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.kpi-card-icon {
  font-size: 1rem;
  opacity: 0.8;
}

.kpi-card-val {
  font-size: 1.6rem;
  font-weight: 800;
  font-family: var(--font-sans);
  color: #f8fafc;
}

.kpi-card-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* Fleet Cards Grid */
.fleet-analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.analytics-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.analytics-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.duty-bar-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background-color: var(--bg-card);
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.duty-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.duty-bar-track {
  height: 10px;
  width: 100%;
  border-radius: 5px;
  background-color: #0b1120;
  display: flex;
  overflow: hidden;
}

.duty-segment {
  height: 100%;
  transition: width 0.3s ease;
}

.duty-segment.flying {
  background-color: var(--brand-primary);
}

.duty-segment.turn {
  background-color: var(--accent-teal);
}

.duty-segment.idle {
  background-color: #334155;
}

.duty-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.68rem;
  color: var(--text-muted);
}

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

.duty-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.metrics-table {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.82rem;
}

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

.metric-name {
  color: var(--text-secondary);
}

.metric-val {
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

/* Distribution & Hub Row */
.analytics-dual-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 900px) {
  .analytics-dual-row {
    grid-template-columns: 1fr;
  }
}

.histogram-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hist-bar-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hist-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
}

.hist-bracket-name {
  font-weight: 600;
  color: var(--text-primary);
}

.hist-bracket-count {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-blue);
}

.hist-track {
  height: 8px;
  width: 100%;
  background-color: var(--bg-card);
  border-radius: 4px;
  overflow: hidden;
}

.hist-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #38bdf8);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* Station Hub Grid */
.hub-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
}

.hub-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.hub-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hub-code {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 800;
  color: #38bdf8;
}

.hub-flight-count {
  font-size: 0.65rem;
  font-weight: 700;
  background-color: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  padding: 2px 6px;
  border-radius: 4px;
}

.hub-stats-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* Tail Duty Roster Table */
.tail-roster-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  padding: 1.25rem;
  overflow-x: auto;
}

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

.roster-table th {
  padding: 0.65rem 0.85rem;
  background-color: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1px;
  border-bottom: 2px solid var(--border-medium);
}

.roster-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.roster-table tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

.roster-tail-id {
  font-family: var(--font-mono);
  font-weight: 700;
}

.roster-badge {
  font-size: 0.65rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 4px;
}

.roster-route {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.btn-table-action {
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  color: var(--accent-blue);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-table-action:hover {
  background-color: var(--brand-primary);
  color: #fff;
}

/* ==========================================================================
   Inspector Slide-over Drawer
   ========================================================================== */
.inspector-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  background-color: var(--bg-panel);
  border-left: 1px solid var(--border-medium);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.inspector-drawer.hidden {
  transform: translateX(100%);
  pointer-events: none;
}

.inspector-header {
  padding: 1.25rem 1.5rem;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inspector-tag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--accent-blue);
  display: block;
  margin-bottom: 2px;
}

.inspector-title {
  font-size: 1.2rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
}

.btn-close:hover {
  color: #fff;
}

.inspector-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Route Hero Card */
.route-hero-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.route-point {
  display: flex;
  flex-direction: column;
}

.route-city-code {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.route-city-type {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.route-time {
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--accent-blue);
  margin-top: 4px;
}

.route-path-graphic {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-grow: 1;
  padding: 0 1rem;
}

.route-duration {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.route-line {
  position: relative;
  width: 100%;
  height: 2px;
  background-color: var(--border-medium);
  margin: 6px 0;
}

.route-plane {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.85rem;
  color: var(--accent-blue);
}

.route-type-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent-green);
}

.text-right {
  text-align: right;
}

/* Specs Grid */
.insp-specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.insp-spec-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.spec-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.spec-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.spec-value.mono {
  font-family: var(--font-mono);
}

/* Sequence Card */
.sequence-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.9rem;
}

.sequence-card-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}

.sequence-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 0.4rem;
}

.sequence-info-row:last-child {
  margin-bottom: 0;
}

.seq-label {
  color: var(--text-muted);
}

.seq-value {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
}

.insp-tip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  background-color: rgba(56, 189, 248, 0.05);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
}

.insp-tip svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--accent-blue);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 90;
}

/* Template Helper Buttons */
.template-help-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent-blue);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.btn-link:hover {
  color: #60a5fa;
}

/* Modal Overlay & Card */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

.modal-tag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--accent-blue);
  display: block;
  margin-bottom: 2px;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}

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

.modal-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Schema Table */
.schema-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  background-color: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.schema-table th {
  background-color: #0b1120;
  padding: 0.65rem 0.8rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-align: left;
  border-bottom: 1px solid var(--border-medium);
}

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

.schema-table tr:last-child td {
  border-bottom: none;
}

.schema-table code {
  background-color: rgba(255, 255, 255, 0.08);
  padding: 2px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #38bdf8;
}

.badge-req {
  background-color: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}

.badge-opt {
  background-color: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
}

.schema-code-block {
  background-color: #080d1a;
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 0.75rem 1rem;
}

.schema-code-block .code-header {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.schema-code-block pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #a5f3fc;
  line-height: 1.4;
  overflow-x: auto;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-medium);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ==========================================================================
   Station Hubs View (Airport Gantt)
   ========================================================================== */
.station-view-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--bg-app);
}

.station-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background-color: var(--bg-panel);
  border-bottom: 1px solid var(--border-medium);
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.station-filter-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.station-kpi-summary-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.station-kpi-pill {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  padding: 4px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.station-kpi-pill strong {
  color: #f8fafc;
  font-family: var(--font-mono);
}

.station-kpi-pill.highlight {
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.station-viewport {
  flex-grow: 1;
  overflow: auto;
  position: relative;
}

.tl-station-header {
  width: var(--tl-tail-col-width);
  flex-shrink: 0;
  position: sticky;
  left: 0;
  background-color: var(--bg-sidebar);
  border-right: 2px solid var(--border-medium);
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem 0.75rem;
  box-sizing: border-box;
}

.tl-station-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.tl-station-title-group {
  display: flex;
  flex-direction: column;
}

.tl-station-code {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 800;
  color: #38bdf8;
  line-height: 1.1;
}

.tl-station-name {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.tl-station-badge-group {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.tl-station-badge {
  font-size: 0.62rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.tl-station-gate-badge {
  font-size: 0.62rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 4px;
  background-color: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

/* Station Continuous Ground Turn Blocks with Non-Overlap Tracks */
.tl-station-turn-block {
  position: absolute;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  overflow: hidden;
  white-space: nowrap;
  min-width: 48px;
}

.tl-station-turn-block:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
  filter: brightness(1.15);
  z-index: 60 !important;
}

.turn-in-chip {
  background-color: rgba(0, 0, 0, 0.25);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.turn-mid-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.turn-tail-name {
  font-weight: 800;
  font-size: 0.72rem;
  color: #f8fafc;
}

.turn-duration-tag {
  font-size: 0.62rem;
  opacity: 0.85;
}

.turn-out-chip {
  background-color: rgba(0, 0, 0, 0.25);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

/* Standalone Flight Event Block at Station */
.tl-station-event-block {
  position: absolute;
  top: 6px;
  height: 36px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: transform 0.15s, filter 0.15s;
  white-space: nowrap;
}

.tl-station-event-block:hover {
  transform: translateY(-2px);
  filter: brightness(1.2);
  z-index: 50;
}

/* ==========================================================================
   Tail Roster View
   ========================================================================== */
.roster-view-wrapper {
  flex-grow: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

.roster-view-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.roster-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.roster-stats-pill {
  display: flex;
  gap: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  background-color: var(--bg-panel);
  border: 1px solid var(--border-medium);
  padding: 0.5rem 1rem;
  border-radius: 12px;
}

/* Schedule Horizon & Calendar Popover Widget */
.period-filter-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calendar-widget-container {
  position: relative;
}

.btn-calendar-trigger {
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-calendar-trigger:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: #38bdf8;
  color: #38bdf8;
}

.btn-calendar-trigger.active {
  background-color: rgba(37, 99, 235, 0.2);
  border-color: var(--accent-blue);
  color: #38bdf8;
}

.cal-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-blue);
  display: none;
}

.btn-calendar-trigger.has-selection .cal-badge-dot {
  display: block;
}

/* Floating Calendar Popover */
.calendar-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background-color: #0b1120;
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7);
  padding: 1rem;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  animation: calFadeIn 0.15s ease-out;
}

@keyframes calFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cal-month-title {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 0.85rem;
  color: #f8fafc;
}

.cal-nav-btn {
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 1rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.cal-nav-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
}

.cal-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  transition: all 0.12s ease;
  border: 1px solid transparent;
}

.cal-day-cell.empty {
  cursor: default;
  pointer-events: none;
}

.cal-day-cell:hover:not(.empty) {
  background-color: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.cal-day-cell.has-flights {
  font-weight: 800;
  color: #f8fafc;
  background-color: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.25);
}

.cal-day-cell.has-flights::after {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--accent-blue);
  position: absolute;
  bottom: 3px;
}

.cal-day-cell.active-date {
  background-color: var(--brand-primary) !important;
  color: #ffffff !important;
  border-color: var(--brand-primary) !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.5);
}

.cal-day-cell.active-date::after {
  background-color: #ffffff;
}

.cal-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.5rem;
  display: flex;
  justify-content: center;
}

.btn-cal-reset {
  background: none;
  border: none;
  color: var(--accent-blue);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-cal-reset:hover {
  color: #60a5fa;
}

/* ==========================================================================
   Route Network Map View (2D Great-Circle Flight Flow)
   ========================================================================== */
.map-view-wrapper {
  flex-grow: 1;
  padding: 1.5rem;
  overflow-y: auto;
  background-color: var(--bg-app);
}

.map-view-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.map-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.map-title-group h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #f8fafc;
}

.map-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.map-hub-filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Map Summary KPIs */
.map-kpi-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.map-kpi-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.map-kpi-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.map-kpi-val {
  font-size: 1.3rem;
  font-weight: 800;
  color: #f8fafc;
  font-family: var(--font-sans);
}

.map-kpi-val.highlight {
  color: #38bdf8;
}

.map-kpi-sub {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* Aviation Map Canvas */
.map-canvas-card {
  background: radial-gradient(circle at 50% 50%, #0c162c 0%, #050811 100%);
  border: 1px solid #1e293b;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  position: relative;
}

.map-overlay-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background-color: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 10;
}

.route-network-svg {
  width: 100%;
  height: 520px;
  display: block;
}

/* Geo-grid lines */
.map-grid-line {
  stroke: var(--grid-line);
  stroke-width: 1;
  stroke-dasharray: 4 6;
}

/* Landmass outline */
.map-landmass {
  fill: rgba(15, 23, 42, 0.4);
  stroke: rgba(56, 189, 248, 0.15);
  stroke-width: 1.2;
}

/* Route Bezier Arcs */
.route-arc {
  transition: stroke-width 0.2s, stroke-opacity 0.2s;
  cursor: pointer;
}

.route-arc:hover {
  stroke-opacity: 1 !important;
  stroke-width: 5 !important;
  filter: drop-shadow(0 0 8px #38bdf8);
}

.radar-ping-ring {
  transform-origin: center;
  animation: pingAnimation 3s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

@keyframes pingAnimation {
  0% {
    r: 6px;
    opacity: 0.9;
  }

  100% {
    r: 24px;
    opacity: 0;
  }
}

/* Leaflet Aviation Map Styling */
.airport-div-icon {
  background: transparent;
  border: none;
}

.leaflet-airport-marker {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.leaflet-airport-marker:hover {
  transform: scale(1.15);
  z-index: 1000 !important;
}

.leaflet-airport-marker.dimmed {
  opacity: 0.35;
}

.leaflet-airport-marker .airport-badge-tag {
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(6px);
  border: 1.5px solid rgba(56, 189, 248, 0.6);
  border-radius: 6px;
  padding: 2px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7), 0 0 10px rgba(56, 189, 248, 0.25);
}

.leaflet-airport-marker.active-hub .airport-badge-tag {
  border-color: #f59e0b;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.5);
}

.leaflet-airport-marker .stn-code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  color: #e2e8f0;
  letter-spacing: 0.5px;
}

.leaflet-airport-marker.active-hub .stn-code {
  color: #fbbf24;
}

.leaflet-airport-marker .stn-count {
  background: #0284c7;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 800;
  border-radius: 10px;
  padding: 1px 5px;
  min-width: 14px;
  text-align: center;
}

.leaflet-airport-marker.active-hub .stn-count {
  background: #f59e0b;
}

.leaflet-container {
  background: #080d1a !important;
  font-family: inherit;
}

.leaflet-popup-content-wrapper {
  background: rgba(15, 23, 42, 0.95) !important;
  backdrop-filter: blur(8px);
  color: #f1f5f9 !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8) !important;
}

.leaflet-tooltip {
  background: rgba(15, 23, 42, 0.95) !important;
  backdrop-filter: blur(8px);
  color: #f1f5f9 !important;
  border: 1px solid rgba(56, 189, 248, 0.4) !important;
  border-radius: 6px !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.7) !important;
}

.leaflet-popup-tip {
  background: rgba(15, 23, 42, 0.95) !important;
}

/* Airport Nodes */
.airport-node-group {
  cursor: pointer;
  transition: transform 0.2s;
}

.airport-node-group:hover circle.airport-core {
  fill: #38bdf8;
  stroke: var(--bg-panel);
  r: 8px;
}

.airport-node-group:hover text {
  fill: #38bdf8;
  font-size: 13px;
}

/* Route Corridors Section */
.map-routes-section {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.map-routes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.85rem;
}

.map-corridor-card {
  background: linear-gradient(145deg, rgba(39, 39, 42, 0.85) 0%, rgba(63, 63, 70, 0.6) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.map-corridor-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-primary), var(--accent-blue));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.map-corridor-card:hover {
  transform: translateY(-4px) scale(1.015);
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.25), 0 0 15px rgba(56, 189, 248, 0.15);
  background: linear-gradient(145deg, rgba(39, 39, 42, 0.95) 0%, rgba(63, 63, 70, 0.8) 100%);
}

.map-corridor-card:hover::before {
  opacity: 1;
}

.corridor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.corridor-pair {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.15rem;
  color: #f8fafc;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.corridor-freq-badge {
  font-size: 0.75rem;
  font-family: var(--font-sans);
  font-weight: 700;
  color: #0f172a;
  background: linear-gradient(90deg, var(--accent-blue), #60a5fa);
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(56, 189, 248, 0.3);
}

.corridor-details-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.15);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.corridor-flights-list {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
  text-align: right;
}


/* ==========================================================================
   OCC Disruption & What-If Stress Tester
   ========================================================================== */
.occ-view-wrapper {
  flex-grow: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

/* OCC Simulation Banner on Gantt */
.occ-sim-banner {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.22) 0%, rgba(217, 119, 6, 0.18) 100%);
  border: 1px solid rgba(239, 68, 68, 0.5);
  border-radius: 12px;
  padding: 0.65rem 1.25rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  animation: simPulse 2s infinite ease-in-out;
}

@keyframes simPulse {
  0% {
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.1);
  }

  50% {
    border-color: rgba(239, 68, 68, 0.9);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.25);
  }

  100% {
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.1);
  }
}

.occ-sim-banner-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.82rem;
  color: #fca5a5;
}

.sim-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

.occ-sim-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-banner-action {
  background-color: #ef4444;
  border: none;
  border-radius: 5px;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-banner-action:hover {
  background-color: #dc2626;
}

.btn-banner-clear {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-banner-clear:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Gantt Flight Block Simulation Styles */
.tl-flight-block.sim-delayed {
  border: 2px dashed #f87171 !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.6) !important;
}

.tl-flight-block.sim-delayed .flight-num::after {
  content: ' â±ï¸';
  font-size: 0.65rem;
}

.tl-sim-ghost-block {
  position: absolute;
  top: 10px;
  height: 28px;
  border-radius: 4px;
  background: repeating-linear-gradient(45deg, rgba(239, 68, 68, 0.25), rgba(239, 68, 68, 0.25) 8px, rgba(239, 68, 68, 0.4) 8px, rgba(239, 68, 68, 0.4) 16px);
  border: 1px solid rgba(239, 68, 68, 0.8);
  pointer-events: none;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  color: #fef2f2;
}

/* OCC Disruption & What-If Stress Tester */
.occ-view-wrapper {
  flex-grow: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

.occ-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.occ-control-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.occ-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.occ-target-mode-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.occ-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.occ-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.occ-input-group label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.occ-select,
.occ-input {
  background-color: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: var(--font-sans);
  padding: 0.5rem 0.75rem;
}

.occ-select:focus,
.occ-input:focus {
  outline: none;
  border-color: var(--border-focus);
}

.occ-impact-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.occ-summary-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.occ-summary-card.danger {
  border-color: rgba(239, 68, 68, 0.4);
  background-color: rgba(239, 68, 68, 0.06);
}

.occ-summary-card.warning {
  border-color: rgba(217, 119, 6, 0.4);
  background-color: rgba(217, 119, 6, 0.06);
}

.occ-summary-card.success {
  border-color: rgba(16, 185, 129, 0.4);
  background-color: rgba(16, 185, 129, 0.06);
}

.occ-summary-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
}

.occ-summary-val {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
}

.occ-summary-sub {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.occ-impact-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cascade-chain-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.cascade-chain-table th {
  background-color: var(--bg-sidebar);
  padding: 0.6rem 0.75rem;
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 700;
  text-align: left;
  border-bottom: 1px solid var(--border-medium);
}

.cascade-chain-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.delay-pill {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.absorbed-pill {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.mct-violation-tag {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border: 1px solid #ef4444;
}

.crew-breach-tag {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: rgba(217, 119, 6, 0.25);
  color: #fcd34d;
  border: 1px solid #d97706;
}

/* ==========================================================================
   Maintenance & A-Check Planner
   ========================================================================== */
.maint-view-wrapper {
  flex-grow: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

.maint-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.maint-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.maint-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.maint-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.maint-tail-title {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.maint-base-badge {
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-sans);
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.3px;
}

.maint-base-badge.base-ok {
  background-color: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.maint-base-badge.base-warning {
  background-color: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.maint-bar-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.maint-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.maint-usage-text {
  color: var(--text-primary);
  font-weight: 700;
}

.maint-bar-track {
  height: 8px;
  width: 100%;
  background-color: var(--bg-card);
  border-radius: 4px;
  overflow: hidden;
}

.maint-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.maint-bar-fill.good {
  background-color: var(--accent-green);
}

.maint-bar-fill.warning {
  background-color: var(--accent-amber);
}

.maint-bar-fill.due {
  background-color: var(--accent-red);
}

.metrics-table {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background-color: var(--bg-card);
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
}

.metric-name {
  color: var(--text-muted);
}

.metric-val {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 600;
}

.maint-remaining-val {
  color: var(--accent-blue);
}

/* ==========================================================================
   Global Toast Notification
   ========================================================================== */
.app-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  background-color: #0f172a;
  border: 1px solid #38bdf8;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  padding: 0.75rem 1.25rem;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  animation: toastSlideUp 0.25s ease-out;
}

@keyframes toastSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   #4 â€” ACCESSIBILITY: Focus-Visible Outlines
   ========================================================================== */
*:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
  border-radius: 4px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.4);
}

/* Skip-to-content link for keyboard users */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 10000;
  background-color: var(--brand-primary);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 8px 8px;
  font-weight: 700;
  font-size: 0.85rem;
  transition: top 0.2s ease;
}

.skip-to-content:focus {
  top: 0;
}

/* ==========================================================================
   #5 â€” ANIMATED EMPTY STATE with Onboarding Steps
   ========================================================================== */
.empty-state-box {
  max-width: 520px;
  text-align: center;
  background: linear-gradient(135deg, rgba(19, 29, 51, 0.9) 0%, rgba(11, 17, 32, 0.95) 100%);
  border: 1px solid var(--border-medium);
  border-radius: 16px;
  padding: 3rem 2.5rem;
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  animation: emptyStateFloat 0.5s ease-out;
}

@keyframes emptyStateFloat {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.empty-illustration {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.5rem;
  color: var(--accent-blue);
  animation: planeFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(56, 189, 248, 0.3));
}

@keyframes planeFloat {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  25% {
    transform: translateY(-6px) rotate(2deg);
  }

  75% {
    transform: translateY(4px) rotate(-1deg);
  }
}

.empty-state-box h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #f8fafc 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.onboarding-steps {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 1.5rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.onboarding-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  animation: stepFadeIn 0.5s ease-out forwards;
}

.onboarding-step:nth-child(1) {
  animation-delay: 0.2s;
}

.onboarding-step:nth-child(2) {
  animation-delay: 0.4s;
}

.onboarding-step:nth-child(3) {
  animation-delay: 0.6s;
}

@keyframes stepFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-primary), var(--accent-blue));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ==========================================================================
   #6 â€” GANTT: Selected Row & "Now" Time Marker
   ========================================================================== */
.tl-row.selected {
  background-color: rgba(37, 99, 235, 0.08);
  border-left: 3px solid var(--brand-primary);
}

.tl-now-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: #ef4444;
  z-index: 15;
  pointer-events: none;
}

.tl-now-marker::before {
  content: 'NOW';
  position: absolute;
  top: -2px;
  left: -16px;
  font-size: 0.55rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #ef4444;
  letter-spacing: 0.5px;
  background-color: rgba(239, 68, 68, 0.15);
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
}

.tl-now-marker::after {
  content: '';
  position: absolute;
  top: 0;
  left: -1px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: #ef4444;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
}

/* ==========================================================================
   #7 â€” ENHANCED KPI BANNER CARDS with Gradient Accents
   ========================================================================== */
.kpi-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(37, 99, 235, 0.06) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  border-radius: 3px 0 0 3px;
}

.kpi-card:nth-child(1)::before {
  background: var(--brand-primary);
}

.kpi-card:nth-child(2)::before {
  background: var(--accent-teal);
}

.kpi-card:nth-child(3)::before {
  background: var(--accent-amber);
}

.kpi-card:nth-child(4)::before {
  background: var(--accent-green);
}

.kpi-icon {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  opacity: 0.5;
}

.kpi-val {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-sans);
  color: var(--text-primary);
  margin: 0.2rem 0;
}

/* Count-up animation utility */
.kpi-val.count-up {
  animation: kpiCountFadeIn 0.6s ease-out;
}

@keyframes kpiCountFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   #8 â€” SIDEBAR CONTENT FADE TRANSITIONS
   ========================================================================== */
.sidebar-scroll {
  padding: 1.25rem;
  overflow-y: auto;
  flex-grow: 1;
  transition: opacity 0.15s ease;
}

.workspace-layout.sidebar-collapsed .sidebar-scroll {
  opacity: 0;
}

/* ==========================================================================
   #9 â€” LIGHT THEME SUPPORT
   ========================================================================== */
:root[data-theme="light"] {
  --bg-app: #f1f5f9;
  --bg-sidebar: #ffffff;
  --bg-panel: #ffffff;
  --bg-card: #f8fafc;
  --bg-card-hover: #f1f5f9;
  --bg-input: #ffffff;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --grid-line: rgba(0, 0, 0, 0.04);
  --border-medium: #e2e8f0;
  --border-focus: #3b82f6;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #f8fafc;
  --tl-ground-bg: rgba(241, 245, 249, 0.95);
  --tl-ground-text: #64748b;
}

:root[data-theme="light"] .app-header,
:root[data-theme="light"] .app-sub-navbar {
  background-color: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

:root[data-theme="light"] .tl-flight-block {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

:root[data-theme="light"] .puck-tooltip {
  background-color: rgba(255, 255, 255, 0.97);
  border-color: #e2e8f0;
  color: #0f172a;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

:root[data-theme="light"] .tt-flight-badge {
  color: var(--brand-primary);
}

:root[data-theme="light"] .tt-arrow {
  color: var(--brand-primary);
}

:root[data-theme="light"] .tt-time-lbl {
  color: #64748b;
}

:root[data-theme="light"] .tt-time-val {
  color: #0f172a;
}

:root[data-theme="light"] .inspector-drawer {
  background-color: #ffffff;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
}

:root[data-theme="light"] .modal-overlay {
  background-color: rgba(0, 0, 0, 0.3);
}

:root[data-theme="light"] .modal-card,
:root[data-theme="light"] .calendar-popover {
  background-color: #ffffff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

:root[data-theme="light"] .app-toast {
  background-color: #ffffff;
  border-color: #e2e8f0;
  color: #0f172a;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

:root[data-theme="light"] .schema-table th,
:root[data-theme="light"] .cascade-chain-table th {
  background-color: #f1f5f9;
  color: #334155;
  border-bottom: 1px solid #cbd5e1;
}

:root[data-theme="light"] .cascade-chain-table td {
  color: #0f172a;
  border-bottom: 1px solid #f1f5f9;
}

:root[data-theme="light"] .occ-control-card,
:root[data-theme="light"] .occ-impact-card,
:root[data-theme="light"] .occ-summary-card {
  background-color: #ffffff;
  border-color: #e2e8f0;
  color: #0f172a;
}

:root[data-theme="light"] .occ-card-title,
:root[data-theme="light"] .occ-card-title span {
  color: #0f172a;
}

:root[data-theme="light"] .occ-input-group label {
  color: #475569;
}

:root[data-theme="light"] .occ-select,
:root[data-theme="light"] .occ-input {
  background-color: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}

:root[data-theme="light"] .occ-select option {
  background-color: #ffffff;
  color: #0f172a;
}

:root[data-theme="light"] .occ-summary-title {
  color: #475569;
}

:root[data-theme="light"] .occ-summary-sub {
  color: #64748b;
}

:root[data-theme="light"] .occ-summary-val {
  color: #0f172a;
}

:root[data-theme="light"] .occ-summary-card.danger {
  background-color: rgba(239, 68, 68, 0.05);
  border-color: rgba(239, 68, 68, 0.3);
}

:root[data-theme="light"] .occ-summary-card.warning {
  background-color: rgba(217, 119, 6, 0.05);
  border-color: rgba(217, 119, 6, 0.3);
}

:root[data-theme="light"] .occ-summary-card.success {
  background-color: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.3);
}

:root[data-theme="light"] .delay-pill {
  background-color: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

:root[data-theme="light"] .absorbed-pill {
  background-color: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

:root[data-theme="light"] .mct-violation-tag {
  background-color: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

:root[data-theme="light"] .maint-card {
  background-color: #ffffff;
  border-color: #e2e8f0;
}

:root[data-theme="light"] .maint-tail-title,
:root[data-theme="light"] .maint-usage-text {
  color: #0f172a;
}

:root[data-theme="light"] .maint-bar-labels {
  color: #475569;
}

:root[data-theme="light"] .maint-bar-track {
  background-color: #e2e8f0;
}

:root[data-theme="light"] .metrics-table {
  background-color: #f8fafc;
  border-color: #e2e8f0;
}

:root[data-theme="light"] .metric-name {
  color: #475569;
}

:root[data-theme="light"] .metric-val {
  color: #0f172a;
}

:root[data-theme="light"] .maint-remaining-val {
  color: #0284c7;
}

:root[data-theme="light"] .maint-base-badge.base-ok {
  background-color: rgba(16, 185, 129, 0.12);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.3);
}

:root[data-theme="light"] .maint-base-badge.base-warning {
  background-color: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.3);
}

:root[data-theme="light"] .map-canvas-card {
  background: radial-gradient(circle at 50% 50%, #e2e8f0 0%, #f1f5f9 100%);
}

:root[data-theme="light"] .tl-tail-header,
:root[data-theme="light"] .tl-station-header {
  background-color: #ffffff;
}

:root[data-theme="light"] .tl-corner-cell,
:root[data-theme="light"] .tl-tier-date,
:root[data-theme="light"] .tl-tier-time {
  background-color: #ffffff;
}

:root[data-theme="light"] .tl-station-header,
:root[data-theme="light"] .tl-tail-header,
:root[data-theme="light"] .tl-tier-date,
:root[data-theme="light"] .tl-tier-time,
:root[data-theme="light"] .roster-tail-id,
:root[data-theme="light"] .cascade-row td:first-child,
:root[data-theme="light"] .map-kpi-val,
:root[data-theme="light"] .occ-metric-val,
:root[data-theme="light"] .health-score,
:root[data-theme="light"] .chart-legend-label,
:root[data-theme="light"] .station-kpi-pill strong {
  color: var(--text-primary);
}

:root[data-theme="light"] .nav-tab:hover {
  color: var(--text-primary);
  background-color: rgba(0, 0, 0, 0.04);
}

:root[data-theme="light"] .nav-tab.active {
  background-color: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.3);
}

:root[data-theme="light"] .drawer-backdrop {
  background-color: rgba(0, 0, 0, 0.2);
}

:root[data-theme="light"] .empty-state-box {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(241, 245, 249, 0.98) 100%);
}

:root[data-theme="light"] .kpi-card {
  background: linear-gradient(135deg, #ffffff 0%, rgba(37, 99, 235, 0.04) 100%);
}

.btn-theme-toggle {
  background-color: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-theme-toggle:hover {
  background-color: var(--bg-card-hover);
  color: var(--accent-amber);
  border-color: var(--accent-amber);
}

.btn-theme-toggle svg {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   #10 â€” FLIGHT BLOCK COLOR CONTRAST FIX
   ========================================================================== */
.tl-flight-block {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.tl-station-turn-block {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   #11 â€” SKELETON LOADING STATES
   ========================================================================== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}

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

  100% {
    background-position: -200% 0;
  }
}

.skeleton-row {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.skeleton-block {
  height: 36px;
  border-radius: 8px;
}

.skeleton-text {
  height: 14px;
  border-radius: 4px;
}

.skeleton-text.short {
  width: 60px;
}

.skeleton-text.medium {
  width: 120px;
}

.skeleton-text.long {
  width: 200px;
}

.skeleton-kpi-card {
  border-radius: 10px;
  height: 90px;
}

/* ==========================================================================
   #12 â€” RICHER TOAST NOTIFICATIONS
   ========================================================================== */
.app-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  padding: 0 1.25rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  animation: toastSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  min-height: 46px;
}

.app-toast.toast-success {
  border-left: 3px solid var(--accent-green);
}

.app-toast.toast-error {
  border-left: 3px solid var(--accent-red);
}

.app-toast.toast-warning {
  border-left: 3px solid var(--accent-amber);
}

.app-toast.toast-info {
  border-left: 3px solid var(--accent-blue);
}

.toast-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent-blue);
  border-radius: 0 0 10px 10px;
  animation: toastCountdown 3.5s linear forwards;
}

@keyframes toastCountdown {
  from {
    width: 100%;
  }

  to {
    width: 0%;
  }
}

.toast-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px;
  margin-left: 0.5rem;
  border-radius: 4px;
  transition: color 0.15s;
}

.toast-close-btn:hover {
  color: var(--text-primary);
}

/* Toast stacking */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
}

/* ==========================================================================
   #13 â€” SVG Airplane Icon (Inspector Route)
   ========================================================================== */
.route-plane-svg {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  color: var(--accent-blue);
  filter: drop-shadow(0 1px 3px rgba(56, 189, 248, 0.5));
}

/* ==========================================================================
   #16 â€” MICRO-INTERACTIONS & DELIGHT
   ========================================================================== */

/* Button press feedback */
.btn:active {
  transform: scale(0.97);
}

.fleet-chip:active {
  transform: scale(0.95);
}

.tool-btn:active {
  transform: scale(0.9);
}

.nav-tab:active {
  transform: scale(0.97);
}

/* Nav tab sliding indicator */
.nav-tabs {
  position: relative;
}

.nav-tab {
  position: relative;
  overflow: hidden;
}

.nav-tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent-blue);
  border-radius: 2px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(-50%);
}

.nav-tab.active::after {
  width: 70%;
}

/* Flight block drag ghost effect */
.tl-flight-block.drag-ghost {
  opacity: 0.5;
  transform: scale(1.05) rotate(1deg);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
}

/* Smooth panel reveal */
.panel-section {
  animation: panelReveal 0.3s ease-out;
}

@keyframes panelReveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Card hover lift â€” applied to analytics, corridor, etc. */
.analytics-card:hover,
.maint-card:hover,
.hub-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Map corridor card smooth hover */
.map-corridor-card {
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* OCC summary card hover */
.occ-summary-card {
  transition: transform 0.2s ease;
}

.occ-summary-card:hover {
  transform: translateY(-2px);
}

/* Strategy radio card selection animation */
.radio-label {
  transition: background-color 0.2s ease, border-color 0.2s ease;
  padding: 0.5rem;
  border-radius: 8px;
}

.radio-label:hover {
  background-color: var(--bg-card-hover);
}

/* Validation card pulse on warning */
.validation-card.warning {
  animation: validationPulse 2s ease-in-out infinite;
}

@keyframes validationPulse {

  0%,
  100% {
    border-color: rgba(239, 68, 68, 0.3);
  }

  50% {
    border-color: rgba(239, 68, 68, 0.6);
  }
}

/* ==========================================================================
   #3 â€” ERROR STATE CARD
   ========================================================================== */
.error-state-view {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.error-state-card {
  max-width: 520px;
  text-align: center;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, var(--bg-panel) 100%);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 14px;
  padding: 2.5rem;
  animation: emptyStateFloat 0.4s ease-out;
}

.error-icon-box {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background-color: rgba(239, 68, 68, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.error-state-card h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #f87171;
  margin-bottom: 0.5rem;
}

.error-state-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.error-detail-box {
  background-color: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 12px;
  padding: 0.75rem;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #fca5a5;
  margin-bottom: 1.25rem;
  max-height: 120px;
  overflow-y: auto;
  word-break: break-word;
}

.error-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

/* ==========================================================================
   #2 â€” STEPPED PROGRESS LOADING INDICATOR
   ========================================================================== */
/* Real-Time Progress Bar & ETA Styles */
.loading-progress-box {
  width: 100%;
  max-width: 440px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 0.75rem 0 0.5rem 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.loading-progress-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(30, 41, 59, 0.9);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.loading-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0284c7, #38bdf8, #818cf8);
  border-radius: 6px;
  transition: width 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.7);
}

.loading-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.loading-pct-badge {
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.5px;
}

.loading-eta-badge {
  color: #94a3b8;
  font-size: 0.7rem;
}

.loading-steps {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.loading-step {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.loading-step.active {
  color: var(--accent-blue);
}

.loading-step.done {
  color: var(--accent-green);
}

.loading-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--border-medium);
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.loading-step.active .loading-step-dot {
  background-color: var(--accent-blue);
  transform: scale(1.3);
  animation: stepPulse 1s ease-in-out infinite;
}

.loading-step.done .loading-step-dot {
  background-color: var(--accent-green);
}

@keyframes stepPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.4);
  }
}

.loading-step-separator {
  width: 20px;
  height: 2px;
  background-color: var(--border-medium);
  border-radius: 1px;
  transition: background-color 0.3s ease;
}

.loading-step-separator.done {
  background-color: var(--accent-green);
}

/* ==========================================================================
   #14 â€” SEARCH DROPDOWN SUGGESTIONS
   ========================================================================== */
.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 280px;
  background-color: var(--bg-panel);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  z-index: 50;
  max-height: 320px;
  overflow-y: auto;
  animation: calFadeIn 0.15s ease-out;
}

.search-group-label {
  padding: 0.5rem 0.75rem 0.25rem;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.search-result-item {
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  transition: background-color 0.1s ease;
}

.search-result-item:hover {
  background-color: rgba(37, 99, 235, 0.1);
}

.search-result-item .result-label {
  font-family: var(--font-mono);
  font-weight: 700;
}

.search-result-item .result-type {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  background-color: var(--bg-card);
  padding: 1px 5px;
  border-radius: 4px;
}

.search-result-count {
  padding: 0.4rem 0.75rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--border-subtle);
}

/* Keyboard shortcut hint */
.search-shortcut-hint {
  font-size: 0.62rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background-color: var(--bg-card);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--border-medium);
  margin-left: 0.5rem;
}

/* ==========================================================================
   #17 â€” PRINT / PDF EXPORT STYLES
   ========================================================================== */
@media print {
  body {
    background-color: #ffffff !important;
    color: #000000 !important;
  }

  .app-header,
  .app-sub-navbar,
  .sidebar,
  .btn-floating-expand,
  .inspector-drawer,
  .drawer-backdrop,
  .puck-tooltip,
  .app-toast,
  .toast-container,
  .csv-guide-modal,
  .search-dropdown,
  .calendar-popover {
    display: none !important;
  }

  .workspace-layout {
    display: block !important;
  }

  .main-workspace {
    overflow: visible !important;
  }

  .timeline-viewport {
    overflow: visible !important;
    height: auto !important;
  }

  .timeline-chart {
    min-width: unset !important;
    width: 100% !important;
  }

  .tl-flight-block {
    box-shadow: none !important;
    border: 1px solid #333 !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .kpi-banner {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border-medium);
    flex-shrink: 0;
    align-items: center;
  }

  .kpi-card {
    border: 1px solid #ddd;
  }
}

/* ==========================================================================
   #1 â€” RESPONSIVE DESIGN: Media Queries
   ========================================================================== */

/* Large screens: Toolbar overflow handling */
@media (max-width: 1200px) {
  .header-right {
    gap: 0.5rem;
  }

  .period-filter-wrapper {
    display: none;
  }

  .search-box input {
    width: 160px;
  }

  .search-box input:focus {
    width: 200px;
  }
}

/* Tablet: Sidebar overlay & stacked KPIs */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 80;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  }

  .workspace-layout.sidebar-collapsed .sidebar {
    transform: translateX(-320px);
  }

  .kpi-banner {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border-medium);
    flex-shrink: 0;
    align-items: center;
  }

  .fleet-filter-wrapper {
    display: none;
  }

  .analytics-dual-row {
    grid-template-columns: 1fr;
  }

  .inspector-drawer {
    width: 320px;
  }

  .header-right .header-divider:nth-of-type(n+2) {
    display: none;
  }
}

/* Mobile: Stack everything */
@media (max-width: 768px) {
  .app-header {
    height: auto;
    padding: 0.5rem 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .header-divider {
    display: none;
  }

  .search-box {
    order: -1;
    width: 100%;
  }

  .search-box input {
    width: 100%;
  }

  .search-box input:focus {
    width: 100%;
  }

  .zoom-toolbar {
    display: none;
  }

  .app-sub-navbar {
    height: auto;
    padding: 0.5rem 0.75rem;
    overflow-x: auto;
  }

  .nav-tabs {
    gap: 0.25rem;
  }

  .nav-tab {
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
  }

  .sidebar {
    width: 280px;
    min-width: 280px;
  }

  .kpi-banner {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border-medium);
    flex-shrink: 0;
    align-items: center;
  }

  .kpi-card {
    padding: 0.6rem 0.75rem;
  }

  .kpi-val {
    font-size: 1.2rem;
  }

  .empty-state-box {
    padding: 2rem 1.5rem;
  }

  .empty-state-box h2 {
    font-size: 1.1rem;
  }

  .onboarding-steps {
    flex-direction: column;
    gap: 1rem;
  }

  .inspector-drawer {
    width: 100%;
    max-width: 100%;
  }

  .route-hero-card {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .route-point.text-right {
    text-align: center;
  }

  .insp-specs-grid {
    grid-template-columns: 1fr;
  }

  .modal-card {
    max-width: 100%;
    margin: 0.5rem;
  }

  .logo-sub {
    display: none;
  }

  .station-header-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.5rem 1rem;
  }

  .map-header-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .roster-toolbar-row {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .occ-sim-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .error-actions {
    flex-direction: column;
  }
}

/* ==========================================================================
   #17 â€” GANTT SECONDARY CONTROLS, TIMELINE SCRUBBER & DENSITY MODES
   ========================================================================== */
.gantt-secondary-toolbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 42px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-medium);
  padding: 0 1.5rem;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.gantt-sec-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.gantt-sec-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.gantt-sec-divider {
  width: 1px;
  height: 18px;
  background-color: var(--border-medium);
}

.btn-group-sm {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.gantt-preset-btn,
.gantt-density-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.gantt-preset-btn:hover,
.gantt-density-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.gantt-preset-btn.active,
.gantt-density-btn.active {
  background: var(--brand-primary);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.3);
}

.gantt-select-sm {
  background-color: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  border-radius: 4px;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  outline: none;
}

.gantt-legend-pills {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
}

.legend-pill {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.pill-flight .legend-dot {
  background-color: var(--brand-primary);
}

.pill-turn .legend-dot {
  background-color: var(--color-success);
}

.pill-tight .legend-dot {
  background-color: #f59e0b;
}

.pill-cascade .legend-dot {
  background-color: #ef4444;
}

/* Density Row Modes */
.density-compact .tl-row {
  height: 28px !important;
}

.density-compact .tl-tail-header {
  font-size: 0.7rem;
}

.density-compact .tl-flight-block {
  height: 20px !important;
  font-size: 0.65rem;
}

.density-standard .tl-row {
  height: 42px;
}

.density-comfort .tl-row {
  height: 56px !important;
}

.density-comfort .tl-tail-header {
  font-size: 0.85rem;
}

.density-comfort .tl-flight-block {
  height: 32px !important;
  font-size: 0.78rem;
}

/* Sub-Fleet Sticky Grouping Header */
.tl-subfleet-header {
  position: sticky;
  left: 0;
  z-index: 15;
  background-color: var(--bg-tertiary);
  color: var(--brand-primary);
  font-weight: 700;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 4px 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-top: 1px solid var(--border-medium);
  border-bottom: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Timeline Vertical Time Scrubber */
.gantt-time-scrubber {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: #38bdf8;
  z-index: 45;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
}

.gantt-scrubber-badge {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #0f172a;
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid #38bdf8;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

/* Tight Turn Warning Stripes (<40 min Ground Layovers) */
.tight-warning {
  background: repeating-linear-gradient(45deg,
      rgba(245, 158, 11, 0.2),
      rgba(245, 158, 11, 0.2) 10px,
      rgba(245, 158, 11, 0.05) 10px,
      rgba(245, 158, 11, 0.05) 20px) !important;
  border: 1px dashed #f59e0b !important;
  color: #f59e0b !important;
}

.tight-warning-icon {
  font-size: 0.65rem;
  margin-right: 2px;
}

/* Station Hub Search Box & Interactive Hub Details Modal */
.station-search-box {
  margin-left: 0.5rem;
}

.station-search-input {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.75rem;
  width: 200px;
  transition: border-color 0.15s ease;
}

.station-search-input:focus {
  outline: none;
  border-color: var(--brand-primary);
}

.modal-large {
  max-width: 860px !important;
  width: 90% !important;
}

.hub-modal-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.hub-stat-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
}

.hub-stat-label {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.hub-stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--brand-primary);
  font-family: var(--font-mono);
  margin: 0.2rem 0;
}

.hub-stat-sub {
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.hub-section-heading {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
  font-weight: 700;
}

.hub-table-wrapper {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border-medium);
  border-radius: 8px;
}

.hub-schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.hub-schedule-table th,
.hub-schedule-table td {
  padding: 7px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-medium);
}

.hub-schedule-table th {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  position: sticky;
  top: 0;
}

/* Tail Roster View Upgrades */
.roster-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.roster-duty-mini {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-card-hover);
  margin-top: 4px;
}

.roster-duty-airborne {
  background-color: var(--brand-primary);
}

.roster-duty-turn {
  background-color: var(--color-success);
}

.roster-duty-idle {
  background-color: rgba(255, 255, 255, 0.15);
}

.sortable-header {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}

.sortable-header:hover {
  color: var(--brand-primary) !important;
}

.btn-occ-jump {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-occ-jump:hover {
  background: rgba(245, 158, 11, 0.3);
  border-color: #f59e0b;
}

/* OCC Disruption Stress Tester & Financial Estimator */
.occ-preset-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.occ-preset-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.occ-preset-btn:hover {
  border-color: var(--brand-primary);
  background: rgba(37, 99, 235, 0.1);
}

.occ-financial-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 1.2rem;
  margin-top: 1rem;
}

.occ-financial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 0.8rem;
}

.occ-financial-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 0.85rem;
}

.occ-financial-label {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-weight: 700;
}

.occ-financial-value {
  font-size: 1.4rem;
  font-weight: 800;
  font-family: var(--font-mono);
  margin-top: 0.3rem;
}

/* Fleet Analytics Dashboard */
.analytics-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.profile-bar-grid {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 4px;
  height: 120px;
  align-items: flex-end;
  margin-top: 1rem;
  padding-top: 1rem;
  border-bottom: 1px solid var(--border-medium);
}

.profile-bar-col {
  background: var(--brand-primary);
  border-radius: 2px 2px 0 0;
  position: relative;
  transition: height 0.2s ease;
}

.profile-bar-col.peak {
  background: #f59e0b;
}

.profile-bar-col:hover::after {
  content: attr(data-count);
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #fff;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  padding: 2px 5px;
  border-radius: 3px;
  white-space: nowrap;
}


/* FOCUS MODE & KPI TOGGLE */
body.focus-mode .app-header,
body.focus-mode .kpi-banner,
body.focus-mode .sidebar {
  display: none !important;
}

body.focus-mode .workspace-layout,
body.focus-mode .timeline-view-wrapper,
body.focus-mode .timeline-viewport {
  height: 100% !important;
  width: 100% !important;
  flex: 1;
}

.btn-exit-focus {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--brand-primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  z-index: 9999;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.btn-exit-focus.hidden {
  display: none;
}

.kpi-banner.expanded {
  flex-direction: column;
  height: auto;
}

.kpi-banner.expanded .kpi-card {
  flex-direction: column;
  align-items: flex-start;
  padding: 0.75rem 1rem;
  border-right: none;
  border-bottom: 1px solid var(--border-medium);
}

.kpi-banner.expanded .kpi-sub {
  display: block;
}

.gantt-secondary-toolbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 38px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-medium);
  padding: 0 1rem;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.legend-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
}

.legend-pill-color {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}


/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-surface);
}

::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}


/* Empty State Overlay */
.empty-state-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-card);
  z-index: 100;
}

.empty-state-overlay.hidden {
  display: none;
}

/* Tail Roster View Upgrades */
.roster-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.roster-duty-mini {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-card-hover);
  margin-top: 4px;
}

.roster-duty-airborne {
  background-color: var(--brand-primary);
}

.roster-duty-turn {
  background-color: var(--color-success);
}

.roster-duty-idle {
  background-color: rgba(255, 255, 255, 0.15);
}

.sortable-header {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}

.sortable-header:hover {
  color: var(--brand-primary) !important;
}

.btn-occ-jump {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-occ-jump:hover {
  background: rgba(245, 158, 11, 0.3);
  border-color: #f59e0b;
}

/* OCC Disruption Stress Tester & Financial Estimator */
.occ-preset-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.occ-preset-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.occ-preset-btn:hover {
  border-color: var(--brand-primary);
  background: rgba(37, 99, 235, 0.1);
}

.occ-financial-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 1.2rem;
  margin-top: 1rem;
}

.occ-financial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 0.8rem;
}

.occ-financial-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 0.85rem;
}

.occ-financial-label {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  font-weight: 700;
}

.occ-financial-value {
  font-size: 1.4rem;
  font-weight: 800;
  font-family: var(--font-mono);
  margin-top: 0.3rem;
}

/* Fleet Analytics Dashboard */
.analytics-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.profile-bar-grid {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 4px;
  height: 120px;
  align-items: flex-end;
  margin-top: 1rem;
  padding-top: 1rem;
  border-bottom: 1px solid var(--border-medium);
}

.profile-bar-col {
  background: var(--brand-primary);
  border-radius: 2px 2px 0 0;
  position: relative;
  transition: height 0.2s ease;
}

.profile-bar-col.peak {
  background: #f59e0b;
}

.profile-bar-col:hover::after {
  content: attr(data-count);
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #fff;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  padding: 2px 5px;
  border-radius: 3px;
  white-space: nowrap;
}


/* FOCUS MODE & KPI TOGGLE */
body.focus-mode .app-header,
body.focus-mode .kpi-banner,
body.focus-mode .sidebar {
  display: none !important;
}

body.focus-mode .workspace-layout,
body.focus-mode .timeline-view-wrapper,
body.focus-mode .timeline-viewport {
  height: 100% !important;
  width: 100% !important;
  flex: 1;
}

.btn-exit-focus {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--brand-primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  z-index: 9999;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.btn-exit-focus.hidden {
  display: none;
}

.kpi-banner.expanded {
  flex-direction: column;
  height: auto;
}

.kpi-banner.expanded .kpi-card {
  flex-direction: column;
  align-items: flex-start;
  padding: 0.75rem 1rem;
  border-right: none;
  border-bottom: 1px solid var(--border-medium);
}

.kpi-banner.expanded .kpi-sub {
  display: block;
}

.gantt-secondary-toolbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 38px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-medium);
  padding: 0 1rem;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.legend-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.68rem;
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
}

.legend-pill-color {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}


/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-surface);
}

::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}


/* Empty State Overlay */
.empty-state-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-card);
  z-index: 100;
}

.empty-state-overlay.hidden {
  display: none;
}

.empty-state-content {
  text-align: center;
  max-width: 400px;
}


.toolbar-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-banner .kpi-card:hover {
  transform: translateY(-2px);
  background-color: var(--bg-card-hover);
}

/* --- World-Class UI/UX Polish Overrides --- */

/* Glassmorphism for Header, Sub-Navbar and Sidebar */
.app-header,
.app-sub-navbar {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

:root:not([data-theme="light"]) .app-header,
:root:not([data-theme="light"]) .app-sub-navbar {
  background-color: rgba(24, 24, 27, 0.75) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

:root[data-theme="light"] .app-header,
:root[data-theme="light"] .app-sub-navbar {
  background-color: rgba(255, 255, 255, 0.85) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.sidebar {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

:root:not([data-theme="light"]) .sidebar {
  background-color: rgba(24, 24, 27, 0.8) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
}

:root[data-theme="light"] .sidebar {
  background-color: rgba(255, 255, 255, 0.85) !important;
  border-right: 1px solid rgba(0, 0, 0, 0.08) !important;
}

/* Button hover polish */
.btn {
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-primary), #818cf8) !important;
  border: none !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3) !important;
}

.btn-primary:hover {
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.45) !important;
}

/* Tab refinements */
.nav-tab {
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

.nav-tab.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(56, 189, 248, 0.1)) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.15) !important;
}

:root[data-theme="light"] .nav-tab.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(56, 189, 248, 0.15)) !important;
  color: #1d4ed8 !important;
}

/* Dropzone hover */
.upload-dropzone {
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

.upload-dropzone:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1) !important;
  border-color: var(--brand-primary) !important;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(150, 150, 150, 0.4);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(150, 150, 150, 0.6);
}

/* Fade in for main content */
.main-workspace {
  animation: smoothFadeIn 0.5s ease-out forwards;
}

@keyframes smoothFadeIn {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Enhanced Cards */
.map-canvas-card,
.error-state-card,
.file-loaded-card,
.radio-card,
.turnaround-item {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(8px);
}

:root:not([data-theme="light"]) .map-canvas-card,
:root:not([data-theme="light"]) .error-state-card,
:root:not([data-theme="light"]) .file-loaded-card,
:root:not([data-theme="light"]) .radio-card,
:root:not([data-theme="light"]) .turnaround-item {
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  background-color: rgba(63, 63, 70, 0.6) !important;
}

:root[data-theme="light"] .map-canvas-card,
:root[data-theme="light"] .error-state-card,
:root[data-theme="light"] .file-loaded-card,
:root[data-theme="light"] .radio-card,
:root[data-theme="light"] .turnaround-item {
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  background-color: rgba(255, 255, 255, 0.7) !important;
}

/* ==========================================================================
   #12 — CONDENSED SCHEDULE VIEW
   ========================================================================== */
.schedule-view-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  background-color: var(--bg-app);
  overflow: hidden;
}

.schedule-toolbar {
  padding: 0.5rem 1.5rem;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.schedule-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.schedule-count {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--brand-primary);
  font-weight: 700;
  background: rgba(99, 102, 241, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

.schedule-table-container {
  flex: 1;
  overflow: auto;
  padding: 0;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.schedule-table th {
  position: sticky;
  top: 0;
  background-color: var(--bg-sidebar);
  color: var(--text-secondary);
  font-weight: 700;
  text-align: left;
  padding: 0.35rem 1rem;
  border-bottom: 2px solid var(--border-medium);
  z-index: 10;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.schedule-table td {
  padding: 0.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  white-space: nowrap;
}

:root[data-theme="light"] .schedule-table td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.schedule-table tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.02);
}

:root[data-theme="light"] .schedule-table tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.02);
}

.schedule-table tr:hover {
  background-color: rgba(99, 102, 241, 0.15);
}

.av-flight-col {
  font-weight: 700;
  color: var(--brand-primary);
}

.av-tail-col {
  color: var(--accent-amber);
}

/* Map Cluster & Markers */
.map-cluster-icon {
  background: rgba(59, 130, 246, 0.8);
  color: white;
  border-radius: 50%;
  text-align: center;
  line-height: 30px;
  font-weight: bold;
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  font-family: var(--font-mono);
}

.airport-marker {
  background: var(--bg-surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-mono);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  text-align: center;
  transition: all 0.2s;
}

.airport-marker:hover {
  background: var(--brand-primary);
  color: #fff;
  cursor: pointer;
  transform: scale(1.1);
}

.hub-marker {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}

/* ==========================================================================
   Fleet Analytics & Light Theme Contrast Overrides
   ========================================================================== */
.analytics-view-wrapper {
  flex-grow: 1;
  padding: 1.5rem;
  overflow-y: auto;
  background-color: var(--bg-app);
}

.analytics-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.analytics-kpi-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

.analytics-kpi-card .kpi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.analytics-kpi-card .kpi-card-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.analytics-kpi-card .kpi-card-val {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.analytics-kpi-card .kpi-card-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.analytics-highlight-val {
  color: var(--accent-blue) !important;
}

.fleet-analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

.analytics-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.analytics-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.duty-bar-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.duty-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.duty-split-stats {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.duty-bar-track {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background-color: var(--bg-card);
}

.duty-segment.flying {
  background-color: var(--brand-primary);
}

.duty-segment.turn {
  background-color: var(--accent-teal);
}

.duty-segment.idle {
  background-color: #334155;
}

.duty-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

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

.duty-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

:root[data-theme="light"] .analytics-view-wrapper {
  background-color: #f1f5f9;
}

:root[data-theme="light"] .analytics-kpi-card {
  background-color: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

:root[data-theme="light"] .analytics-kpi-card .kpi-card-title {
  color: #475569;
}

:root[data-theme="light"] .analytics-kpi-card .kpi-card-val {
  color: #0f172a;
}

:root[data-theme="light"] .analytics-kpi-card .kpi-card-sub {
  color: #64748b;
}

:root[data-theme="light"] .analytics-card {
  background-color: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

:root[data-theme="light"] .analytics-card-title {
  color: #0f172a;
}

:root[data-theme="light"] .analytics-highlight-val {
  color: #0284c7 !important;
}

:root[data-theme="light"] .duty-bar-header {
  color: #334155;
}

:root[data-theme="light"] .duty-split-stats {
  color: #64748b;
}

:root[data-theme="light"] .duty-bar-track {
  background-color: #e2e8f0;
}

:root[data-theme="light"] .duty-segment.idle {
  background-color: #cbd5e1;
}

:root[data-theme="light"] .duty-legend {
  color: #475569;
}

:root[data-theme="light"] .corridor-pair {
  color: #0f172a;
  text-shadow: none;
}

:root[data-theme="light"] .corridor-details-row {
  background: #f8fafc;
  color: #475569;
  border-color: #e2e8f0;
}

:root[data-theme="light"] .corridor-flights-list {
  color: #64748b;
}

:root[data-theme="light"] .map-corridor-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

:root[data-theme="light"] .map-corridor-card:hover {
  background: #f8fafc;
  border-color: #0284c7;
}

:root[data-theme="light"] .occ-preset-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

:root[data-theme="light"] .occ-financial-card,
:root[data-theme="light"] .occ-financial-item {
  background: #ffffff;
  border-color: #e2e8f0;
}

:root[data-theme="light"] .occ-financial-value {
  color: #0f172a;
}

:root[data-theme="light"] .hub-stat-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

:root[data-theme="light"] .hub-schedule-table th {
  background: #f1f5f9;
  color: #334155;
}

:root[data-theme="light"] .hub-schedule-table td {
  border-color: #e2e8f0;
  color: #0f172a;
}

:root[data-theme="light"] .roster-duty-idle {
  background-color: #cbd5e1;
}