/* ══════════════════════════════════════════════════════════
   AerisJet Crew Training & Checking Tracker — Brand Theme
   Palette: Deep Blue #082742, Blue #11548F, Grey #333,
            Light Grey #F4F6F9, White #FFF
   Typography: Gill Sans MT (headings), Aptos/Inter (body),
               JetBrains Mono (data)
   ══════════════════════════════════════════════════════════ */

:root {
  --bg: #041c32;
  --surface: #082742;
  --surface2: #0a3256;
  --surface3: #0d3d6b;
  --border: rgba(17,84,143,0.25);
  --border2: rgba(17,84,143,0.40);
  --text: #e8eff6;
  --text-muted: #7ba3c4;
  --text-dim: #a4c4de;
  --accent: #11548F;
  --accent2: #4a8ec8;
  --accent-glow: rgba(17,84,143,0.15);
  --green: #10b981;
  --green-dim: #059669;
  --green-bg: rgba(16,185,129,0.12);
  --amber: #f59e0b;
  --amber-bg: rgba(245,158,11,0.12);
  --red: #ef4444;
  --red-bg: rgba(239,68,68,0.12);
  --expired: #6b7f94;
  --expired-bg: rgba(107,127,148,0.15);
  --renewal: #8b5cf6;
  --renewal-bg: rgba(139,92,246,0.15);
  --booked: #06b6d4;
  --booked-bg: rgba(6,182,212,0.10);
  /* Brand reference */
  --brand-deep-blue: #082742;
  --brand-blue: #11548F;
  --brand-grey: #333333;
  --brand-light-grey: #F4F6F9;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', Aptos, 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── EXPORT CARDS ── */
.export-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 8px;
}
@media (max-width: 700px) { .export-cards { grid-template-columns: 1fr; } }
.export-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 24px 24px 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.export-card-icon { font-size: 28px; line-height: 1; }
.export-card-title {
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-size: 16px; font-weight: 700; letter-spacing: 0.5px; color: var(--text);
}
.export-card-desc {
  font-size: 12px; color: var(--text-muted); line-height: 1.6;
  font-family: 'Inter', Aptos, 'Segoe UI', system-ui, sans-serif; flex: 1;
}
.export-options {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px; background: var(--surface2);
  border-radius: 6px; border: 1px solid var(--border2);
  color: var(--text);
}

/* ── PRINT STYLES ── */
@media print {
  body * { visibility: hidden; }
  #print-frame, #print-frame * { visibility: visible; }
  #print-frame {
    position: fixed; top: 0; left: 0; width: 100%;
    font-family: Arial, sans-serif; background: #fff; color: #000;
  }
  @page { size: A4 landscape; margin: 12mm 10mm; }
}

/* ── LIGHT MODE ── */
body.light-mode {
  --bg: #F4F6F9;
  --surface: #FFFFFF;
  --surface2: #EDF1F7;
  --surface3: #E2E8F0;
  --border: #CBD5E1;
  --border2: #B0BEC5;
  --text: #333333;
  --text-muted: #64748B;
  --text-dim: #475569;
  --accent: #11548F;
  --accent2: #1a6db5;
  --accent-glow: rgba(17,84,143,0.08);
  --green: #059669;
  --green-dim: #047857;
  --green-bg: rgba(5,150,105,0.08);
  --amber: #d97706;
  --amber-bg: rgba(217,119,6,0.08);
  --red: #dc2626;
  --red-bg: rgba(220,38,38,0.08);
  --expired: #6b7280;
  --expired-bg: rgba(107,114,128,0.10);
  --renewal: #7c3aed;
  --renewal-bg: rgba(124,58,237,0.08);
  --booked: #0891b2;
  --booked-bg: rgba(8,145,178,0.06);
}

/* ── ADMIN PANEL ── */
.admin-panel {
  max-width: 900px; margin: 0 auto; padding: 24px;
  display: flex; flex-direction: column; gap: 24px;
}
.admin-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px 24px;
}
.admin-section-title {
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-size: 16px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--text); margin-bottom: 6px;
}
.admin-section-desc {
  font-size: 13px; color: var(--text-muted); margin-bottom: 16px;
  font-family: 'Inter', Aptos, 'Segoe UI', system-ui, sans-serif; line-height: 1.6;
}
.admin-users-list {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px;
}
.admin-user-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 6px; padding: 8px 12px;
}
.admin-user-email {
  flex: 1; font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--text);
}
.admin-user-role {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  padding: 2px 8px; border-radius: 4px; font-weight: 600;
}
.admin-user-role.admin-role { background: rgba(17,84,143,0.18); color: var(--accent2); }
.admin-user-role.readonly-role { background: rgba(100,116,139,0.15); color: var(--text-muted); }
.admin-add-user-row {
  display: flex; gap: 8px; align-items: center;
}
.admin-add-user-row input, .admin-add-user-row select {
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
}
.admin-add-user-row input { flex: 1; }
.admin-check-rules {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
@media (max-width: 700px) { .admin-check-rules { grid-template-columns: 1fr; } }
.admin-check-card {
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 8px; padding: 14px 16px;
}
.admin-check-card-title {
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-size: 13px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.admin-check-dot { width: 8px; height: 8px; border-radius: 50%; }
.admin-rule-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; gap: 8px;
}
.admin-rule-label {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--text-muted); flex: 1; line-height: 1.3;
}
.admin-rule-input {
  width: 70px; text-align: center;
  font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 600;
  background: var(--surface3); border: 1px solid var(--border);
  color: var(--text); border-radius: 5px; padding: 4px 8px;
}
.admin-rule-unit {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--text-muted); width: 40px;
}
.theme-toggle-wrap {
  display: flex; gap: 8px;
}
.theme-btn {
  padding: 8px 18px; border-radius: 6px; cursor: pointer;
  font-size: 13px; font-weight: 500; border: 1px solid var(--border);
  background: var(--surface2); color: var(--text-muted);
  transition: all 0.15s;
}
.theme-btn:hover { border-color: var(--accent); color: var(--text); }
.theme-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── AUTH ── */
#auth-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
}
.auth-box {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 44px 40px;
  width: min(400px, calc(100vw - 32px));
  text-align: center;
  box-shadow: 0 40px 100px rgba(0,0,0,0.5);
}
.auth-logo {
  width: 64px; height: 64px;
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
}
.auth-logo img {
  width: 100%; height: 100%; object-fit: contain;
}
/* Legacy hex support — hidden if logo img is used */
.auth-hex {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--brand-deep-blue), var(--brand-blue));
  clip-path: polygon(50% 0%,100% 25%,100% 75%,50% 100%,0% 75%,0% 25%);
  margin: 0 auto 16px;
  display: none; /* Replaced by .auth-logo */
  align-items: center; justify-content: center;
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-weight: 700; font-size: 20px; color: white;
}
.auth-title {
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-weight: 700; font-size: 26px;
  letter-spacing: 3px; text-transform: uppercase;
  margin-bottom: 4px; color: var(--text);
}
.auth-sub {
  font-size: 13px; color: var(--text-muted); margin-bottom: 28px;
  font-family: 'Inter', Aptos, 'Segoe UI', system-ui, sans-serif;
  letter-spacing: 0.5px;
}
.auth-error { color: var(--red); font-size: 12px; margin-top: 10px; display: none; }
.auth-toggle { font-size: 11px; color: var(--text-muted); margin-top: 14px; cursor: pointer; }
.auth-toggle span { color: var(--accent2); text-decoration: underline; }

/* ── HEADER ── */
header {
  background: var(--brand-deep-blue);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 54px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 90;
}
.logo { display: flex; align-items: center; gap: 11px; }
.logo-icon {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-icon img { width: 100%; height: 100%; object-fit: contain; }
/* Legacy hex — hidden when logo-icon is used */
.logo-hex {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--brand-deep-blue), var(--brand-blue));
  clip-path: polygon(50% 0%,100% 25%,100% 75%,50% 100%,0% 75%,0% 25%);
  display: none; /* Replaced by .logo-icon */
  align-items: center; justify-content: center;
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-weight: 700; font-size: 11px; color: white;
}
.logo-name {
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-weight: 700; font-size: 17px; letter-spacing: 3px; text-transform: uppercase;
  color: #FFFFFF;
}
.logo-tag {
  font-family: 'Inter', Aptos, 'Segoe UI', system-ui, sans-serif;
  font-size: 9px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-muted); margin-top: 1px;
}
.header-right { display: flex; align-items: center; gap: 12px; }
.clock {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--text-muted); letter-spacing: 1px;
}
.role-pill {
  font-family: 'JetBrains Mono', monospace; font-size: 9px;
  text-transform: uppercase; letter-spacing: 1.5px;
  padding: 3px 9px; border-radius: 20px;
}
.role-admin { background: rgba(17,84,143,0.25); color: #4a8ec8; }
.role-readonly { background: rgba(123,163,196,0.15); color: var(--text-muted); }

/* ── TABS ── */
.tabs {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex; gap: 0;
  overflow-x: auto; scrollbar-width: none;
  position: sticky; top: 0; z-index: 100;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 11px 16px;
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-weight: 600; font-size: 12px;
  letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--text-muted); cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: all 0.15s;
  white-space: nowrap;
}
.tab:hover { color: var(--text-dim); }
.tab.active { color: var(--accent2); border-bottom-color: var(--accent); }

/* ── MAIN ── */
main { padding: 20px 24px; max-width: 1800px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; }

/* ── BUTTONS ── */
.btn {
  padding: 7px 15px; border-radius: 6px;
  font-family: 'Inter', Aptos, 'Segoe UI', system-ui, sans-serif;
  font-weight: 600; font-size: 13px;
  cursor: pointer; border: none; transition: all 0.15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: #0e4778; }
.btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border2); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-danger { background: var(--red-bg); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.2); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }

/* ── STATS BAR ── */
.stats-bar { display: grid; grid-template-columns: repeat(5,1fr); gap: 10px; margin-bottom: 20px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 16px;
}
.stat-label {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text-muted); margin-bottom: 6px;
}
.stat-value {
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-weight: 700; font-size: 36px; line-height: 1;
}
.stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* ── SECTION HEADER ── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-title {
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-weight: 700; font-size: 15px;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim);
}

/* ── CURRENCY TABLE ── */
.currency-table-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; overflow: clip; margin-bottom: 24px;
}
.table-sticky-head {
  position: sticky; top: 54px; z-index: 5;
  overflow: hidden; background: var(--surface2);
  border-bottom: 1px solid var(--border2);
}
.table-sticky-head table { border-collapse: collapse; width: 100%; }
.thead-sizer { visibility: hidden; }
.table-body-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--surface2); border-bottom: 1px solid var(--border2); }
th {
  padding: 9px 12px; text-align: left;
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-size: 10px;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); font-weight: 700; white-space: nowrap;
}
th:first-child, td:first-child { padding-left: 18px; }
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(17,84,143,0.06); }
td { padding: 12px 12px; vertical-align: middle; }
.pilot-name {
  font-weight: 700; font-size: 15px;
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
}
.pilot-role {
  font-size: 12px; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace; margin-top: 1px;
}
.check-cell { display: flex; flex-direction: column; gap: 2px; min-width: 95px; }
td.check-cell-clickable {
  cursor: pointer; transition: background 0.12s;
  border-radius: 0;
}
td.check-cell-clickable:hover { background: var(--accent-glow); }
.check-date { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 500; }
.check-expiry { font-size: 12px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 4px;
  font-size: 10px; font-family: 'JetBrains Mono', monospace;
  font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  margin-top: 2px; width: fit-content;
}
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-expired { background: var(--red-bg); color: var(--red); border: 1px solid rgba(239,68,68,0.25); }
.badge-none { background: var(--surface2); color: var(--text-muted); }
.badge-na { background: transparent; color: var(--border); font-size: 10px; }
.dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; display: inline-block; }
.check-na { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-muted); }
.booked-tag {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--booked-bg); color: var(--booked);
  border: 1px solid rgba(6,182,212,0.2);
  padding: 1px 6px; border-radius: 3px;
  font-size: 9px; font-family: 'JetBrains Mono', monospace;
  margin-top: 2px; width: fit-content;
}
.booked-tag-overdue {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--amber-bg); color: var(--amber);
  border: 1px solid rgba(245,158,11,0.3);
  padding: 1px 6px; border-radius: 3px;
  font-size: 9px; font-family: 'JetBrains Mono', monospace;
  margin-top: 2px; width: fit-content;
  cursor: pointer; transition: background 0.15s;
}
.booked-tag-overdue:hover { background: rgba(245,158,11,0.2); }

/* ── BOOKING REVIEW MODAL ── */
.br-summary {
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 8px; padding: 14px; margin-bottom: 16px;
}
.br-summary-title {
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--amber); margin-bottom: 10px;
}
.br-summary-row {
  display: flex; gap: 16px; margin-bottom: 4px; font-size: 13px;
}
.br-summary-label {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--text-muted); min-width: 70px;
}
.br-summary-value {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text);
}
.br-related-title {
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--text-muted); margin-bottom: 8px;
}
.br-bookings-list {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 220px; overflow-y: auto; padding: 2px;
  border: 1px solid var(--border2); border-radius: 6px; background: var(--surface);
  margin-bottom: 16px;
}
.br-bookings-list::-webkit-scrollbar { width: 6px; }
.br-bookings-list::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
.br-select-actions {
  display: flex; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--border);
}
.br-select-action {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--accent2);
  cursor: pointer; background: none; border: none; padding: 0; text-decoration: underline;
}
.br-select-action:hover { color: var(--text); }
.br-booking-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; cursor: pointer; border-radius: 4px; transition: all 0.12s;
}
.br-booking-item:hover { background: var(--surface2); }
.br-booking-item.selected { background: var(--accent-glow); }
.br-booking-item.selected .br-check-box { background: var(--accent); border-color: var(--accent); }
.br-booking-item.selected .br-check-box::after { display: block; content: '\2713'; color: #fff; font-size: 11px; font-weight: 700; line-height: 1; }
.br-check-box {
  width: 16px; height: 16px; border-radius: 3px; border: 2px solid var(--border2);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: all 0.15s;
}
.br-check-box::after { content: ''; display: none; }
.br-booking-name {
  font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text);
  user-select: none;
}
.br-booking-check {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted);
  user-select: none;
}
.br-booking-loc {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted);
  margin-left: auto; user-select: none;
}
.br-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
}

/* Gantt overdue booked bar */
.gantt-bar-booked-overdue {
  background: repeating-linear-gradient(
    60deg, rgba(245,158,11,0.18) 0px, rgba(245,158,11,0.18) 4px,
    rgba(245,158,11,0.06) 4px, rgba(245,158,11,0.06) 8px
  );
  border: 1px dashed rgba(245,158,11,0.55);
}

/* ── GANTT CHART ── */
.gantt-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; overflow: clip; margin-bottom: 24px;
}
.gantt-header {
  background: var(--surface2); border-bottom: 1px solid var(--border2);
  padding: 12px 18px; display: flex; align-items: center; justify-content: space-between;
}
.gantt-title {
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-weight: 700; font-size: 14px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text-dim);
}
.gantt-controls { display: flex; gap: 8px; align-items: center; }
.gantt-sticky-header-wrap {
  position: sticky; top: 54px; z-index: 10;
  overflow: hidden; background: var(--surface2);
  border-bottom: 1px solid var(--border2);
}
.gantt-scroll-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; position: relative; z-index: 1; }
.gantt-inner { min-width: 900px; }

/* Timeline header */
.gantt-timeline-header {
  display: flex; background: var(--surface2);
}
.gantt-label-col {
  width: 240px; min-width: 240px;
  border-right: 1px solid var(--border2);
  padding: 6px 12px;
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted);
  background: var(--surface2);
}
.gantt-months { flex: 1; display: flex; }
.gantt-month {
  flex: 1; min-width: 0; text-align: center;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--text-muted); padding: 7px 2px;
  border-right: 1px solid var(--border);
  white-space: nowrap; overflow: hidden;
  letter-spacing: 0.5px;
}
.gantt-month.current { color: var(--accent2); background: rgba(17,84,143,0.08); }

/* Pilot group */
.gantt-pilot-group {}
.gantt-pilot-hidden .gantt-pilot-header { opacity: 0.5; }
.gantt-pilot-hidden .gantt-check-rows-wrap { opacity: 0.4; }
.gantt-pilot-header {
  display: flex; align-items: center;
  background: var(--surface2); border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border2);
  cursor: pointer; user-select: none;
}
.gantt-pilot-label {
  width: 240px; min-width: 240px;
  border-right: 1px solid var(--border2);
  padding: 8px 12px;
  display: flex; flex-direction: column; gap: 1px;
}
.gantt-pilot-name {
  font-weight: 700; font-size: 14px;
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
}
.gantt-pilot-role {
  font-size: 11px; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}
.gantt-pilot-spacer { flex: 1; }
.gantt-pilot-collapse-btn {
  width: 28px; height: 28px; margin-right: 8px;
  background: var(--surface3); border: 1px solid var(--border2);
  border-radius: 5px; color: var(--text-muted); font-size: 13px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background 0.15s, color 0.15s;
}
.gantt-pilot-collapse-btn:hover { background: var(--border); color: var(--text); }
.gantt-check-rows-wrap { overflow: hidden; }
.gantt-check-rows-wrap.collapsed { display: none; }
.pilot-hidden-badge {
  display: inline-block; font-size: 9px; font-family: 'JetBrains Mono', monospace;
  background: rgba(123,163,196,0.15); color: var(--text-muted);
  border: 1px solid var(--border2); border-radius: 3px;
  padding: 1px 5px; margin-left: 6px; vertical-align: middle; letter-spacing: 0.04em;
}
.pilot-ifsp-badge {
  display: inline-block; font-size: 9px; font-family: 'JetBrains Mono', monospace;
  background: rgba(6,182,212,0.12); color: #06b6d4;
  border: 1px solid rgba(6,182,212,0.3); border-radius: 3px;
  padding: 1px 5px; margin-left: 6px; vertical-align: middle; letter-spacing: 0.04em;
}
tr.pilot-hidden-row td { opacity: 0.45; }
tr.pilot-hidden-row { border-top: 1px solid var(--border2); }
.hidden-section-divider {
  text-align: left; padding: 6px 12px;
  font-size: 10px; font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted); letter-spacing: 0.08em;
  background: var(--bg); border-top: 1px dashed var(--border2);
}
.btn-hide { background: rgba(123,163,196,0.10); color: var(--text-muted); border: 1px solid var(--border2); }
.btn-hide:hover { background: rgba(123,163,196,0.20); color: var(--text); }
.btn-unhide { background: rgba(17,84,143,0.12); color: var(--accent2); border: 1px solid rgba(17,84,143,0.3); }
.btn-unhide:hover { background: rgba(17,84,143,0.22); }
.show-hidden-toggle {
  font-size: 11px; font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted); background: none; border: 1px solid var(--border2);
  border-radius: 5px; padding: 3px 10px; cursor: pointer; margin-left: 10px;
  transition: color 0.15s, border-color 0.15s;
}
.show-hidden-toggle:hover { color: var(--text); border-color: var(--border); }

/* Check rows */
.gantt-check-row {
  display: flex; align-items: center;
  border-bottom: 1px solid var(--border);
  min-height: 36px;
}
.gantt-check-row:last-child { border-bottom: none; }
.gantt-check-label {
  width: 240px; min-width: 240px;
  border-right: 1px solid var(--border2);
  padding: 6px 8px 6px 20px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--text-muted); display: flex; align-items: center; gap: 6px;
  white-space: nowrap; overflow: hidden;
}
.gantt-check-label.clickable {
  cursor: pointer; transition: background 0.15s, color 0.15s;
}
.gantt-check-label.clickable:hover {
  background: var(--surface2); color: var(--accent2);
  border-radius: 0;
}
.gantt-check-label.clickable:hover .check-type-dot {
  box-shadow: 0 0 0 2px var(--accent2);
}
.gantt-check-label .check-type-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.gantt-label-badge {
  margin-left: auto; flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
  letter-spacing: 0.5px; border-radius: 3px; padding: 1px 5px;
  white-space: nowrap; vertical-align: middle;
}
.gantt-label-badge-expired { background: rgba(220,38,38,0.15); border: 1px solid rgba(220,38,38,0.4); color: var(--red); }
.gantt-label-badge-red { background: rgba(220,38,38,0.10); border: 1px solid rgba(220,38,38,0.25); color: var(--red); }
.gantt-label-badge-amber { background: rgba(245,158,11,0.10); border: 1px solid rgba(245,158,11,0.25); color: var(--amber); }
.gantt-label-badge-yellow { background: rgba(234,179,8,0.10); border: 1px solid rgba(234,179,8,0.25); color: #eab308; }
.gantt-label-badge-green { background: rgba(16,185,129,0.10); border: 1px solid rgba(16,185,129,0.25); color: var(--green); }
.gantt-track { flex: 1; position: relative; height: 36px; overflow: visible; }
.gantt-track-bg { position: absolute; inset: 0; display: flex; }
.gantt-track-month {
  flex: 1; border-right: 1px solid rgba(17,84,143,0.06);
  height: 100%;
}
.gantt-track-month.current-month { background: rgba(17,84,143,0.06); }

/* Bars */
.gantt-bar {
  position: absolute; height: 18px; top: 9px;
  border-radius: 3px; cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
  display: flex; align-items: center; overflow: hidden;
  z-index: 2;
}
.gantt-bar:hover { filter: brightness(1.2); transform: scaleY(1.1); }
.gantt-bar-current:hover { z-index: 2; } /* stay below overlays on hover */
.gantt-bar-label {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  padding: 0 5px; white-space: nowrap; overflow: hidden;
  color: rgba(255,255,255,0.85); font-weight: 500;
}
.gantt-bar-count {
  font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 600;
  color: rgba(255,255,255,0.7); width: 100%; text-align: center;
  pointer-events: none; white-space: nowrap; overflow: hidden;
}
.gantt-bar-current { background: linear-gradient(90deg, #059669, #10b981); }
.gantt-bar-superseded { background: linear-gradient(90deg, #059669, #10b981); opacity: 0.3; }
.gantt-bar-renewal {
  background: repeating-linear-gradient(
    -45deg,
    rgba(0,60,30,0.55),
    rgba(0,60,30,0.55) 3px,
    transparent 3px,
    transparent 6px
  );
  z-index: 3; pointer-events: auto;
}
.gantt-bar-booked, .gantt-bar-booked-overdue { z-index: 15 !important; }
.gantt-bar-grace {
  background: repeating-linear-gradient(
    -45deg,
    rgba(234,179,8,0.55),
    rgba(234,179,8,0.55) 4px,
    rgba(30,30,50,0.45) 4px,
    rgba(30,30,50,0.45) 9px
  );
  border: 1px solid rgba(234,179,8,0.5);
  border-radius: 2px;
  opacity: 0.85;
}
.gantt-bar-expired { background: #1a2e42; border: 1px solid #2a4560; }
.gantt-bar-booked {
  background: repeating-linear-gradient(
    60deg, rgba(6,182,212,0.45) 0px, rgba(6,182,212,0.45) 4px,
    rgba(6,182,212,0.20) 4px, rgba(6,182,212,0.20) 8px
  );
  border: 2px solid rgba(6,182,212,0.8);
}
.gantt-bar-booked .gantt-bar-label { color: rgba(255,255,255,0.95); font-weight: 700; }
.gantt-bar-future-expired { background: repeating-linear-gradient(45deg,#0f1f30,#0f1f30 3px,#132a40 3px,#132a40 6px); border: 1px solid #1a3550; }

/* Today line */
.gantt-today-line {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: rgba(239,68,68,0.7);
  z-index: 20; pointer-events: none;
}
/* TODAY label only in the header row, not on each check row */
.gantt-header-today {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: rgba(239,68,68,0.85);
  z-index: 20; pointer-events: none;
}
.gantt-header-today::before {
  content: 'TODAY';
  position: absolute; bottom: -18px; left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
  color: var(--red); letter-spacing: 1.5px; white-space: nowrap;
  background: var(--surface2); padding: 1px 5px; border-radius: 2px;
  border: 1px solid rgba(239,68,68,0.3);
}

/* Gantt legend */
.gantt-legend {
  padding: 10px 18px; display: flex; gap: 18px; align-items: center;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.legend-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-muted);
  font-family: 'Inter', Aptos, 'Segoe UI', system-ui, sans-serif;
}
.legend-swatch { width: 20px; height: 10px; border-radius: 2px; }

/* Tooltip */
.gantt-tooltip {
  position: fixed;
  background: var(--surface3); border: 1px solid var(--border2);
  border-radius: 8px; padding: 10px 14px;
  font-size: 12px; z-index: 200; pointer-events: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  max-width: 240px; display: none;
}
.gantt-tooltip.visible { display: block; }
.tt-title {
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-weight: 700; font-size: 14px; letter-spacing: 0.5px;
  margin-bottom: 6px; text-transform: uppercase;
}
.tt-row { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 2px; }
.tt-key { color: var(--text-muted); font-size: 11px; }
.tt-val { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text); }

/* ── ALERTS ── */
.alerts-panel { display: flex; flex-direction: column; gap: 7px; margin-bottom: 22px; }
.alert-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 11px 16px;
  display: flex; align-items: center; gap: 12px; border-left: 3px solid;
}
.alert-item.critical { border-left-color: var(--red); }
.alert-item.warning { border-left-color: var(--amber); }
.alert-item.resolving { border-left-color: #3b82f6; opacity: 0.85; }
.alert-item.resolving .alert-pilot { color: var(--text-muted); }
.alert-text { flex: 1; }
.alert-pilot {
  font-weight: 700; font-size: 14px;
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
}
.alert-detail { font-size: 13px; color: var(--text-muted); margin-top: 1px; }
.alert-days {
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}

/* Alert summary bar */
.alert-summary-bar {
  display: flex; align-items: center; gap: 18px;
  padding: 10px 14px; margin-bottom: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px;
}
.alert-summary-item {
  display: flex; align-items: center; gap: 7px;
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-weight: 600; font-size: 13px; color: var(--text);
}
.alert-summary-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.alert-summary-actions { margin-left: auto; display: flex; gap: 6px; }

/* Alert groups (per pilot) */
.alert-group {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden; border-left: 3px solid var(--border);
}
.alert-group.critical { border-left-color: var(--red); }
.alert-group.warning { border-left-color: var(--amber); }
.alert-group.resolving { border-left-color: #3b82f6; }
.alert-group-header {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; cursor: pointer; user-select: none;
}
.alert-group-header:hover { background: rgba(255,255,255,0.03); }
.alert-caret { font-size: 11px; color: var(--text-muted); width: 10px; flex-shrink: 0; }
.alert-group-name { flex: 1; }
.alert-group-pilot {
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-weight: 700; font-size: 14px;
}
.alert-group-role { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.alert-group-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.alert-chip {
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-weight: 600; font-size: 11px; letter-spacing: 0.3px;
  padding: 3px 9px; border-radius: 12px;
  display: inline-flex; align-items: center; gap: 4px;
}
.alert-chip.chip-critical { background: var(--red-bg); color: var(--red); }
.alert-chip.chip-warning { background: var(--amber-bg); color: var(--amber); }
.alert-chip.chip-resolving { background: rgba(59,130,246,0.12); color: #3b82f6; }
.alert-group-body {
  flex-direction: column; gap: 6px;
  padding: 4px 12px 12px 12px;
  border-top: 1px solid var(--border);
}
.alert-group-body .alert-item { background: var(--bg); }

/* ── MODAL OVERLAY ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(4,28,50,0.80); z-index: 200;
  align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 14px; width: min(1100px, 95vw); max-width: 95vw;
  box-shadow: 0 32px 100px rgba(0,0,0,0.6);
  margin: auto;
}
.modal-header {
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-title {
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-weight: 700; font-size: 20px; letter-spacing: 1px; text-transform: uppercase;
}
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; padding: 4px; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 24px; }
.modal-tab {
  padding: 9px 14px; font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-weight: 600; font-size: 13px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.15s;
}
.modal-tab:hover { color: var(--text-dim); }
.modal-tab.active { color: var(--accent2); border-bottom-color: var(--accent); }
.modal-pane { display: none; padding: 20px 24px; }
.modal-pane.active { display: block; }
.modal-footer { padding: 14px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ── FORM ELEMENTS ── */
.form-row { margin-bottom: 16px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 16px; }
label {
  display: block; font-size: 10px;
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted);
  margin-bottom: 5px; font-weight: 700;
}
input[type="text"], input[type="date"], input[type="password"],
input[type="url"], select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border2);
  border-radius: 6px; padding: 8px 11px; color: var(--text);
  font-family: 'Inter', Aptos, 'Segoe UI', system-ui, sans-serif;
  font-size: 13px; outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 72px; line-height: 1.5; font-size: 14px; }
select option { background: var(--surface2); }
.expiry-preview {
  padding: 8px 11px; background: var(--bg); border: 1px solid var(--border2);
  border-radius: 6px; font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--text-dim); min-height: 36px; display: flex; align-items: center;
}
.form-section {
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-weight: 700; font-size: 11px;
  letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted);
  padding: 14px 0 8px; border-top: 1px solid var(--border); margin: 16px 0 12px;
}
.form-section:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
.rule-hint {
  background: var(--accent-glow); border: 1px solid rgba(17,84,143,0.15);
  border-radius: 5px; padding: 8px 12px; font-size: 11px;
  color: var(--text-dim); line-height: 1.6; margin-bottom: 12px;
}

/* ── DASHBOARD ACTION BUTTONS ── */
.dash-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 0 0 8px;
}

/* ── QUICK LOG MODAL ── */
.ql-crew-grid {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 180px; overflow-y: auto; padding: 2px;
  border: 1px solid var(--border2); border-radius: 6px; background: var(--surface);
}
.ql-crew-grid::-webkit-scrollbar { width: 6px; }
.ql-crew-grid::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
.ql-crew-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; cursor: pointer; border-radius: 4px; transition: all 0.12s;
}
.ql-crew-item:hover { background: var(--surface2); }
.ql-crew-item.selected { background: var(--accent-glow); }
.ql-crew-item.selected .ql-check-box { background: var(--accent); border-color: var(--accent); }
.ql-crew-item.selected .ql-check-box::after { display: block; content: '\2713'; color: #fff; font-size: 11px; font-weight: 700; line-height: 1; }
.ql-crew-item .ql-check-box { flex-shrink: 0; }
.ql-crew-name {
  font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text);
  user-select: none;
}
.ql-crew-role {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-muted);
  margin-left: auto; user-select: none;
}
.ql-select-actions {
  display: flex; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--border);
}
.ql-select-action {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--accent2);
  cursor: pointer; background: none; border: none; padding: 0; text-decoration: underline;
}
.ql-select-action:hover { color: var(--text); }
.ql-toggle-wrap {
  display: flex; gap: 0; border-radius: 6px; overflow: hidden;
  border: 1px solid var(--border2);
}
.ql-toggle {
  flex: 1; padding: 8px 16px; border: none; background: var(--surface2);
  color: var(--text-muted); font-family: 'JetBrains Mono', monospace;
  font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.ql-toggle:hover { color: var(--text-dim); }
.ql-toggle.active { background: var(--accent); color: #fff; }
.ql-checks-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.ql-check-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 6px; padding: 8px 12px; cursor: pointer; transition: all 0.15s;
}
.ql-check-item:hover { border-color: var(--accent); }
.ql-check-item.selected { border-color: var(--accent); background: var(--accent-glow); }
.ql-check-item.disabled { opacity: 0.3; cursor: not-allowed; pointer-events: none; }
.ql-check-box {
  width: 16px; height: 16px; border-radius: 3px; border: 2px solid var(--border2);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: all 0.15s;
}
.ql-check-item.selected .ql-check-box {
  background: var(--accent); border-color: var(--accent);
}
.ql-check-box::after { content: ''; display: none; }
.ql-check-item.selected .ql-check-box::after {
  display: block; content: '\2713'; color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
}
.ql-check-label {
  font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text);
  user-select: none;
}

/* ── HISTORY TABLE ── */
.history-table-wrap {
  border: 1px solid var(--border2); border-radius: 8px;
  overflow-x: auto; overflow-y: visible;
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}
.history-table { table-layout: auto; width: 100%; min-width: 750px; border-collapse: collapse; }
.history-table thead tr { background: var(--surface2); }
.history-table th {
  padding: 8px 10px; font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-muted); text-align: left; font-weight: 700;
}
.history-table td { padding: 10px 10px; border-top: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.history-table tr:hover td { background: rgba(17,84,143,0.04); }
.history-date { font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.history-location { color: var(--text-dim); font-size: 11px; }
.history-notes { color: var(--text-muted); font-size: 11px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-delete { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 2px 5px; border-radius: 3px; font-size: 13px; }
.history-delete:hover { color: var(--red); background: var(--red-bg); }
.history-edit-btn {
  background: none; border: none; color: var(--accent2); cursor: pointer;
  font-size: 11px; padding: 2px 6px; border-radius: 3px; opacity: 0.7;
  font-family: 'JetBrains Mono', monospace;
}
.history-edit-btn:hover { opacity: 1; background: var(--accent-glow); }
.history-row-editing { background: rgba(17,84,143,0.08) !important; }
.history-edit-input {
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  background: var(--surface3); border: 1px solid var(--border2);
  color: var(--text); border-radius: 4px; padding: 3px 6px;
}
.history-edit-input:focus { border-color: var(--accent); outline: none; }
.history-edit-input-date { width: 128px; }
.history-edit-input-text { width: 110px; }
.history-edit-input-url  { width: 160px; }
.history-edit-save {
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  font-size: 11px; padding: 3px 8px; border-radius: 3px; white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
}
.history-edit-save:hover { opacity: 0.85; }
.history-action-btns { display: flex; gap: 3px; align-items: center; }

/* Add history entry inline form */
.add-history-form {
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 8px; padding: 14px; margin-bottom: 16px;
}
.add-history-title {
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text-muted); margin-bottom: 12px; font-weight: 700;
}

/* Booked next check */
.booked-section {
  background: var(--booked-bg); border: 1px solid rgba(6,182,212,0.2);
  border-radius: 8px; padding: 14px; margin-bottom: 16px;
}
.booked-title {
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--booked); margin-bottom: 12px; font-weight: 700;
}

/* Booking cards (pilot modal — Bookings tab) */
.booking-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.booking-card {
  background: var(--booked-bg); border: 1px solid rgba(6,182,212,0.25);
  border-radius: 8px; padding: 14px;
  transition: box-shadow 0.3s, border-color 0.3s;
}
.booking-card.booking-card-flash {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.booking-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.booking-card-summary {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1;
}

/* Audit filters row (Admin tab) */
.audit-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.audit-filters input, .audit-filters select {
  padding: 6px 10px; background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 6px; color: var(--text); font-size: 12px; font-family: 'JetBrains Mono', monospace;
}

/* Audit trail timeline (pilot modal History tab + Admin audit log) */
.audit-timeline { display: flex; flex-direction: column; gap: 16px; margin-bottom: 16px; }
.audit-day-label {
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text-muted); font-weight: 700; padding: 4px 0 8px;
  border-bottom: 1px solid var(--border2); margin-bottom: 6px;
}
.audit-day-rows { display: flex; flex-direction: column; gap: 6px; }
.audit-row {
  display: grid; grid-template-columns: 60px 1fr; gap: 10px;
  padding: 8px 12px; background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 6px; font-size: 12px;
}
.audit-row-time { color: var(--text-muted); font-family: 'JetBrains Mono', monospace; font-size: 11px; padding-top: 2px; }
.audit-row-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.audit-row-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.audit-row-actor { font-size: 11px; color: var(--text-dim); }
.audit-action-badge {
  display: inline-block; padding: 1px 7px; border-radius: 4px;
  font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase;
}
.audit-action-create { background: rgba(16,185,129,0.15); color: #10b981; border: 1px solid rgba(16,185,129,0.3); }
.audit-action-update { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }
.audit-action-delete { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.audit-entity { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-muted); }
.audit-path-label { color: var(--text); font-weight: 500; flex: 1; min-width: 0; }
.audit-source-badge {
  display: inline-block; padding: 1px 6px; border-radius: 3px;
  background: var(--surface); color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: 0.3px;
  text-transform: uppercase; border: 1px solid var(--border2);
}
.audit-row-values { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.audit-value { display: flex; gap: 8px; align-items: flex-start; font-size: 11px; }
.audit-value-label {
  flex-shrink: 0; width: 44px;
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-muted); padding-top: 2px;
}
.audit-value code {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  background: var(--surface); padding: 2px 6px; border-radius: 3px;
  border: 1px solid var(--border); color: var(--text-dim);
  word-break: break-word; white-space: pre-wrap; flex: 1; min-width: 0;
}
.audit-value-old code { color: #f87171; }
.audit-value-new code { color: #10b981; }

/* Per-check-pane bookings summary */
.check-bookings-empty {
  font-size: 12px; color: var(--text-muted); padding: 10px 14px;
  border: 1px dashed var(--border2); border-radius: 6px; margin-bottom: 16px;
}
.check-bookings-empty a { color: var(--accent2); text-decoration: underline; cursor: pointer; }
.check-bookings-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.check-booking-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 12px; background: var(--booked-bg);
  border: 1px solid rgba(6,182,212,0.25); border-radius: 6px;
}
.check-booking-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 12px; }
.check-booking-date { font-family: 'JetBrains Mono', monospace; font-weight: 600; color: var(--text); }
.check-booking-loc { color: var(--text-dim); }
.check-booking-notes { color: var(--text-muted); font-style: italic; }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-icon { font-size: 36px; margin-bottom: 10px; }
.empty-title {
  font-family: 'Gill Sans MT', 'Gill Sans', Calibri, sans-serif;
  font-size: 16px; letter-spacing: 1px; text-transform: uppercase;
  margin-bottom: 4px; color: var(--text-dim); font-weight: 700;
}
.empty-sub { font-size: 12px; }

/* ── SEARCH ── */
.search-wrap { position: relative; }
.search-wrap input { padding-left: 32px; width: 220px; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 13px; pointer-events: none; }

/* ── ALERTS OVERVIEW GRID ── */
.ov-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 11px; color: var(--text-muted); margin-bottom: 10px; align-items: center; }
.ov-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ov-legend-sq { width: 14px !important; height: 14px !important; min-width: 14px; min-height: 14px; border-radius: 3px; cursor: default !important; }
.ov-legend-note { color: var(--text-muted); font-size: 10px; opacity: 0.7; cursor: help; border-bottom: 1px dotted var(--text-muted); }
.ov-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.ov-table { border-collapse: separate; border-spacing: 0; width: 100%; font-family: 'JetBrains Mono', monospace; }
.ov-table th, .ov-table td { padding: 4px 4px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ov-table tbody tr:last-child td { border-bottom: none; }
.ov-section-head { font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-muted); padding: 8px 10px 4px !important; text-align: left; font-weight: 600; background: rgba(17,84,143,0.08); }
.ov-col-head { height: 110px; padding: 6px 0 !important; background: rgba(17,84,143,0.04); }
.ov-col-head-inner { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 10px; font-weight: 600; letter-spacing: 0.5px; color: var(--text-muted); white-space: nowrap; margin: 0 auto; }
.ov-name-head { min-width: 160px; text-align: left; background: rgba(17,84,143,0.04); padding: 8px 12px !important; font-size: 11px; color: var(--text-muted); font-weight: 600; letter-spacing: 1px; text-transform: uppercase; position: sticky; left: 0; z-index: 2; }
.ov-name-cell { min-width: 160px; padding: 8px 12px !important; text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; font-family: 'Inter', system-ui, sans-serif; }
.ov-pilot-name { font-size: 12px; font-weight: 600; color: var(--text); }
.ov-pilot-role { font-size: 10px; color: var(--text-muted); margin-top: 1px; }
.ov-group-divider { border-left: 1px solid var(--border2) !important; }
.ov-cell-wrap { text-align: center; padding: 3px 3px !important; }
.ov-cell { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: -0.3px; cursor: pointer; border: 1px solid transparent; transition: transform 0.08s ease, box-shadow 0.08s ease; }
.ov-cell:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,0.25); }
.ov-cell.ov-green    { background: rgba(16,185,129,0.12);  color: #10b981;       border-color: rgba(16,185,129,0.40); }
.ov-cell.ov-yellow   { background: rgba(250,204,21,0.16);  color: #facc15;       border-color: rgba(250,204,21,0.50); }
.ov-cell.ov-amber    { background: rgba(249,115,22,0.16);  color: #f97316;       border-color: rgba(249,115,22,0.55); }
.ov-cell.ov-red      { background: rgba(239,68,68,0.16);   color: #ef4444;       border-color: rgba(239,68,68,0.55); }
.ov-cell.ov-expired  { background: #ef4444;                color: #fff;          border-color: #ef4444; }
.ov-cell.ov-na,
.ov-cell.ov-none     { background: rgba(123,163,196,0.08); color: var(--text-muted); border-color: var(--border); cursor: default; }
.ov-cell.ov-na:hover,
.ov-cell.ov-none:hover { transform: none; box-shadow: none; }

/* ── PRINT ── */
@media print {
  header, .tabs, .stats-bar, .section-header .btn, .actions { display: none !important; }
  body { background: white; color: black; }
  .gantt-wrap, .currency-table-wrap { border: 1px solid #ccc; }
}

@media (max-width: 900px) {
  .stats-bar { grid-template-columns: repeat(3,1fr); }
  main { padding: 12px; }
}

@media (max-width: 600px) {
  header { padding: 0 12px; }
  .logo-tag { display: none; }
  .form-row-2,
  .form-row-3 { grid-template-columns: 1fr; }
  .modal-pane { padding: 14px 16px; }
  .modal-header { padding: 14px 16px 10px; }
  .modal-footer { padding: 10px 16px; }
  .modal-overlay { padding: 16px 8px; }
  .modal-tabs { padding: 0 16px; }
  .admin-panel { padding: 12px; }
  .admin-section { padding: 14px 16px; }
  .gantt-label-col,
  .gantt-pilot-label,
  .gantt-check-label { width: 160px; min-width: 160px; }
  .gantt-inner { min-width: 700px; }
}

@media (max-width: 500px) {
  main { padding: 8px; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .clock { display: none; }
  #user-display { display: none; }
}

@media (max-width: 1000px) {
  .gantt-month {
    writing-mode: vertical-rl;
    padding: 8px 6px;
  }
}

/* ── SPINNER ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── RECENCY ── */
.recency-mode-toggle { display: flex; gap: 4px; }
.recency-mode-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.recency-detail-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.rec-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.rec-card-title { font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.rec-card-count { font-size: 28px; font-weight: 700; line-height: 1; margin-bottom: 6px; }
.rec-card-expiry { font-size: 11px; font-family: 'JetBrains Mono', monospace; color: var(--text-dim); line-height: 1.6; }
.rec-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600; text-align: center; min-width: 60px; line-height: 1.4; }
.rec-badge-green { background: var(--green-bg); color: var(--green); }
.rec-badge-yellow { background: rgba(234,179,8,0.12); color: #eab308; }
.rec-badge-blue { background: rgba(56,189,248,0.12); color: #38bdf8; }
.rec-badge-amber { background: var(--amber-bg); color: var(--amber); }
.rec-badge-red { background: var(--red-bg); color: var(--red); }
.rec-badge-expired { background: var(--red-bg); color: var(--red); }
.recency-table { table-layout: fixed; width: 100%; }
.rec-col-crew { width: 14%; }
.recency-table th:not(:first-child) { text-align: center; }
.rec-summary-cell { text-align: center; }
.rec-summary-count { font-size: 13px; font-weight: 600; }
.rec-summary-expiry { font-size: 10px; font-family: 'JetBrains Mono', monospace; color: var(--text-dim); margin-top: 2px; }
.rec-flights-wrap { overflow-x: auto; }
.rec-flights-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.rec-flights-table th { background: var(--surface2); padding: 8px 10px; text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1; }
.rec-flights-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.rec-flights-table tr:hover td { background: var(--surface2); }
.upload-zone { position: relative; border: 2px dashed var(--border2); border-radius: 8px; padding: 24px; text-align: center; transition: all 0.2s; background: var(--surface2); }
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--accent); background: var(--accent-glow); }
.upload-zone-text { font-size: 13px; color: var(--text-dim); pointer-events: none; }
.upload-status { font-size: 12px; color: var(--text-muted); margin-top: 8px; font-family: 'JetBrains Mono', monospace; }
.manual-flight-form { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.form-grid-rec { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.form-group-rec label { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.form-group-rec input, .form-group-rec select { width: 100%; padding: 6px 8px; font-size: 12px; background: var(--surface2); color: var(--text); border: 1px solid var(--border2); border-radius: 4px; font-family: 'JetBrains Mono', monospace; }
.form-group-rec input:focus, .form-group-rec select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }
.recency-row { cursor: pointer; }
.recency-row:hover td { background: var(--surface2); }

/* Recency Gantt event markers */
.rec-gantt-event { position: absolute; width: 7px; height: 7px; top: 50%; margin-top: -3.5px;
  transform: rotate(45deg); border-radius: 1px; z-index: 16; cursor: pointer;
  background: var(--accent2); transition: transform 0.15s; pointer-events: auto; }
.rec-gantt-event:hover { transform: rotate(45deg) scale(1.5); box-shadow: 0 0 6px var(--accent2); }
/* Future flight: outline diamond */
.rec-gantt-event-future { background: transparent !important; border: 2px solid var(--accent2); width: 7px; height: 7px; }
.rec-gantt-event-future:hover { box-shadow: 0 0 6px currentColor; }
/* SIM flight: solid circle */
.rec-gantt-event-sim { transform: none; border-radius: 50%; margin-top: -3.5px; }
.rec-gantt-event-sim:hover { transform: scale(1.5); }
/* Future SIM: hollow circle */
.rec-gantt-event-future-sim { background: transparent !important; border: 2px solid; border-radius: 50%; transform: none; }
.rec-gantt-event-future-sim:hover { transform: scale(1.5); box-shadow: 0 0 6px currentColor; }
/* Future/planned bar pattern */
.gantt-bar-future { background-image: repeating-linear-gradient(135deg, transparent, transparent 3px, rgba(255,255,255,0.15) 3px, rgba(255,255,255,0.15) 6px); }
/* Legend swatch for planned pattern */
.gantt-swatch-future { background: #22c55e; background-image: repeating-linear-gradient(135deg, transparent, transparent 3px, rgba(255,255,255,0.15) 3px, rgba(255,255,255,0.15) 6px); }
.rec-gantt-label-info { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.rec-gantt-label-count { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-dim); white-space: nowrap; }

/* Future Flights Management */
.ff-group { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 12px; overflow: hidden; }
.ff-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--surface2); border-bottom: 1px solid var(--border); }
.ff-header-info { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ff-date { font-weight: 700; font-size: 13px; }
.ff-route { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--accent2); }
.ff-flight { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-muted); }
.ff-type { font-size: 11px; color: var(--text-dim); }
.ff-crew-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ff-crew-table th { padding: 6px 8px; text-align: left; font-size: 10px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.ff-crew-row td { padding: 4px 8px; border-bottom: 1px solid var(--border); }
.ff-crew-row:hover td { background: var(--surface2); }
.ff-input { background: var(--surface2); color: var(--text); border: 1px solid var(--border2); border-radius: 3px; font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.ff-input:focus { outline: none; border-color: var(--accent); }
.ff-num { width: 42px; padding: 2px 4px; text-align: center; }
.ff-num-set { background: rgba(34,197,94,0.15) !important; border-color: rgba(34,197,94,0.4) !important; color: #22c55e !important; }
.ff-num-warn { background: rgba(245,158,11,0.15) !important; border-color: rgba(245,158,11,0.5) !important; color: #f59e0b !important; }
.ff-select { padding: 2px 4px; }
.ff-time { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-muted); }
.ff-night, .ff-day { font-size: 12px; cursor: help; }
.ff-rec-icon { font-size: 14px; margin-left: 1px; cursor: help; vertical-align: middle; font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 20; }
.ff-training-group { border-left: 3px solid #8b5cf6; }
.ff-training-header { background: rgba(139,92,246,0.06) !important; }
.ff-training-badge { display: inline-block; padding: 1px 8px; border-radius: 3px; font-size: 10px; font-weight: 700; letter-spacing: 0.5px; background: rgba(139,92,246,0.15); color: #8b5cf6; margin-left: 8px; }

/* ── PLANNING TAB ── */
.planning-check-badge { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.3px; font-family: 'JetBrains Mono', monospace; white-space: nowrap; }
.planning-impact-badge { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 9px; font-weight: 700; letter-spacing: 0.5px; background: rgba(59,130,246,0.15); color: #3b82f6; font-family: 'JetBrains Mono', monospace; }
.planning-sim-badge { display: inline-block; padding: 1px 8px; border-radius: 3px; font-size: 10px; font-weight: 700; letter-spacing: 0.5px; background: rgba(139,92,246,0.15); color: #8b5cf6; }
