/* Fonts are served by the app itself (SIL Open Font License, see fonts/OFL-*.txt): no third-party requests. */
@font-face { font-family: "DM Sans"; src: url("fonts/dm-sans-latin.woff2") format("woff2"); font-weight: 100 1000; font-style: normal; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/manrope-latin.woff2") format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jetbrains-mono-latin.woff2") format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }

/* Shared UI foundation (from Posrep)
   The visual system is intentionally quiet: midnight navigation, warm ivory surfaces,
   precise data typography and a restrained champagne accent. Operational status colors
   remain fixed so an alert always means the same thing for every operator. */
:root {
  --bg: #F3F5F2;
  --panel: #FFFEFB;
  --panel-2: #F0F3F0;
  --panel-3: #E7ECE9;
  --ink: #13263A;
  --muted: #5D6D79;
  --faint: #8A979E;
  --line: #DCE4DF;
  --line-strong: #C5D0C9;
  --brand: #0B1B2A;
  --brand-ink: #F8F5ED;
  --nav: #091725;
  --nav-2: #10283A;
  --nav-ink: #EEF4F5;
  --nav-muted: #9BAEB8;
  --live: #176B8C;
  --live-soft: #E0F0F3;
  --accent: #B98A48;
  --accent-soft: #F4EBDD;
  --warn: #94620B;
  --warn-soft: #FBF0D8;
  --bad: #B8343C;
  --bad-soft: #FBE6E6;
  --good: #1C7656;
  --good-soft: #DFF2E8;
  --shadow: 0 12px 32px rgba(15, 35, 49, .055);
  --shadow-strong: 0 18px 45px rgba(15, 35, 49, .10);
  --f-display: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --f-ui: "Manrope", "Segoe UI", system-ui, sans-serif;
  --f-data: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --r: 12px;
}
/* Night mode: follows the computer, unless the person picked Day or Night (the toggle sets data-theme on <html>). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07131F;
    --panel: #0D1C2A;
    --panel-2: #122535;
    --panel-3: #193044;
    --ink: #E8F0F3;
    --muted: #A4B5BF;
    --faint: #748A97;
    --line: #203646;
    --line-strong: #304B5D;
    --brand: #E8F0F3;
    --brand-ink: #091725;
    --nav: #050F19;
    --nav-2: #112B3D;
    --nav-ink: #F0F6F6;
    --nav-muted: #99ADB9;
    --live: #63B4CC;
    --live-soft: #153846;
    --accent: #D2A865;
    --accent-soft: #3B2E1B;
    --warn: #E4B452;
    --warn-soft: #3B2E14;
    --bad: #F07178;
    --bad-soft: #3D1D23;
    --good: #63C99D;
    --good-soft: #143629;
    --shadow: 0 12px 32px rgba(0, 0, 0, .18);
    --shadow-strong: 0 18px 45px rgba(0, 0, 0, .28);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #07131F;
  --panel: #0D1C2A;
  --panel-2: #122535;
  --panel-3: #193044;
  --ink: #E8F0F3;
  --muted: #A4B5BF;
  --faint: #748A97;
  --line: #203646;
  --line-strong: #304B5D;
  --brand: #E8F0F3;
  --brand-ink: #091725;
  --nav: #050F19;
  --nav-2: #112B3D;
  --nav-ink: #F0F6F6;
  --nav-muted: #99ADB9;
  --live: #63B4CC;
  --live-soft: #153846;
  --accent: #D2A865;
  --accent-soft: #3B2E1B;
  --warn: #E4B452;
  --warn-soft: #3B2E14;
  --bad: #F07178;
  --bad-soft: #3D1D23;
  --good: #63C99D;
  --good-soft: #143629;
  --shadow: 0 12px 32px rgba(0, 0, 0, .18);
  --shadow-strong: 0 18px 45px rgba(0, 0, 0, .28);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 85% -10%, rgba(185, 138, 72, .075), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--f-ui);
  letter-spacing: -.01em;
}
a { color: var(--live); }
:focus-visible { outline: 2px solid var(--co-accent-line, var(--accent)); outline-offset: 3px; }
h1 { font: 700 clamp(27px, 2.4vw, 36px)/1.08 var(--f-display); letter-spacing: -.045em; margin: 0; }
h2 { font: 700 16px/1.2 var(--f-display); letter-spacing: -.02em; margin: 0; }
.mono { font-family: var(--f-data); font-variant-numeric: tabular-nums; letter-spacing: -.025em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* Shell: the navigation is a dark flight-desk rail; the top bar carries the operator identity. */
body.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  grid-template-rows: 76px minmax(0, 1fr);
  min-height: 100vh;
}
.top {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 clamp(20px, 3vw, 44px);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
}
.top::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: linear-gradient(90deg, var(--co-header, var(--accent)), transparent 70%);
  opacity: .72;
}
.top-context { min-width: 0; display: grid; gap: 2px; }
.top-kicker {
  color: var(--faint);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .16em;
  line-height: 1;
  text-transform: uppercase;
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--brand); text-decoration: none; }
.brand svg { width: 22px; height: 22px; }
.brand b { font: 800 14px/1 var(--f-display); letter-spacing: .18em; }
.org-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(620px, 100%);
  color: var(--ink);
  text-decoration: none;
}
.org-brand img { max-height: 38px; max-width: 100%; object-fit: contain; display: block; }
.org-name-brand {
  overflow: hidden;
  max-width: 100%;
  color: var(--ink);
  font: 700 19px/1.1 var(--f-display);
  letter-spacing: -.025em;
  white-space: nowrap;
  text-overflow: ellipsis;
  border-left: 3px solid var(--co-header, var(--accent));
  padding-left: 11px;
}
.top-actions { display: flex; align-items: center; gap: clamp(15px, 2.5vw, 32px); min-width: 0; }
.system-status, .side-status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.system-status i, .side-status > i {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 4px var(--good-soft);
}
.who { display: flex; align-items: center; gap: 14px; min-width: 0; color: var(--muted); white-space: nowrap; }
.who form { margin: 0; }
.user-chip { display: inline-flex; align-items: center; gap: 9px; min-width: 0; color: var(--ink); text-decoration: none; }
.user-chip:hover b { color: var(--live); }
.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--warn);
  font: 700 13px var(--f-display);
}
.user-copy { display: grid; gap: 1px; min-width: 0; }
.user-copy b { overflow: hidden; max-width: 170px; font-size: 12.5px; text-overflow: ellipsis; }
.user-copy small { color: var(--muted); font-size: 10.5px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--live); font: 600 12px var(--f-ui); cursor: pointer; text-decoration: none; }
.linkbtn:hover { color: var(--ink); text-decoration: underline; }

.side {
  grid-column: 1;
  grid-row: 1 / 3;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 25px 15px 18px;
  color: var(--nav-ink);
  background: linear-gradient(165deg, var(--nav) 0%, #0B2030 100%);
  border-right: 1px solid rgba(255, 255, 255, .06);
  position: sticky;
  top: 0;
  z-index: 11;
  overflow-y: auto;
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 40px;
  margin: 0 8px 20px;
  color: var(--nav-ink);
  text-decoration: none;
}
.side-brand:hover { color: #fff; }
.side-mark { display: grid; place-items: center; color: var(--accent); }
.side-mark svg { width: 28px; height: 28px; }
.side-brand > span:last-child { display: grid; gap: 3px; }
.side-brand b { font: 800 15px/1 var(--f-display); letter-spacing: .2em; }
.side-brand small { color: var(--nav-muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.side-rule { height: 1px; margin: 0 8px 18px; background: rgba(255, 255, 255, .10); }
.side-label {
  margin: 0 12px 5px;
  color: #6F8997;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.side-label-secondary { margin-top: 24px; }
.side a:not(.side-brand) {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--nav-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.side a:not(.side-brand) svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.side a:not(.side-brand):hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side a:not(.side-brand).on {
  color: #fff;
  background: linear-gradient(90deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .045));
  border-color: rgba(255, 255, 255, .09);
  box-shadow: inset 3px 0 0 var(--co-accent, var(--accent)), 0 6px 18px rgba(0, 0, 0, .10);
}
.side a:not(.side-brand).on svg { color: var(--co-accent, var(--accent)); }
.side-bottom { margin-top: auto; display: grid; gap: 18px; padding: 24px 10px 0; }
.side-status { align-items: flex-start; color: #C8D6DA; }
.side-status > i { margin-top: 5px; width: 6px; height: 6px; box-shadow: 0 0 0 4px rgba(99, 201, 157, .12); }
.side-status span { display: grid; gap: 2px; }
.side-status b { font-size: 11px; font-weight: 700; }
.side-status small { color: #6F8997; font-size: 10px; }
.side-foot { color: #6F8997; font-size: 10px; letter-spacing: .02em; }
main {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  max-width: 1680px;
  min-width: 0;
  padding: clamp(25px, 3vw, 42px) clamp(20px, 3.4vw, 54px) 58px;
}
.logo-edit { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 20px; align-items: start; }
.logo-preview { display: grid; gap: 8px; justify-items: center; padding: 20px; border: 1px dashed var(--line-strong); border-radius: 14px; background: var(--panel); }
.logo-preview img { max-height: 60px; max-width: 100%; object-fit: contain; }

/* Page headings and actions */
.head { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; }
.head p { max-width: 760px; margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  font: 700 12.5px var(--f-ui);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(15, 35, 49, .025);
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.btn:hover { border-color: var(--live); color: var(--live); box-shadow: 0 5px 14px rgba(15, 35, 49, .07); transform: translateY(-1px); }
.btn:active { transform: none; box-shadow: none; }
.btn.primary { background: var(--co-accent, var(--accent)); border-color: var(--co-accent, var(--accent)); color: var(--co-accent-ink, #17212A); box-shadow: 0 6px 16px color-mix(in srgb, var(--co-accent, var(--accent)) 25%, transparent); }
.btn.primary:hover { border-color: var(--co-accent, var(--accent)); color: var(--co-accent-ink, #17212A); filter: brightness(1.045); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background: transparent; }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.btn.small { min-height: 32px; padding: 0 11px; border-radius: 8px; font-size: 11.5px; }
.flash { padding: 12px 15px; border: 1px solid color-mix(in srgb, var(--good) 25%, var(--line)); border-left: 3px solid var(--good); border-radius: 10px; margin-bottom: 18px; background: var(--good-soft); color: var(--good); font-weight: 700; }
.flash.bad, .errors { border-color: color-mix(in srgb, var(--bad) 25%, var(--line)); border-left-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.errors { padding: 12px 15px; border: 1px solid color-mix(in srgb, var(--bad) 25%, var(--line)); border-left: 3px solid var(--bad); border-radius: 10px; margin: 0 0 18px; }
.errors ul { margin: 0; padding-left: 18px; }

/* Surface language */
.panel {
  min-width: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow);
}
.panel > h2, .panel-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 19px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, color-mix(in srgb, var(--panel-2) 45%, transparent), transparent 70%);
}
.panel-b { padding: 19px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 17px; align-items: start; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 17px; }
.kpi {
  position: relative;
  display: grid;
  gap: 7px;
  min-height: 106px;
  padding: 18px 18px 16px 20px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.kpi::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); }
.kpi span { color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: .08em; line-height: 1.25; text-transform: uppercase; }
.kpi b { color: var(--ink); font: 700 30px/1 var(--f-display); font-variant-numeric: tabular-nums; letter-spacing: -.055em; }
/* Featured card uses the rail colors, which stay dark in both themes (--brand flips light in dark mode). */
.kpi:first-child { background: var(--nav-2); border-color: var(--nav-2); }
.kpi:first-child span { color: var(--nav-muted); }
.kpi:first-child b { color: var(--nav-ink); }
.kpi:first-child::before { background: var(--co-accent, var(--accent)); }
.kpi.attn::before { background: var(--warn); }
.kpi.attn b { color: var(--warn); }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}
.tag.live { background: var(--live-soft); color: var(--live); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.good { background: var(--good-soft); color: var(--good); }
.tag.priv { background: var(--accent-soft); color: var(--warn); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--faint); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
tbody tr:not(.group):hover { background: color-mix(in srgb, var(--live-soft) 28%, transparent); }
tbody tr:last-child td { border-bottom: 0; }
tr.group th { padding-top: 17px; padding-bottom: 8px; background: var(--panel); color: var(--warn); letter-spacing: .1em; border-bottom: 1px solid var(--line-strong); }
tr.group th::before { content: ''; display: inline-block; width: 6px; height: 6px; margin: 0 8px 1px 0; border-radius: 50%; background: currentColor; }
td a.rowlink { color: inherit; text-decoration: none; font-weight: 800; }
td a.rowlink:hover { color: var(--live); text-decoration: underline; text-underline-offset: 3px; }
.empty { padding: 32px 18px; text-align: center; color: var(--muted); }

/* Forms */
.form { display: grid; gap: 16px; max-width: 760px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 16px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label, .label { color: var(--ink); font-size: 12px; font-weight: 800; }
.field .hint { color: var(--muted); font-size: 11.5px; }
input:not([type]), input[type=search], input[type=tel], input[type=url], input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], input[type=date], select, textarea {
  width: 100%;
  min-height: 42px;
  touch-action: manipulation;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--panel);
  color: var(--ink);
  font: 13px var(--f-ui);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:not([type]):focus, input[type=search]:focus, input[type=tel]:focus, input[type=url]:focus, input[type=text]:focus, input[type=email]:focus, input[type=password]:focus, input[type=number]:focus, input[type=datetime-local]:focus, input[type=date]:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--live);
  box-shadow: 0 0 0 3px var(--live-soft);
}
textarea { min-height: 88px; resize: vertical; }
input[type=color] { width: 72px; height: 42px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--panel); touch-action: manipulation; }
input[type=file] { width: 100%; min-height: 42px; padding: 10px; border: 1px dashed var(--line-strong); border-radius: 9px; background: var(--panel-2); color: var(--muted); font: 12px var(--f-ui); touch-action: manipulation; }
button, select, input, textarea, summary, a.btn { touch-action: manipulation; }
button, .btn, summary { -webkit-user-select: none; user-select: none; }
.check { display: flex; gap: 8px; align-items: center; min-height: 44px; font-size: 13px; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.inline form { margin: 0; }

/* Trip and flight detail */
dl.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 9px 18px; margin: 0; font-size: 13px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { min-width: 0; margin: 0; }
.oooi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 17px; }
.oooi div { padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.oooi span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.oooi b { color: var(--ink); font: 600 15px var(--f-data); }
.delaybox, .cancelbox { padding: 13px 15px; border: 1px solid color-mix(in srgb, var(--warn) 28%, var(--line)); border-left: 4px solid var(--warn); border-radius: 10px; background: var(--warn-soft); margin-bottom: 17px; }
.delaybox.coded { border-color: color-mix(in srgb, var(--good) 28%, var(--line)); border-left-color: var(--good); background: var(--good-soft); }
.cancelbox { border-color: color-mix(in srgb, var(--bad) 28%, var(--line)); border-left-color: var(--bad); background: var(--bad-soft); }
.bars { display: grid; gap: 13px; }
.bar { display: grid; grid-template-columns: minmax(120px, 230px) minmax(0, 1fr) 72px; gap: 12px; align-items: center; font-size: 12px; }
.bar progress { width: 100%; height: 8px; appearance: none; border: 0; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.bar progress::-webkit-progress-bar { background: var(--panel-2); border-radius: 999px; }
.bar progress::-webkit-progress-value { background: var(--live); border-radius: 999px; }
.bar progress::-moz-progress-bar { background: var(--live); border-radius: 999px; }
.bar progress.uncoded::-webkit-progress-value { background: var(--warn); }
.bar progress.uncoded::-moz-progress-bar { background: var(--warn); }
.secret { padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); color: var(--ink); font: 600 16px var(--f-data); letter-spacing: .08em; word-break: break-all; }
.copybox { padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); font: 12px var(--f-data); word-break: break-all; user-select: all; }

/* Bare/authentication pages */
.bare {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 30px 16px;
  background:
    linear-gradient(135deg, rgba(9, 23, 37, .96), rgba(16, 40, 58, .90)),
    radial-gradient(circle at 75% 20%, rgba(185, 138, 72, .32), transparent 28rem);
}
.bare::before { content: ''; position: fixed; inset: 0; pointer-events: none; opacity: .14; background-image: linear-gradient(120deg, transparent 0 48%, rgba(255,255,255,.20) 49% 50%, transparent 51%); background-size: 42rem 42rem; }
.card { position: relative; width: min(100%, 440px); display: grid; gap: 18px; padding: 32px; background: var(--panel); border: 1px solid rgba(255, 255, 255, .12); border-radius: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .26); }
.card .brand { justify-content: center; margin-bottom: 2px; }
.card h1 { font-size: 27px; text-align: center; }
.card p { margin: 0; color: var(--muted); }
.card .btn { width: 100%; }
.foot { color: var(--muted); font-size: 11px; text-align: center; }
body.login-branded .bare { background: linear-gradient(140deg, var(--co-header, #091725), #10283A 68%, #B98A48 180%); }
.login-brand { display: grid; place-items: center; min-height: 86px; margin: -32px -32px 0; padding: 20px 22px; border-radius: 20px 20px 0 0; background: var(--co-header, var(--brand)); }
.login-brand img { max-height: 56px; max-width: 100%; object-fit: contain; display: block; }
.login-brand .org-name-brand { max-width: 100%; border-left: 0; border-bottom: 2px solid var(--co-accent, var(--accent)); padding: 0 0 5px; color: var(--co-header-ink, var(--brand-ink)); font-size: 22px; }
.powered { display: inline-flex; align-items: center; gap: 4px; }
.powered svg { width: 12px; height: 12px; }

/* Aircraft and administration cards */
.cards-list { display: grid; gap: 12px; }
.provider { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); }
.provider > div { min-width: 0; }
.fleet { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.ac-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.ac-photo { display: block; aspect-ratio: 16 / 9; max-width: 100%; overflow: hidden; background: var(--panel-2); }
.ac-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ac-placeholder { display: grid; place-content: center; justify-items: center; gap: 7px; width: 100%; height: 100%; color: var(--faint); background: linear-gradient(145deg, var(--panel-2), var(--panel-3)); }
.ac-placeholder svg { width: 42px; height: 42px; }
.ac-placeholder .mono { color: var(--muted); font-size: 14px; letter-spacing: .06em; }
.ac-body { display: grid; gap: 7px; padding: 15px 16px 17px; }
.ac-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ac-title b { font-size: 18px; }
.ac-type { color: var(--muted); font-size: 12.5px; }
.ac-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ac-actions { font-size: 12px; }
.photo-edit { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 20px; align-items: start; }
.photo-edit .ac-photo { border: 1px solid var(--line); border-radius: 12px; }

/* Interaction helpers */
.btn.busy { cursor: progress; }
.btn.busy::after { content: ''; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn, .side a:not(.side-brand) { transition: none; } .btn.busy::after { animation: none; } }
.tabs { display: flex; gap: 4px; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 800; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { border-bottom-color: var(--co-accent-line, var(--accent)); color: var(--ink); }
.review-panel { border-color: color-mix(in srgb, var(--warn) 42%, var(--line)); }
.review-panel > h2 span { font-weight: 500; }
.release { display: grid; gap: 9px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 11px; }
.release.current { border-color: var(--good); box-shadow: inset 3px 0 var(--good); }
.release-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.release-notes { margin: 0; padding-left: 18px; color: var(--muted); }
summary { color: var(--live); cursor: pointer; font-weight: 700; }

/* Aircraft categories, settings preview, live map */
.cat { margin-bottom: 16px; }
.cat > summary { display: flex; align-items: center; gap: 12px; padding: 14px 17px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); color: var(--ink); cursor: pointer; list-style: none; }
.cat > summary::-webkit-details-marker { display: none; }
.cat > summary::before { content: ''; width: 7px; height: 7px; flex: none; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); transition: transform .15s; }
.cat[open] > summary::before { transform: rotate(45deg); }
.cat[open] > summary { border-radius: 13px 13px 0 0; border-bottom-color: transparent; }
.cat > .fleet { padding: 16px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 13px 13px; background: color-mix(in srgb, var(--panel-2) 35%, transparent); }
.cat-name { font: 700 15px var(--f-display); }
.cat-count { color: var(--muted); font-size: 12px; }
.sortform { gap: 6px; align-items: center; }
.sortform select { width: auto; min-height: 36px; }
.theme-preview { display: grid; grid-template-columns: 90px 1fr; min-height: 120px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.theme-preview .tp-top { grid-column: 1 / -1; display: grid; place-items: center; height: 36px; }
.theme-preview .tp-side { display: grid; align-content: start; gap: 6px; padding: 8px; border-right: 1px solid var(--line); background: var(--panel); }
.theme-preview .tp-item { height: 12px; border-radius: 4px; background: var(--panel-2); }
.theme-preview .tp-body { display: grid; align-content: start; gap: 8px; padding: 10px; }
.swatch-row { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch-row span { display: inline-flex; align-items: center; gap: 6px; font: 11px var(--f-data); }
.swatch-row i { display: inline-block; width: 18px; height: 18px; border: 1px solid var(--line); border-radius: 4px; }
.map-panel { overflow: hidden; }
.map-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 19px; border-bottom: 1px solid var(--line); }
.live-map { width: 100%; height: 440px; background: #DDE8E7; }
.live-map.map-failed { display: grid; place-items: center; padding: 20px; color: var(--muted); text-align: center; }
.map-missing { display: grid; gap: 4px; padding: 0 19px; }
.map-missing:not(:empty) { padding-top: 12px; padding-bottom: 2px; border-top: 1px solid var(--line); }
.map-miss { font-size: 12.5px; }
.map-credit { margin: 0; padding: 8px 19px 13px; }
.map-credit:empty { display: none; }
.ac-pin { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.ac-pin-icon { display: grid; place-items: center; width: 27px; height: 27px; color: var(--co-accent, var(--live)); filter: drop-shadow(0 2px 2px rgba(0,0,0,.45)); transition: transform .4s; }
.ac-pin-icon svg { width: 27px; height: 27px; fill: currentColor; stroke: #091725; stroke-width: .8; }
.ac-pin-label { padding: 3px 7px; border-radius: 5px; background: var(--co-header, var(--brand)); color: var(--co-header-ink, var(--brand-ink)); font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.ac-pin.stale .ac-pin-icon { color: var(--warn); }
.ac-pin.ground .ac-pin-icon { opacity: .8; }
.map-pop { display: grid; gap: 3px; min-width: 180px; color: #13263A; font: 12.5px var(--f-ui); }
.map-pop .muted { color: #5D6D79; }
.map-pop .warn { color: #94620B; font-weight: 700; }
.map-pop a { color: #176B8C; font-weight: 700; }
.design-map-placeholder {
  display: grid;
  place-items: center;
  min-height: 320px;
  height: 100%;
  padding: 24px;
  color: #C7D8DE;
  text-align: center;
  background-color: #102C3B;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px), radial-gradient(circle at 50% 50%, rgba(185,138,72,.18), transparent 36%);
  background-size: 48px 48px, 48px 48px, auto;
}
.design-map-placeholder::after { content: 'LIVE AIRSPACE'; padding: 7px 11px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: #E5D0A4; font-size: 10px; font-weight: 800; letter-spacing: .14em; }

/* Automatic flight log and filters */
.grid-times { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
.filters { display: flex; flex-wrap: wrap; gap: 0 13px; align-items: end; }
.filters .field { min-width: 150px; }
.mt { margin-top: 17px; }
.stack { display: grid; gap: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 1100px) {
  .system-status { display: none; }
  .top-actions { gap: 14px; }
  .grid2 { grid-template-columns: 1fr; }
}
@media (pointer: coarse), (max-width: 900px) {
  .btn { min-height: 48px; padding-left: 16px; padding-right: 16px; }
  .btn.small { min-height: 44px; padding-left: 13px; padding-right: 13px; font-size: 12px; }
  .theme-btn { min-height: 44px; padding-left: 13px; padding-right: 13px; }
  .linkbtn { min-height: 44px; padding: 8px 4px; }
  .check > input { width: 24px; height: 24px; flex: none; }
  details > summary:not(.btn) { display: flex; align-items: center; min-height: 44px; padding: 8px 4px; }
  input:not([type]), input[type=search], input[type=tel], input[type=url], input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], input[type=date], select { min-height: 50px; font-size: 16px; }
  textarea { font-size: 16px; }
  input[type=file] { min-height: 50px; padding-top: 13px; }
  .actions, .inline { gap: 10px; }
}
@media (max-width: 900px) {
  body.shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: 68px auto minmax(0, 1fr); }
  .top { grid-column: 1; grid-row: 1; padding: 0 16px; position: static; }
  .top-kicker { display: none; }
  .top-context { flex: 1; }
  .org-name-brand { font-size: 17px; }
  .user-copy { display: none; }
  .who { gap: 10px; }
  .side { grid-column: 1; grid-row: 2; min-height: 0; flex-direction: row; align-items: center; gap: 5px; padding: 8px 10px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.08); position: static; overflow-x: auto; }
  .side-brand { min-width: 30px; margin: 0 9px 0 4px; }
  .side-brand > span:last-child, .side-rule, .side-label, .side-label-secondary, .side-bottom { display: none; }
  .side a:not(.side-brand) { min-height: 46px; padding: 10px 12px; white-space: nowrap; }
  .side a:not(.side-brand) svg { width: 17px; height: 17px; }
  main { grid-column: 1; grid-row: 3; padding: 23px 15px 42px; }
  .head { align-items: flex-start; margin-bottom: 18px; }
  .actions { width: 100%; }
  .actions .btn { flex: 0 0 auto; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .fields { grid-template-columns: 1fr; }
  .oooi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bar { grid-template-columns: minmax(0, 1fr) 66px; gap: 7px; }
  .bar progress { grid-column: 1 / -1; grid-row: 2; }
  .logo-edit, .photo-edit { grid-template-columns: 1fr; }
  .live-map { height: 320px; }
}
@media (max-width: 520px) {
  .top { gap: 8px; }
  .top-actions { gap: 8px; }
  .linkbtn { font-size: 0; }
  .linkbtn::after { content: 'Exit'; font-size: 11px; }
  .head h1 { font-size: 27px; }
  .kpi { min-height: 92px; padding: 14px 13px 13px 16px; }
  .kpi b { font-size: 26px; }
  .panel-b { padding: 15px; }
  th, td { padding: 10px 11px; }
  .card { padding: 25px 20px; }
  .login-brand { margin: -25px -20px 0; }
}
@media (prefers-reduced-motion: reduce) { .cat > summary::before, .ac-pin-icon { transition: none; } }

/* Day / Night toggle (top bar). Only the button for the other mode shows. */
.theme-form { margin: 0; }
.theme-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--panel); color: var(--ink); font: 600 12px/1 var(--f-ui); cursor: pointer; white-space: nowrap; }
.theme-btn:hover { border-color: var(--accent); }
.theme-btn svg { width: 15px; height: 15px; flex: none; }
.theme-btn.to-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn.to-dark { display: none; }
  :root:not([data-theme="light"]) .theme-btn.to-light { display: inline-flex; }
}
:root[data-theme="dark"] .theme-btn.to-dark { display: none; }
:root[data-theme="dark"] .theme-btn.to-light { display: inline-flex; }

/* Aircraft photo next to the tail on Operations, and in the map pop-up. */
.ops-ac { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ops-thumb { flex: none; width: 64px; height: 36px; border-radius: 6px; object-fit: cover; background: var(--panel-2); border: 1px solid var(--line); }
.map-pop-photo { display: block; width: 100%; max-width: 220px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; margin-bottom: 6px; }
@media (max-width: 720px) { .ops-thumb { width: 48px; height: 27px; } .theme-btn .theme-label { display: none; } }

/* Status badge follows the company's flight-data connection (ops_status). */
a.system-status { text-decoration: none; }
a.system-status:hover { color: var(--ink); }
.system-status.is-warn i, .side-status.is-warn > i { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.system-status.is-bad i, .side-status.is-bad > i { background: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); }
.system-status.is-off i, .side-status.is-off > i { background: var(--faint); box-shadow: 0 0 0 4px var(--panel-2); }
.system-status.is-bad { color: var(--bad); font-weight: 700; }
.system-status.is-warn { color: var(--warn); font-weight: 700; }
.side-status.is-bad b { color: #FF8A8F; }
.side-status.is-warn b { color: #F0C063; }

/* Phone app and notifications (Your account) */
[hidden] { display: none !important; }
.app-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.app-steps > div { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--panel-2); }
.app-steps p { margin: 4px 0 0; }
.push-panel { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
@media (max-width: 720px) { .app-steps { grid-template-columns: 1fr; } }
@media (display-mode: standalone) { body.shell { padding-top: env(safe-area-inset-top); } }
/* Password-confirmed actions and masked IPs */
.confirm-details > summary { list-style: none; cursor: pointer; }
.confirm-details > summary::-webkit-details-marker { display: none; }
.confirm-details[open] > summary { opacity: .7; }
.ip-reveal { display: inline; margin: 0; }

/* Repositioning flights: one fixed violet everywhere (tags and map), distinct from passenger trips. */
:root { --repo: #6D4AC2; --repo-soft: #EEE8FB; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --repo: #B9A2F5; --repo-soft: #2A2145; } }
:root[data-theme="dark"] { --repo: #B9A2F5; --repo-soft: #2A2145; }
.tag.repo { background: var(--repo-soft); color: var(--repo); }
.ac-pin.repo .ac-pin-icon { color: #A78BFA; }
.ac-pin-repo { padding: 2px 5px; border-radius: 4px; background: #6D4AC2; color: #FFFFFF; font: 700 9.5px/1.2 var(--f-ui, sans-serif); letter-spacing: .06em; }
.map-pop-repo { color: var(--repo); font-weight: 700; }

.tag.hold { background: var(--warn-soft); color: var(--repo); box-shadow: inset 0 0 0 1px var(--repo); }

/* Admin: what this site includes */
.package-list { margin: 0 0 .6em; padding-left: 1.1em; display: grid; gap: .45em; }
.report-pick { display: flex; flex-wrap: wrap; align-items: center; gap: .6em 1em; border-top: 1px solid var(--line, rgba(127,127,127,.2)); }
/* Operations: countdown to departure */
.countdown { display: inline-block; margin-top: .2em; font-size: .78em; font-weight: 600; color: var(--muted); white-space: nowrap; }
.countdown.is-soon { color: var(--warn); }
.countdown.is-due { color: var(--bad); }
/* Operations: five stat cards (cancellations added) */
.kpis.kpis-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .kpis.kpis-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .kpis.kpis-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Reports: show or hide repositioning flights */
.report-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 14px; }
.repo-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: .82rem; font-weight: 600; text-decoration: none; }
.repo-toggle i { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--repo); }
.repo-toggle.is-on { color: inherit; border-color: var(--repo); }
.repo-toggle.is-on i { background: var(--repo); }
.repo-toggle:hover { border-color: var(--repo); }
