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

:root {
  --bg: #eef1ee;
  --surface: #ffffff;
  --surface-2: #f5f7f4;
  --border: #dde3dd;
  --ink: #16211c;
  --ink-muted: #5c6a62;
  --accent: #146058;
  --accent-dark: #0e453f;
  --accent-soft: #e1efec;
  --accent-ink: #ffffff;
  --gold: #b8862f;
  --gold-soft: #f6ecd7;
  --danger: #ae2a1f;
  --danger-soft: #fbeae8;
  --good: #2c7a4f;
  --good-soft: #e3f1e8;
  --warn: #a86a1f;
  --warn-soft: #f5e9d6;
  --shadow-sm: 0 1px 2px rgba(16, 28, 22, 0.05);
  --shadow-md: 0 1px 2px rgba(16, 28, 22, 0.05), 0 10px 28px -14px rgba(16, 28, 22, 0.22);
  --radius: 10px;

  /* Title bar only — sky-and-cloud, distinct from the green/gold accent used
     everywhere else in the app (buttons, badges, stat cards stay as they were). */
  --sky-deep: #4A9BD1;
  --sky-mid: #9FD3EC;
  --sky-cloud: #F2FAFD;
  --sky-ink: #0B3654;
  --sky-ink-muted: #3D6E8F;
  --star-gold: #D9A62B;
  --purple: #6B46C1;
  --purple-soft: #EDE7FB;
  --teal: #1B7A85;
  --teal-soft: #E1F1F2;
  --orange: #C1601F;
  --orange-soft: #FBE9DC;

  /* Auth page (login/register) — dark navy, its own visual identity separate
     from the light in-app theme, scoped entirely under .auth-page. */
  --auth-bg-1: #050D1F;
  --auth-bg-2: #0B1E3D;
  --auth-bg-3: #14315E;
  --auth-card-bg: rgba(6, 15, 32, 0.92);
  --auth-card-border: rgba(255, 255, 255, 0.16);
  --auth-text: #FFFFFF;
  --auth-text-muted: #C3D3EC;
  --auth-input-bg: rgba(255, 255, 255, 0.09);
  --auth-input-border: rgba(255, 255, 255, 0.22);
  --auth-input-border-focus: #6BB6E8;
  --auth-blue-1: #3B82F6;
  --auth-blue-2: #1D4ED8;
  --auth-text-outline:
    -1px -1px 2px rgba(0, 0, 0, 0.85), 1px -1px 2px rgba(0, 0, 0, 0.85),
    -1px 1px 2px rgba(0, 0, 0, 0.85), 1px 1px 2px rgba(0, 0, 0, 0.85),
    0 2px 10px rgba(0, 0, 0, 0.65);

  --icon-chart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='20' x2='18' y2='10'/%3E%3Cline x1='12' y1='20' x2='12' y2='4'/%3E%3Cline x1='6' y1='20' x2='6' y2='14'/%3E%3C/svg%3E");
  --icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpolyline points='22 4 12 14.01 9 11.01'/%3E%3C/svg%3E");
  --icon-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
  --icon-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='15' y1='9' x2='9' y2='15'/%3E%3Cline x1='9' y1='9' x2='15' y2='15'/%3E%3C/svg%3E");
  --icon-shield: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: linear-gradient(180deg, var(--sky-cloud) 0%, var(--sky-mid) 35%, var(--sky-deep) 75%, var(--sky-ink) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "Public Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand, button, .top-nav a, .btn-link {
  font-family: "Manrope", "Public Sans", -apple-system, sans-serif;
}

.center-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(600px 300px at 15% -5%, var(--accent-soft), transparent),
    var(--bg);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  padding: 36px;
  width: 100%;
  max-width: 800px;
}

h1 { font-size: 23px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 4px; }
.subtitle { color: var(--ink-muted); margin: 0 0 24px; font-size: 14px; }

.tabs { display: flex; gap: 4px; margin-bottom: 20px; background: var(--surface-2); border-radius: 9px; padding: 4px; }
.tab-btn {
  flex: 1; padding: 8px; border: none; background: transparent; border-radius: 6px;
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-muted);
}
.tab-btn.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.1); }

/* Ops Control Centre tab bar — each tab gets its own transparent color tint so the
   six sections read as visually distinct at a glance, not just by label. Scoped to
   #occ-tabs's specific data-tab values so this never touches the login page's
   Log in/Register tabs, which reuse the same .tabs/.tab-btn base classes. */
#occ-tabs .tab-btn[data-tab="overview"] { background: rgba(46, 117, 172, 0.12); }
#occ-tabs .tab-btn[data-tab="overview"].active { background: rgba(46, 117, 172, 0.26); color: #1E4D7B; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
#occ-tabs .tab-btn[data-tab="dispatch"] { background: rgba(20, 96, 88, 0.12); }
#occ-tabs .tab-btn[data-tab="dispatch"].active { background: rgba(20, 96, 88, 0.26); color: var(--accent-dark); box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
#occ-tabs .tab-btn[data-tab="rotations"] { background: rgba(107, 70, 193, 0.12); }
#occ-tabs .tab-btn[data-tab="rotations"].active { background: rgba(107, 70, 193, 0.26); color: var(--purple); box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
#occ-tabs .tab-btn[data-tab="disrupted"] { background: rgba(174, 42, 31, 0.12); }
#occ-tabs .tab-btn[data-tab="disrupted"].active { background: rgba(174, 42, 31, 0.26); color: var(--danger); box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
#occ-tabs .tab-btn[data-tab="deferred"] { background: rgba(168, 106, 31, 0.12); }
#occ-tabs .tab-btn[data-tab="deferred"].active { background: rgba(168, 106, 31, 0.26); color: var(--warn); box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
#occ-tabs .tab-btn[data-tab="weather"] { background: rgba(184, 134, 47, 0.12); }
#occ-tabs .tab-btn[data-tab="weather"].active { background: rgba(184, 134, 47, 0.26); color: var(--gold); box-shadow: 0 1px 2px rgba(0,0,0,0.1); }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.01em; color: var(--ink-muted); margin-bottom: 5px; }
.field input, .field select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 7px;
  font-size: 14px; background: var(--surface); color: var(--ink); font-family: inherit;
}
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* Radio-per-row selector (passenger payment method) — needs higher specificity than
   `.field input`/`.field label` above, which otherwise force width:100%/display:block
   onto anything nested in a .field and break the row layout (radio and its label text
   end up far apart). Scoped by the container id so it wins without !important. */
#payment-method-options { display: flex; flex-direction: column; gap: 8px; }
#payment-method-options .payment-option {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  font-size: 13.5px; font-weight: 500; color: var(--ink); cursor: pointer; margin: 0;
}
#payment-method-options .payment-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
#payment-method-options .payment-option.disabled { color: var(--ink-muted); cursor: not-allowed; }
#payment-method-options .payment-option input[type="radio"] {
  width: auto; flex: none; margin: 0; padding: 0; border: none; background: none; accent-color: var(--accent);
}

.payment-status {
  display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  padding: 8px 12px; border-radius: 8px;
}
.payment-status.pending { background: var(--surface-2); color: var(--ink-muted); }
.payment-status.success { background: var(--good-soft); color: var(--good); }
.payment-status.failed { background: var(--danger-soft); color: var(--danger); }
.payment-status-spinner {
  width: 13px; height: 13px; flex: none; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--ink-muted);
  animation: payment-status-spin 0.8s linear infinite;
}
@keyframes payment-status-spin { to { transform: rotate(360deg); } }

.show-password-row {
  display: flex; align-items: center; gap: 6px; margin-top: -8px; margin-bottom: 14px;
}
.show-password-row input[type="checkbox"] { width: auto; margin: 0; accent-color: var(--accent); }
.show-password-row label {
  margin: 0; font-size: 12.5px; font-weight: 500; color: var(--ink-muted); cursor: pointer;
}

.divider {
  display: flex; align-items: center; text-align: center; margin: 20px 0 16px;
  color: var(--ink-muted); font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
}
.divider::before, .divider::after {
  content: ""; flex: 1; border-top: 1px solid var(--border);
}
.divider span { padding: 0 12px; }

.btn-outline {
  display: block; width: 100%; text-align: center; padding: 10px; border-radius: 7px;
  border: 1.5px solid var(--accent); color: var(--accent-dark); font-weight: 700; font-size: 14px;
  text-decoration: none; box-sizing: border-box; transition: background-color 0.12s ease;
}
.btn-outline:hover { background: var(--accent-soft); }

.passenger-hint {
  text-align: center; margin: 8px 0 0; font-size: 12px; color: var(--ink-muted);
}

button.primary {
  width: 100%; padding: 10px; border: none; border-radius: 7px; background: var(--accent);
  color: var(--accent-ink); font-weight: 700; font-size: 14px; cursor: pointer; margin-top: 6px;
  transition: background-color 0.12s ease;
}
button.primary:hover { background: var(--accent-dark); }
button.primary:disabled { opacity: 0.6; cursor: not-allowed; }

.error-box {
  background: var(--danger-soft); color: var(--danger); border-radius: 7px; padding: 9px 12px;
  font-size: 13px; margin-bottom: 14px; display: none;
}
.error-box.show { display: block; }
.error-box.success { background: var(--good-soft); color: var(--good); }

.form-panel { display: none; }
.form-panel.active { display: block; }

/* App shell: dark sidebar navigation + light content area with a header bar. */
.app-shell { display: flex; align-items: stretch; min-height: 100vh; }

.sidebar {
  flex: 0 0 280px; width: 280px; min-width: 0; box-sizing: border-box; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #1E4D7B 0%, #2E75AC 100%);
  color: #D7E7F5; padding: 22px 16px 16px; position: sticky; top: 0; height: 100vh;
  overflow-y: auto; overflow-x: hidden;
}
.sidebar.collapsed { display: none; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 22px; }
.sidebar-logo { height: 40px; width: auto; object-fit: contain; flex: none; }
.sidebar-brand-text {
  color: #ffffff; font-family: "Manrope", sans-serif; font-weight: 800; font-size: 13px;
  line-height: 1.3; letter-spacing: 0.05em; text-transform: uppercase;
}

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px;
  color: #A9BAD6; text-decoration: none; font-size: 13.5px; font-weight: 600;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.side-nav a svg { flex: none; width: 17px; height: 17px; }
.side-nav a:hover:not(.active) { background: rgba(255, 255, 255, 0.07); color: #ffffff; }
.side-nav a.active { background: var(--sky-deep); color: #ffffff; box-shadow: 0 4px 14px -6px rgba(74, 155, 209, 0.65); }

.side-nav-section-label {
  margin: 20px 6px 8px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: #A9CBE8;
}

/* Child links under a parent group (e.g. "Engineering & Maintenance") get extra
   left padding so the hierarchy reads visually, not just via the label above them. */
.side-nav-nested a { padding-left: 30px; }
.side-nav-nested.collapsed { display: none; }

.side-nav-group-toggle {
  display: flex; align-items: center; justify-content: flex-start; gap: 6px; width: 100%;
  background: none; border: none; cursor: pointer; margin: 4px 0; padding: 9px 8px 9px 12px; border-radius: 9px;
  font-size: 12.5px; font-weight: 600; color: #A9BAD6; font-family: inherit;
  text-align: left; white-space: nowrap; transition: background-color 0.12s ease, color 0.12s ease;
}
.side-nav-group-toggle svg:not(.side-nav-group-chevron) { flex: none; width: 17px; height: 17px; }
.side-nav-group-toggle:hover:not(.active) { background: rgba(255, 255, 255, 0.07); color: #ffffff; }
.side-nav-group-toggle.active { background: var(--sky-deep); color: #ffffff; box-shadow: 0 4px 14px -6px rgba(74, 155, 209, 0.65); }
.side-nav-group-chevron { width: 12px; height: 12px; flex: none; margin-left: -3px; transition: transform 0.15s ease; }
.side-nav-group-toggle.collapsed .side-nav-group-chevron { transform: rotate(-90deg); }

.sidebar-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.09); position: relative; }
.sidebar-footer-row {
  display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px;
  cursor: pointer; background: none; border: none; width: 100%; text-align: left; color: inherit;
  font-family: inherit;
}
.sidebar-footer-row:hover { background: rgba(255, 255, 255, 0.07); }
.avatar-circle {
  flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--sky-deep);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: "Manrope", sans-serif; font-weight: 800; font-size: 12.5px;
}
.avatar-circle.sm { width: 26px; height: 26px; font-size: 10.5px; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-status { font-size: 11px; color: #C3DCF0; display: flex; align-items: center; gap: 5px; margin-top: 1px; }
.sidebar-user-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--good); flex: none; }
.sidebar-footer-chevron { flex: none; color: #C3DCF0; transition: transform 0.15s ease; }
.sidebar-footer.open .sidebar-footer-chevron { transform: rotate(180deg); }

.account-menu {
  display: none; position: absolute; bottom: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-md); padding: 6px; z-index: 20;
}
.sidebar-footer.open .account-menu { display: block; }
.account-menu button {
  width: 100%; text-align: left; background: none; border: none; padding: 8px 10px;
  border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer;
  font-family: "Public Sans", sans-serif;
}
.account-menu button:hover { background: var(--surface-2); }

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 14px 32px; background: linear-gradient(180deg, #1E4D7B 0%, #2E75AC 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  position: sticky; top: 0; z-index: 10;
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.sidebar-toggle {
  display: flex; flex: none; width: 36px; height: 36px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12); color: #ffffff; align-items: center; justify-content: center; cursor: pointer;
}
.sidebar-toggle:hover { background: rgba(255, 255, 255, 0.22); color: #ffffff; }
.sidebar-toggle svg { width: 17px; height: 17px; }
.topbar-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-title-icon {
  flex: none; width: 38px; height: 38px; border-radius: 10px; background: rgba(255, 255, 255, 0.15);
  color: #ffffff; display: flex; align-items: center; justify-content: center;
}
.topbar-title-icon svg { width: 19px; height: 19px; }
.topbar-title h1 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; color: #ffffff; }
.topbar-title p { margin: 1px 0 0; font-size: 12.5px; color: #C3DCF0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar-actions { display: flex; align-items: center; gap: 14px; flex: none; }
.topbar-search {
  display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 100px; padding: 8px 14px; width: 240px; color: #ffffff;
}
.topbar-search svg { flex: none; width: 15px; height: 15px; }
.topbar-search input { border: none; background: none; outline: none; font-size: 13px; width: 100%; color: #ffffff; font-family: inherit; }
.topbar-search input::placeholder { color: rgba(255, 255, 255, 0.65); }
.icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.12); color: #ffffff; display: flex; align-items: center;
  justify-content: center; cursor: pointer; flex: none;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: rgba(255, 255, 255, 0.22); color: #ffffff; }
.notif-badge {
  position: absolute; top: -4px; right: -4px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 100px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
  font-family: "IBM Plex Mono", monospace; border: 2px solid #1E4D7B;
}
.topbar-avatar-wrap { position: relative; }
.topbar-avatar-wrap button.avatar-circle { border: 2px solid rgba(255, 255, 255, 0.4); cursor: pointer; padding: 0; }
.topbar-avatar-wrap .account-menu { top: calc(100% + 8px); bottom: auto; left: auto; right: 0; width: 170px; }
.topbar-avatar-wrap.open .account-menu { display: block; }

@media (max-width: 860px) {
  .sidebar { position: fixed; z-index: 30; top: 0; left: 0; box-shadow: var(--shadow-md); }
  .topbar-search { display: none; }
}

/* Placeholder pages (Audit Log / Settings / Help — shell only, not built yet) */
.placeholder-page {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 90px 24px; color: var(--ink-muted);
}
.placeholder-page .placeholder-icon {
  width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft);
  color: var(--accent-dark); display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
}
.placeholder-page .placeholder-icon svg { width: 28px; height: 28px; }
.placeholder-page h2 { margin: 0 0 6px; font-size: 19px; color: var(--ink); }
.placeholder-page p { margin: 0; max-width: 360px; font-size: 14px; }

.badge.overdue { background: var(--danger-soft); color: var(--danger); }
.badge.due_soon { background: var(--warn-soft); color: var(--warn); }
.badge.completed { background: var(--good-soft); color: var(--good); }
.badge.scheduled { background: var(--surface-2); color: var(--ink-muted); }

.disclaimer {
  font-size: 12.5px; color: var(--ink-muted); background: var(--surface);
  border: 1px solid var(--border); border-left: 3px solid var(--gold); border-radius: 0 8px 8px 0;
  padding: 10px 14px; margin-bottom: 18px;
}

/* Organisation Chart — a plain recursive nested-card tree, no charting library. */
.org-chart-roots { display: flex; gap: 24px; flex-wrap: wrap; padding: 8px 0; }
.org-chart-node { display: flex; flex-direction: column; align-items: center; }
.org-chart-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 10px 16px; min-width: 160px; text-align: center;
}
.org-chart-name { font-weight: 700; font-size: 14px; }
.org-chart-title { font-size: 12.5px; color: var(--ink-muted); margin-top: 2px; }
.org-chart-children {
  display: flex; gap: 20px; margin-top: 20px; padding-top: 20px; position: relative;
  border-top: 2px solid var(--border);
}
.org-chart-children::before {
  content: ""; position: absolute; top: -2px; left: 50%; width: 0; height: 20px;
  border-left: 2px solid var(--border);
}

/* Flight Status route map (Ops Control Centre) — routes/markers/plane icons are
   real SVG drawn from airport coordinates; the backdrop is a real world map image
   (public/assets/flight-route-map.jpg), calibrated so lat/lon project onto the
   correct spot on that image. See public/app.js's project() for the calibration. */
.map-view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.map-view-btn {
  border: none; background: var(--surface); color: var(--ink-muted); font-size: 12.5px; font-weight: 600;
  padding: 6px 14px; cursor: pointer;
}
.map-view-btn + .map-view-btn { border-left: 1px solid var(--border); }
.map-view-btn.active { background: var(--accent); color: #fff; }
.flight-map-wrap {
  position: relative;
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: var(--surface-2); box-shadow: var(--shadow-sm);
}
#flight-map { display: block; width: 100%; height: auto; cursor: grab; touch-action: none; }
#flight-map image { image-rendering: optimizeQuality; image-rendering: high-quality; }
#flight-map:active { cursor: grabbing; }
#flight-map-google-canvas { min-height: 420px; }
.flight-map-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 10px; }
.flight-map-legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-muted); }
.flight-map-legend-swatch { display: inline-block; width: 12px; height: 3px; border-radius: 2px; }
.flight-map-controls {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  display: flex; flex-direction: column; gap: 4px;
}
.flight-map-controls button {
  width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--ink); font-size: 16px; font-weight: 700;
  line-height: 1; cursor: pointer; box-shadow: var(--shadow-sm);
}
.flight-map-controls button:hover { background: var(--accent-soft); }
#flight-map-zoom-reset { width: auto; padding: 0 8px; font-size: 11px; font-weight: 600; }

.badge.expired { background: var(--danger-soft); color: var(--danger); }
.badge.expiring_soon { background: var(--warn-soft); color: var(--warn); }
.badge.valid { background: var(--good-soft); color: var(--good); }
.badge.over_limit { background: var(--danger-soft); color: var(--danger); }
.badge.within_limit { background: var(--good-soft); color: var(--good); }
.badge.not_tracked { background: var(--surface-2); color: var(--ink-muted); }

.duty-settings-card {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px 18px; margin-bottom: 24px; font-size: 13.5px; color: var(--ink-muted);
  box-shadow: var(--shadow-sm);
}
.duty-settings-card strong { color: var(--ink); font-weight: 700; }

.page { max-width: 1920px; width: 100%; box-sizing: border-box; margin: 0 auto; padding: 36px 28px 64px; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.page-head h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.fleet-count { font-weight: 500; color: var(--ink-muted); font-size: 14px; font-family: "Public Sans", sans-serif; }

.stats-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 28px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 17px 15px 64px; box-shadow: var(--shadow-sm); position: relative;
}
.stat-card::before {
  content: ""; position: absolute; left: 16px; top: 16px; width: 34px; height: 34px;
  border-radius: 10px; background: var(--accent-soft);
}
.stat-card::after {
  content: ""; position: absolute; left: 25px; top: 25px; width: 16px; height: 16px;
  background-color: var(--accent-dark); mask-image: var(--icon-chart); -webkit-mask-image: var(--icon-chart);
  mask-size: contain; -webkit-mask-size: contain; mask-repeat: no-repeat; -webkit-mask-repeat: no-repeat;
  mask-position: center; -webkit-mask-position: center;
}
.stat-card .stat-value {
  font-family: "IBM Plex Mono", monospace; font-size: 23px; font-weight: 600;
  font-variant-numeric: tabular-nums; line-height: 1.2;
}
.stat-card .stat-label { font-size: 12px; color: var(--ink-muted); margin-top: 3px; }
.stat-card.grounded .stat-value,
.stat-card.overdue .stat-value,
.stat-card.expired .stat-value { color: var(--danger); }
.stat-card.in_maintenance .stat-value,
.stat-card.due_soon .stat-value,
.stat-card.expiring_soon .stat-value { color: var(--warn); }
.stat-card.completed .stat-value,
.stat-card.in_service .stat-value,
.stat-card.valid .stat-value { color: var(--good); }

.stat-card.completed::before, .stat-card.in_service::before, .stat-card.valid::before { background: var(--good-soft); }
.stat-card.completed::after, .stat-card.in_service::after, .stat-card.valid::after {
  background-color: var(--good); mask-image: var(--icon-check); -webkit-mask-image: var(--icon-check);
}
.stat-card.due_soon::before, .stat-card.expiring_soon::before, .stat-card.in_maintenance::before { background: var(--warn-soft); }
.stat-card.due_soon::after, .stat-card.expiring_soon::after, .stat-card.in_maintenance::after {
  background-color: var(--warn); mask-image: var(--icon-alert); -webkit-mask-image: var(--icon-alert);
}
.stat-card.overdue::before, .stat-card.grounded::before, .stat-card.expired::before { background: var(--danger-soft); }
.stat-card.overdue::after, .stat-card.grounded::after, .stat-card.expired::after {
  background-color: var(--danger); mask-image: var(--icon-x); -webkit-mask-image: var(--icon-x);
}
.stat-card.roles::before { background: var(--gold-soft); }
.stat-card.roles::after {
  background-color: var(--gold); mask-image: var(--icon-shield); -webkit-mask-image: var(--icon-shield);
}

table {
  width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
  font-variant-numeric: tabular-nums;
}
thead th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ink-muted); background: var(--surface-2); padding: 11px 14px;
}
tbody td { padding: 11px 14px; border-top: 1px solid var(--border); font-size: 14px; }
tbody tr { transition: background-color 0.1s ease; }
tbody tr:hover { background: var(--surface-2); }
.empty-row td { text-align: center; color: var(--ink-muted); padding: 32px; }
.empty-row:hover { background: transparent; }

.badge {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.01em;
  padding: 3px 9px; border-radius: 100px;
  background: var(--good-soft); color: var(--good);
}
.badge.grounded { background: var(--danger-soft); color: var(--danger); }
.badge.in_maintenance { background: var(--warn-soft); color: var(--warn); }

.badge.boarding { background: var(--warn-soft); color: var(--warn); }
.badge.departed { background: var(--accent-soft); color: var(--accent-dark); }
.badge.arrived { background: var(--good-soft); color: var(--good); }
.badge.cancelled { background: var(--danger-soft); color: var(--danger); }

.badge.pending_release { background: var(--warn-soft); color: var(--warn); }
.badge.released { background: var(--good-soft); color: var(--good); }

.badge.pending { background: var(--surface-2); color: var(--ink-muted); }
.badge.paid { background: var(--good-soft); color: var(--good); }
.badge.refunded { background: var(--accent-soft); color: var(--accent-dark); }
.badge.failed { background: var(--danger-soft); color: var(--danger); }
.badge.checked_in { background: var(--good-soft); color: var(--good); }
.badge.not_checked_in { background: var(--surface-2); color: var(--ink-muted); }
.badge.in_progress { background: var(--warn-soft); color: var(--warn); }

.badge.role-guardian { background: var(--gold-soft); color: var(--gold); }
.badge.role-client { background: var(--sky-cloud); color: var(--sky-ink); }
.badge.role-office_staff { background: var(--purple-soft); color: var(--purple); }
.badge.role-crew { background: var(--accent-soft); color: var(--accent-dark); }
.badge.role-booking_agent { background: var(--warn-soft); color: var(--warn); }
.badge.role-ground_staff { background: var(--teal-soft); color: var(--teal); }
.badge.role-engineer { background: var(--orange-soft); color: var(--orange); }

.badge.domestic { background: var(--good-soft); color: var(--good); }
.badge.international { background: var(--accent-soft); color: var(--accent-dark); }

.user-name-cell { display: flex; align-items: center; gap: 9px; }

.modal-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(15, 24, 19, 0.44);
  align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(1.5px);
}
.modal-backdrop.show { display: flex; }
.modal {
  background: var(--surface); border-radius: 14px; padding: 28px; width: 100%; max-width: 760px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 64px -20px rgba(16, 28, 22, 0.4);
}
.modal-section-title { margin: 22px 0 10px; font-size: 13px; font-weight: 700; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.modal-section-title:first-of-type { margin-top: 0; }
.modal h3 { margin: 0 0 16px; font-size: 17px; font-weight: 800; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions button.secondary {
  flex: 1; background: transparent; border: 1px solid var(--border); border-radius: 7px;
  padding: 9px; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink);
}
.modal-actions button.secondary:hover { background: var(--surface-2); }
.modal-actions button.primary { flex: 1; margin-top: 0; }

.btn-link {
  background: none; border: none; color: var(--accent-dark); font-weight: 700; font-size: 13.5px;
  cursor: pointer; padding: 0; text-decoration: none;
}
.btn-link:hover { text-decoration: underline; }

/* Dashboard hub */
.dash-welcome { margin-bottom: 28px; }
.dash-welcome h1 {
  font-size: 26px; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 4px;
}
.dash-welcome-sub { color: var(--ink-muted); font-size: 14.5px; margin: 0; }

.module-grid {
  display: flex; flex-wrap: wrap; gap: 21px;
}
.module-grid .module-card { flex: 1 1 294px; min-width: 294px; }
.module-card {
  display: block; background: rgba(255, 255, 255, 0.5); border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 23px; padding: 27px; text-decoration: none; color: inherit;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 34px -12px rgba(20, 80, 130, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.module-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 42px -14px rgba(20, 80, 130, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  border-color: var(--accent);
}
.module-card-label {
  font-family: "Manrope", sans-serif; font-weight: 800; font-size: 19.95px; margin-bottom: 6px;
}
.module-card-desc { font-size: 14.7px; color: var(--ink-muted); line-height: 1.45; margin-bottom: 14px; }
.module-card-stat {
  font-family: "IBM Plex Mono", monospace; font-size: 14.2px; color: var(--accent-dark);
  font-weight: 600;
}
.module-card-footer {
  display: flex; align-items: center; gap: 18.9px; margin-top: 16.8px; padding-top: 16.8px;
  border-top: 1px solid rgba(255, 255, 255, 0.7);
}
.module-card-chart { flex: none; width: 96.6px; height: 96.6px; position: relative; }
.module-card-stat { flex: 1; min-width: 0; line-height: 1.4; }
.module-card-legend { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.module-card-legend li {
  display: flex; align-items: center; gap: 6px; font-size: 12.6px; color: var(--ink-muted); font-weight: 600;
}
.module-card-legend .legend-star { font-size: 13.65px; line-height: 1; }

/* ---- Auth page (login / register) — dark navy, its own identity ---- */
body.auth-page {
  background: var(--auth-bg-1); min-height: 100vh; position: relative; overflow-x: hidden;
}
.auth-bg {
  position: fixed; inset: -6px; z-index: 0;
  background: url('assets/login-bg.png') center center / cover no-repeat, var(--auth-bg-1);
  filter: blur(1px);
}

.auth-shell {
  position: relative; z-index: 1; max-width: 620px; margin: 0 auto;
  padding: 56px 24px 40px; display: flex; flex-direction: column; align-items: center;
}
.auth-header { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-logo { height: 80px; width: auto; object-fit: contain; }
.auth-wordmark {
  color: var(--auth-text); font-family: "Times New Roman", Times, serif; font-weight: 700;
  font-size: 26px; line-height: 1; letter-spacing: 0.04em; white-space: nowrap;
  text-shadow: var(--auth-text-outline);
}
.auth-title {
  color: var(--auth-text); font-size: 30px; font-weight: 800; letter-spacing: -0.01em;
  margin: 0 0 8px; text-align: center; text-shadow: var(--auth-text-outline);
}
.auth-subtitle {
  color: var(--auth-text); font-size: 14.5px; margin: 0 0 30px; text-align: center;
  text-shadow: var(--auth-text-outline);
}

.auth-card {
  width: 100%; background: var(--auth-card-bg); border: 1px solid var(--auth-card-border);
  border-radius: 18px; padding: 32px; box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-sizing: border-box;
}
.auth-card h1, .auth-card .subtitle { display: none; }

.auth-card .tabs { background: rgba(255, 255, 255, 0.06); }
.auth-card .tab-btn { color: var(--auth-text-muted); }
.auth-card .tab-btn.active { background: rgba(255, 255, 255, 0.12); color: var(--auth-text); }

.auth-card .field label { color: var(--auth-text-muted); }
.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-input-icon {
  position: absolute; left: 12px; width: 16px; height: 16px; color: var(--auth-text-muted);
  pointer-events: none;
}
.auth-card .field input {
  background: var(--auth-input-bg); border: 1px solid var(--auth-input-border);
  color: var(--auth-text); padding-left: 36px;
}
.auth-input-wrap.has-toggle .field input,
.auth-input-wrap input[type="password"],
.auth-input-wrap input[type="text"].auth-pw-text { padding-right: 38px; }
.auth-card .field input::placeholder { color: rgba(145, 168, 204, 0.55); }
.auth-card .field input:focus { outline: 2px solid var(--auth-input-border-focus); outline-offset: -1px; }

.auth-eye-toggle { position: absolute; opacity: 0; pointer-events: none; }
.auth-eye-label {
  position: absolute; right: 10px; width: 22px; height: 22px; display: flex; align-items: center;
  justify-content: center; color: var(--auth-text-muted); cursor: pointer; border-radius: 5px;
}
.auth-eye-label:hover { color: var(--auth-text); }
.auth-eye-label svg { width: 16px; height: 16px; }
.auth-eye-label .eye-closed { display: none; }
.auth-eye-toggle:checked ~ .auth-eye-label .eye-open { display: none; }
.auth-eye-toggle:checked ~ .auth-eye-label .eye-closed { display: flex; }

.auth-checkbox-row {
  display: flex; align-items: center; justify-content: space-between; margin: -6px 0 16px; font-size: 13px;
}
.auth-checkbox { display: flex; align-items: center; gap: 7px; color: var(--auth-text-muted); cursor: pointer; }
.auth-checkbox input { accent-color: var(--auth-input-border-focus); width: 15px; height: 15px; margin: 0; }
.auth-link { color: #8FC5F0; text-decoration: none; font-weight: 700; }
.auth-link:hover { text-decoration: underline; }
.auth-forgot-note {
  font-size: 12px; color: var(--auth-text-muted); background: rgba(255, 255, 255, 0.06);
  border-radius: 7px; padding: 8px 10px; margin: -6px 0 14px; display: none;
}
.auth-forgot-note.show { display: block; }

.auth-card .error-box { background: rgba(174, 42, 31, 0.25); color: #FFB4AC; }

button.primary.auth-submit {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: linear-gradient(120deg, var(--auth-blue-1), var(--auth-blue-2));
}
button.primary.auth-submit:hover { background: linear-gradient(120deg, var(--auth-blue-2), var(--auth-blue-2)); }
.auth-submit svg { width: 16px; height: 16px; }

.auth-card .divider { color: var(--auth-text-muted); }
.auth-card .divider::before, .auth-card .divider::after { border-top-color: rgba(255, 255, 255, 0.14); }

.auth-passenger-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  border-color: rgba(255, 255, 255, 0.25); color: var(--auth-text);
}
.auth-passenger-btn:hover { background: rgba(255, 255, 255, 0.08); }
.auth-passenger-btn svg { width: 16px; height: 16px; }
.auth-card .passenger-hint { color: var(--auth-text-muted); }

.auth-trust-row {
  display: flex; justify-content: center; gap: 34px; margin-top: 34px; flex-wrap: wrap;
}
.auth-trust-item {
  display: flex; align-items: center; gap: 9px; color: var(--auth-text); font-size: 12.5px; font-weight: 600;
  text-shadow: var(--auth-text-outline);
}
.auth-trust-item svg {
  width: 30px; height: 30px; padding: 7px; box-sizing: border-box; border-radius: 9px;
  background: rgba(11, 26, 51, 0.4); color: #BFE0F5; flex: none;
}

.auth-footer {
  margin-top: 30px; display: flex; align-items: center; gap: 14px; color: var(--auth-text);
  font-size: 12.5px; flex-wrap: wrap; justify-content: center; text-shadow: var(--auth-text-outline);
}
.auth-footer-sep { width: 1px; height: 13px; background: rgba(255, 255, 255, 0.18); }
.auth-footer a { color: #7FB8E8; text-decoration: none; font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

@media (max-width: 560px) {
  .auth-card { padding: 24px 20px; }
  .auth-trust-row { gap: 20px; }
}
