/* Posrep: chart navy, airspace blue for active flights, chart magenta accent. Operator accent (--op) comes from /brand.css. */
:root {
  --bg: #EEF2F6; --panel: #FFFFFF; --panel-2: #F4F7FA; --ink: #10263F; --muted: #56697D; --faint: #8597A9;
  --line: #DCE4EC; --line-strong: #C6D2DE; --brand: #10263F; --brand-ink: #F3F7FB;
  --live: #1E5FA8; --live-soft: #E1ECF8; --accent: #9B2270; --accent-soft: #F5E3EE;
  --warn: #9A6205; --warn-soft: #FBEFD6; --bad: #C0343B; --bad-soft: #FBE4E5; --good: #1D7A55; --good-soft: #DFF2E8;
  --f-display: "Archivo", "Segoe UI", system-ui, sans-serif;
  --f-ui: "Archivo Narrow", "Arial Narrow", "Segoe UI", system-ui, sans-serif;
  --f-data: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --r: 8px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #081320; --panel: #0E1C2C; --panel-2: #122438; --ink: #E6EEF7; --muted: #9DB0C3; --faint: #6E8499;
    --line: #1F3348; --line-strong: #2C455E; --brand: #E6EEF7; --brand-ink: #0B1726;
    --live: #6FA8EA; --live-soft: #16304D; --accent: #E0579F; --accent-soft: #3A1830;
    --warn: #F0B44D; --warn-soft: #3B2E14; --bad: #FF6B72; --bad-soft: #3D1C22; --good: #5BC99A; --good-soft: #133528;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--f-ui); }
a { color: var(--live); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1 { font: 700 24px/1.15 var(--f-display); margin: 0; }
h2 { font: 700 16px/1.2 var(--f-display); margin: 0; }
.mono { font-family: var(--f-data); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* shell: company branding across the top, navigation down the left */
body.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); grid-template-rows: 64px minmax(0, 1fr); min-height: 100vh; }
.top { grid-column: 1 / -1; display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding-right: 16px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--brand); text-decoration: none; }
.top .brand { padding-left: 18px; opacity: .85; }
.brand svg { width: 22px; height: 22px; }
.brand b { font: 700 14px/1 var(--f-display); letter-spacing: .12em; }
.org-brand { justify-self: center; display: flex; align-items: center; justify-content: center; height: 64px; min-width: 0; max-width: min(520px, 100%); text-decoration: none; }
.org-brand img { max-height: 42px; max-width: 100%; object-fit: contain; display: block; }
.org-name-brand { font: 700 21px/1.1 var(--f-display); color: var(--ink); letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 3px solid var(--op, #C9A15A); padding-bottom: 2px; }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.who form { margin: 0; }
.side { grid-column: 1; grid-row: 2; background: var(--panel); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; }
.side a { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: var(--r); color: var(--muted); text-decoration: none; font-weight: 600; font-size: 15px; }
.side a svg { width: 20px; height: 20px; flex: none; }
.side a:hover { background: var(--panel-2); color: var(--ink); }
.side a.on { background: var(--brand); color: var(--brand-ink); box-shadow: inset 4px 0 0 var(--op, #C9A15A); }
.side-foot { margin-top: auto; padding: 10px 12px 0; font-size: 11.5px; color: var(--faint); }
main { grid-column: 2; grid-row: 2; padding: 22px 26px 44px; width: 100%; max-width: 1320px; min-width: 0; }
.logo-edit { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 18px; align-items: start; }
.logo-preview { display: grid; gap: 8px; justify-items: center; padding: 18px; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--panel); }
.logo-preview img { max-height: 60px; max-width: 100%; object-fit: contain; }
@media (max-width: 900px) {
  body.shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); }
  .top { grid-template-columns: auto minmax(0, 1fr) auto; padding: 0 12px; position: static; }
  .top .brand { padding-left: 0; }
  .top .brand b { display: none; }
  .org-brand { height: 56px; }
  .who span { display: none; }
  .side { grid-column: 1; grid-row: 2; flex-direction: row; height: auto; position: static; overflow-x: auto; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side a { padding: 8px 10px; white-space: nowrap; }
  .side-foot { display: none; }
  main { grid-column: 1; grid-row: 3; padding: 16px 14px 36px; }
  .logo-edit { grid-template-columns: 1fr; }
}
.head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.head p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* bits */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); font: 600 14px var(--f-ui); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--live); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn.small { min-height: 30px; padding: 0 10px; font-size: 13px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--live); font: inherit; cursor: pointer; text-decoration: underline; }
.flash { padding: 10px 14px; border-radius: var(--r); margin-bottom: 14px; background: var(--good-soft); color: var(--good); font-weight: 600; }
.flash.bad, .errors { background: var(--bad-soft); color: var(--bad); }
.errors { padding: 10px 14px; border-radius: var(--r); margin: 0 0 14px; }
.errors ul { margin: 0; padding-left: 18px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.panel > h2, .panel-h { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.panel-b { padding: 14px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; display: grid; gap: 2px; }
.kpi span { font-size: 12.5px; color: var(--muted); }
.kpi b { font: 700 24px/1.1 var(--f-display); font-variant-numeric: tabular-nums; }
.kpi.attn b { color: var(--warn); }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--panel-2); color: var(--muted); }
.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(--accent); }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 600; white-space: nowrap; }
tr.group th { background: var(--panel-2); color: var(--muted); letter-spacing: .12em; }
td a.rowlink { color: inherit; text-decoration: none; font-weight: 600; }
td a.rowlink:hover { color: var(--live); text-decoration: underline; }
.empty { padding: 26px 14px; text-align: center; color: var(--muted); }

/* forms */
.form { display: grid; gap: 14px; max-width: 760px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label, .label { font-size: 13px; font-weight: 600; }
.field .hint { font-size: 12.5px; color: var(--muted); }
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: 40px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--panel); color: var(--ink); font: 15px var(--f-ui);
}
textarea { min-height: 80px; resize: vertical; }
input[type=color] { width: 70px; height: 40px; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--panel); }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.inline form { margin: 0; }

/* trip detail */
dl.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
.oooi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.oooi div { background: var(--panel-2); border-radius: var(--r); padding: 8px 10px; }
.oooi span { display: block; font-size: 12px; color: var(--muted); }
.oooi b { font: 600 16px var(--f-data); }
.delaybox { border-left: 4px solid var(--warn); background: var(--warn-soft); padding: 10px 12px; border-radius: 0 var(--r) var(--r) 0; margin-bottom: 12px; }
.delaybox.coded { border-left-color: var(--good); background: var(--good-soft); }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: minmax(120px, 230px) minmax(0, 1fr) 70px; gap: 10px; align-items: center; font-size: 13.5px; }
.bar progress { width: 100%; height: 12px; appearance: none; border: 0; border-radius: 6px; background: var(--panel-2); overflow: hidden; }
.bar progress::-webkit-progress-bar { background: var(--panel-2); border-radius: 6px; }
.bar progress::-webkit-progress-value { background: var(--live); border-radius: 6px; }
.bar progress::-moz-progress-bar { background: var(--live); border-radius: 6px; }
.bar progress.uncoded::-webkit-progress-value { background: var(--warn); }
.bar progress.uncoded::-moz-progress-bar { background: var(--warn); }
.secret { font: 600 16px var(--f-data); letter-spacing: .08em; word-break: break-all; background: var(--panel-2); padding: 10px 12px; border-radius: var(--r); }
.copybox { font: 13px var(--f-data); word-break: break-all; background: var(--panel-2); padding: 10px 12px; border-radius: var(--r); user-select: all; }

/* bare pages (sign-in) */
.bare { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.card { width: min(100%, 420px); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 26px; display: grid; gap: 16px; }
.card .brand { justify-content: center; }
.card h1 { font-size: 22px; text-align: center; }
.card p { margin: 0; color: var(--muted); }
.card .btn { width: 100%; }
.foot { font-size: 12px; color: var(--muted); text-align: center; }

@media (max-width: 900px) {
  .grid2 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fields { grid-template-columns: 1fr; }
  .oooi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bar { grid-template-columns: minmax(0, 1fr) 60px; }
  .bar progress { grid-column: 1 / -1; grid-row: 2; }
}
.mt { margin-top: 14px; }
.stack { display: grid; gap: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
summary { cursor: pointer; font-weight: 600; color: var(--live); }
.cards-list { display: grid; gap: 10px; }
.provider { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); }
.provider > div { min-width: 0; }
/* fleet grid */
.fleet { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.ac-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.ac-photo { display: block; aspect-ratio: 16 / 9; max-width: 100%; background: var(--panel-2); overflow: hidden; }
.ac-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ac-placeholder { width: 100%; height: 100%; display: grid; place-content: center; justify-items: center; gap: 6px; color: var(--faint); background: linear-gradient(160deg, var(--panel-2), var(--line)); }
.ac-placeholder svg { width: 40px; height: 40px; }
.ac-placeholder .mono { font-size: 15px; letter-spacing: .06em; color: var(--muted); }
.ac-body { padding: 12px 14px; display: grid; gap: 6px; }
.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: 14px; }
.ac-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ac-actions { font-size: 13.5px; }
.photo-edit { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 16px; align-items: start; }
.photo-edit .ac-photo { border-radius: 10px; border: 1px solid var(--line); }
@media (max-width: 700px) { .photo-edit { grid-template-columns: 1fr; } }
.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.busy::after { animation: none; } }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 14px; }
.tabs a { padding: 9px 14px; color: var(--muted); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
.cancelbox { border-left: 4px solid var(--bad); background: var(--bad-soft); padding: 10px 12px; border-radius: 0 var(--r) var(--r) 0; margin-bottom: 12px; }
