/* Pilot application. One stylesheet, mobile first, built on the look of the office app
   (silverair/assets/css: tokens.css, components.css – list cards, tabs, form fields, tags). */

/* ---------- Tokens (the same values as silverair/assets/css/tokens.css) ---------- */
:root {
  --navy: #1d284b;
  --navy-deep: #141a33;
  --slate: #3a4975;
  --sky: #b5ceed;
  --navy-rgb: 29, 40, 75;
  --navy-deep-rgb: 20, 26, 51;
  --slate-rgb: 58, 73, 117;
  --sky-rgb: 181, 206, 237;

  --surface: #fff;
  --surface-soft: #f2f5fa;
  --ink: #141a33;
  --muted: #4f5872;
  --muted-2: #8790a6;
  --line: #edf0f5;
  --line-strong: #dfe5ef;

  --success: #12623c;
  --success-bg: #dcf3e6;
  --warning: #7a4a00;
  --warning-bg: #fdf0d5;
  --danger: #b42318;
  --danger-bg: #fdeaea;
  --info: #1d4bb0;
  --info-bg: #e3ecfb;

  --readonly-bg: #e1e7f2;
  --readonly-ink: #2a395f;

  --radius-card: 16px;
  --radius-field: 10px;
  --topbar-height: 52px;
  --condensed: "Barlow Semi Condensed", "Barlow", sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  font-family: "Barlow", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
  background: var(--surface-soft);
}
a { color: inherit; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
ul { list-style: none; }

.icon { width: 18px; height: 18px; fill: currentColor; flex: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.pre { white-space: pre-wrap; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--navy-deep);
  color: #fff;
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 4px;
  height: var(--topbar-height);
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 6px 0 16px;
}
.topbar a { color: #fff; text-decoration: none; }
.topbar-back {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-left: -14px;
}
.topbar-back .icon { width: 24px; height: 24px; }
.topbar-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-logo {
  display: block;
  width: 96px;
  aspect-ratio: 633 / 131;
  background: #fff;
  -webkit-mask: url("logo-wide.svg") center / contain no-repeat;
  mask: url("logo-wide.svg") center / contain no-repeat;
}
.topbar-app {
  padding-left: 12px;
  border-left: 1px solid #3a4470;
  color: #b9c7ff;
  font-family: var(--condensed);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  line-height: 14px;
}
.topbar-clock {
  display: grid;
  justify-items: end;
  gap: 1px;
  margin-left: auto;
  padding: 0 6px;
  line-height: 1;
}
.topbar-clock-label { color: #8f9ac2; font-family: var(--condensed); font-size: 9px; font-weight: 700; letter-spacing: 0.13em; }
.topbar-clock strong { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* account menu: the avatar opens the name and "Log out" */
.topbar-menu { position: relative; }
.topbar-menu summary {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  list-style: none;
  cursor: pointer;
}
.topbar-menu summary::-webkit-details-marker { display: none; }
.topbar-menu summary .avatar { width: 28px; height: 28px; font-size: 12px; box-shadow: 0 0 0 2px var(--navy-deep), 0 0 0 3px #4a5585; }
.topbar-menu summary:focus-visible { outline: 2px solid #b9c7ff; outline-offset: -2px; border-radius: 50%; }
.topbar-menu-panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 4px;
  display: grid;
  gap: 10px;
  min-width: 200px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 10px 30px rgba(var(--navy-deep-rgb), 0.18);
}
.topbar-user-text { display: grid; line-height: 1.2; min-width: 0; }
.topbar-user-text strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user-text small { color: var(--muted); font-family: var(--condensed); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.topbar .topbar-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 600;
}
.topbar .topbar-logout:hover { background: var(--line-strong); }

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--sky);
  color: var(--navy-deep);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.avatar--light { background: rgba(var(--sky-rgb), 0.45); }

/* ---------- Page ---------- */
.page {
  display: grid;
  gap: 16px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

/* ---------- Notices, tags, chips ---------- */
.notice {
  padding: 12px 14px;
  border: 1px solid rgba(37, 99, 201, 0.18);
  border-radius: 12px;
  background: var(--info-bg);
  color: var(--navy);
  font-size: 0.92rem;
}
.notice p + p { margin-top: 4px; }
.notice--ok { background: var(--success-bg); border-color: rgba(27, 127, 88, 0.22); color: var(--success); }
.notice--error { background: var(--danger-bg); border-color: rgba(180, 35, 24, 0.22); color: var(--danger); }
.notice strong { display: block; margin-bottom: 2px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2f8;
  color: var(--muted);
  font-family: var(--condensed);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.5;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.tag .icon { width: 13px; height: 13px; }
.tag--small { padding: 0 5px; font-size: 0.6rem; vertical-align: 2px; }
.tag--ok { background: var(--success-bg); color: var(--success); }
.tag--warn { background: var(--warning-bg); color: var(--warning); }
.tag--info { background: var(--info-bg); color: var(--info); }
.tag--link { background: rgba(var(--sky-rgb), 0.4); color: var(--navy); }
.tag--link:hover { background: var(--sky); }

.chip {
  display: inline-flex;
  padding: 0 5px;
  border-radius: 5px;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.5;
}
.chip--on-time { background: var(--success-bg); color: var(--success); }
.chip--delayed { background: var(--warning-bg); color: var(--warning); }
.chip--late { background: var(--danger-bg); color: var(--danger); }

.legend { display: flex; gap: 14px; color: var(--muted); font-size: 0.74rem; white-space: nowrap; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.legend li { color: var(--muted); }
.legend--on-time::before { background: var(--success) !important; }
.legend--delayed::before { background: #d98a00 !important; }
.legend--late::before { background: var(--danger) !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(var(--slate-rgb), 0.14);
  border-radius: 10px;
  background: var(--surface);
  color: var(--slate);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.btn:hover { border-color: rgba(var(--slate-rgb), 0.28); color: var(--navy); }
.btn:focus-visible, .tab:focus-visible, .segmented a:focus-visible { outline: 2px solid rgba(var(--sky-rgb), 0.9); outline-offset: 2px; }
.btn--primary { border-color: var(--navy); background: var(--navy); color: #fff; }
.btn--primary:hover { border-color: var(--navy-deep); background: var(--navy-deep); color: #fff; }
.btn--secondary { background: rgba(var(--surface-soft-rgb, 244, 247, 251), 0.9); background: var(--surface-soft); }
.btn--danger { color: var(--danger); }
.btn--danger:hover { border-color: rgba(180, 35, 24, 0.35); color: var(--danger); background: var(--danger-bg); }
.btn--small { min-height: 32px; padding: 0 10px; font-size: 0.7rem; }
.btn--small .icon { width: 16px; height: 16px; }
.btn--large { min-height: 48px; padding: 0 22px; font-size: 0.85rem; }
.btn--block { width: 100%; }
.btn--icon { width: 40px; padding: 0; }
.btn--icon.btn--small { width: 32px; }

/* segmented control: like the Active / Closed / Both filter of the office lists */
.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(var(--slate-rgb), 0.09);
}
.segmented a, .segmented label span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--slate);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.segmented a:hover { color: var(--navy); }
.segmented a.is-active, .segmented input:checked + span {
  background: #fff;
  color: var(--navy-deep);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(var(--navy-rgb), 0.16);
}
.segmented label { display: flex; flex: 1; }
.segmented label span { flex: 1; min-height: 38px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented input:focus-visible + span { outline: 2px solid rgba(var(--sky-rgb), 0.9); }
.segmented--scroll { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented--scroll::-webkit-scrollbar { display: none; }
.segmented--block { display: flex; }

/* ---------- Form fields (like .app-form-* of the office app) ---------- */
.form { display: grid; gap: 22px; }
.field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.label {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-field);
  background: #fff;
  color: var(--ink);
  font-size: 16px; /* no zoom on iOS */
  transition: border-color .18s ease, box-shadow .18s ease;
}
select.input { padding-right: 8px; }
.input:focus { outline: none; border-color: var(--slate); box-shadow: 0 0 0 3px rgba(var(--slate-rgb), 0.14); }
.input::placeholder { color: #a9b2c6; }
.input[readonly] { background: var(--readonly-bg); border-color: transparent; color: var(--readonly-ink); }
.input--computed { font-weight: 700; }
.input--area { min-height: 96px; padding: 10px 12px; resize: vertical; }
.input--time { font-size: 1.25rem; font-weight: 700; letter-spacing: 0.04em; text-align: center; font-variant-numeric: tabular-nums; }
.input.is-carried { border-color: #d98a00; background: var(--warning-bg); }
.hint { color: var(--muted); font-size: 0.8rem; }
.hint--carried { color: var(--warning); }

.check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.9rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--navy); }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.grid--times { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field--wide { grid-column: 1 / -1; }
.time-input { display: flex; gap: 6px; }
.time-input .input { flex: 1; min-width: 0; }
.btn--now { min-height: 44px; padding: 0 10px; font-size: 0.68rem; }

.section { display: grid; gap: 14px; }
.section + .section { margin-top: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.section-title {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--navy);
  font-size: 1rem;
  font-weight: 700;
}
.section-head .section-title { flex: 1; }
.section-title small { margin-left: 6px; color: var(--muted); font-size: 0.66rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.section--boxed { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.section--boxed .input:not([readonly]) { background: #fff; }

/* computed values (block time, fuel used): a strip of read-outs */
.totals {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.totals > div {
  display: grid;
  min-width: 110px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(var(--sky-rgb), 0.28);
}
.totals small { color: var(--slate); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.totals output { color: var(--navy-deep); font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.save-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -16px -16px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}
.save-bar-state { color: var(--muted); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }

/* upload box for the receipt: big target for a phone camera */
.upload {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.upload:hover, .upload:focus-within { border-color: var(--slate); }
.upload.has-file { border-style: solid; border-color: var(--success); background: var(--success-bg); }
.upload input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(var(--sky-rgb), 0.4);
  color: var(--navy);
}
.upload-icon .icon { width: 24px; height: 24px; }
.upload-text { display: grid; min-width: 0; }
.upload-text strong { color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-text small { color: var(--muted); font-size: 0.8rem; }

/* ---------- Flight list: head band (title, counts, date range) ---------- */
.list-head { background: #fff; border-bottom: 1px solid var(--line-strong); }
.list-head-inner { max-width: 1240px; margin: 0 auto; padding: 12px 16px 0; }
.list-head-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.list-head h1 { margin-right: auto; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { padding: 4px 9px; border-radius: 999px; background: #eef2f8; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill strong { color: var(--ink); }
.pill--warn, .pill--warn strong { background: var(--warning-bg); color: var(--warning); }

.range-nav { display: flex; align-items: center; gap: 2px; margin: 4px -12px 0; }
.range-step { display: grid; place-items: center; width: 44px; height: 48px; flex: none; color: var(--ink); }
.range-step .icon { width: 22px; height: 22px; }
.range-step:focus-visible, .range-pick summary:focus-visible { outline: 2px solid var(--info); outline-offset: -4px; border-radius: 8px; }
.range-pick { position: relative; flex: 1; min-width: 0; }
.range-pick summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  list-style: none;
  cursor: pointer;
}
.range-pick summary::-webkit-details-marker { display: none; }
.range-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 4px 3px 8px;
  border-radius: 6px;
  background: var(--info-bg);
  color: var(--info);
  font-family: var(--condensed);
  font-size: 13px;
  font-weight: 700;
}
.range-chip .icon { width: 16px; height: 16px; transition: transform .16s ease; }
.range-pick[open] .range-chip .icon { transform: rotate(180deg); }
.range-dates { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.range-panel {
  position: absolute;
  top: 100%;
  left: 50%;
  z-index: 15;
  display: grid;
  gap: 14px;
  width: min(340px, calc(100vw - 24px));
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(var(--navy-deep-rgb), 0.16);
  transform: translateX(-50%);
}
.range-presets { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.range-presets a {
  display: grid;
  place-items: center;
  min-height: 40px;
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.range-presets a.is-active { background: var(--navy-deep); color: #fff; }
.range-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.range-form .input { padding: 0 8px; }
.range-submit { grid-column: 1 / -1; }

.day-head { display: none; }

/* ---------- List card (office flights list) ---------- */
.list-card {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  background: var(--surface);
  overflow: hidden;
}
.list-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-strong);
}
.list-card-title { display: flex; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; }
.list-card-title strong { color: var(--navy); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; }
.list-card-title span { color: var(--muted); font-size: 0.8rem; }

.list-table { width: 100%; border-collapse: collapse; }
.list-table thead th {
  padding: 10px 18px;
  border-bottom: 1px solid var(--line-strong);
  background: #e7ecf5;
  color: var(--slate);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.list-table tbody td {
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}
.list-table tbody tr:last-child td { border-bottom: 0; }
.list-table .flight-row { cursor: pointer; }
.list-table .flight-row:hover td { background: rgba(var(--sky-rgb), 0.22); }
.list-table .main { display: inline-block; color: var(--navy-deep); font-size: 0.95rem; font-weight: 700; text-decoration: none; }
.list-table .link:hover { text-decoration: underline; }
.list-table .sub { display: flex; align-items: center; gap: 6px; margin-top: 2px; color: var(--muted); font-size: 0.74rem; }
.list-table .crew { max-width: 260px; white-space: normal; color: var(--ink); font-size: 0.85rem; }
.list-table .tags { white-space: normal; }
.list-table .tags .tag { margin: 2px 4px 2px 0; }
.list-table .cell-action { text-align: right; }
.route { display: inline-flex !important; align-items: center; gap: 8px; }
.route-arrow { color: var(--muted); font-weight: 400; }

.day-band th, .day-band--card {
  padding: 7px 18px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background: rgba(var(--sky-rgb), 0.32);
  color: var(--slate);
  font-size: 0.78rem;
  font-weight: 400;
  text-align: left;
}
.day-band strong { margin-right: 8px; color: var(--navy); font-weight: 700; }
.day-band .tag { margin-left: 8px; }
.list-table thead + tbody .day-band:first-child th { border-top: 0; }

.flight-cards { display: none; }

.empty {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 44px 18px;
  color: var(--muted);
  text-align: center;
}
.empty strong { color: var(--navy); font-size: 1.05rem; }
.empty--small { padding: 26px 12px; border: 1px dashed var(--line-strong); border-radius: 14px; }
.empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: rgba(var(--sky-rgb), 0.4);
  color: var(--navy);
}
.empty-icon .icon { width: 26px; height: 26px; }

/* ---------- Flight: summary band, record links, crew, call to action ---------- */
.flight-summary { background: #fff; border-bottom: 1px solid var(--line-strong); }
.flight-summary-inner { display: grid; gap: 12px; max-width: 1240px; margin: 0 auto; padding: 12px 16px 14px; }
.flight-summary-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.flight-summary-top h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.flight-summary-top h1 span { margin-left: 6px; color: var(--muted); font-size: 14px; font-weight: 500; letter-spacing: 0; }
.flight-summary-route { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: 8px; }
.flight-summary-end { display: grid; gap: 2px; min-width: 0; }
.flight-summary-end strong { font-size: 28px; font-weight: 700; line-height: 1; letter-spacing: 0.01em; }
.flight-summary-end span { overflow: hidden; color: var(--muted); font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.flight-summary-end--arr { text-align: right; }
.flight-summary .flight-path { width: 96px; padding-top: 4px; }

/* dashed line with a plane and the scheduled block time, in the cards and the summary */
.flight-path { display: grid; justify-items: center; gap: 2px; }
.flight-path-line { display: flex; align-items: center; gap: 6px; width: 100%; color: #2b3566; }
.flight-path-line::before, .flight-path-line::after { content: ""; flex: 1; border-top: 1.5px dashed #b8c2d6; }
.flight-path-line .icon { width: 18px; height: 18px; transform: rotate(90deg); }
.flight-path-dur { color: var(--muted); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }

.time-boxes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.time-box { display: flex; justify-content: space-between; gap: 6px; padding: 8px 10px; border-radius: 10px; background: #f4f7fb; }
.time-box > span { display: grid; gap: 1px; }
.time-box small, .record-meta dt, .caption {
  color: var(--muted);
  font-family: var(--condensed);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.time-box strong { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.time-box-actual { justify-items: end; text-align: right; }
.time-box-actual strong { font-weight: 600; }
.time-box-actual strong.is-empty { color: #8a93ab; }

.record-meta { display: grid; grid-template-columns: 1.4fr 1.4fr 0.6fr 0.6fr; border: 1px solid #e3e8f1; border-radius: 10px; }
.record-meta > div { min-width: 0; padding: 7px 10px; }
.record-meta > div + div { border-left: 1px solid #e3e8f1; }
.record-meta dd { overflow: hidden; font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.record-meta dd span { color: var(--muted); font-weight: 500; }

.page--flight { gap: 10px; padding-top: 10px; }
.record-links { overflow: hidden; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; }
.record-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 10px 10px 12px;
  text-decoration: none;
}
.record-links a + a { border-top: 1px solid var(--line); }
.record-links a:hover { background: #f8fafd; }
.record-links a > .icon { width: 18px; height: 18px; color: #8a93ab; }
.record-link-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 10px; background: #eef2f8; color: #2b3566; }
.record-link-icon.is-warn { background: var(--warning-bg); color: var(--warning); }
.record-link-icon .icon { width: 20px; height: 20px; }
.record-link-text { display: grid; flex: 1; gap: 1px; min-width: 0; }
.record-link-text strong { font-size: 16px; }
.record-link-text small { color: var(--muted); font-size: 13px; font-weight: 500; }

.page--flight .section { gap: 6px; }
.caption { margin: 4px 4px 0; font-family: inherit; font-size: 13px; letter-spacing: 0.03em; }
.empty-line { padding: 12px; border: 1px dashed #c9d1e0; border-radius: 12px; color: var(--muted); font-size: 14px; text-align: center; }
.notes { padding: 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; }

.crew-list { display: grid; gap: 6px; }
.crew-list li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; }
.crew-name { display: grid; flex: 1; min-width: 0; line-height: 1.2; }
.crew-name strong { color: var(--ink); }
.crew-name small { color: var(--success); font-family: var(--condensed); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }

.cta-bar {
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: 10px 12px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-strong);
  background: #fff;
}
.cta-bar .btn { max-width: 1216px; margin: 0 auto; background: var(--navy-deep); border-color: var(--navy-deep); font-size: 16px; letter-spacing: 0; text-transform: none; }

.subpage-head { display: grid; gap: 2px; }
.subpage-head h1 { font-size: 22px; font-weight: 700; line-height: 1.1; }
.subpage-head span { color: var(--muted); font-size: 14px; }
.subpage-head b { color: var(--ink); }

/* ---------- Tabs card (like .app-tabs-card) ---------- */
.tabs-card {
  border: 1px solid rgba(var(--slate-rgb), 0.14);
  border-radius: 18px;
  background: var(--surface);
}
.tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(var(--slate-rgb), 0.12);
  font-size: 0.68rem;
  letter-spacing: 0;
}
.tabs-panel { display: grid; gap: 22px; padding: 16px; }

/* ---------- Expenses ---------- */
.total-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.expense-list { display: grid; gap: 8px; }
.expense {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.expense.is-editing { border-color: var(--slate); background: rgba(var(--sky-rgb), 0.16); }
.expense-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(var(--sky-rgb), 0.4);
  color: var(--navy);
}
.expense-main { display: grid; gap: 2px; min-width: 0; }
.expense-main > strong { color: var(--navy-deep); }
.expense-meta, .expense-note { color: var(--muted); font-size: 0.82rem; }
.expense-note { color: var(--ink); }
.expense-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.expense-side { display: grid; justify-items: end; gap: 8px; }
.expense-amount { color: var(--navy-deep); font-size: 1.05rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.expense-amount small { color: var(--muted); font-size: 0.7rem; letter-spacing: 0.06em; }
.expense-actions { display: flex; gap: 6px; }
.expense-actions form { display: contents; }

/* ---------- Login (like silverair/assets/css/pages/auth-login.css) ---------- */
.login-page {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 20px;
  background:
    radial-gradient(circle at 12% 16%, rgba(var(--sky-rgb), 0.62) 0, rgba(var(--sky-rgb), 0) 36%),
    radial-gradient(circle at 86% 84%, rgba(var(--slate-rgb), 0.12) 0, rgba(var(--slate-rgb), 0) 38%),
    linear-gradient(145deg, #eef3fa 0%, #dfe6f1 100%);
}
.login-wrap { width: min(860px, 100%); }
.login-card {
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(var(--slate-rgb), 0.14);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 12px 40px rgba(20, 32, 58, 0.1);
}
.login-hero {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  min-height: 200px;
  padding: 28px;
  overflow: hidden;
  isolation: isolate;
  background: var(--navy-deep) url("login.jpg") center / cover no-repeat;
}
.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(var(--navy-rgb), 0.35), rgba(var(--navy-deep-rgb), 0.7));
}
.login-hero-logo {
  width: 240px;
  max-width: 80%;
  aspect-ratio: 633 / 131;
  background: #fff;
  -webkit-mask: url("logo-wide.svg") center / contain no-repeat;
  mask: url("logo-wide.svg") center / contain no-repeat;
  filter: drop-shadow(0 4px 16px rgba(var(--navy-deep-rgb), 0.5));
}
.login-hero-app {
  padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.login-form { display: grid; gap: 16px; padding: 28px 24px 24px; }
.login-form h1 { color: var(--navy); font-size: 1.6rem; line-height: 1.1; }
.login-intro { margin-top: -10px; color: var(--muted); font-size: 0.92rem; }
.login-form .input { background: var(--surface-soft); }
.login-form .input:focus { background: #fff; }
.login-foot { color: var(--muted-2); font-size: 0.78rem; text-align: center; }

/* ---------- Phone ---------- */
@media (max-width: 760px) {

  .page { gap: 14px; padding: 12px 10px 40px; }

  .list-card { border: 0; background: none; overflow: visible; }
  .list-card-head { display: none; }
  .list-head-inner, .flight-summary-inner { padding-left: 12px; padding-right: 12px; }
  .page--flight { padding-top: 10px; }
  .legend { display: none; }
  .list-table { display: none; }
  .flight-cards { display: grid; gap: 8px; }
  .day-head { display: flex; align-items: center; gap: 8px; padding: 6px 4px 0; }
  .day-head strong { font-size: 13px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; }
  .day-head-utc { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 500; }
  .flight-card {
    display: grid;
    gap: 10px;
    padding: 12px 12px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    text-decoration: none;
  }
  .flight-card:active { background: #f8fafd; }
  .flight-card-route { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
  .flight-card-end { display: grid; gap: 1px; }
  .flight-card-end strong { font-size: 22px; font-weight: 700; line-height: 1; letter-spacing: 0.01em; }
  .flight-card-end .time { display: flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .flight-card-end small { color: var(--muted); font-size: 12px; font-weight: 500; }
  .flight-card-end--arr { justify-items: end; }
  .flight-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
  .flight-card-info { min-width: 0; overflow: hidden; color: var(--muted); font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
  .flight-card-info b { color: var(--ink); font-weight: 700; }
  .flight-card-tags { display: flex; flex: none; gap: 4px; }
  .empty { border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); }

  .tabs-panel { padding: 14px; }
  .save-bar { margin: 0 -14px -14px; padding-left: 14px; padding-right: 14px; }
  .save-bar .btn { flex: 1; }
  .section--boxed { margin: 0 -2px; padding: 14px; }
  .expense { grid-template-columns: auto minmax(0, 1fr); }
  .expense-side { grid-column: 2; grid-auto-flow: column; justify-content: space-between; align-items: center; justify-items: start; }

  .login-page { padding: 12px; }
  .login-hero { min-height: 170px; }
}

@media (min-width: 761px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid--times { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .field--wide { grid-column: span 2; }
  .tabs-panel { padding: 20px; }
  .save-bar { margin: 0 -20px -20px; padding-left: 20px; padding-right: 20px; }
  .login-card { grid-template-columns: 1.05fr 1fr; }
  .login-hero { min-height: 440px; }
  .login-form { padding: 40px 40px; align-content: center; }
}

@media (min-width: 761px) and (max-width: 1020px) {
  .list-table .crew { max-width: 180px; }
  .list-table thead th, .list-table tbody td { padding-left: 12px; padding-right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
