:root {
  color-scheme: light;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --text: #17213c;
  --muted: #647084;
  --navy: #17245d;
  --navy-2: #223475;
  --accent: #213474;
  --accent-strong: #e2ad22;
  --border: #e2e6ec;
  --shadow: 0 8px 24px rgba(22, 34, 72, 0.07);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  line-height: 1.6;
}

.page-shell {
  max-width: 1160px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.hero {
  display: grid;
  gap: 24px;
  padding: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.sheet-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.sheet-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  align-items: baseline;
  margin-bottom: 24px;
}

.sheet-header h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.8rem);
}

.sheet-header p {
  margin: 0;
  color: var(--muted);
  max-width: 640px;
}

.sheet-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.sheet-tab {
  display: inline-flex;
  align-items: center;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.sheet-tab.active {
  background: var(--accent);
  color: #fff;
}

.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.sheet-actions .controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.sheet-actions input[type="search"] {
  width: 240px;
  min-width: 180px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
}

.schedule-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.schedule-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.calendar-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.calendar-table th,
.calendar-table td {
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.calendar-table th {
  background: #f8fbff;
  color: var(--text);
  font-weight: 700;
}

.calendar-table td {
  height: 68px;
  background: #fff;
}

.booking-block {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100%;
  padding: 10px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, #0ea5e9 0%, #38bdf8 100%);
  color: #fff;
  box-shadow: 0 14px 30px rgba(14, 165, 233, 0.2);
  font-size: 0.95rem;
  line-height: 1.4;
}

.booking-block strong {
  display: block;
  margin-bottom: 6px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.tracker-page {
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.tracker-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}

.tracker-header h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 3.7rem);
  line-height: 1;
}

.tracker-header p {
  margin: 12px 0 0;
  color: var(--muted);
}

.tracker-header .controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.quiet {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.05);
}

.metric-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--metric-color);
  content: "";
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin: 4px 0 1px;
  font-size: 2rem;
  line-height: 1.2;
}

.metric-blue { --metric-color: #0ea5e9; }
.metric-green { --metric-color: #10b981; }
.metric-yellow { --metric-color: #f59e0b; }
.metric-red { --metric-color: #ef4444; }
.metric-orange { --metric-color: #e07a24; }

.stage-metric-grid {
  grid-template-columns: repeat(5, minmax(170px, 1fr));
}

.tracker-panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.tracker-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tracker-toolbar input,
.tracker-toolbar select,
.request-dialog input,
.request-dialog select,
.request-dialog textarea {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
}

.tracker-toolbar input,
.tracker-toolbar select {
  min-height: 42px;
  padding: 8px 12px;
}

.search-field {
  width: min(320px, 45vw);
}

.result-count {
  margin: 0;
  color: var(--muted);
  white-space: nowrap;
}

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

.tracker-table {
  width: 100%;
  min-width: 1260px;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.tracker-table th,
.tracker-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.tracker-table th {
  position: sticky;
  top: 0;
  background: #f8fbff;
  color: #334155;
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.tracker-table tbody tr:hover {
  background: #f8fbff;
}

.tracker-table td {
  max-width: 220px;
}

.tracker-table td strong,
.tracker-table td small,
.tracker-table time {
  display: block;
}

.tracker-table td small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.wrap-cell {
  line-height: 1.4;
}

.course-chip {
  display: inline-block;
  margin: 5px 6px 0 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 0.7rem;
  font-weight: 800;
}

.status-badge {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-on-time {
  background: #dcfce7;
  color: #166534;
}

.status-delayed {
  background: #fee2e2;
  color: #991b1b;
}

.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.delay-reason {
  font-weight: 700;
}

.row-action {
  border: 0;
  background: transparent;
  color: #b91c1c;
  font-size: 0.78rem;
  font-weight: 700;
}

.row-action.edit-action {
  padding: 6px 10px;
  border: 1px solid #d7deeb;
  border-radius: 7px;
  background: #fff;
  color: var(--navy);
}

.row-action.edit-action:hover {
  background: #edf0f8;
}

.tracker-table tr.request-incomplete td {
  background: rgba(255, 249, 230, 0.42);
}

.tracker-table tr.request-incomplete:hover td {
  background: rgba(255, 246, 211, 0.68);
}

.empty-state {
  padding: 72px 24px;
  text-align: center;
}

.empty-state p {
  margin: 5px 0 0;
  color: var(--muted);
}

.request-dialog {
  width: min(760px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  box-shadow: 0 30px 100px rgba(15, 23, 42, 0.3);
}

.request-dialog::backdrop {
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
}

.request-dialog form {
  padding: 26px;
}

.dialog-heading,
.dialog-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.dialog-heading h2 {
  margin: 0;
  font-size: 1.8rem;
}

.dialog-heading .eyebrow {
  margin-bottom: 8px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #f8fafc;
  color: var(--muted);
  font-size: 1.6rem;
}

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

.form-grid label {
  color: #334155;
  font-size: 0.86rem;
  font-weight: 700;
}

.request-dialog input,
.request-dialog select,
.request-dialog textarea {
  display: block;
  margin-top: 6px;
  padding: 10px 12px;
  resize: vertical;
}

.full-field {
  grid-column: 1 / -1;
}

.dialog-actions {
  justify-content: flex-end;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.oil-eyebrow {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
}

.oil-primary {
  background: #087f5b;
}

.oil-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 18px;
  align-items: start;
}

.oil-toolbar {
  flex-wrap: wrap;
  background: #f7fbf9;
}

.month-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.month-controls input {
  min-width: 155px;
  font-weight: 700;
  color: #14532d;
}

.month-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  background: #fff;
  color: #047857;
  font-size: 1.5rem;
}

.oil-table {
  min-width: 720px;
  font-size: 0.95rem;
}

.oil-table th {
  background: #23664f;
  color: #fff;
}

.oil-table th,
.oil-table td {
  padding: 14px 18px;
}

.aircraft-chip {
  display: inline-flex;
  min-width: 82px;
  justify-content: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 800;
  line-height: 1.25;
}

.aircraft-yellow { background: #fde7a4; color: #795c0c; }
.aircraft-blue { background: #bfdbfe; color: #1d4ed8; }
.aircraft-purple { background: #e9d5ff; color: #7e22ce; }
.aircraft-orange { background: #fed7aa; color: #9a3412; }
.aircraft-teal { background: #cce7ec; color: #155e75; }
.aircraft-green { background: #d9f4c7; color: #15803d; }
.aircraft-gray { background: #e2e8f0; color: #475569; }

.initials-chip {
  display: inline-flex;
  min-width: 42px;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #334155;
  font-weight: 800;
}

.fleet-panel {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.fleet-heading {
  padding: 20px;
  background: linear-gradient(135deg, #14532d, #087f5b);
  color: #fff;
}

.fleet-heading span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fleet-heading h2 {
  margin: 3px 0 0;
  font-size: 1.25rem;
}

.fleet-list {
  display: grid;
}

.fleet-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 15px 17px;
  border-bottom: 1px solid var(--border);
}

.fleet-item:last-child {
  border-bottom: 0;
}

.fleet-item div {
  text-align: right;
}

.fleet-item strong,
.fleet-item small {
  display: block;
}

.fleet-item strong {
  font-size: 1rem;
}

.fleet-item small {
  color: var(--muted);
  font-size: 0.7rem;
}

.equipment-eyebrow {
  background: rgba(14, 116, 144, 0.12);
  color: #0e7490;
}

.equipment-primary {
  background: #0f766e;
}

.equipment-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 18px;
  align-items: start;
}

.equipment-table {
  min-width: 980px;
}

.equipment-table th {
  background: #286653;
  color: #fff;
}

.equipment-table td {
  vertical-align: middle;
}

.e6b-number {
  display: inline-grid;
  min-width: 42px;
  height: 36px;
  place-items: center;
  border: 1px solid #99f6e4;
  border-radius: 10px;
  background: #ccfbf1;
  color: #115e59;
  font-size: 0.9rem;
  font-weight: 900;
}

.rental-returned {
  background: #dcfce7;
  color: #166534;
}

.rental-active {
  background: #dbeafe;
  color: #1e40af;
}

.rental-overdue {
  background: #fee2e2;
  color: #991b1b;
}

.rental-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.return-button {
  padding: 6px 10px;
  border: 1px solid #99f6e4;
  border-radius: 9px;
  background: #f0fdfa;
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 800;
}

.equipment-heading {
  background: linear-gradient(135deg, #134e4a, #0e7490);
}

.inventory-list {
  grid-template-columns: 1fr;
}

.inventory-item div {
  min-width: 0;
}

.inventory-item div strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-item small.inventory-available {
  color: #15803d;
  font-weight: 800;
}

.inventory-item small.inventory-active {
  color: #1d4ed8;
  font-weight: 800;
}

.inventory-item small.inventory-overdue {
  color: #b91c1c;
  font-weight: 800;
}

.fuel-eyebrow {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.fuel-primary {
  background: #2563eb;
}

.fuel-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

.fuel-table {
  min-width: 1120px;
}

.fuel-table th {
  background: #326f5d;
  color: #fff;
}

.fuel-table td {
  vertical-align: middle;
}

.tailnumber-chip {
  display: inline-flex;
  min-width: 92px;
  justify-content: center;
  padding: 4px 11px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
  font-weight: 800;
}

.issue-chip {
  display: inline-flex;
  min-width: 120px;
  justify-content: center;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.issue-delayed {
  background: #dcecca;
  color: #365f22;
}

.issue-water {
  background: #dbeafe;
  color: #1e40af;
}

.issue-level {
  background: #fef3c7;
  color: #92400e;
}

.issue-other {
  background: #e2e8f0;
  color: #475569;
}

.fuel-heading {
  background: linear-gradient(135deg, #1e3a8a, #0e7490);
}

.fuel-summary-item div {
  min-width: 0;
}

.fuel-summary-item strong,
.fuel-summary-item small {
  white-space: nowrap;
}

@media (max-width: 980px) {
  .calendar-table {
    min-width: 100%;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .stage-metric-grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .oil-layout {
    grid-template-columns: 1fr;
  }

  .equipment-layout {
    grid-template-columns: 1fr;
  }

  .fuel-layout {
    grid-template-columns: 1fr;
  }

  .fleet-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fleet-item:nth-child(odd) {
    border-right: 1px solid var(--border);
  }
}

@media (max-width: 760px) {
  .sheet-header,
  .sheet-actions,
  .schedule-meta {
    flex-direction: column;
    align-items: stretch;
  }

  .sheet-actions input[type="search"] {
    width: 100%;
    max-width: 100%;
  }

  .tracker-page {
    padding: 18px 12px;
  }

  .tracker-header,
  .tracker-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .tracker-header .controls {
    justify-content: flex-start;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .filter-group,
  .search-field,
  .filter-group label {
    width: 100%;
  }

  .month-controls {
    width: 100%;
  }

  .month-controls label,
  .month-controls input {
    width: 100%;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .full-field {
    grid-column: auto;
  }
}

/* Full-width ground trainer scheduler */
.trainer-page {
  width: 100%;
  padding: 18px clamp(12px, 2vw, 32px) 16px;
}

.trainer-page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  max-width: 1800px;
  margin: 0 auto 12px;
}

.trainer-page-header h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  letter-spacing: -0.055em;
  line-height: 1;
}

.trainer-page-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.trainer-toolbar {
  display: grid;
  max-width: 1800px;
  grid-template-columns: minmax(320px, 1fr) auto minmax(240px, 1fr);
  align-items: center;
  gap: 18px;
  margin: 0 auto 10px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(22, 34, 72, 0.04);
}

.trainer-tabs,
.week-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.trainer-tab {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.trainer-tab:hover {
  background: #f5f7fa;
  color: var(--navy);
}

.trainer-tab.active {
  border-color: #d8deea;
  background: #edf0f8;
  color: var(--navy);
}

.trainer-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #28a26a;
  box-shadow: 0 0 0 3px rgba(40, 162, 106, 0.12);
}

.week-controls {
  justify-content: center;
}

.week-controls strong {
  min-width: 190px;
  margin-left: 6px;
  color: var(--navy);
  font-size: 0.88rem;
  text-align: center;
}

.icon-control {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  font-size: 1.4rem;
}

.icon-control:hover {
  background: #f5f7fa;
}

.trainer-search {
  justify-self: end;
  width: min(100%, 300px);
}

.trainer-search input {
  width: 100%;
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.calendar-shell {
  max-width: 1800px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #dce1e9;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(22, 34, 72, 0.06);
}

.calendar-scroll {
  overflow-x: auto;
  overflow-y: visible;
}

.trainer-calendar {
  --slot-height: 52px;
  display: grid;
  min-width: 1280px;
  grid-template-columns: 96px repeat(7, minmax(165px, 1fr));
  grid-template-rows: 62px auto;
}

.calendar-corner,
.day-header {
  position: sticky;
  z-index: 10;
  top: 0;
  border-bottom: 1px solid #dce1e9;
  background: #f6f8fb;
}

.calendar-corner {
  z-index: 12;
  left: 0;
  display: flex;
  align-items: end;
  padding: 10px 9px;
  border-right: 1px solid #dce1e9;
}

.calendar-corner span {
  color: #7a8496;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.day-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-right: 1px solid #e5e8ee;
  color: var(--muted);
}

.day-header span {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.day-header strong {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--navy);
  font-size: 1rem;
}

.day-header.today {
  background: #fff9e9;
  color: #8e680b;
}

.day-header.today strong {
  background: var(--accent-strong);
  color: #fff;
}

.time-rail {
  position: sticky;
  z-index: 8;
  left: 0;
  height: calc((22 - 6) * 2 * var(--slot-height));
  border-right: 1px solid #dce1e9;
  background: #f8f9fb;
}

.time-label {
  height: var(--slot-height);
  padding: 3px 9px 0;
  border-bottom: 1px solid #e5e8ee;
  color: #6e788b;
  font-size: 0.68rem;
  font-weight: 750;
  text-align: right;
}

.day-column {
  position: relative;
  height: calc((22 - 6) * 2 * var(--slot-height));
  border-right: 1px solid #e5e8ee;
  background: #fff;
  transition: background-color 0.12s ease;
}

.day-column.today {
  background: rgba(255, 249, 233, 0.38);
}

.day-column.drag-over {
  background: #eef2fb;
  box-shadow: inset 0 0 0 2px var(--navy-2);
}

.calendar-slot {
  display: block;
  width: 100%;
  height: var(--slot-height);
  padding: 0;
  border: 0;
  border-bottom: 1px solid #e5e8ee;
  background: transparent;
}

.calendar-slot::after {
  display: block;
  width: 100%;
  border-top: 1px dashed rgba(226, 230, 236, 0.7);
  content: "";
  transform: translateY(-50%);
}

.calendar-slot:hover {
  background: rgba(33, 52, 116, 0.035);
}

.calendar-booking {
  position: absolute;
  z-index: 3;
  right: 7px;
  left: 7px;
  display: block;
  overflow: hidden;
  padding: 6px 10px;
  border: 1px solid rgba(25, 40, 92, 0.18);
  border-left-width: 4px;
  border-radius: 7px;
  background: #e9edf8;
  box-shadow: 0 2px 5px rgba(22, 34, 72, 0.11);
  color: var(--navy);
  cursor: grab;
  text-align: left;
  transition: box-shadow 0.14s ease, transform 0.14s ease, opacity 0.14s ease;
}

.calendar-booking:hover {
  z-index: 5;
  transform: translateY(-1px);
  box-shadow: 0 7px 16px rgba(22, 34, 72, 0.18);
}

.calendar-booking:active {
  cursor: grabbing;
}

.calendar-booking.dragging {
  opacity: 0.42;
}

.calendar-booking .booking-resize-handle {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 8px;
  border-radius: 999px;
  background: rgba(34, 51, 85, 0.22);
  cursor: ns-resize;
}

.calendar-booking.resizing {
  box-shadow: 0 8px 20px rgba(22, 34, 72, 0.22);
}

.calendar-booking strong,
.calendar-booking span,
.calendar-booking small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-booking strong {
  font-size: 0.86rem;
  line-height: 1.3;
}

.calendar-booking span {
  margin-top: 3px;
  font-size: 0.72rem;
  font-weight: 750;
  opacity: 0.78;
}

.calendar-booking small {
  margin-top: 5px;
  font-size: 0.68rem;
  opacity: 0.7;
}

.booking-lesson {
  border-left-color: #294795;
  background: #e8edf9;
  color: #1d326d;
}

.booking-reservation {
  border-left-color: #b98208;
  background: #fff5d9;
  color: #725208;
}

.booking-maintenance {
  border-left-color: #b34242;
  background: #fbe8e8;
  color: #7d3030;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  padding: 10px 14px;
  border-top: 1px solid #e2e6ec;
  background: #fafbfc;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.legend-dot.lesson {
  background: #294795;
}

.legend-dot.reservation {
  background: #b98208;
}

.legend-dot.maintenance {
  background: #b34242;
}

.calendar-legend .drag-hint {
  margin-left: auto;
  color: #727d90;
}

.booking-dialog-actions {
  width: 100%;
}

.dialog-action-spacer {
  flex: 1;
}

.danger-button {
  border-color: #eccaca;
  background: #fff;
  color: #a53636;
}

.schedule-toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  padding: 11px 15px;
  border-radius: 8px;
  background: var(--navy);
  box-shadow: 0 8px 24px rgba(22, 34, 72, 0.24);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.schedule-toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  .trainer-toolbar {
    grid-template-columns: 1fr auto;
  }

  .trainer-search {
    width: 100%;
    max-width: none;
    grid-column: 1 / -1;
  }
}

/* Signed staff notes */
.notes-page {
  width: min(1400px, 100%);
  margin: 0 auto;
  padding: 38px 24px 60px;
}

.notes-header {
  margin-bottom: 24px;
}

.notes-header h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(2.4rem, 5vw, 4rem);
  letter-spacing: -0.055em;
  line-height: 1;
}

.notes-header p {
  max-width: 640px;
  margin: 12px 0 0;
  color: var(--muted);
}

.notes-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(420px, 1.28fr);
  align-items: start;
  gap: 24px;
}

.note-composer,
.notes-board {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.note-composer {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 18px;
  padding: 24px;
}

.note-composer-heading h2,
.notes-board-toolbar h2 {
  margin: 0;
  color: var(--navy);
  font-size: 1.55rem;
}

.note-composer .section-label,
.notes-board-toolbar .section-label {
  margin-bottom: 3px;
}

.note-composer label {
  color: #334155;
  font-size: 0.86rem;
  font-weight: 750;
}

.note-composer input,
.note-composer textarea,
.notes-search input {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  resize: vertical;
}

.note-composer .button {
  justify-content: center;
}

.notes-board {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  min-height: 0;
  max-height: calc(100vh - 180px);
}

.notes-board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.notes-search {
  width: min(280px, 45%);
}

.notes-board > .result-count {
  padding: 12px 22px;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
}

.notes-list {
  display: grid;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
}

.note-card {
  padding: 20px;
  border: 1px solid #dfe4ed;
  border-left: 4px solid var(--accent-strong);
  border-radius: 12px;
  background: #fff;
}

.note-card p {
  margin: 0;
  color: var(--text);
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.note-card footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.note-card strong,
.note-card time {
  display: block;
}

.note-card strong {
  color: var(--navy);
}

.note-card time {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.74rem;
}

@media (max-width: 900px) {
  .notes-layout {
    grid-template-columns: 1fr;
  }

  .note-composer {
    position: static;
  }

  .notes-board {
    max-height: min(72vh, 920px);
  }
}

@media (max-width: 600px) {
  .notes-page {
    padding: 24px 14px 40px;
  }

  .notes-board-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .notes-search {
    width: 100%;
  }

  .note-card footer {
    align-items: flex-start;
  }

  .notes-board {
    max-height: none;
  }

  .notes-list {
    max-height: 70vh;
  }
}

@media (max-width: 720px) {
  .trainer-page {
    padding: 22px 8px 32px;
  }

  .trainer-page-header {
    align-items: stretch;
    flex-direction: column;
    padding: 0 8px;
  }

  .trainer-page-header .button {
    align-self: flex-start;
  }

  .trainer-toolbar {
    grid-template-columns: 1fr;
    margin-right: 0;
    margin-left: 0;
    border-radius: 8px;
  }

  .trainer-tabs,
  .week-controls {
    overflow-x: auto;
    justify-content: flex-start;
  }

  .trainer-search {
    grid-column: auto;
  }

  .week-controls strong {
    min-width: 165px;
  }

  .calendar-shell {
    border-radius: 8px;
  }

  .calendar-legend .drag-hint {
    width: 100%;
    margin-left: 0;
  }
}

/* Written practice test progress */
.written-page {
  max-width: 1540px;
}

.written-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.written-topbar-copy p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.written-progress-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.written-toolbar {
  border-bottom: 1px solid var(--border);
}

.written-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 12px;
}

.written-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  align-items: stretch;
  gap: 24px;
}

.written-schedule-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  box-shadow: var(--shadow);
}

.written-progress-panel,
.written-schedule-panel {
  min-height: 0;
  max-height: calc(100vh - 230px);
}

.written-schedule-header {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.written-schedule-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

.written-schedule-controls strong {
  min-width: 150px;
  padding: 0 4px;
  text-align: center;
  color: var(--navy);
  font-size: 1rem;
  line-height: 1;
}

.written-schedule-controls .button {
  min-height: 44px;
}

.written-schedule-controls .button.quiet {
  min-width: 44px;
}

#today-written-month {
  min-width: 82px;
}

#open-written-booking-button {
  min-width: 146px;
}

.written-schedule-form {
  margin: 0;
}

.written-calendar-shell {
  border: 1px solid #dce5ef;
  border-radius: 14px;
  background: #fff;
}

.written-calendar-shell {
  overflow: hidden;
  max-height: none;
}

.written-schedule-calendar {
  display: grid;
  gap: 0;
}

.written-month-weekdays,
.written-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.written-month-weekdays span {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  background: #f8fbff;
  color: #64748b;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.written-month-day {
  display: grid;
  appearance: none;
  align-content: start;
  gap: 7px;
  aspect-ratio: 1 / 1;
  width: 100%;
  min-height: 0;
  padding: 10px;
  border-top: 0;
  border-left: 0;
  border-right: 1px solid #e6edf5;
  border-bottom: 1px solid #e6edf5;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.written-month-day {
  border-radius: 0;
}

.written-month-day:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}

.written-month-day:nth-child(7n) {
  border-right: 0;
}

.written-month-day.outside-month {
  background: #f8fafc;
}

.written-month-day.today {
  background: linear-gradient(180deg, #fff3b8 0%, #fff8df 100%);
}

.written-month-day-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.written-month-day-header span {
  color: var(--navy);
  font-size: 0.85rem;
  font-weight: 850;
}

.written-month-day-header small {
  color: var(--muted);
  font-size: 0.63rem;
}

.written-month-day:hover {
  background-color: #e9eef7;
}

.written-month-day.today:hover {
  background: linear-gradient(180deg, #f7e287 0%, #fff1bf 100%);
}

.written-month-day-list {
  display: grid;
  gap: 6px;
  align-content: start;
  overflow: hidden;
}

.written-month-booking {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-left: 4px solid #0f4c81;
  border-radius: 8px;
  background: linear-gradient(180deg, #d8ecff 0%, #bfdef8 100%);
  color: #0f2740;
  text-align: left;
  cursor: pointer;
}

.written-month-booking strong,
.written-month-booking span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.written-month-booking strong {
  font-size: 0.68rem;
}

.written-month-booking span {
  font-size: 0.58rem;
}

.written-month-more {
  color: var(--muted);
  font-size: 0.62rem;
}

.written-day-dialog-list {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.written-day-dialog-card {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fbff;
}

.written-day-dialog-card strong,
.written-day-dialog-card small {
  display: block;
}

.written-day-dialog-card strong {
  color: var(--navy);
  font-size: 0.9rem;
}

.written-day-dialog-card small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.74rem;
}

.written-student-list {
  display: grid;
  overflow: auto;
}

.written-student-card {
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.written-student-card:last-child {
  border-bottom: 0;
}

.written-student-card > summary {
  display: grid;
  min-height: 78px;
  grid-template-columns: minmax(190px, 1.3fr) minmax(180px, 1fr) minmax(130px, 0.8fr) 145px;
  align-items: center;
  gap: 20px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
}

.written-student-card > summary::-webkit-details-marker {
  display: none;
}

.written-student-card > summary:hover {
  background: #f8f9fb;
}

.written-student-card[open] > summary {
  border-bottom: 1px solid var(--border);
  background: #f8f9fb;
}

.written-student-card.status-complete > summary {
  box-shadow: inset 4px 0 #1d9b63;
}

.written-student-card.status-close > summary {
  box-shadow: inset 4px 0 #d19a16;
}

.written-student-card.status-progress > summary {
  box-shadow: inset 4px 0 #8792a5;
}

.written-student-name,
.written-student-name strong,
.written-student-name small {
  display: block;
}

.written-student-name strong {
  color: var(--navy);
  font-size: 0.95rem;
}

.written-student-name small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.7rem;
}

.score-streak {
  display: flex;
  gap: 6px;
}

.score-chip {
  display: inline-grid;
  min-width: 48px;
  min-height: 32px;
  place-items: center;
  border-radius: 7px;
  font-size: 0.73rem;
  font-weight: 850;
}

.score-chip.passing {
  background: #dcf5e8;
  color: #167449;
}

.score-chip.below {
  background: #f3e8e8;
  color: #923d3d;
}

.no-scores {
  color: var(--muted);
  font-size: 0.72rem;
}

.written-progress-track {
  position: relative;
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: #e7eaf0;
}

.written-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--navy-2);
}

.status-complete .written-progress-track i {
  background: #1d9b63;
}

.written-status-complete {
  justify-self: end;
  background: #dcf5e8;
  color: #167449;
}

.written-status-close {
  justify-self: end;
  background: #fff0c7;
  color: #815d07;
}

.written-status-progress {
  justify-self: end;
  background: #edf0f4;
  color: #5e6879;
}

.written-history {
  overflow-x: auto;
  padding: 0 18px 18px;
  background: #f8f9fb;
}

.written-progress-panel .empty-state {
  margin: 18px;
}

.written-student-list::-webkit-scrollbar,
.written-calendar-shell::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.written-student-list::-webkit-scrollbar-thumb,
.written-calendar-shell::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(120, 138, 167, 0.5);
  background-clip: padding-box;
}

.written-student-list::-webkit-scrollbar-track,
.written-calendar-shell::-webkit-scrollbar-track {
  background: transparent;
}

.written-history-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
}

.written-history-actions strong {
  color: var(--navy);
  font-size: 0.78rem;
}

.delete-written-student {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.72rem;
}

.written-history table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: #fff;
}

.written-history th,
.written-history td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.written-history th {
  color: #687386;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.written-history td {
  color: #485367;
  font-size: 0.75rem;
}

@media (max-width: 900px) {
  .written-workspace {
    grid-template-columns: 1fr;
  }

  .written-progress-panel,
  .written-schedule-panel {
    max-height: none;
  }

  .written-schedule-header {
    align-items: center;
  }

  .written-schedule-controls {
    justify-content: center;
  }

  .written-month-weekdays span,
  .written-month-day {
    min-width: 0;
  }

  .written-month-day {
    aspect-ratio: auto;
    min-height: 112px;
  }

  .written-toolbar-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .written-student-card > summary {
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 12px;
  }

  .score-streak,
  .written-progress-track {
    grid-column: 1 / -1;
  }

  .written-status-complete,
  .written-status-close,
  .written-status-progress {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (max-width: 480px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .stage-metric-grid {
    grid-template-columns: 1fr;
  }

  .fleet-list {
    grid-template-columns: 1fr;
  }

  .fleet-item:nth-child(odd) {
    border-right: 0;
  }
}

.hero-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.site-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.site-brand strong {
  font-size: 1.1rem;
}

.site-brand span {
  color: var(--muted);
  font-size: 0.95rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.site-nav a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.12);
  color: var(--accent-strong);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(2.5rem, 3vw, 4rem);
  line-height: 1.04;
}

.hero p {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(14, 165, 233, 0.18);
}

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

.secondary {
  background: rgba(251, 191, 36, 0.12);
  color: #92400e;
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.feature-section {
  margin-top: 36px;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.feature-grid {
  display: grid;
  gap: 20px;
  margin-top: 22px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.feature-card {
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  background: var(--surface-2);
}

.feature-card h3 {
  margin-top: 0;
  margin-bottom: 12px;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
}

.grid-section {
  margin-top: 42px;
}

.grid-section h2,
.grid-section p,
.notes h2,
.notes p {
  margin: 0;
}

.grid-section h2 {
  font-size: 2rem;
}

.grid-section p {
  color: var(--muted);
  margin-top: 10px;
  max-width: 760px;
}

.grid {
  display: grid;
  gap: 20px;
  margin-top: 24px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 24px;
  background: var(--surface);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.04);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 12px;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.tag {
  display: inline-flex;
  margin-top: 18px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.16);
  color: #92400e;
  font-size: 0.9rem;
}

.notes {
  margin-top: 42px;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

footer {
  margin-top: 42px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

@media (max-width: 760px) {
  .hero {
    padding: 28px;
  }

  .page-shell {
    padding: 24px 18px 32px;
  }
}

/* Academy of Aviation product shell */
.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: flex;
  width: 100%;
  min-height: 72px;
  align-items: stretch;
  gap: 28px;
  padding: 0 max(24px, calc((100vw - 1540px) / 2));
  border-bottom: 3px solid var(--accent-strong);
  background: var(--navy);
  box-shadow: 0 6px 20px rgba(12, 22, 58, 0.18);
}

.brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}

.brand img {
  width: 74px;
  height: 52px;
  padding: 2px 4px;
  border-radius: 6px;
  background: #fff;
  object-fit: contain;
}

.brand span,
.brand strong,
.brand small {
  display: block;
}

.brand span {
  display: none;
}

.brand strong {
  font-size: 1rem;
  letter-spacing: 0.12em;
}

.brand small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  min-width: 0;
  align-items: stretch;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.main-nav a {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 0 15px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.16s ease, background-color 0.16s ease;
}

.main-nav a:hover,
.main-nav a.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.main-nav a.active::after {
  position: absolute;
  right: 15px;
  bottom: 0;
  left: 15px;
  height: 3px;
  background: #f4c84d;
  content: "";
}

.page-shell {
  max-width: 1240px;
  padding: 38px 24px 56px;
}

.home-page {
  display: grid;
  max-width: 1540px;
  gap: 28px;
}

.home-dashboard {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(560px, 1.1fr);
  align-items: start;
  gap: 28px;
}

.home-primary,
.live-operations {
  display: grid;
  min-width: 0;
  gap: 20px;
}

.home-hero {
  position: relative;
  min-height: 294px;
  overflow: hidden;
  border: 1px solid #dfe3ea;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.home-hero::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--accent-strong);
  content: "";
}

.home-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 38px;
}

.section-label {
  display: block;
  margin-bottom: 10px;
  color: #a17408;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.home-hero h1 {
  max-width: 560px;
  margin: 0;
  color: var(--navy);
  font-size: clamp(2.35rem, 4.5vw, 4rem);
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.home-hero p {
  max-width: 560px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.06rem;
}

.home-hero .hero-actions {
  align-items: center;
  margin-top: 24px;
}

.text-link {
  padding: 10px 4px;
  color: var(--navy);
  font-weight: 750;
  text-decoration: none;
}

.text-link span {
  margin-left: 5px;
  color: #b8860b;
}

.hero-brand-panel {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: center;
  padding: 38px;
  background: linear-gradient(145deg, #f7f8fb, #edf0f6);
  text-align: center;
}

.hero-brand-panel img {
  width: min(100%, 330px);
  margin: 0 auto;
  mix-blend-mode: multiply;
}

.hero-brand-panel strong,
.hero-brand-panel span {
  display: block;
}

.hero-brand-panel strong {
  margin-top: 8px;
  color: var(--navy);
}

.hero-brand-panel span {
  color: var(--muted);
  font-size: 0.82rem;
}

.live-operations {
  position: sticky;
  top: 96px;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid #cce9da;
  border-radius: 999px;
  background: #edf9f3;
  color: #167449;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.live-indicator i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1d9b63;
  box-shadow: 0 0 0 4px rgba(29, 155, 99, 0.12);
}

.embed-card {
  overflow: hidden;
  border: 1px solid #dce1e9;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(22, 34, 72, 0.06);
}

.embed-card header {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.embed-card header strong,
.embed-card header span {
  display: block;
}

.embed-card header strong {
  color: var(--navy);
  font-size: 0.95rem;
}

.embed-card header span {
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.68rem;
}

.embed-card header .embed-card-label {
  margin: 0 0 2px;
  color: #9b7008;
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.embed-header-status {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.embed-card header a {
  flex: 0 0 auto;
  color: var(--navy);
  font-size: 0.7rem;
  font-weight: 800;
  text-decoration: none;
}

.embed-card header a:hover {
  text-decoration: underline;
}

.embed-card iframe {
  display: block;
  width: 100%;
  height: 390px;
  border: 0;
  background: #eef1f5;
}

.weather-embed iframe {
  height: 430px;
}

.flight-status-updated {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
}

.home-metar {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: #f7f9fc;
}

.home-metar span,
.home-metar strong {
  display: block;
}

.home-metar span {
  margin-bottom: 4px;
  color: #7a8496;
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.home-metar strong {
  color: var(--navy);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.45;
}

.home-flight-status {
  overflow-x: auto;
  background: #fff;
}

.home-status-head,
.home-status-group {
  display: grid;
  min-width: 520px;
  grid-template-columns: 34% 66%;
}

.home-status-head {
  grid-template-columns: 34% 33% 33%;
  border-bottom: 1px solid #dae2f9;
  background: #f3f5fa;
}

.home-status-head span {
  padding: 8px 10px;
  color: #5d687a;
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-status-group + .home-status-group {
  border-top: 1px solid #dae2f9;
}

.home-profile-name {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-right: 1px solid #dae2f9;
  color: #40478c;
  font-size: 0.82rem;
  text-align: center;
}

.home-status-row {
  display: grid;
  min-height: 34px;
  grid-template-columns: 50% 50%;
  align-items: stretch;
}

.home-status-row + .home-status-row {
  border-top: 1px solid #dae2f9;
}

.home-status-row > span,
.home-status-row > strong {
  display: flex;
  align-items: center;
  padding: 7px 10px;
  font-size: 0.68rem;
  font-weight: 800;
}

.home-status-row > strong {
  color: #fff;
}

.home-status-row > strong.open {
  background: #22a866;
}

.home-status-row > strong.hold {
  background: #d94b4b;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  min-height: 50px;
  margin-bottom: 12px;
}

.section-heading h2,
.support-strip h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.section-heading p,
.support-strip p {
  margin: 0;
  color: var(--muted);
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.tool-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 0;
  min-height: 68px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(22, 34, 72, 0.04);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: #bdc5d5;
  box-shadow: 0 10px 24px rgba(22, 34, 72, 0.09);
}

.tool-card:last-child {
  grid-column: auto;
}

.tool-card-copy,
.tool-card-copy strong,
.tool-card-copy small {
  display: block;
}

.tool-card-copy strong {
  color: var(--navy);
  font-size: 1rem;
}

.tool-card-copy small {
  margin-top: 2px;
  color: var(--muted);
}

.support-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 30px 34px;
  border-left: 4px solid var(--accent-strong);
  border-radius: 8px;
  background: var(--navy);
}

.support-strip h2 {
  color: #fff;
  font-size: 1.5rem;
}

.support-strip p {
  max-width: 390px;
  color: rgba(255, 255, 255, 0.68);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px max(24px, calc((100vw - 1240px) / 2));
  border-top: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 0.78rem;
}

/* Clean workspace pages */
.tracker-page,
.sheet-page {
  padding-top: 36px;
}

.tracker-header,
.sheet-header {
  align-items: end;
  margin-bottom: 26px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.tracker-header h1,
.sheet-header h1 {
  color: var(--navy);
  font-size: clamp(2.1rem, 4vw, 3.35rem);
  letter-spacing: -0.05em;
}

.tracker-header p,
.sheet-header p {
  margin-top: 9px;
}

.eyebrow,
.oil-eyebrow,
.equipment-eyebrow,
.fuel-eyebrow {
  margin-bottom: 10px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #9b7008;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.13em;
}

.button {
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 750;
}

.button:hover {
  box-shadow: 0 6px 14px rgba(22, 34, 72, 0.12);
}

.primary,
.oil-primary,
.equipment-primary,
.fuel-primary {
  background: var(--navy);
  color: #fff;
}

.secondary {
  border-color: #d9dee7;
  background: #fff;
  color: var(--navy);
}

.quiet {
  border-color: #d9dee7;
}

.metric-grid {
  gap: 12px;
}

.metric-card {
  padding: 18px 18px 18px 20px;
  border-radius: 10px;
  box-shadow: 0 3px 12px rgba(22, 34, 72, 0.04);
}

.metric-card::before {
  width: 3px;
}

.metric-card strong {
  color: var(--navy);
  font-size: 1.8rem;
}

.tracker-panel,
.fleet-panel,
.schedule-panel {
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(22, 34, 72, 0.05);
}

.tracker-toolbar {
  background: #fafbfc;
}

.tracker-toolbar input,
.tracker-toolbar select,
.request-dialog input,
.request-dialog select,
.request-dialog textarea,
.sheet-actions input[type="search"] {
  border-color: #d9dee7;
  border-radius: 7px;
}

.tracker-table th,
.calendar-table th {
  background: #f3f5f8;
  color: #465066;
}

.oil-table th,
.equipment-table th,
.fuel-table th {
  background: var(--navy);
  color: #fff;
}

.fleet-heading,
.equipment-heading,
.fuel-heading {
  background: var(--navy);
}

.sheet-tabs {
  gap: 4px;
  padding-bottom: 0;
  border-bottom: 1px solid var(--border);
}

.sheet-tab {
  padding: 11px 15px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
}

.sheet-tab.active {
  border-bottom-color: var(--accent-strong);
  background: transparent;
  color: var(--navy);
}

.calendar-table td {
  background: #fff;
}

.booking-block {
  border-radius: 8px;
  background: var(--navy-2);
  box-shadow: none;
}

@media (max-width: 1180px) {
  .home-dashboard {
    grid-template-columns: 1fr;
  }

  .live-operations {
    position: static;
  }
}

@media (max-width: 1050px) {
  .topbar {
    display: block;
    padding: 0;
  }

  .brand {
    height: 64px;
    padding: 7px 18px;
  }

  .brand img {
    width: 66px;
    height: 46px;
  }

  .main-nav {
    height: 48px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .main-nav a {
    padding: 0 14px;
  }

  .home-hero {
    grid-template-columns: 1fr;
  }

  .home-dashboard {
    grid-template-columns: 1fr;
  }

  .live-operations {
    position: static;
  }

  .embed-card iframe,
  .weather-embed iframe {
    height: min(520px, 62vw);
  }

  .hero-brand-panel {
    display: none;
  }
}

@media (max-width: 760px) {
  .home-page {
    gap: 24px;
    padding-top: 20px;
  }

  .home-dashboard,
  .home-primary,
  .live-operations {
    gap: 18px;
  }

  .home-hero {
    min-height: auto;
  }

  .home-hero-copy {
    padding: 38px 26px;
  }

  .home-hero h1 {
    font-size: 2.6rem;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }

  .tool-card:last-child {
    grid-column: auto;
  }

  .section-heading,
  .support-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .support-strip {
    padding: 26px;
  }

  .site-footer {
    flex-direction: column;
  }

  .embed-card header {
    min-height: 54px;
    padding: 9px 11px;
  }

  .embed-card header span {
    display: none;
  }

  .embed-card header .live-indicator {
    display: inline-flex;
  }

  .embed-header-status {
    align-self: center;
  }

  .embed-card iframe,
  .weather-embed iframe {
    height: 72vw;
    min-height: 300px;
    max-height: 430px;
  }

  .tracker-page,
  .sheet-page {
    padding-top: 26px;
  }
}

/* Roomy ground trainer workspace */
.trainer-page {
  padding-top: 26px;
  padding-bottom: 28px;
}

.trainer-page-header {
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
}

.trainer-page-header h1 {
  font-size: clamp(1.8rem, 2.5vw, 2.4rem);
  letter-spacing: -0.045em;
}

.trainer-page-header .button {
  min-height: 44px;
  padding: 10px 18px;
  font-size: 0.82rem;
}

.trainer-toolbar {
  gap: 18px;
  margin-bottom: 18px;
  padding: 12px;
  border-radius: 14px;
}

.trainer-tab {
  min-height: 42px;
  padding: 10px 14px;
  font-size: 0.8rem;
}

.icon-control {
  width: 42px;
  height: 42px;
}

.week-controls strong {
  min-width: 200px;
  font-size: 0.86rem;
}

.trainer-search {
  width: min(100%, 300px);
}

.trainer-search input {
  min-height: 42px;
  padding: 10px 12px;
  font-size: 0.82rem;
}

.trainer-calendar {
  --slot-height: 52px;
  grid-template-rows: 62px auto;
}

.day-header strong {
  width: 36px;
  height: 36px;
  font-size: 0.95rem;
}

.calendar-legend {
  gap: 20px;
  padding: 12px 16px;
  font-size: 0.72rem;
}

@media (max-width: 720px) {
  .trainer-page {
    padding-top: 14px;
  }

  .trainer-page-header {
    align-items: center;
    flex-direction: row;
    gap: 10px;
    padding: 0 4px;
  }

  .trainer-page-header h1 {
    font-size: 1.3rem;
  }

  .trainer-page-header .button {
    width: auto;
    margin-left: auto;
    white-space: nowrap;
  }

  .trainer-toolbar {
    grid-template-columns: 1fr;
  }

  .trainer-tabs,
  .week-controls {
    width: 100%;
  }

  .trainer-tabs .trainer-tab {
    flex: 1;
    justify-content: center;
  }

  .week-controls {
    justify-content: flex-start;
  }

  .week-controls strong {
    min-width: 0;
    margin-left: auto;
  }

  .trainer-search {
    width: 100%;
    max-width: none;
    grid-column: auto;
  }

  .calendar-legend .drag-hint {
    display: none;
  }
}

/* Simplified primary navigation */
.main-nav {
  overflow: visible;
}

.nav-more {
  position: relative;
  display: flex;
  align-items: stretch;
  color: rgba(255, 255, 255, 0.72);
}

.nav-more summary {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 15px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  list-style: none;
  transition: color 0.16s ease, background-color 0.16s ease;
}

.nav-more summary::-webkit-details-marker {
  display: none;
}

.nav-more summary::after {
  border: 4px solid transparent;
  border-top-color: currentColor;
  content: "";
  transform: translateY(3px);
}

.nav-more:hover summary,
.nav-more[open] summary,
.nav-more.active summary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-more.active summary::before {
  position: absolute;
  right: 15px;
  bottom: 0;
  left: 15px;
  height: 3px;
  background: #f4c84d;
  content: "";
}

.nav-more-menu {
  position: absolute;
  z-index: 100;
  top: calc(100% - 4px);
  right: 0;
  display: grid;
  width: 190px;
  padding: 7px;
  border: 1px solid #dce1e9;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(12, 22, 58, 0.2);
}

.main-nav .nav-more-menu a {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 7px;
  color: var(--navy);
}

.main-nav .nav-more-menu a:hover,
.main-nav .nav-more-menu a.active {
  background: #edf0f8;
  color: var(--navy);
}

.main-nav .nav-more-menu a.active::after {
  display: none;
}

/* Latest signed notes on home */
.home-notes-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.home-notes-heading {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}

.home-notes-heading .section-label {
  margin-bottom: 3px;
}

.home-notes-heading h2 {
  margin: 0;
  color: var(--navy);
  font-size: 1.35rem;
}

.home-notes-heading a,
.home-notes-empty a {
  color: var(--navy);
  font-size: 0.76rem;
  font-weight: 800;
  text-decoration: none;
}

.home-notes-list {
  display: grid;
  max-height: 360px;
  overflow-y: auto;
}

.home-note {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.home-note:last-child {
  border-bottom: 0;
}

.home-note p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--text);
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.home-note footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.7rem;
}

.home-note strong {
  color: var(--navy);
}

.home-notes-empty {
  padding: 28px 18px;
  text-align: center;
}

.home-notes-empty p {
  margin: 0 0 5px;
  color: var(--muted);
}

@media (max-width: 760px) {
  .topbar {
    align-items: center;
    gap: 8px;
  }

  .brand span {
    display: none;
  }

  .brand img {
    width: 62px;
    height: 46px;
  }

  .main-nav {
    flex: 1;
    justify-content: flex-end;
  }

  .main-nav > a,
  .nav-more summary {
    padding: 0 9px;
    font-size: 0.72rem;
  }

  .main-nav > a:nth-of-type(2),
  .main-nav > a:nth-of-type(3) {
    display: none;
  }

  .nav-more-menu {
    position: fixed;
    top: 70px;
    right: 10px;
    left: 10px;
    width: auto;
  }

  .home-notes-heading {
    padding: 14px;
  }

  .home-note {
    padding: 14px;
  }

  .home-notes-list {
    max-height: 320px;
  }
}

/* Responsive polish for tablets and phones */
@media (max-width: 1050px) {
  .tracker-page,
  .sheet-page {
    width: 100%;
    padding-right: 18px;
    padding-left: 18px;
  }

  .tracker-header,
  .sheet-header {
    gap: 18px;
  }

  .tracker-header h1,
  .sheet-header h1 {
    font-size: clamp(2rem, 6vw, 3rem);
  }

  .tracker-table-wrap,
  .written-history,
  .calendar-scroll {
    overscroll-behavior-x: contain;
    scrollbar-color: #aeb7c6 #eef1f5;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .tracker-table-wrap::-webkit-scrollbar,
  .written-history::-webkit-scrollbar,
  .calendar-scroll::-webkit-scrollbar,
  .main-nav::-webkit-scrollbar {
    height: 6px;
  }

  .tracker-table-wrap::-webkit-scrollbar-thumb,
  .written-history::-webkit-scrollbar-thumb,
  .calendar-scroll::-webkit-scrollbar-thumb,
  .main-nav::-webkit-scrollbar-thumb {
    border-radius: 99px;
    background: #aeb7c6;
  }

  .tracker-table-wrap::-webkit-scrollbar-track,
  .written-history::-webkit-scrollbar-track,
  .calendar-scroll::-webkit-scrollbar-track {
    background: #eef1f5;
  }

  .tracker-table {
    min-width: 1040px;
  }

  .oil-table {
    min-width: 700px;
  }

  .equipment-table {
    min-width: 880px;
  }

  .fuel-table {
    min-width: 960px;
  }

  .trainer-calendar {
    min-width: 1120px;
    grid-template-columns: 82px repeat(7, minmax(145px, 1fr));
  }

  .calendar-booking {
    right: 3px;
    left: 3px;
  }
}

@media (max-width: 760px) {
  body {
    line-height: 1.45;
  }

  .topbar {
    position: sticky;
  }

  .brand {
    height: 56px;
    padding: 6px 12px;
  }

  .brand img {
    width: 58px;
    height: 40px;
  }

  .brand small {
    font-size: 0.62rem;
  }

  .main-nav {
    height: 44px;
    scroll-padding-inline: 12px;
    scroll-snap-type: x proximity;
  }

  .main-nav a {
    min-height: 44px;
    padding: 0 12px;
    font-size: 0.76rem;
    scroll-snap-align: start;
  }

  .page-shell,
  .tracker-page,
  .sheet-page {
    padding-right: 12px;
    padding-left: 12px;
  }

  .tracker-header,
  .sheet-header {
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 18px;
  }

  .tracker-header h1,
  .sheet-header h1 {
    font-size: clamp(1.8rem, 10vw, 2.45rem);
    line-height: 1.03;
  }

  .tracker-header p,
  .sheet-header p {
    line-height: 1.45;
  }

  .tracker-header .controls,
  .sheet-actions .controls {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .tracker-header .controls .button,
  .sheet-actions .controls .button {
    width: 100%;
    min-width: 0;
    padding-right: 10px;
    padding-left: 10px;
  }

  .tracker-header .controls .button:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .metric-grid,
  .stage-metric-grid {
    gap: 8px;
  }

  .metric-card {
    min-width: 0;
    padding: 13px 12px 13px 15px;
  }

  .metric-card span,
  .metric-card small {
    font-size: 0.72rem;
    line-height: 1.35;
  }

  .metric-card strong {
    overflow-wrap: anywhere;
    font-size: clamp(1.25rem, 7vw, 1.65rem);
  }

  .tracker-panel,
  .fleet-panel,
  .written-progress-panel,
  .written-schedule-panel,
  .calendar-shell {
    border-radius: 9px;
  }

  .tracker-toolbar {
    gap: 10px;
    padding: 12px;
  }

  .filter-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .tracker-toolbar input,
  .tracker-toolbar select {
    min-height: 44px;
  }

  .month-controls label {
    min-width: 0;
    flex: 1;
  }

  .month-controls .month-button {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
  }

  .result-count {
    white-space: normal;
  }

  .tracker-table {
    min-width: 920px;
    font-size: 0.8rem;
  }

  .tracker-table th,
  .tracker-table td {
    padding: 11px 9px;
  }

  .row-action,
  .return-button {
    min-height: 44px;
    padding: 8px 11px;
  }

  .rental-actions {
    flex-wrap: wrap;
  }

  .oil-table {
    min-width: 650px;
  }

  .equipment-table {
    min-width: 810px;
  }

  .fuel-table {
    min-width: 880px;
  }

  .fleet-list {
    grid-template-columns: 1fr;
  }

  .fleet-item:nth-child(odd) {
    border-right: 0;
  }

  .fleet-heading {
    padding: 16px;
  }

  .request-dialog {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 12px);
    margin: auto 0 0;
    border-radius: 16px 16px 0 0;
  }

  .request-dialog form {
    padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
  }

  .dialog-heading h2 {
    font-size: 1.45rem;
  }

  .form-grid {
    gap: 12px;
    margin: 18px 0;
  }

  .request-dialog input,
  .request-dialog select,
  .request-dialog textarea {
    min-height: 44px;
    font-size: 16px;
  }

  .dialog-actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .dialog-actions .button {
    flex: 1 1 120px;
  }

  .dialog-action-spacer {
    display: none;
  }

  .trainer-page {
    padding: 14px 8px 12px;
  }

  .trainer-page-header {
    gap: 12px;
    margin-bottom: 10px;
    padding: 0 4px;
  }

  .trainer-page-header h1 {
    font-size: clamp(1.75rem, 10vw, 2.35rem);
  }

  .trainer-page-header p {
    font-size: 0.84rem;
    line-height: 1.4;
  }

  .trainer-page-header .button {
    width: 100%;
  }

  .trainer-toolbar {
    gap: 8px;
    padding: 8px;
  }

  .trainer-tab,
  .icon-control,
  .trainer-search input,
  .week-controls .button {
    min-height: 44px;
  }

  .week-controls {
    padding-bottom: 2px;
  }

  .week-controls strong {
    min-width: 150px;
    font-size: 0.8rem;
  }

  .trainer-calendar {
    min-width: 980px;
    grid-template-columns: 72px repeat(7, minmax(128px, 1fr));
  }

  .calendar-corner {
    padding: 6px;
  }

  .time-label {
    padding-right: 6px;
    font-size: 0.62rem;
  }

  .calendar-booking strong {
    font-size: 0.74rem;
  }

  .calendar-booking span,
  .calendar-booking small {
    font-size: 0.6rem;
  }

  .calendar-legend {
    gap: 10px 14px;
    padding: 9px 10px;
  }

  .written-student-card > summary {
    min-height: 70px;
    padding: 12px;
  }

  .written-schedule-panel {
    padding: 14px;
    gap: 14px;
  }

  .written-schedule-form {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .written-calendar-shell {
    max-height: none;
    overflow-x: auto;
  }

  .written-student-list {
    overflow: visible;
  }

  .score-streak {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .written-history {
    padding: 0 10px 12px;
  }

  .written-history-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .home-hero-copy {
    padding: 30px 22px;
  }

  .home-hero h1 {
    font-size: clamp(2.15rem, 12vw, 2.8rem);
  }

  .home-hero .hero-actions {
    align-items: stretch;
    flex-direction: column;
    margin-top: 24px;
  }

  .home-hero .hero-actions .button,
  .home-hero .hero-actions .text-link {
    width: 100%;
    text-align: center;
  }

  .tool-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 15px;
  }

  .support-strip {
    padding: 22px;
  }

  .site-footer {
    padding-right: 16px;
    padding-left: 16px;
  }
}

@media (max-width: 480px) {
  .metric-grid,
  .stage-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card small {
    display: none;
  }

  .tracker-header .controls {
    grid-template-columns: 1fr;
  }

  .tracker-header .controls .button:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .dialog-actions .button,
  .booking-dialog-actions .button {
    flex-basis: 100%;
  }

  .written-student-card > summary {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .written-status-complete,
  .written-status-close,
  .written-status-progress {
    font-size: 0.65rem;
  }
}

/* Homepage alignment pass */
.topbar {
  padding-right: max(24px, calc((100vw - 1400px) / 2));
  padding-left: max(24px, calc((100vw - 1400px) / 2));
}

.home-page {
  width: 100%;
  max-width: 1400px;
  padding-top: 12px;
}

.home-dashboard {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.home-primary,
.live-operations {
  gap: 24px;
}

.home-hero {
  min-height: 240px;
}

.home-hero-copy {
  padding: 40px;
}

.section-heading {
  min-height: 64px;
  margin-bottom: 16px;
}

.section-heading .section-label {
  margin-bottom: 6px;
}

.tool-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tool-card {
  min-height: 76px;
  gap: 14px;
  padding: 14px 16px;
}

.tool-card-copy small {
  line-height: 1.35;
}

.embed-card header {
  min-height: 80px;
  padding: 14px 18px;
}

.home-metar {
  padding: 14px 18px;
}

.home-status-head span,
.home-profile-name,
.home-status-row > span,
.home-status-row > strong {
  padding-right: 14px;
  padding-left: 14px;
}

.site-footer {
  padding-right: max(24px, calc((100vw - 1400px) / 2));
  padding-left: max(24px, calc((100vw - 1400px) / 2));
}

@media (max-width: 1180px) {
  .home-dashboard {
    grid-template-columns: 1fr;
  }

  .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1050px) {
  .topbar {
    padding-right: 0;
    padding-left: 0;
  }
}

@media (max-width: 760px) {
  .home-page {
    padding-top: 18px;
  }

  .home-dashboard,
  .home-primary,
  .live-operations {
    gap: 16px;
  }

  .home-hero-copy {
    padding: 30px 24px;
  }

  .section-heading {
    min-height: 0;
    margin-bottom: 12px;
  }

  .tool-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .tool-card {
    min-height: 68px;
    padding: 12px 14px;
  }

  .embed-card header,
  .home-metar {
    padding-right: 14px;
    padding-left: 14px;
  }

  .home-status-head,
  .home-status-group {
    min-width: 0;
    grid-template-columns: 32% 68%;
  }

  .home-status-head {
    grid-template-columns: 32% 34% 34%;
  }

  .home-status-head span,
  .home-profile-name,
  .home-status-row > span,
  .home-status-row > strong {
    padding-right: 8px;
    padding-left: 8px;
  }

  .home-profile-name {
    overflow-wrap: anywhere;
    font-size: 0.7rem;
  }

  .home-status-row > span,
  .home-status-row > strong {
    font-size: 0.64rem;
  }
}

@media (max-width: 720px) {
  .trainer-page {
    padding-top: 14px;
  }

  .trainer-page-header {
    align-items: center;
    flex-direction: row;
    gap: 10px;
    margin-bottom: 14px;
    padding: 0 4px;
  }

  .trainer-page-header h1 {
    font-size: 1.55rem;
  }

  .trainer-page-header .button {
    width: auto;
    min-height: 44px;
    margin-left: auto;
    padding: 10px 14px;
    white-space: nowrap;
  }

  .trainer-tab,
  .icon-control,
  .trainer-search input,
  .week-controls .button {
    min-height: 44px;
  }

  .calendar-legend {
    padding: 10px 12px;
  }
}

/* Clean desktop application header */
@media (min-width: 1051px) {
  .topbar {
    min-height: 76px;
    align-items: center;
    gap: 28px;
    padding-right: max(28px, calc((100vw - 1400px) / 2));
    padding-left: max(28px, calc((100vw - 1400px) / 2));
    border-bottom: 1px solid #dce1e9;
    background: #fff;
    box-shadow: 0 5px 18px rgba(22, 34, 72, 0.07);
  }

  .brand {
    gap: 12px;
    color: var(--navy);
  }

  .brand img {
    width: 76px;
    height: 52px;
    padding: 0;
    background: transparent;
  }

  .brand strong {
    font-size: 0.95rem;
  }

  .brand small {
    color: var(--muted);
  }

  .main-nav {
    flex: 1;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    overflow: visible;
  }

  .main-nav > a,
  .main-nav .nav-more-menu a {
    min-height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    color: #536078;
    font-size: 0.76rem;
    font-weight: 750;
    white-space: nowrap;
  }

  .main-nav > a:hover,
  .main-nav .nav-more-menu a:hover {
    background: #f0f2f6;
    color: var(--navy);
  }

  .main-nav > a.active,
  .main-nav .nav-more-menu a.active {
    background: var(--navy);
    color: #fff;
  }

  .main-nav a.active::after {
    display: none;
  }

  .nav-more {
    display: flex;
    align-items: center;
    color: #536078;
  }

  .nav-more summary {
    display: flex;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    color: #536078;
    font-size: 0.76rem;
    font-weight: 750;
  }

  .nav-more:hover summary,
  .nav-more[open] summary {
    background: #f0f2f6;
    color: var(--navy);
  }

  .nav-more.active summary {
    background: var(--navy);
    color: #fff;
  }

  .nav-more.active summary::before {
    display: none;
  }

  .nav-more-menu {
    top: calc(100% + 8px);
    width: 205px;
    gap: 3px;
  }
}

/* Simple home page hero */
.home-title-hero {
  position: relative;
  display: flex;
  min-height: 132px;
  align-items: end;
  padding: 12px 4px;
}

.home-title-hero::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--accent-strong);
  content: "";
}

.home-title-hero h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(3rem, 6vw, 5.5rem);
  letter-spacing: -0.065em;
  line-height: 0.95;
}

@media (max-width: 760px) {
  .home-title-hero {
    min-height: 120px;
    padding: 18px 2px;
  }

  .home-title-hero h1 {
    font-size: clamp(2.5rem, 14vw, 4rem);
  }
}

@media (min-width: 1181px) {
  .home-title-hero::after {
    width: calc(200% + 24px);
  }
}

/* Home dashboard layout */
.home-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.home-resources {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-self: stretch;
}

.home-resources .section-heading {
  margin-bottom: 16px;
}

.home-resources .tool-grid {
  height: 100%;
  grid-auto-rows: minmax(0, 1fr);
}

.home-resources .tool-card {
  min-height: 0;
}

@media (min-width: 1181px) {
  .home-primary {
    display: contents;
  }

  .home-title-hero {
    grid-column: 1 / -1;
  }

  .home-title-hero::after {
    width: 100%;
  }

  .home-notes-panel {
    grid-column: 1;
  }

  .home-resources {
    grid-column: 2;
  }
}

.home-live-grid {
  position: static;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 24px;
}

.home-live-grid .embed-card {
  display: flex;
  min-width: 0;
  min-height: 520px;
  flex-direction: column;
}

.home-live-grid .weather-embed iframe {
  height: auto;
  min-height: 0;
  flex: 1;
}

.home-live-grid .home-flight-status {
  flex: 1;
}

@media (max-width: 1180px) {
  .home-dashboard {
    grid-template-columns: 1fr;
  }

  .home-resources .tool-grid {
    height: auto;
    grid-auto-rows: auto;
  }

  .home-live-grid {
    grid-template-columns: 1fr;
  }

  .home-live-grid .embed-card {
    min-height: 0;
  }

  .home-live-grid .weather-embed iframe {
    height: clamp(420px, 56vw, 620px);
    flex: 0 0 auto;
  }
}

@media (min-width: 761px) and (max-width: 1180px) {
  .home-live-grid .weather-embed {
    min-height: 560px;
  }

  .home-live-grid .weather-embed iframe {
    height: 560px;
    min-height: 560px;
    max-height: none;
  }
}

@media (max-width: 760px) {
  .home-live-grid {
    gap: 16px;
  }

  .home-live-grid .weather-embed iframe {
    height: 72vw;
    min-height: 300px;
  }
}

/* Mobile parity pass */
@media (max-width: 760px) {
  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    align-items: stretch;
  }

  .brand {
    height: auto;
    min-height: 60px;
    padding: 8px 12px;
  }

  .brand strong {
    font-size: 0.84rem;
    letter-spacing: 0.08em;
  }

  .main-nav {
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
  }

  .main-nav > a,
  .nav-more summary {
    display: inline-flex;
    padding: 0 12px;
    font-size: 0.76rem;
  }

  .main-nav > a:nth-of-type(2),
  .main-nav > a:nth-of-type(3) {
    display: inline-flex;
  }

  .nav-more-menu {
    top: calc(100% + 6px);
  }

  .metric-grid,
  .stage-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-card {
    min-height: 104px;
  }

  .metric-card small {
    display: block;
  }

  .tracker-header .controls,
  .sheet-actions .controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trainer-page {
    padding: 18px 10px 18px;
  }

  .trainer-page-header {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 16px;
    padding: 0 4px;
  }

  .trainer-page-header h1 {
    font-size: clamp(1.75rem, 8vw, 2.35rem);
  }

  .trainer-page-header .button {
    width: 100%;
    margin-left: 0;
    white-space: normal;
  }

  .trainer-tabs .trainer-tab {
    flex: 0 0 auto;
  }

  .week-controls {
    justify-content: space-between;
  }

  .week-controls strong {
    min-width: 0;
    margin-left: 0;
    flex: 1;
  }

  .notes-board-toolbar,
  .home-notes-heading,
  .embed-card header {
    align-items: flex-start;
    flex-direction: column;
  }

  .embed-card header span {
    display: block;
  }

  .embed-header-status {
    width: 100%;
    justify-items: start;
  }

  .tool-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .home-flight-status {
    overflow-x: auto;
  }

  .home-status-head,
  .home-status-group {
    min-width: 520px;
    grid-template-columns: 34% 66%;
  }

  .home-status-head {
    grid-template-columns: 34% 33% 33%;
  }

  .home-status-head span,
  .home-profile-name,
  .home-status-row > span,
  .home-status-row > strong {
    padding-right: 12px;
    padding-left: 12px;
  }

  .home-profile-name {
    font-size: 0.78rem;
  }

  .home-status-row > span,
  .home-status-row > strong {
    font-size: 0.68rem;
  }

  .site-footer {
    gap: 6px;
  }
}

@media (max-width: 480px) {
  .metric-grid,
  .stage-metric-grid,
  .tracker-header .controls,
  .sheet-actions .controls,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .metric-card small {
    display: block;
  }
}

@media (max-width: 1050px) {
  .topbar {
    border-bottom: 1px solid #dce1e9;
    background: #fff;
    box-shadow: 0 5px 18px rgba(22, 34, 72, 0.07);
  }

  .brand {
    color: var(--navy);
  }

  .brand img {
    padding: 0;
    background: transparent;
  }

  .main-nav {
    border-top: 0;
  }

  .main-nav > a {
    border-radius: 8px;
    color: #536078;
    font-weight: 750;
  }

  .main-nav > a:hover,
  .main-nav > a.active {
    background: #f0f2f6;
    color: var(--navy);
  }

  .main-nav > a.active::after {
    display: none;
  }

  .nav-more {
    color: #536078;
  }

  .nav-more summary {
    min-height: 40px;
    border-radius: 8px;
    color: #536078;
    font-weight: 750;
  }

  .nav-more:hover summary,
  .nav-more[open] summary {
    background: #f0f2f6;
    color: var(--navy);
  }

  .nav-more.active summary {
    background: var(--navy);
    color: #fff;
  }

  .nav-more.active summary::before {
    display: none;
  }

  .nav-more-menu {
    border: 1px solid #dce1e9;
    background: #fff;
    box-shadow: 0 18px 40px rgba(12, 22, 58, 0.2);
  }

  .main-nav .nav-more-menu a {
    min-height: 42px;
    border-radius: 7px;
    color: var(--navy);
  }

  .main-nav .nav-more-menu a:hover,
  .main-nav .nav-more-menu a.active {
    background: #edf0f8;
    color: var(--navy);
  }

  .tracker-panel,
  .fleet-panel,
  .written-progress-panel,
  .written-schedule-panel,
  .calendar-shell,
  .home-notes-panel,
  .embed-card {
    border: 1px solid var(--border);
    background: #fff;
    box-shadow: 0 4px 16px rgba(22, 34, 72, 0.05);
  }

  .home-notes-heading,
  .embed-card header {
    background: #fafbfc;
  }

  .tool-card {
    border: 1px solid var(--border);
    background: #fff;
    box-shadow: 0 3px 12px rgba(22, 34, 72, 0.04);
  }
}

@media (max-width: 760px) {
  .topbar {
    overflow: visible;
  }

  .main-nav {
    overflow-x: auto;
    overflow-y: visible;
    position: relative;
    padding: 0 12px 10px;
    gap: 6px;
  }

  .nav-more {
    position: static;
    flex: 0 0 auto;
  }

  .nav-more summary {
    white-space: nowrap;
  }

  .nav-more-menu {
    position: fixed;
    z-index: 200;
    top: 98px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
    padding: 8px;
    border-radius: 12px;
  }

  .main-nav .nav-more-menu a {
    padding: 10px 12px;
  }
}
