/* ==========================================================================
   Flight Admin - Custom Design System & CSS Stylesheet
   Executive Modern Theme (Sora, DM Sans, IBM Plex Mono) + Material Symbols
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=IBM+Plex+Mono:ital,wght@0,400;0,600;0,700;1,400&family=Sora:wght@400;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

/* 1. CSS CUSTOM PROPERTIES & DESIGN TOKENS */
:root {
  /* Dynamic Proportional Base Font Size */
  --base-font-size: 14px;

  /* Colors - Night Mode (Default) */
  --bg-dark: #0b1320;
  --bg-sidebar: #0f1c2e;
  --bg-card: #15243b;
  --bg-card-alt: #1c2e4a;
  --bg-input: #0f1a2c;
  --border-color: #243854;
  --border-highlight: #3b82f6;
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --logo-admin-color: #ffffff;

  /* Executive Accent Palette (Customizable 3 Colors) */
  --accent-blue: #3b82f6;   /* Color 1: Primary Accent */
  --accent-cyan: #06b6d4;   /* Color 2: Secondary Accent */
  --accent-emerald: #10b981;
  --accent-gold: #f59e0b;
  --accent-crimson: #ef4444;
  --accent-purple: #8b5cf6;

  /* Status Colors */
  --status-enroute: #06b6d4;
  --status-onground: #10b981;
  --status-ready: #f59e0b;
  --status-blocked: #ef4444;

  /* Typography Fonts */
  --font-heading: 'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* Transitions & Shadows */
  --transition-fast: 0.15s ease;
  --transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-card: 0 8px 30px -4px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 15px rgba(6, 182, 212, 0.25);
}

/* Day Mode Theme Tokens (Light Sidebar & Clean Contrast) */
body.light-theme {
  --bg-dark: #f8fafc;
  --bg-sidebar: #ffffff;  /* Light clean sidebar background in Day Mode */
  --bg-card: #ffffff;
  --bg-card-alt: #f1f5f9;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --border-highlight: #2563eb;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --logo-admin-color: #0f223d;

  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 12px rgba(37, 99, 235, 0.15);
}

/* Day Mode Navigation Link Contrast Overrides */
body.light-theme .nav-btn {
  color: #475569;
}

body.light-theme .nav-btn:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

body.light-theme .nav-btn.active {
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.12) 0%, rgba(37, 99, 235, 0.08) 100%);
  color: #0284c7;
  border-left: 3px solid #0284c7;
  font-weight: 700;
}

body.light-theme .nav-label {
  color: #94a3b8;
}

body.light-theme #sidebar {
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.04);
}

/* 2. BASE RESET & GLOBAL STYLES */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--base-font-size, 14px);
}

body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 1.4rem;
  display: inline-block;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;
  vertical-align: middle;
}

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

#app-root {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* 3. SIDEBAR NAVIGATION */
#sidebar {
  width: 250px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 20;
  transition: background-color 0.2s ease;
}

.sidebar-header {
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  padding: 12px 12px 6px 12px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
}

.nav-btn:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}

.nav-btn.active {
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.22) 0%, rgba(59, 130, 246, 0.12) 100%);
  color: var(--accent-cyan);
  border-left: 3px solid var(--accent-cyan);
  font-weight: 600;
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border-color);
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 4. MAIN WRAPPER & TOP HEADER */
#main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

#top-header {
  height: 64px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.page-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
}

.flight-ticker {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  background: var(--bg-card-alt);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

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

.ticker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.ticker-dot.pulse {
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(6, 182, 212, 0); }
  100% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0); }
}

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

.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.theme-toggle-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* 5. MAIN CONTENT AREA */
#content-area {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
}

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

.card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
  opacity: 0.94;
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

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

.btn-danger {
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.btn-danger:hover {
  background-color: rgba(239, 68, 68, 0.3);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.85rem;
}

/* FORMS & INPUTS (Strict Overflow Prevention) */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  min-width: 0;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: var(--transition-fast);
  min-width: 0;
}

input[type="datetime-local"].form-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-family: var(--font-body);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-glow);
}

/* DATA TABLES */
.table-container {
  width: 100%;
  overflow-x: auto;
}

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

.data-table th {
  background-color: var(--bg-card-alt);
  padding: 10px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.92rem;
  vertical-align: middle;
}

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

/* DAILY OPS MOVEMENTS ROW HIGHLIGHT */
.movement-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.movement-row:hover {
  background-color: rgba(6, 182, 212, 0.08) !important;
}

.movement-arr {
  border-left: 4px solid var(--accent-emerald);
}

.movement-dep {
  border-left: 4px solid var(--accent-cyan);
}

/* PAID FLIGHT MOVEMENT LINE STYLING (LIGHT GREY) */
.movement-row-item.paid-movement-row {
  opacity: 0.5;
  background-color: rgba(148, 163, 184, 0.06) !important;
  border-left-color: #64748b !important;
}

.movement-row-item.paid-movement-row td,
.movement-row-item.paid-movement-row strong,
.movement-row-item.paid-movement-row span {
  color: #94a3b8 !important;
}

body.light-theme .movement-row-item.paid-movement-row {
  opacity: 0.6;
  background-color: #f1f5f9 !important;
  border-left-color: #94a3b8 !important;
}

body.light-theme .movement-row-item.paid-movement-row td,
body.light-theme .movement-row-item.paid-movement-row strong,
body.light-theme .movement-row-item.paid-movement-row span {
  color: #64748b !important;
}

/* CALENDAR GRID AGENDA OVERVIEW STYLES (MATCHING REFERENCE DESIGN) */
.calendar-day-cell {
  transition: background-color 0.15s ease;
}

.calendar-day-cell:hover {
  background: rgba(6, 182, 212, 0.04) !important;
}

.calendar-day-cell.today-cell {
  background: rgba(6, 182, 212, 0.06) !important;
}

.calendar-event-bar:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

body.light-theme .calendar-event-bar {
  background: #d1fae5 !important;
  border-left-color: #059669 !important;
  color: #064e3b !important;
}

body.light-theme .calendar-event-bar.paid-bar {
  background: #f1f5f9 !important;
  border-left-color: #94a3b8 !important;
  color: #64748b !important;
}

/* MOVEMENT SELECTED SERVICE STATUS BADGES */
.movement-services-symbols {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 220px;
}

.service-symbol-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  user-select: none;
  cursor: default;
}

.service-symbol-badge:hover {
  transform: scale(1.18);
  filter: brightness(1.2);
  box-shadow: 0 0 8px currentColor;
  z-index: 2;
}

.service-symbol-badge .material-symbols-outlined {
  font-size: 1.15rem;
  line-height: 1;
}

button.service-status-chip {
  padding: 0;
  font: inherit;
  cursor: pointer;
  flex-shrink: 0;
}

body.light-theme .service-symbol-badge {
  filter: saturate(1.15);
}

/* DOCUMENT ATTACHMENT PILL */
.doc-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.85rem;
}

.doc-pill .btn-delete-doc,
.doc-pill .btn-delete-ac-doc {
  background: transparent;
  border: none;
  color: #ef4444;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  margin-left: 4px;
  line-height: 1;
}

.doc-pill .btn-delete-doc:hover,
.doc-pill .btn-delete-ac-doc:hover {
  color: #dc2626;
}

/* MODAL OVERLAY & CARD */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 16px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  max-width: 92vw;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow-x: hidden;
}

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

.turnaround-modal {
  width: 97vw;
  max-width: 1680px;
  height: calc(100dvh - 32px);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 18px;
}

.turnaround-reference {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-top: 4px;
  white-space: nowrap;
  user-select: text;
}

.turnaround-modal .card-title { flex-wrap: wrap; }
.turnaround-modal .card-title .turnaround-reference { flex-basis: 100%; }

.turnaround-modal .modal-header {
  flex: 0 0 auto;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-bottom: 12px;
}

.turnaround-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 12px;
}

.turnaround-columns {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) minmax(0, 1.15fr);
  align-items: stretch;
  gap: 18px;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.turnaround-details {
  min-width: 0;
  align-self: stretch;
  background: var(--bg-card-alt);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.turnaround-documents {
  flex: 0 0 auto;
}

.turnaround-detail-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex: 1;
  align-items: stretch;
  align-content: space-between;
  gap: 10px;
}

.turnaround-info-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.turnaround-panel-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  margin: 0;
}

.turnaround-pob-grid {
  display: grid;
  grid-template-columns: auto repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 6px;
  flex: 1;
}

.turnaround-pob-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.turnaround-pob-grid .form-input { text-align: center; }

.turnaround-billing-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.turnaround-detail-fields > h4,
.turnaround-detail-fields > .form-group:first-of-type,
.turnaround-detail-fields > .grid:nth-last-child(2),
.turnaround-detail-fields > .grid:last-child {
  grid-column: 1 / -1;
}

.turnaround-detail-fields > *,
.turnaround-document-upload > *,
.turnaround-documents input[type="file"] {
  min-width: 0;
}

.turnaround-details .form-label { font-size: 0.72rem; }
.turnaround-details .form-input,
.turnaround-details .form-select { padding: 6px 8px; }

.turnaround-document-upload {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1fr);
  gap: 8px;
}

.turnaround-services {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.turnaround-services-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.turnaround-services-scroll table { min-width: 640px; }
.turnaround-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
}

@media (max-width: 1100px) {
  .turnaround-columns { grid-template-columns: minmax(0, 1fr); }
  .turnaround-services { height: 420px; }
}

@media (max-width: 640px) {
  .turnaround-detail-fields,
  .turnaround-document-upload { grid-template-columns: minmax(0, 1fr); }
  .turnaround-modal .modal-header > div { flex-wrap: wrap; }
}

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

.modal-close:hover {
  color: var(--text-main);
}

/* GRID UTILITIES */
.grid {
  display: grid;
}

.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-7 { grid-template-columns: repeat(7, 1fr); }

/* ==========================================================================
   EXECUTIVE A4 PDF INVOICE TEMPLATE STYLES
   ========================================================================== */
.a4-invoice-sheet {
  background: #ffffff !important;
  color: #1e293b !important;
  font-family: var(--font-body), sans-serif;
  width: 210mm;
  min-height: 297mm;
  padding: 12mm 15mm 15mm 15mm;
  margin: 0 auto;
  box-sizing: border-box;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  border-radius: 4px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ==========================================================================
   STRICT PRINT OVERRIDES FOR PURE WHITE A4 EXPORT (ELIMINATES BLACK PAGES)
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  html, body {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Hide main application frame and web UI action bars */
  #app-root,
  .modal-header,
  .modal-close,
  button,
  .btn {
    display: none !important;
  }

  /* Force modal overlay and card to be pure white and unconstrained for print */
  .modal-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: auto !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    backdrop-filter: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    overflow: visible !important;
  }

  .modal-card {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
  }

  /* Render printable invoice sheet full page at (0,0) in crisp A4 dimensions */
  #printable-invoice-wrapper {
    display: flex !important;
    visibility: visible !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 210mm !important;
    min-height: 297mm !important;
    margin: 0 !important;
    padding: 12mm 15mm 15mm 15mm !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* ==========================================================================
   CUSTOM VISUAL AIRCRAFT SHAPE PICKER (ADAPTIVE DAY/NIGHT THEME)
   ========================================================================== */
.custom-shape-picker .shape-picker-trigger {
  background: var(--bg-card-alt);
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.custom-shape-picker .shape-picker-trigger:hover {
  border-color: var(--accent-cyan);
}

.custom-shape-picker .shape-picker-thumb-box {
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
}

.custom-shape-picker .shape-picker-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1) drop-shadow(0 2px 4px rgba(0,0,0,0.7));
}

body.light-theme .custom-shape-picker .shape-picker-thumb-box {
  background: #cbd5e1;
  border-color: #94a3b8;
}

body.light-theme .custom-shape-picker .shape-picker-thumb-img {
  filter: brightness(0) drop-shadow(0 1px 3px rgba(0,0,0,0.25));
}

.custom-shape-picker .shape-picker-menu {
  background: var(--bg-card);
  border: 1.5px solid var(--accent-cyan);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  padding: 8px;
}

body.light-theme .custom-shape-picker .shape-picker-menu {
  background: #ffffff;
  border-color: var(--accent-blue);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.custom-shape-picker .shape-opt-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.custom-shape-picker .shape-opt-row:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--accent-cyan);
}

body.light-theme .custom-shape-picker .shape-opt-row:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--accent-blue);
}

body.light-theme .custom-shape-picker .shape-opt-row.selected {
  background: rgba(59, 130, 246, 0.18);
  border-color: var(--accent-blue);
}

.aircraft-shape-row-img {
  filter: brightness(0) invert(1);
}

body.light-theme .aircraft-shape-row-img {
  filter: brightness(0);
}

/* ==========================================================================
   RESPONSIVE DESIGN SYSTEM (TABLETS & SMARTPHONE BROWSERS)
   ========================================================================== */

/* Mobile Menu Toggle Button & Sidebar Backdrop Overlay */
.mobile-menu-btn {
  display: none;
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-right: 10px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
  background: var(--accent-blue);
  color: #ffffff;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

/* Tablet Breakpoint (< 992px) */
@media (max-width: 992px) {
  #app-root {
    position: relative;
    overflow-x: hidden;
  }

  /* Slide-out Drawer Sidebar Overlay */
  #sidebar {
    position: fixed;
    top: 0;
    left: -270px;
    height: 100vh;
    z-index: 999;
    box-shadow: 6px 0 25px rgba(0, 0, 0, 0.5);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  #sidebar.mobile-open {
    left: 0;
  }

  #main-wrapper {
    width: 100vw;
  }

  .mobile-menu-btn {
    display: flex;
  }

  #top-header {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .header-left {
    gap: 10px;
    flex: 1;
    align-items: center;
  }

  .page-title {
    font-size: 1.05rem;
  }

  #content-area {
    padding: 14px;
  }

  /* Responsive Grid Adjustments */
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .grid-cols-3 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Modal Dialog Scaling */
  .modal-card {
    max-width: 92vw !important;
    max-height: 88vh !important;
    padding: 18px !important;
    border-radius: 12px !important;
  }
}

/* Smartphone Breakpoint (< 640px) */
@media (max-width: 640px) {
  #top-header {
    flex-direction: column;
    align-items: stretch;
  }

  .header-right {
    justify-content: flex-end;
    width: 100%;
  }

  .flight-ticker {
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 4px;
  }

  /* Collapse all multi-column grids to 1 column on smartphones */
  .grid-cols-4,
  .grid-cols-3,
  .grid-cols-2 {
    grid-template-columns: 1fr !important;
  }

  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
  }

  .data-table th,
  .data-table td {
    padding: 8px 10px;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  /* Touch Target Optimizations */
  .btn,
  .form-input,
  .form-select,
  .form-textarea {
    min-height: 40px;
  }

  .modal-card {
    max-width: 95vw !important;
    max-height: 92vh !important;
    padding: 14px !important;
  }
}

/* ==========================================================================
   FBO GENERAL TASK MANAGER MODULE STYLES & HOVER COMMENT BALLOONS
   ========================================================================== */
.fbo-task-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 8px;
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-blue);
  gap: 12px;
  transition: all 0.2s ease;
}

/* Light Green Completed State with Checkmark */
.fbo-task-item.completed {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  border-left: 4px solid var(--accent-emerald) !important;
  color: var(--text-muted);
}

body.light-theme .fbo-task-item.completed {
  background: #d1fae5 !important;
  border-color: #a7f3d0 !important;
  color: #065f46 !important;
}

.fbo-task-item.completed .task-title-text {
  text-decoration: line-through;
  color: var(--accent-emerald) !important;
  font-weight: 700;
}

/* Light Orange / Amber Overdue / Deadline Reached State */
.fbo-task-item.overdue {
  background: rgba(245, 158, 11, 0.18) !important;
  border-color: rgba(245, 158, 11, 0.5) !important;
  border-left: 4px solid var(--accent-gold) !important;
}

body.light-theme .fbo-task-item.overdue {
  background: #fef3c7 !important;
  border-color: #fde68a !important;
  color: #92400e !important;
}

/* Hover Comment Balloon / Tooltip */
.task-comment-balloon {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  width: 260px;
  background: #0f172a;
  color: #f8fafc;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--accent-gold);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  font-size: 0.8rem;
  z-index: 100;
  pointer-events: none;
  animation: balloonFade 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light-theme .task-comment-balloon {
  background: #ffffff;
  color: #0f172a;
  border-color: var(--accent-gold);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.task-comment-balloon::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: var(--accent-gold) transparent transparent transparent;
}

.fbo-task-item:hover .task-comment-balloon {
  display: block;
}

@keyframes balloonFade {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ==========================================================================
   MTOW BREAKPOINT RULER COMPONENT (System 3)
   ========================================================================== */
.mtow-ruler-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg, 12px);
  padding: 20px 24px;
  margin-bottom: 20px;
}

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

.mtow-ruler-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.mtow-ruler-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.mtow-ruler-container {
  position: relative;
  margin-top: 26px;
  margin-bottom: 28px;
  padding: 0 4px;
}

.mtow-ruler-track {
  position: relative;
  height: 64px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: visible;
  cursor: crosshair;
  user-select: none;
  display: flex;
}

body.light-theme .mtow-ruler-track {
  background: rgba(241, 245, 249, 0.9);
}

.mtow-ruler-segment {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 4px 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.15s ease, filter 0.15s ease;
  overflow: hidden;
  text-align: center;
  box-sizing: border-box;
}

.mtow-ruler-segment:hover {
  filter: brightness(1.15);
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.05);
}

.mtow-segment-name {
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.mtow-segment-fee {
  font-size: 0.72rem;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  margin-top: 2px;
  white-space: nowrap;
}

/* Breakpoint Pin Handles */
.mtow-ruler-pin {
  position: absolute;
  top: -14px;
  bottom: -6px;
  width: 28px;
  margin-left: -14px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: ew-resize;
  touch-action: none;
}

.mtow-ruler-pin-handle {
  background: var(--bg-card);
  border: 2px solid var(--accent-gold);
  color: var(--accent-gold);
  border-radius: 12px;
  padding: 2px 7px;
  font-size: 0.68rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  pointer-events: auto;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.mtow-ruler-pin:hover .mtow-ruler-pin-handle,
.mtow-ruler-pin.dragging .mtow-ruler-pin-handle {
  transform: scale(1.15);
  background: var(--accent-gold);
  color: #0f172a;
}

.mtow-ruler-pin-line {
  flex: 1;
  width: 2px;
  background: var(--accent-gold);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
  pointer-events: none;
}

.mtow-ruler-pin-bottom-notch {
  width: 8px;
  height: 8px;
  background: var(--accent-gold);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.8);
}

/* Hover guideline */
.mtow-ruler-hover-guide {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(6, 182, 212, 0.9);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.8);
  pointer-events: none;
  z-index: 15;
  display: none;
}

.mtow-ruler-hover-badge {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.light-theme .mtow-ruler-hover-badge {
  background: #ffffff;
}

/* Scale ticks below ruler */
.mtow-ruler-ticks {
  position: relative;
  height: 22px;
  margin-top: 6px;
  user-select: none;
}

.mtow-ruler-tick {
  position: absolute;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mtow-ruler-tick-mark {
  width: 1px;
  height: 6px;
  background: var(--text-muted);
  opacity: 0.5;
}

.mtow-ruler-tick-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 2px;
}

/* Row indicator dot in table */
.tier-color-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

/* ==========================================================================
   Address Book & Contacts Directory Module Styles
   ========================================================================== */
.contact-cat-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.contact-cat-tab-btn:hover {
  background: var(--bg-card-alt);
  color: var(--text-main);
  border-color: var(--border-highlight);
}

.contact-cat-tab-btn.active {
  background: var(--bg-card-alt);
  color: var(--text-main);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 1px var(--accent-cyan);
}

.contact-cat-badge {
  font-size: 0.72rem;
  background: var(--bg-dark);
  padding: 1px 7px;
  border-radius: 12px;
  color: var(--text-muted);
  font-weight: 700;
}

.contact-cat-tab-btn.active .contact-cat-badge {
  background: var(--accent-cyan);
  color: #0b1320;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 18px;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
  display: flex;
  flex-direction: column;
}

.contact-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
}

.contact-card-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 6px;
  margin-bottom: 2px;
  line-height: 1.3;
}

.contact-category-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid;
  background: rgba(255, 255, 255, 0.03);
}

.contact-service-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 3px 8px;
}

body.light-theme .contact-cat-tab-btn {
  background: #ffffff;
}

body.light-theme .contact-cat-tab-btn.active {
  background: #f1f5f9;
}

body.light-theme .contact-cat-badge {
  background: #e2e8f0;
}

body.light-theme .contact-card {
  background: #ffffff;
}

.view-toggle-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.view-toggle-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.view-toggle-btn.active {
  background: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

body.light-theme .view-toggle-btn.active {
  background: var(--accent-blue);
  color: #ffffff;
}

body.light-theme .view-toggle-btn:hover {
  background: #f1f5f9;
}

/* ==========================================================================
   INVOICE STATUS STYLES & COLOR SYSTEM
   ========================================================================== */

/* Movement Row Greyed Out when Sent or Paid */
.daily-movement-row.movement-row-greyed {
  background: rgba(148, 163, 184, 0.05) !important;
  color: var(--text-muted) !important;
}

.daily-movement-row.movement-row-greyed td strong.movement-time-text,
.daily-movement-row.movement-row-greyed td strong.movement-tail-text,
.daily-movement-row.movement-row-greyed td div.movement-date-text {
  color: var(--text-muted) !important;
}

body.light-theme .daily-movement-row.movement-row-greyed {
  background: rgba(148, 163, 184, 0.12) !important;
  color: #64748b !important;
}

body.light-theme .daily-movement-row.movement-row-greyed td strong.movement-time-text,
body.light-theme .daily-movement-row.movement-row-greyed td strong.movement-tail-text,
body.light-theme .daily-movement-row.movement-row-greyed td div.movement-date-text {
  color: #64748b !important;
}

/* Invoice Status Select Dropdowns & Badges */
.inv-status-dropdown,
.inv-status-select,
.inv-status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  width: auto;
  min-width: 126px;
  border: 1px solid transparent;
}

/* Status: UNPAID (Red / Alert) */
.inv-status-dropdown.unpaid,
.inv-status-dropdown.inv-status-unpaid,
.inv-status-select.unpaid,
.inv-status-select.inv-status-unpaid,
.inv-status-badge.unpaid,
.inv-status-badge.inv-status-unpaid {
  background-color: rgba(239, 68, 68, 0.14) !important;
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.45) !important;
}

/* Status: INVOICE SENT (Amber / Gold / Progress) */
.inv-status-dropdown.sent,
.inv-status-dropdown.inv-status-sent,
.inv-status-select.sent,
.inv-status-select.inv-status-sent,
.inv-status-badge.sent,
.inv-status-badge.inv-status-sent {
  background-color: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.45) !important;
}

/* Status: PAID (Emerald / Green / Success) */
.inv-status-dropdown.paid,
.inv-status-dropdown.inv-status-paid,
.inv-status-select.paid,
.inv-status-select.inv-status-paid,
.inv-status-badge.paid,
.inv-status-badge.inv-status-paid {
  background-color: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.45) !important;
}

/* Light Theme Invoice Status */
body.light-theme .inv-status-dropdown.unpaid,
body.light-theme .inv-status-dropdown.inv-status-unpaid,
body.light-theme .inv-status-select.unpaid,
body.light-theme .inv-status-select.inv-status-unpaid,
body.light-theme .inv-status-badge.unpaid,
body.light-theme .inv-status-badge.inv-status-unpaid {
  background-color: #fee2e2 !important;
  color: #dc2626 !important;
  border-color: #fca5a5 !important;
}

body.light-theme .inv-status-dropdown.sent,
body.light-theme .inv-status-dropdown.inv-status-sent,
body.light-theme .inv-status-select.sent,
body.light-theme .inv-status-select.inv-status-sent,
body.light-theme .inv-status-badge.sent,
body.light-theme .inv-status-badge.inv-status-sent {
  background-color: #fef3c7 !important;
  color: #d97706 !important;
  border-color: #fcd34d !important;
}

body.light-theme .inv-status-dropdown.paid,
body.light-theme .inv-status-dropdown.inv-status-paid,
body.light-theme .inv-status-select.paid,
body.light-theme .inv-status-select.inv-status-paid,
body.light-theme .inv-status-badge.paid,
body.light-theme .inv-status-badge.inv-status-paid {
  background-color: #d1fae5 !important;
  color: #059669 !important;
  border-color: #6ee7b7 !important;
}

/* Select Option styling so menu options look crisp on all OSes */
.inv-status-dropdown option,
.inv-status-select option {
  background-color: var(--bg-card);
  color: var(--text-main);
  font-weight: 600;
}

body.light-theme .inv-status-dropdown option,
body.light-theme .inv-status-select option {
  background-color: #ffffff;
  color: #0f172a;
}

/* -------------------------------------------------------------
 * 16. SHIFT BRIEFING & HANDOVER STYLES
 * ------------------------------------------------------------- */
.badge-ready {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid var(--accent-emerald);
}

.badge-pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
}

.badge-critical {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid #ef4444;
}

/* Provider observations are separate from editable planned times. */
.flight-tracking-status { display: flex; flex-direction: column; gap: 3px; font-size: .73rem; min-width: 155px; }
.tracking-muted, .tracking-summary { color: var(--text-muted); font-size: .72rem; }
.tracking-summary { padding: 0 16px 12px; }
.tracking-airborne strong { color: var(--accent-cyan); }
.tracking-arrived strong { color: var(--accent-emerald); }
.tracking-late strong { color: var(--accent-gold); }

.arrival-confirmed { color: #059669 !important; }
.arrival-diverted { color: #d97706 !important; }
.arrival-live-dot { font-size: .75rem; margin-right: .2rem; }
.arrival-time-label { font-size: .65rem; font-weight: 700; margin-top: .2rem; }

.daily-movement-row .movement-time-text.arrival-confirmed, .daily-movement-row .arrival-time-label.arrival-confirmed { color: #059669 !important; }
.daily-movement-row .movement-time-text.arrival-diverted, .daily-movement-row .arrival-time-label.arrival-diverted { color: #d97706 !important; }
[data-arrival-time] .movement-date-text { font-size: .78rem; font-weight: 700; white-space: nowrap; }
[data-arrival-time] .movement-time-text { font-size: .95rem; white-space: nowrap; }

.badge-longstay {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

/* Print styling for shift briefing handover sheet */
@media print {
  body * {
    visibility: hidden;
  }

  .shift-briefing-modal,
  .shift-briefing-modal * {
    visibility: visible;
  }

  .shift-briefing-modal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    box-shadow: none !important;
    border: none !important;
    background: #ffffff !important;
    color: #000000 !important;
  }

  .shift-briefing-header button,
  .btn-close-out-service,
  #btn-briefing-close-bottom,
  .btn-briefing-open-flight {
    display: none !important;
  }

  .shift-briefing-scroll {
    overflow: visible !important;
  }

  .aog-card,
  .movement-briefing-card {
    border: 1px solid #cccccc !important;
    background: #ffffff !important;
    color: #000000 !important;
    page-break-inside: avoid;
  }
}

.service-symbol-pill { transition: transform 0.15s ease; }
.service-symbol-pill:hover { transform: scale(1.08); }
@media (max-width: 1024px) {
  .briefing-grid-3col {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================================
   GS PRO - REPORTS & BUSINESS INTELLIGENCE DASHBOARD (.bi-dashboard)
   ============================================================================ */
.bi-dashboard {
  --bi-canvas: #0b0f19;
  --bi-card: #141c2e;
  --bi-surface: #0b0f19;
  --bi-filter-bg: rgba(20, 28, 46, 0.96);
  --bi-border: #23314d;
  --bi-text: #f8fafc;
  --bi-muted: #94a3b8;
  --bi-zulu: #60a5fa;
  background: var(--bi-canvas);
  color: var(--bi-text);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border: 1px solid var(--bi-border);
}

body.light-theme .bi-dashboard {
  --bi-canvas: var(--bg-dark, #f8fafc);
  --bi-card: var(--bg-card, #ffffff);
  --bi-surface: var(--bg-card-alt, #f1f5f9);
  --bi-filter-bg: rgba(255, 255, 255, 0.96);
  --bi-border: var(--border-color, #e2e8f0);
  --bi-text: var(--text-main, #0f172a);
  --bi-muted: var(--text-muted, #475569);
  --bi-zulu: #2563eb;
}

.bi-filter-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bi-filter-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--bi-border);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.bi-filter-left, .bi-filter-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.bi-brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 12px;
  border-right: 1px solid #23314d;
}

.bi-brand-badge .material-symbols-outlined {
  color: #3b50ff;
  font-size: 26px;
}

.bi-brand-title {
  font-family: var(--font-heading, 'Sora', sans-serif);
  font-weight: 800;
  font-size: 0.96rem;
  color: var(--bi-text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.bi-tag {
  font-size: 0.65rem;
  font-family: 'IBM Plex Mono', monospace;
  background: rgba(59, 80, 255, 0.2);
  color: var(--bi-zulu);
  border: 1px solid rgba(59, 80, 255, 0.45);
  padding: 1px 6px;
  border-radius: 4px;
}

.bi-brand-sub {
  font-size: 0.72rem;
  color: var(--bi-muted);
}

.bi-mono-zulu {
  font-family: 'IBM Plex Mono', monospace;
  color: var(--bi-zulu);
  font-weight: 600;
  font-size: 0.75rem;
}

.bi-station-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bi-field-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bi-muted);
  font-weight: 700;
}

.bi-select, .bi-date-input {
  background: var(--bi-surface);
  color: var(--bi-text);
  border: 1px solid var(--bi-border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 600;
}

.bi-tf-group {
  display: inline-flex;
  background: var(--bi-surface);
  border: 1px solid var(--bi-border);
  border-radius: 8px;
  padding: 2px;
}

.bi-tf-btn {
  background: transparent;
  color: var(--bi-muted);
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.bi-tf-btn.active {
  background: #3b50ff;
  color: #ffffff;
}

.bi-custom-range {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bi-tz-btn, .bi-btn-secondary, .bi-btn-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bi-surface);
  color: var(--bi-text);
  border: 1px solid var(--bi-border);
  border-radius: 8px;
  padding: 6px 11px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.bi-tz-btn.is-utc {
  border-color: rgba(59, 80, 255, 0.5);
  color: var(--bi-zulu);
}

.bi-btn-secondary:hover, .bi-tz-btn:hover, .bi-btn-mini:hover {
  border-color: #3b50ff;
  color: var(--bi-text);
}

.bi-export-group {
  display: flex;
  gap: 6px;
}

.bi-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.bi-card {
  background: var(--bi-card);
  border: 1px solid var(--bi-border);
  border-radius: 12px;
  padding: 16px 18px;
}

.bi-kpi-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bi-kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.bi-kpi-label {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bi-muted);
}

.bi-kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bi-kpi-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.bi-kpi-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--bi-text);
  font-family: var(--font-heading, 'Sora', sans-serif);
}

.bi-kpi-delta, .bi-kpi-pill {
  font-size: 0.73rem;
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--bi-surface);
}

.bi-kpi-sub {
  font-size: 0.76rem;
  color: var(--bi-muted);
}

.bi-grid-main {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.bi-span-2 {
  grid-column: span 2;
}

.bi-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.bi-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--bi-text);
}

.bi-card-sub {
  margin: 3px 0 0 0;
  font-size: 0.76rem;
  color: var(--bi-muted);
}

.bi-svg-wrap {
  width: 100%;
  overflow-x: auto;
}

.bi-chart-svg, .bi-map-svg {
  width: 100%;
  height: auto;
  display: block;
}

.bi-donut-layout {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.bi-donut-svg-wrap {
  flex: 0 0 auto;
  margin: 0 auto;
}

.bi-donut-slice.is-drillable, .bi-legend-row.is-drillable {
  cursor: pointer;
}

.bi-donut-slice {
  transition: opacity 0.15s ease;
}

.bi-donut-slice:hover {
  opacity: 0.85;
}

.bi-donut-legend {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bi-drill-header {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #f59e0b;
  margin-bottom: 2px;
}

.bi-legend-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--bi-surface);
  border: 1px solid var(--bi-border);
  font-size: 0.78rem;
}

.bi-legend-row.is-drillable:hover {
  border-color: #f59e0b;
}

.bi-legend-left, .bi-legend-right, .bi-inline-keys, .bi-key-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bi-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.bi-mono-val {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  color: var(--bi-text);
}

.bi-muted-val {
  font-family: 'IBM Plex Mono', monospace;
  color: var(--bi-muted);
  font-size: 0.74rem;
}

.bi-stacked-bar {
  display: flex;
  height: 22px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--bi-border);
  margin-bottom: 14px;
}

.bi-stacked-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #ffffff;
  font-family: 'IBM Plex Mono', monospace;
}

.bi-fleet-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bi-fleet-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.78rem;
  margin-bottom: 4px;
}

.bi-fleet-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bi-fleet-ex {
  color: #64748b;
  font-size: 0.72rem;
}

.bi-fleet-nums {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bi-conv-pill {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.73rem;
  font-weight: 700;
}

.bi-dual-bar-track {
  position: relative;
  height: 8px;
  background: var(--bi-surface);
  border-radius: 999px;
  overflow: hidden;
}

.bi-dual-bar-share {
  height: 100%;
  border-radius: 999px;
  opacity: 0.45;
}

.bi-dual-bar-conv {
  position: absolute;
  top: 0;
  left: 0;
  height: 4px;
  background: #10b981;
  border-radius: 999px;
}

@keyframes bi-arc-flow {
  to { stroke-dashoffset: -28; }
}

.bi-flight-arc {
  animation: bi-arc-flow 1.8s linear infinite;
}

@keyframes bi-beacon-pulse {
  0%, 100% { transform: scale(1); opacity: 0.22; }
  50% { transform: scale(1.35); opacity: 0.08; }
}

.bi-pulse-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: bi-beacon-pulse 2.2s ease-in-out infinite;
}

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

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

.bi-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bi-muted);
  border-bottom: 1px solid var(--bi-border);
}

.bi-table td {
  padding: 10px;
  border-bottom: 1px solid var(--bi-border);
}

.bi-leader-row {
  cursor: pointer;
}

.bi-leader-row:hover {
  background: rgba(59, 80, 255, 0.1);
}

.bi-station-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bi-icao-pill {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 0.74rem;
  background: rgba(59, 80, 255, 0.18);
  color: var(--bi-zulu);
  border: 1px solid rgba(59, 80, 255, 0.45);
  padding: 2px 7px;
  border-radius: 6px;
}

.bi-station-name {
  font-weight: 600;
  color: var(--bi-text);
}

.bi-station-meta {
  font-size: 0.71rem;
  color: var(--bi-muted);
}

.bi-conv-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bi-mini-bar {
  width: 56px;
  height: 6px;
  background: var(--bi-surface);
  border-radius: 999px;
  overflow: hidden;
}

.bi-mini-bar > div {
  height: 100%;
  border-radius: 999px;
}

.bi-sla-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid;
  padding: 2px 8px;
  border-radius: 999px;
}

.bi-sankey-grid {
  display: grid;
  grid-template-columns: 200px 1fr 1.2fr;
  align-items: center;
  gap: 12px;
}

.bi-sankey-source {
  background: var(--bi-surface);
  border: 1px solid var(--bi-border);
  border-left: 3px solid #3b50ff;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--bi-muted);
}

.bi-sankey-source strong {
  font-size: 1.2rem;
  color: var(--bi-text);
}

.bi-sankey-svg {
  width: 100%;
  height: 160px;
  display: block;
}

.bi-sankey-targets {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bi-sankey-bucket {
  background: var(--bi-surface);
  border: 1px solid var(--bi-border);
  border-radius: 10px;
  padding: 10px 12px;
}

.bi-sankey-bucket.is-internal {
  border-left: 3px solid #10b981;
}

.bi-sankey-bucket.is-competitor {
  border-left: 3px solid #ef4444;
}

.bi-bucket-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.bi-bucket-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bi-dest-chip {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.14);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.bi-dest-chip.is-leak {
  background: rgba(239, 68, 68, 0.14);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

@media (max-width: 1100px) {
  .bi-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bi-grid-main { grid-template-columns: 1fr; }
  .bi-span-2 { grid-column: auto; }
  .bi-sankey-grid { grid-template-columns: 1fr; }
}

/* PROMINENT ACTIVE FBO HEADER PILL */
.active-fbo-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(6, 182, 212, 0.12);
  border: 1.5px solid var(--accent-cyan);
  border-radius: 10px;
  padding: 5px 12px;
  font-size: 0.82rem;
}

.active-fbo-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--accent-cyan);
}

.active-fbo-code {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-main);
}

.active-fbo-name {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.active-fbo-select {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 0.84rem;
  cursor: pointer;
  outline: none;
}

body.light-theme .active-fbo-select option {
  background: #ffffff;
  color: #0f172a;
}

body:not(.light-theme) .active-fbo-select option {
  background: #0f172a;
  color: #f8fafc;
}
