:root {
  color-scheme: dark;
  --page: #1d1e20;
  --panel: #252629;
  --panel-raised: #2d2f32;
  --line: #36404a;
  --line-strong: #1676ce;
  --blue: #1689ef;
  --blue-light: #28a1ff;
  --text: #f2f4f6;
  --muted: #a5a9ad;
  --subtle: #747a80;
  --cyan: #00bad6;
  font-family: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
}

button, input, select { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.app-shell { max-width: 1680px; margin: 0 auto; padding: 0 18px 24px; }
.topbar { min-height: 72px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid #343639; }
.brand-mark { width: 42px; height: 34px; display: grid; place-items: center; border: 1px solid #b99860; color: #d4b276; font-weight: 800; letter-spacing: .06em; }
.brand-copy h1 { margin: 0; font-size: 19px; font-weight: 700; }
.brand-copy p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.topbar-meta { margin-left: auto; color: var(--muted); font-size: 13px; }
.signout-button { margin: 10px 0 14px auto; display: block; }
.auth-panel { max-width: 430px; margin: 36px auto; padding: 24px; border: 1px solid #3d444c; border-radius: 8px; background: #242629; }
.auth-panel h2 { margin: 0 0 8px; font-size: 20px; }
.auth-panel p { color: var(--muted); }
.auth-panel form, .auth-panel label { display: grid; gap: 8px; }
.auth-panel form { gap: 16px; margin-top: 20px; }
.auth-panel label { font-size: 13px; font-weight: 600; }
.auth-panel input { width: 100%; min-height: 42px; padding: 8px 10px; color: var(--text); background: #202124; border: 1px solid #3d444c; border-radius: 5px; }
.auth-panel .primary-button { min-height: 40px; border: 0; border-radius: 5px; background: var(--blue); color: white; font-weight: 700; cursor: pointer; }
.auth-error { min-height: 18px; margin: 0; color: #ffb4a9 !important; font-size: 13px; }

.toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 14px; padding: 18px 0; }
.search-wrap, .month-wrap { position: relative; display: flex; flex-direction: column; gap: 6px; }
.search-wrap { width: min(430px, 100%); }
.month-wrap { width: 190px; }
.field-label { color: #d6d9dc; font-size: 13px; font-weight: 700; }
input, select { min-height: 42px; border: 1px solid #3d444c; border-radius: 5px; background: #202225; color: var(--text); padding: 0 12px; outline: none; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 2px #1689ef33; }
input::placeholder { color: #81878d; }
.summary { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.summary-badge { border: 1px solid #3d444c; border-radius: 3px; padding: 7px 9px; background: #242629; }
.summary-badge strong { color: var(--text); font-size: 13px; margin-right: 4px; }
.summary-badge.warning { border-color: #755832; color: #e8c98b; }
.summary-action { cursor: pointer; }
.summary-action:hover, .summary-action:focus { background: #34383c; outline: 1px solid #b48b4d; }

.coverage-panel { margin: 0 0 16px; border: 1px solid #755832; border-radius: 5px; background: #252629; overflow: hidden; }
.coverage-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 13px 15px; border-bottom: 1px solid #51432d; }
.coverage-heading h2 { margin: 0; font-size: 14px; }
.coverage-heading p { margin: 5px 0 0; color: #c9b88f; font-size: 12px; }
.coverage-table-wrap { max-height: 280px; overflow: auto; }
.coverage-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.coverage-table th, .coverage-table td { padding: 8px 10px; border-bottom: 1px solid #383b3e; text-align: left; white-space: nowrap; }
.coverage-table th { position: sticky; top: 0; background: #2d2f32; color: #c4c8cc; }
.coverage-row { cursor: pointer; }
.coverage-row:hover { background: #33363a; }
.coverage-status { color: #e7c47a; }

.suggestions { position: absolute; z-index: 10; top: 68px; left: 0; right: 0; max-height: 340px; overflow: auto; border: 1px solid #3c444c; border-radius: 5px; background: #282a2d; box-shadow: 0 8px 22px #0008; }
.suggestion { display: flex; align-items: center; width: 100%; padding: 11px 12px; border: 0; border-bottom: 1px solid #383b3e; background: transparent; text-align: left; cursor: pointer; }
.suggestion:hover, .suggestion:focus { background: #34383c; outline: none; }
.suggestion-id { min-width: 64px; color: var(--blue-light); font-size: 12px; }
.suggestion-name { color: var(--text); }
.suggestions-empty { padding: 12px; color: var(--muted); font-size: 13px; }

.schedule-panel { border: 1px solid #3b4249; border-radius: 5px; background: var(--panel); overflow: hidden; min-height: 470px; }
.schedule-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 16px; border-bottom: 1px solid var(--line); }
.schedule-heading h2 { margin: 0; font-size: 16px; }
.schedule-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.schedule-heading-actions { display: flex; align-items: center; gap: 18px; }
.export-controls { display: flex; gap: 7px; }
.secondary-button { min-height: 30px; padding: 0 10px; border: 1px solid #3d444c; border-radius: 4px; background: #292b2e; color: #e2e5e8; font-size: 12px; cursor: pointer; }
.secondary-button:hover:not(:disabled) { background: #363a3e; border-color: var(--blue); }
.secondary-button:disabled { opacity: .45; cursor: default; }
.week-controls { display: flex; align-items: center; gap: 13px; color: #dce1e5; font-size: 13px; }
.icon-button { width: 31px; height: 30px; border: 1px solid #3d444c; border-radius: 4px; background: #292b2e; font-size: 24px; line-height: 20px; cursor: pointer; }
.icon-button:hover:not(:disabled) { background: #363a3e; border-color: var(--blue); }
.icon-button:disabled { color: #686d72; cursor: default; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); overflow-x: auto; }
.day-column { min-width: 110px; min-height: 340px; border-right: 1px solid var(--line); background: #252629; }
.day-column:last-child { border-right: 0; }
.day-column.today .day-number { color: white; background: #26384d; }
.day-column.outside-month { background: #202123; }
.day-heading { text-align: center; background: #292b2e; border-bottom: 1px solid var(--line); }
.day-name { padding: 8px 4px 5px; color: #d9dce0; font-size: 12px; }
.day-number { padding: 5px; min-height: 28px; border-top: 1px solid #373a3d; color: #f0f1f2; font-size: 13px; }
.day-events { padding: 10px 6px; display: flex; flex-direction: column; gap: 7px; }
.event-card { width: 100%; min-height: 58px; border: 0; border-radius: 4px; padding: 8px 6px; background: #1689ef; color: white; text-align: center; cursor: pointer; box-shadow: inset 0 0 0 1px #5ab2ff44; }
.event-card:hover, .event-card:focus { background: #2798ff; outline: 2px solid #9bd1ff; outline-offset: 1px; }
.event-flight { display: block; font-size: 12px; font-weight: 700; }
.event-route { display: block; margin-top: 4px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-time { display: block; margin-top: 4px; font-size: 10px; color: #e2f2ff; }
.layover-card { min-height: 52px; margin: 0 -6px; display: flex; align-items: center; justify-content: center; background: #818181; color: #fff; font-size: 11px; text-align: center; }
.empty-state { display: none; padding: 50px 20px; color: var(--muted); text-align: center; }
.empty-state.visible { display: block; }
.footer-note { padding: 12px 2px; color: var(--subtle); font-size: 11px; line-height: 1.5; }

.overlay { position: fixed; inset: 0; z-index: 19; background: #0008; }
.details-panel { position: fixed; z-index: 20; top: 0; right: 0; bottom: 0; width: min(430px, 94vw); transform: translateX(102%); transition: transform .2s ease; border-left: 1px solid #176bb1; background: #242629; box-shadow: -12px 0 34px #0007; display: flex; flex-direction: column; }
.details-panel.open { transform: translateX(0); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding: 0 14px; background: #1689ef; color: white; font-weight: 700; }
.panel-title { display: flex; gap: 8px; align-items: center; }
.plane-icon { font-size: 18px; }
.exit-button { display: flex; align-items: center; gap: 6px; border: 0; background: transparent; color: white; cursor: pointer; font-weight: 700; }
.exit-button:hover { opacity: .8; }
.exit-button:first-letter { font-size: 21px; }
.details-content { overflow: auto; padding: 11px; }
.detail-card { margin-bottom: 10px; padding: 12px; border: 1px solid #3d444b; border-radius: 5px; background: #292b2e; }
.detail-date { color: #e9ebed; font-size: 15px; }
.detail-caption { margin-top: 9px; color: var(--subtle); font-size: 12px; }
.detail-flight-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 11px; color: #e8ebed; font-size: 13px; }
.detail-flight-line strong { color: var(--blue-light); font-size: 16px; }
.route-hero { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.route-airport { min-width: 0; }
.route-code { display: flex; align-items: center; gap: 7px; color: #ededee; font-size: 18px; font-weight: 700; }
.route-place { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.3; }
.route-arrow { color: var(--blue-light); font-size: 20px; }
.detail-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.fact-label { color: var(--muted); font-size: 11px; }
.fact-value { margin-top: 4px; color: #ededee; font-weight: 700; }
.crew-header { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; padding-bottom: 10px; border-bottom: 1px solid #3d444b; color: var(--blue-light); font-weight: 700; }
.crew-search { width: 125px; min-height: 29px; margin-left: auto; padding: 0 8px; border-radius: 14px; font-size: 11px; }
.crew-table { overflow-x: auto; }
.crew-table-header, .crew-member { min-width: 350px; display: grid; grid-template-columns: minmax(110px, 1.7fr) minmax(30px, .55fr) minmax(34px, .6fr) minmax(32px, .5fr) minmax(53px, .8fr); align-items: center; gap: 5px; }
.crew-table-header { padding: 6px 0; border-bottom: 1px solid #3d444b; color: var(--muted); font-size: 10px; font-weight: 700; }
.crew-table-header span:not(:first-child) { text-align: center; }
.crew-member { padding: 10px 0; border-bottom: 1px solid #34373a; }
.crew-name, .crew-value { min-width: 0; color: #f1f2f4; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crew-value { text-align: center; color: #d9dcdf; }
.no-crew, .unavailable-note { color: #d6bb83; font-size: 12px; line-height: 1.45; }
.unavailable-note { border-left: 3px solid #80663b; padding-left: 9px; }
.no-results { grid-column: 1 / -1; padding: 32px 15px; color: var(--muted); text-align: center; }

@media (max-width: 760px) {
  .app-shell { padding: 0 10px 18px; }
  .topbar { min-height: 64px; }
  .topbar-meta { width: 100%; margin: 0 0 10px 54px; }
  .toolbar { align-items: stretch; }
  .search-wrap, .month-wrap { width: 100%; }
  .summary { margin-left: 0; }
  .schedule-heading { align-items: flex-start; flex-direction: column; }
  .schedule-heading-actions { width: 100%; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
  .calendar { grid-template-columns: repeat(7, 120px); }
}

@page { size: landscape; margin: 11mm; }
.print-page { margin: 0; min-height: 100vh; background: #eef1f4; color: #172331; font: 10px Arial, Helvetica, sans-serif; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.print-sheet { max-width: 1480px; margin: 24px auto; padding: 25px; background: #fff; box-shadow: 0 5px 24px #14223520; }
.print-page .report-header { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; border-bottom: 3px solid #1b83d8; }
.print-page .brand { width: 45px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #b18a4d; color: #8c6a32; font-size: 18px; font-weight: 800; letter-spacing: .08em; }
.print-page .eyebrow { margin: 0 0 3px; color: #5a6b7c; font-size: 8px; font-weight: 700; letter-spacing: .15em; }
.print-page h1 { margin: 0; color: #172c43; font-size: 20px; }
.print-page .pilot-line { margin: 4px 0 0; color: #465669; font-size: 11px; }
.print-page .report-stats { display: flex; gap: 18px; margin-left: auto; text-align: right; }
.print-page .stat strong { display: block; color: #183c5d; font-size: 17px; }
.print-page .stat span { color: #657487; font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.print-page .schedule-table { width: 100%; margin-top: 15px; border-collapse: collapse; table-layout: fixed; }
.print-page .schedule-table thead { display: table-header-group; }
.print-page .schedule-table th { padding: 8px 7px; background: #eaf1f7; border-top: 1px solid #cbd5df; border-bottom: 1px solid #b9c6d2; color: #32495f; font-size: 8px; text-align: left; text-transform: uppercase; letter-spacing: .06em; }
.print-page .schedule-table td { padding: 8px 7px; border-bottom: 1px solid #dbe1e7; vertical-align: top; overflow-wrap: anywhere; line-height: 1.3; }
.print-page .schedule-table tbody tr:nth-child(even) { background: #f7f9fb; }
.print-page .schedule-table tbody tr { break-inside: avoid; page-break-inside: avoid; }
.print-page .schedule-table th:nth-child(1) { width: 10%; }
.print-page .schedule-table th:nth-child(2) { width: 5%; }
.print-page .schedule-table th:nth-child(3) { width: 9%; }
.print-page .schedule-table th:nth-child(4) { width: 18%; }
.print-page .schedule-table th:nth-child(5) { width: 8%; }
.print-page .schedule-table th:nth-child(6) { width: 6%; }
.print-page .schedule-table th:nth-child(7) { width: 8%; }
.print-page .schedule-table th:nth-child(8) { width: 8%; }
.print-page .schedule-table th:nth-child(9) { width: 28%; }
.print-page .date-cell { color: #3e5266; font-size: 9px; }
.print-page .flight-cell { color: #1376c3; font-size: 12px; font-weight: 700; }
.print-page .route-code { color: #203a52; font-size: 10px; font-weight: 700; white-space: nowrap; }
.print-page .route-code span { padding: 0 2px; color: #1889df; }
.print-page .time-line { display: grid; grid-template-columns: 27px 1fr; column-gap: 4px; margin-bottom: 4px; }
.print-page .time-line:last-child { margin-bottom: 0; }
.print-page .time-line b { color: #4c6175; font-size: 8px; }
.print-page .time-line small { grid-column: 2; color: #6b7785; font-size: 8px; }
.print-page .subline { display: block; margin-top: 3px; color: #667587; font-size: 8px; }
.print-page .pax-cell { color: #243f59; font-weight: 700; }
.print-page .print-crew-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 8px; }
.print-page .print-crew-member { display: flex; gap: 5px; min-width: 0; font-size: 8px; }
.print-page .print-crew-member b { min-width: 22px; color: #26618f; }
.print-page .print-crew-member span { min-width: 0; overflow-wrap: anywhere; }
.print-page .muted { color: #697786; }
.print-page .print-layovers { margin-top: 14px; padding: 9px 11px; border-left: 3px solid #8f969d; background: #f0f2f4; }
.print-page .print-layovers h2 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 7px; color: #34485b; font-size: 10px; }
.print-page .print-layovers h2 span { color: #6d7882; font-size: 8px; font-weight: 400; }
.print-page .print-layover-list { display: flex; flex-wrap: wrap; gap: 6px; }
.print-page .print-layover { display: flex; gap: 7px; align-items: center; padding: 5px 8px; border: 1px solid #d4d9de; border-radius: 3px; background: #fff; color: #475664; font-size: 8px; }
.print-page .print-layover b { color: #34485b; }
.print-page footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 13px; padding-top: 8px; border-top: 1px solid #dbe1e7; color: #667587; font-size: 8px; }
@media screen { .print-sheet { margin: 24px auto; padding: 25px; } }
@media print { .print-page { background: #fff; } .print-sheet { max-width: none; margin: 0; padding: 0; box-shadow: none; } }
