/* Aeropict FlightDesk — © Aeropict Aviation LLC */
:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #566174;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --accent: #1d4ed8;
  --accent-ink: #ffffff;
  --accent-soft: #dbeafe;
  --ok: #15803d; --ok-soft: #dcfce7;
  --warn: #b45309; --warn-soft: #fef3c7;
  --bad: #b91c1c; --bad-soft: #fee2e2;
  --info: #0369a1; --info-soft: #e0f2fe;
  --side: #0b1b33;
  --side-ink: #cbd5e1;
  --side-active: #1e3a66;
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 16px rgba(15,23,42,.06);
  --shadow-lg: 0 10px 40px rgba(15,23,42,.22);
  --radius: 10px;
  --night: rgba(15,23,42,.07);
  --twilight: rgba(15,23,42,.035);
  --grid: #eef2f6;
  --grid-hour: #dfe5ec;
  --now: #ef4444;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --panel: #111a2b; --panel-2: #0f1727; --ink: #e5e9f0; --ink-2: #cbd5e1; --muted: #94a3b8;
    --line: #1f2b40; --line-2: #2c3b55; --accent: #60a5fa; --accent-ink: #0b1220; --accent-soft: #1e3a5f;
    --ok: #4ade80; --ok-ink: #04210f; --ok-soft: #12351f; --warn: #fbbf24; --warn-soft: #3a2c0b; --bad: #f87171; --bad-soft: #3b1414;
    --info: #7dd3fc; --info-soft: #0c2e44; --side: #070d19; --side-active: #16294a;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 10px 40px rgba(0,0,0,.6);
    --night: rgba(0,0,0,.28); --twilight: rgba(0,0,0,.14); --grid: #16213a; --grid-hour: #22304b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220; --panel: #111a2b; --panel-2: #0f1727; --ink: #e5e9f0; --ink-2: #cbd5e1; --muted: #94a3b8;
  --line: #1f2b40; --line-2: #2c3b55; --accent: #60a5fa; --accent-ink: #0b1220; --accent-soft: #1e3a5f;
  --ok: #4ade80; --ok-ink: #04210f; --ok-soft: #12351f; --warn: #fbbf24; --warn-soft: #3a2c0b; --bad: #f87171; --bad-soft: #3b1414;
  --info: #7dd3fc; --info-soft: #0c2e44; --side: #070d19; --side-active: #16294a;
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 10px 40px rgba(0,0,0,.6);
  --night: rgba(0,0,0,.28); --twilight: rgba(0,0,0,.14); --grid: #16213a; --grid-hour: #22304b;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
code { background: var(--panel-2); border: 1px solid var(--line); padding: 0 .3em; border-radius: 4px; font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; z-index: 1000; }
.skip:focus { left: 8px; top: 8px; }
.ico { flex: none; vertical-align: middle; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------- app shell */
body.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex: none; background: var(--side); color: var(--side-ink);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 14px; color: #fff; text-decoration: none; }
.brand strong { display: block; font-size: .98rem; line-height: 1.2; }
.brand small { color: #7f93b2; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 6px 10px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px;
  color: var(--side-ink); text-decoration: none; margin-bottom: 2px; font-weight: 500;
}
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: var(--side-active); color: #fff; }
.sidebar nav a span { flex: 1; }
.badge { font-style: normal; background: #3b82f6; color: #fff; font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.badge.red { background: #dc2626; }
.side-foot { display: flex; align-items: center; gap: 6px; padding: 12px 10px; border-top: 1px solid rgba(255,255,255,.08); }
.side-foot .me { flex: 1; display: flex; align-items: center; gap: 10px; color: var(--side-ink); text-decoration: none; min-width: 0; padding: 4px; border-radius: 8px; }
.side-foot .me:hover, .side-foot .me.active { background: rgba(255,255,255,.06); }
.side-foot .me strong { display: block; color: #fff; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .me small { color: #7f93b2; font-size: .75rem; }
.side-foot .me > span:last-child { min-width: 0; }
.side-foot .icon-btn { color: var(--side-ink); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #2563eb; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex: none; }

.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--panel);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; min-height: 58px;
}
.page-title { font-size: 1.2rem; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.menu-btn { display: none; }
main { padding: 22px 24px 40px; max-width: 1200px; width: 100%; }
main.wide { max-width: none; }
.app-foot { padding: 14px 24px; color: var(--muted); font-size: .78rem; margin-top: auto; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 39; }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; visibility: hidden; }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); visibility: visible; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 10px 14px; }
  main { padding: 16px 16px 32px; }
}

/* ---------------- buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel);
  color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.danger.solid { background: var(--bad); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: var(--ok-ink, #fff); }
.btn.small { padding: 5px 10px; font-size: .84rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--panel-2); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-row.end { justify-content: flex-end; }
.spacer { flex: 1; }

.form label, label.field { display: block; font-weight: 600; font-size: .86rem; color: var(--ink-2); margin-bottom: 12px; }
.form label > input, .form label > select, .form label > textarea,
label.field > input, label.field > select, label.field > textarea { margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=time],
input[type=datetime-local], input[type=search], input[type=url], input:not([type]), select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel);
  color: var(--ink); font: inherit; font-weight: 400;
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); border-color: var(--accent); }
input[type=color] { width: 44px; height: 34px; padding: 2px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); cursor: pointer; }
label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
label.check input { margin-top: 3px; width: auto; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 700px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr; } }
@media (min-width: 701px) and (max-width: 1000px) { .grid4 { grid-template-columns: repeat(2, 1fr); } }
.hint { font-weight: 400; color: var(--muted); font-size: .8rem; display: block; margin-top: 3px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px 4px; margin: 0 0 16px; }
legend { font-weight: 700; padding: 0 6px; }

/* ---------------- cards, flashes, pills */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; flex: 1; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .cols { grid-template-columns: minmax(0, 1fr); } }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid transparent; }
.flash.success { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.flash.error { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.flash.info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.flash.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.flash ul { margin: 4px 0 0; padding-left: 18px; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: .76rem; font-weight: 700; background: var(--panel-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.pill.st-scheduled { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.pill.st-dispatched, .pill.st-active, .pill.st-resolved, .pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.st-completed { background: var(--panel-2); color: var(--muted); }
.pill.st-cancelled, .pill.st-rejected, .pill.st-suspended, .pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.st-noshow, .pill.st-pending, .pill.st-deferred, .pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.st-open { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; border: 1px solid rgba(0,0,0,.15); }
.stat { display: flex; flex-direction: column; }
.stat b { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .82rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stats .card { margin: 0; padding: 14px 16px; }
.owes { color: var(--bad); } .credit { color: var(--ok); }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; align-content: start; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-weight: 500; }
.empty { text-align: center; color: var(--muted); padding: 28px 10px; }

/* ---------------- tables */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tbl th { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; background: var(--panel-2); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--panel-2); }
.tbl td.actions { text-align: right; white-space: nowrap; }
.tbl tfoot td { font-weight: 700; border-top: 2px solid var(--line-2); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a, .tabs button { padding: 8px 14px; border: 0; background: none; color: var(--muted); text-decoration: none; font: inherit; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.tabs a.active, .tabs button.active, .tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search] { max-width: 280px; }

/* ---------------- checks (dispatch) */
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { display: grid; grid-template-columns: 26px 150px 1fr; gap: 8px; align-items: start; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.checks li:last-child { border-bottom: 0; }
.checks .mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .8rem; color: #fff; }
.checks .pass .mark { background: var(--ok); }
.checks .warn .mark { background: #d97706; }
.checks .fail .mark { background: var(--bad); }
.checks .info .mark { background: var(--muted); }
.checks .lbl { font-weight: 600; }
.checks .hard { font-size: .74rem; font-weight: 700; color: var(--bad); display: block; }
@media (max-width: 600px) { .checks li { grid-template-columns: 26px 1fr; } .checks li .det { grid-column: 2; } }
ul.checklist { list-style: none; padding: 0; }
ul.checklist li { padding: 6px 0; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
ul.checklist .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); flex: none; }
ul.checklist .fail .dot { background: var(--bad); }
ul.checklist small { flex-basis: 100%; color: var(--bad); padding-left: 18px; }

/* ---------------- public pages */
body.public { min-height: 100vh; display: flex; flex-direction: column; }
.pub-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; background: var(--side); }
.pub-top .brand { padding: 0; }
.pub-top nav { display: flex; gap: 14px; align-items: center; }
.pub-top nav a:not(.btn) { color: #cbd5e1; text-decoration: none; font-weight: 600; }
.pub-main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 32px 20px; }
.pub-main.narrow { max-width: 820px; }
.pub-foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 18px; }
.auth-card { max-width: 420px; margin: 24px auto; }
.auth-card.wide { max-width: 640px; }
.hero {
  border-radius: 16px; padding: 56px 40px; color: #fff; margin-bottom: 32px;
  background: radial-gradient(1200px 400px at 90% -10%, rgba(96,165,250,.45), transparent 60%),
              linear-gradient(135deg, #0b1b33 0%, #12315f 60%, #1d4ed8 130%);
}
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: .3em; }
.hero .lead { font-size: 1.1rem; max-width: 620px; color: #dbeafe; }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; color: #93c5fd; font-weight: 700; margin: 0 0 8px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.hero .btn:not(.primary) { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.hero .btn.primary { background: #fff; color: #0b1b33; border-color: #fff; }
.fleet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.fleet-card { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.fleet-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; background: var(--panel-2); }
.fleet-card figcaption { padding: 10px 12px; }
.install-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.install-head h1 { margin: 0; }
ol.steps li { margin-bottom: 6px; }

/* ---------------- modal / popover / toast */
.modal-back { position: fixed; inset: 0; background: rgba(2,6,23,.5); z-index: 100; display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal {
  background: var(--panel); color: var(--ink); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px;
  max-height: calc(100vh - 32px); overflow-y: auto; border: 1px solid var(--line);
}
.modal.lg { max-width: 720px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px 0; }
.modal-head h2 { flex: 1; margin: 0; }
.modal-body { padding: 14px 20px; }
.modal-foot { padding: 12px 20px 18px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--line); }
.popover {
  position: fixed; z-index: 90; width: 320px; max-width: calc(100vw - 20px); background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 14px 16px;
}
.popover .pop-type { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 4px; }
.popover .pop-type .swatch { width: 12px; height: 12px; }
.popover h3 { margin: 0 0 6px; font-size: 1.02rem; }
.popover dl.kv { font-size: .88rem; margin-bottom: 10px; }
.popover .notes { font-size: .86rem; background: var(--panel-2); border-radius: 8px; padding: 6px 9px; white-space: pre-wrap; margin-bottom: 10px; }
.toast-wrap { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 500; }
.toast.error { background: #b91c1c; }
.toast.warn { background: #92400e; }
.toast.ok { background: #166534; }
.ac-modal .ac-photo { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; background: var(--panel-2); display: block; margin-bottom: 12px; }
.ac-modal .ac-grounded { background: var(--bad-soft); color: var(--bad); font-weight: 700; padding: 8px 12px; border-radius: 8px; margin-bottom: 10px; }
.ac-modal ul { padding-left: 18px; margin: 4px 0 10px; }
.ac-modal .state-overdue { color: var(--bad); font-weight: 700; }
.ac-modal .state-soon { color: var(--warn); font-weight: 700; }

/* ---------------- schedule */
body.schedule main { padding: 0; max-width: none; display: flex; flex-direction: column; height: calc(100vh - 58px); }
body.schedule .app-foot { display: none; }
.sch-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
.sch-bar .date-label { font-weight: 700; font-size: 1.02rem; min-width: 170px; }
.sch-bar input[type=date] { width: auto; padding: 6px 8px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--panel); color: var(--ink-2); padding: 6px 11px; font: inherit; font-weight: 600; cursor: pointer; border-right: 1px solid var(--line-2); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.sch-bar select { width: auto; padding: 6px 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 6px 16px; font-size: .78rem; color: var(--muted); background: var(--panel); border-bottom: 1px solid var(--line); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.sch-host { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.sch-loading { position: absolute; top: 10px; right: 16px; font-size: .8rem; color: var(--muted); z-index: 20; }

/* horizontal timeline */
.tl { display: flex; flex-direction: column; height: 100%; --label-w: 150px; }
.tl-scroll { overflow: auto; position: relative; }
.tl-head { display: flex; position: sticky; top: 0; z-index: 12; background: var(--panel); border-bottom: 1px solid var(--line-2); }
.tl-corner { position: sticky; left: 0; z-index: 13; width: var(--label-w); flex: none; background: var(--panel); border-right: 1px solid var(--line-2); padding: 4px 10px; font-size: .72rem; color: var(--muted); display: flex; align-items: flex-end; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.tl-times { position: relative; height: 44px; flex: none; }
.tl-day { position: absolute; top: 0; height: 20px; font-size: .75rem; font-weight: 700; padding: 2px 6px; border-left: 2px solid var(--line-2); color: var(--ink-2); white-space: nowrap; overflow: hidden; }
.tl-day.today { color: var(--accent); }
.tl-hour { position: absolute; bottom: 0; height: 22px; font-size: .72rem; color: var(--muted); padding-left: 4px; border-left: 1px solid var(--grid-hour); white-space: nowrap; }
.tl-section { display: flex; flex-direction: column; min-height: 0; }
.tl-section-title { position: sticky; left: 0; z-index: 11; display: flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--panel-2); border-bottom: 1px solid var(--line); width: 100%; }
.tl-row, .tl-head { width: max-content; min-width: 100%; }
.tl-row { display: flex; border-bottom: 1px solid var(--line); min-height: 46px; }
.tl-label {
  position: sticky; left: 0; z-index: 10; width: var(--label-w); flex: none; background: var(--panel); border-right: 1px solid var(--line-2);
  padding: 5px 10px; display: flex; flex-direction: column; justify-content: center; line-height: 1.2; overflow: hidden;
}
.tl-label button.tail { all: unset; cursor: pointer; font-weight: 800; color: var(--accent); font-size: .95rem; letter-spacing: .02em; display: inline-flex; align-items: center; gap: 5px; }
.tl-label button.tail:hover { text-decoration: underline; }
.tl-label button.tail:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.tl-label small { color: var(--muted); font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-label .gnd { display: inline-block; font-size: .64rem; font-weight: 800; background: #b91c1c; color: #fff; border-radius: 4px; padding: 0 4px; letter-spacing: .04em; }
.tl-label .instr-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.tl-label strong { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-lane { position: relative; flex: none; cursor: cell; touch-action: pan-x pan-y; }
.tl-lane.ro { cursor: default; }
.lane-bg { position: absolute; inset: 0; pointer-events: none; }
.lane-bg i { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--grid); }
.lane-bg i.h { border-left-color: var(--grid-hour); }
.lane-bg i.d { border-left: 2px solid var(--line-2); }
.lane-bg b { position: absolute; top: 0; bottom: 0; background: var(--night); }
.lane-bg b.tw { background: var(--twilight); }
.now-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--now); z-index: 5; pointer-events: none; }
.tl-split { height: 8px; flex: none; background: var(--panel-2); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); cursor: row-resize; display: grid; place-items: center; touch-action: none; }
.tl-split::after { content: ""; width: 40px; height: 3px; border-radius: 3px; background: var(--line-2); }
.tl-split:hover::after, .tl-split:focus-visible::after { background: var(--accent); }

.blk {
  position: absolute; top: 4px; bottom: 4px; border-radius: 6px; padding: 3px 7px; font-size: .76rem; line-height: 1.2;
  overflow: hidden; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.2); z-index: 3; user-select: none; -webkit-user-select: none;
  border: 1px solid rgba(0,0,0,.12); display: flex; flex-direction: column; justify-content: center; min-width: 6px;
}
.blk b { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk:hover { filter: brightness(1.06); z-index: 4; }
.blk:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; z-index: 6; }
.blk.st-cancelled { opacity: .55; background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(255,255,255,.35) 6px 12px) !important; text-decoration: line-through; }
.blk.st-noshow { background-image: repeating-linear-gradient(45deg, transparent 0 6px, rgba(0,0,0,.12) 6px 12px); }
.blk.maint { background-image: repeating-linear-gradient(135deg, transparent 0 8px, rgba(255,255,255,.18) 8px 16px); }
.blk.dragging { opacity: .85; z-index: 50; box-shadow: var(--shadow-lg); }
.blk.bad-drop { outline: 3px solid var(--bad); }
.blk .grip { position: absolute; top: 0; bottom: 0; right: 0; width: 8px; cursor: ew-resize; }
.blk.mine { box-shadow: 0 0 0 2px rgba(255,255,255,.9) inset, 0 1px 2px rgba(0,0,0,.25); }
.sel-box { position: absolute; top: 3px; bottom: 3px; background: color-mix(in srgb, var(--accent) 22%, transparent); border: 2px dashed var(--accent); border-radius: 6px; z-index: 2; pointer-events: none; font-size: .72rem; font-weight: 700; color: var(--accent); padding: 2px 5px; white-space: nowrap; }

/* vertical day view */
.vt { height: 100%; overflow: auto; position: relative; }
.vt-grid { display: grid; position: relative; min-width: 100%; }
.vt-head { position: sticky; top: 0; z-index: 12; background: var(--panel); border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 6px 4px; text-align: center; line-height: 1.2; border-left: 1px solid var(--line); min-height: 50px; }
.vt-head small { color: var(--muted); font-size: .72rem; }
.vt-corner { position: sticky; top: 0; left: 0; z-index: 14; background: var(--panel); border-bottom: 1px solid var(--line-2); }
.vt-times { position: sticky; left: 0; z-index: 11; background: var(--panel); border-right: 1px solid var(--line-2); }
.vt-times div { position: absolute; left: 0; right: 0; font-size: .72rem; color: var(--muted); padding: 0 6px; transform: translateY(-.6em); text-align: right; }
.vt-col { position: relative; border-left: 1px solid var(--line); cursor: cell; }
.vt-col .lane-bg i { left: 0; right: 0; top: auto; bottom: auto; border-left: 0; border-top: 1px solid var(--grid); height: 0; }
.vt-col .lane-bg i.h { border-top-color: var(--grid-hour); }
.vt-col .lane-bg b { left: 0; right: 0; top: auto; bottom: auto; }
.vt-col .now-line { left: 0; right: 0; top: auto; bottom: auto; width: auto; height: 2px; }
.vt-col .blk { top: auto; bottom: auto; left: 3px; right: 3px; justify-content: flex-start; padding-top: 4px; }
.vt-col .blk .grip { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 8px; cursor: ns-resize; }
.vt-col .sel-box { top: auto; bottom: auto; left: 3px; right: 3px; }

/* month view */
.mv { height: 100%; overflow: auto; padding: 12px 16px 20px; }
.mv-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--line); border-top: 1px solid var(--line); background: var(--panel); border-radius: 8px; overflow: hidden; }
.mv-dow { padding: 6px 8px; font-size: .72rem; font-weight: 800; text-transform: uppercase; color: var(--muted); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel-2); }
.mv-day { min-height: 118px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px 5px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mv-day.other { background: var(--panel-2); }
.mv-day.other .mv-num { color: var(--muted); }
.mv-num { all: unset; cursor: pointer; font-weight: 700; font-size: .82rem; padding: 1px 6px; border-radius: 99px; align-self: flex-start; }
.mv-num:hover { background: var(--accent-soft); }
.mv-day.today .mv-num { background: var(--accent); color: var(--accent-ink); }
.mv-chip { all: unset; cursor: pointer; display: block; font-size: .72rem; padding: 1px 5px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-more { font-size: .72rem; color: var(--muted); padding-left: 5px; }
@media (max-width: 700px) { .mv-day { min-height: 70px; } .mv-chip { font-size: .64rem; } }

/* list view */
.lv { height: 100%; overflow: auto; padding: 12px 16px 20px; }
.lv h3 { margin: 16px 0 6px; font-size: .9rem; color: var(--ink-2); position: sticky; top: -12px; background: var(--bg); padding: 6px 0; z-index: 2; }
.lv-item { display: grid; grid-template-columns: 6px 110px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 8px 0; margin-bottom: 6px; cursor: pointer; overflow: hidden; }
.lv-item:hover { border-color: var(--line-2); }
.lv-item .bar { align-self: stretch; }
.lv-item .when { font-weight: 700; font-variant-numeric: tabular-nums; }
.lv-item .what { min-width: 0; }
.lv-item .what b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-item .what small { color: var(--muted); }
@media (max-width: 600px) { .lv-item { grid-template-columns: 6px minmax(0,1fr) auto; } .lv-item .when { grid-column: 2; } .lv-item .what { grid-column: 2; } .lv-item .pill { grid-row: 1; grid-column: 3; } }

/* flight line */
.fl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.fl-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.fl-card .fl-top { display: flex; gap: 12px; padding: 12px; align-items: center; border-bottom: 1px solid var(--line); }
.fl-card img { width: 86px; height: 56px; object-fit: cover; border-radius: 6px; background: var(--panel-2); }
.fl-card .fl-status { font-weight: 800; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
.fl-card .fl-body { padding: 10px 12px; flex: 1; font-size: .9rem; }
.fl-card.out { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); }
.fl-card.overdue { border-color: var(--bad); box-shadow: 0 0 0 2px color-mix(in srgb, var(--bad) 30%, transparent); }
.fl-card.grounded { border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); }
.fl-status.out { color: var(--ok); } .fl-status.overdue, .fl-status.grounded { color: var(--bad); } .fl-status.avail { color: var(--muted); }

/* aircraft pages */
.ac-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; }
.ac-hero img { width: 100%; border-radius: 10px; aspect-ratio: 16/10; object-fit: cover; background: var(--panel-2); }
@media (max-width: 800px) { .ac-hero { grid-template-columns: minmax(0, 1fr); } }
.ac-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.ac-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--panel-2); display: block; }
.ac-card .body { padding: 12px 14px; flex: 1; }
.ac-card h3 { margin: 0; font-size: 1.1rem; }
.ac-card:hover { border-color: var(--line-2); }
.state-overdue { color: var(--bad); font-weight: 700; }
.state-soon, .state-unknown { color: var(--warn); font-weight: 700; }
.state-ok { color: var(--ok); }

/* types editor */
.type-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.preview-blk { display: inline-flex; flex-direction: column; border-radius: 6px; padding: 3px 9px; font-size: .76rem; min-width: 120px; line-height: 1.25; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.color-pair { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* receipt / print */
.receipt { max-width: 720px; }
@media print {
  .sidebar, .topbar, .app-foot, .no-print, .flash { display: none !important; }
  body.app { display: block; background: #fff; }
  main { padding: 0; }
  .card { box-shadow: none; border: 0; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.preview-blk span { font-weight: 400; }
.vt-col .blk b, .vt-col .blk span { white-space: normal; }
@media (max-width: 700px) {
  .sch-bar { padding: 8px 10px; gap: 6px; }
  .sch-bar .date-label { display: none; }
  .sch-bar #schZoomIn, .sch-bar #schZoomOut { display: none; }
  .sch-bar .spacer { display: none; }
  .seg button { padding: 5px 9px; }
  .sch-bar select { max-width: 150px; }
  .legend { display: none; }
}
