@font-face {
  font-family: "IBM Plex Sans";
  src: url("/brand/fonts/IBMPlexSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/brand/fonts/IBMPlexSans-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/brand/fonts/IBMPlexSans-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}

:root {
  --ink: #1d1d1b;
  --muted: #565654;
  --teal: #607980;
  --deep: #234951;
  --wash: #f0f7f9;
  --line: #c7c7c6;
  --paper: #ffffff;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--ink);
  background: var(--wash);
  min-height: 100vh;
}
a.brand span { margin-left: 8px; font-weight: 700; color: var(--deep); letter-spacing: 0.04em; }
header.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--paper);
  border-bottom: 3px solid var(--teal);
}
.nav { display: flex; gap: 14px; margin-right: auto; margin-left: 18px; }
.nav a { color: var(--deep); font-weight: 700; text-decoration: none; }
.nav a:hover { color: var(--teal); }
.brand img { height: 42px; width: auto; display: block; }
.who { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.who form { margin: 0; }
main { padding: 24px 16px 48px; max-width: 880px; margin: 0 auto; }
main.wide { max-width: none; padding: 16px 12px 32px; }
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
}
.card.narrow { max-width: 420px; margin: 0 auto; }
.eyebrow {
  margin: 0;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
}
h1 { margin: 6px 0 8px; font-size: 28px; }
h2 { margin: 0 0 8px; font-size: 16px; color: var(--deep); }
.lede { margin: 0 0 16px; color: var(--muted); }
.error {
  background: #fff4f0;
  border: 1px solid #e3b2a4;
  color: #6b2b1d;
  padding: 10px 12px;
  border-radius: 8px;
}
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; }
label.remember { flex-direction: row; align-items: center; font-weight: 500; margin: 12px 0; }
label.remember input { width: auto; }
input, select, textarea {
  font: inherit;
  font-weight: 500;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 100%;
  background: white;
}
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.leg { margin-top: 18px; padding-top: 8px; border-top: 1px solid var(--wash); }
textarea { min-height: 180px; resize: vertical; }
button:disabled { background: #d5e0e3; color: #1d1d1b; cursor: not-allowed; }
.email-history { padding-left: 18px; }
.email-preview { background: #f0f7f9; padding: 12px; border-radius: 12px; }
.total-line { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums lining-nums; }
.request-card { max-width: 640px; }
.preview-mail { white-space: pre-wrap; background: white; border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
button, .button {
  font: inherit;
  font-weight: 700;
  background: var(--teal);
  color: white;
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  text-decoration: none;
  display: inline-block;
}
button.secondary, .button.secondary, button.text {
  background: white;
  color: var(--deep);
  border: 1px solid var(--teal);
}
button.text { padding: 6px 10px; }
table.audit {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 18px;
  font-family: "IBM Plex Sans", sans-serif;
  font-variant-numeric: tabular-nums lining-nums;
  font-size: 12px;
}
table.audit th, table.audit td { text-align: left; padding: 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.audit .formula { white-space: pre-wrap; }
table.lines { width: 100%; border-collapse: collapse; margin: 12px 0 18px; }
table.lines th, table.lines td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--wash); vertical-align: top; }
table.lines th { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal); }
.num { text-align: right; white-space: nowrap; }
table.lines tfoot td { font-weight: 700; font-size: 18px; border-bottom: 0; }
.reasons { padding-left: 18px; color: var(--muted); }
.muted { color: var(--muted); font-size: 12px; }
.badge {
  display: inline-block;
  margin: 0 0 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--line);
  color: var(--deep);
  font-size: 13px;
}
.cal-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.cal-nav { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.cal-nav label { font-size: 13px; }
.cal-nav input { width: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 12px 16px; padding: 0; margin: 0 0 12px; list-style: none; font-size: 13px; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; }
.swatch.charter { background: #607980; }
.swatch.owner { background: #c4a35a; }
.swatch.positioning { background: #3d5a80; }
.swatch.block { background: #a33b3b; }
.swatch.proposed { background: white; border: 1.5px dashed #234951; }
.cal-scroll {
  overflow: auto;
  max-height: calc(100vh - 220px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
table.cal {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
}
table.cal th, table.cal td {
  vertical-align: top;
  padding: 4px 6px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: white;
  font-size: 12px;
  font-weight: 500;
}
table.cal thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #e7eef0;
  text-align: left;
}
table.cal .name {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 112px;
  background: #f7fbfc;
  font-weight: 700;
}
table.cal thead th.name { z-index: 4; background: #d5e3e7; }
table.cal th.slim, table.cal td.slim { width: 46px; max-width: 46px; }
table.cal th.past, table.cal td.past { background: #efefed; }
table.cal thead th.past { background: #e4e4e2; color: #6e6e6c; }
table.cal th.today, table.cal td.today { background: #fff3cc; }
table.cal thead th.today { background: #f6d56a; color: #1d1d1b; }
table.cal td.past .chip, table.cal td.today .chip { opacity: 1; }
table.cal .dow, table.cal .dom { display: block; white-space: nowrap; }
tr.brokered .name, tr.brokered td { background: #fbf8f1; }
tr.pilot .name, tr.pilot td { background: #f4f7f8; }
tr.aircraft + tr.brokered th.name, tr.brokered + tr.pilot th.name { box-shadow: inset 0 3px 0 var(--teal); }
.where, .crewline { white-space: nowrap; color: var(--muted); font-size: 11px; }
.chip {
  display: block;
  width: max-content;
  max-width: none;
  white-space: nowrap;
  margin: 0 0 4px;
  padding: 4px 6px;
  border-radius: 6px;
  color: white;
  line-height: 1.3;
}
.chip span { display: block; }
.chip.charter, .chip.crew-fly { background: #607980; }
.chip.owner { background: #c4a35a; color: #1d1d1b; }
.chip.positioning { background: #3d5a80; }
.chip.block, .chip.crew-off { background: #a33b3b; color: #ffffff; }
.chip.crew-duty, .chip.crew-vacation, .chip.crew-training, .chip.crew-sick, .chip.crew-other {
  background: #d5e0e3;
  color: #1d1d1b;
}
.chip.grey { opacity: 0.4; }
.span-bars { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.span-bar.chip {
  width: auto;
  height: 22px;
  margin: 0;
  line-height: 18px;
  overflow: hidden;
}
.span-bar.chip span { display: inline; margin-right: 6px; }
.span-bar.start { border-radius: 4px 0 0 4px; margin-right: -8px; position: relative; z-index: 1; overflow: visible; white-space: nowrap; }
.span-bar.mid { border-radius: 0; margin-left: -8px; margin-right: -8px; }
.span-bar.end { border-radius: 0 4px 4px 0; margin-left: -8px; }
.span-bar.gap { visibility: hidden; height: 22px; }
.zulu { display: block; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums lining-nums; }
.chip.proposed { background: white; color: var(--ink); border: 1.5px dashed #234951; }
td.drop-hover { outline: 2px solid var(--teal); outline-offset: -2px; }
.proposals { margin-top: 16px; }
.proposal { border-top: 1px solid var(--line); padding: 8px 0; }
.airport { position: relative; display: flex; flex-direction: column; gap: 4px; font-weight: 500; }
.airport-menu {
  position: absolute;
  z-index: 6;
  top: 44px;
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: 240px;
  overflow: auto;
  box-shadow: 0 8px 24px rgba(29, 29, 27, 0.08);
}
.airport-menu li { padding: 8px 10px; cursor: pointer; font-weight: 500; }
.airport-menu li[aria-selected="true"], .airport-menu li:hover { background: var(--wash); }
.airport-hint { color: var(--muted); font-size: 13px; font-weight: 500; }
.field-error { color: #8a2b22; font-size: 13px; font-weight: 700; }
.crew-band { display: flex; flex-direction: column; gap: 2px; min-height: 16px; margin-bottom: 4px; }
.crew-seg {
  display: block;
  height: 18px;
  border: 0;
  padding: 0 4px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  color: white;
  background: #234951;
  text-align: left;
  white-space: nowrap;
  overflow: visible;
}
.crew-seg.start { border-radius: 4px 0 0 4px; margin-right: -7px; position: relative; z-index: 1; }
.crew-seg.mid { border-radius: 0; margin-left: -7px; margin-right: -7px; }
.crew-seg.end { border-radius: 0 4px 4px 0; margin-left: -7px; }
.crew-seg.single { border-radius: 4px; }
.crew-seg.seed { background: #5d737a; }
.crew-seg.manual { background: #234951; }
.crew-seg.warn { box-shadow: inset 0 -3px 0 #a33b3b; }
.crew-add {
  border: 0;
  background: transparent;
  color: var(--teal);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.crew-warnings { margin: 0 0 8px; padding-left: 18px; color: #8a2b22; font-size: 13px; }
.time-basis { border: 0; margin: 0; padding: 0; }
.time-basis legend { font-weight: 600; margin-bottom: 6px; }
.tz-toggle { display: inline-flex; border: 1px solid var(--teal); border-radius: 8px; overflow: hidden; }
.tz-toggle button, .tz-toggle label { border: 0; border-radius: 0; background: white; color: var(--deep); }
.tz-toggle label { padding: 8px 12px; cursor: pointer; }
.tz-toggle label input { position: absolute; opacity: 0; }
.tz-toggle button[aria-pressed="true"], .tz-toggle label:has(input:checked) { background: var(--teal); color: white; }
.when-local { display: none; }
body[data-calendar-tz="local"] .when-utc { display: none; }
body[data-calendar-tz="local"] .when-local { display: block; }
.crew-seg:disabled { opacity: 1; color: white; }
#crew-editor { border: 0; border-radius: 12px; padding: 18px; max-width: 360px; }
#crew-editor::backdrop { background: rgba(29, 29, 27, 0.35); }
#crew-editor label { margin-top: 10px; }
@media (max-width: 700px) {
  .grid { grid-template-columns: 1fr; }
  header.top { align-items: flex-start; flex-wrap: wrap; }
  .nav { margin-left: 0; width: 100%; }
  h1 { font-size: 24px; }
  input, select, button { font-size: 16px; }
  .cal-scroll { max-height: calc(100vh - 280px); }
}
