/* MTP · Maintenance Tracking — "Flight Deck" theme. Plain CSS, no build step.
   Idea: Hillsboro Aero Academy's own brand (HAA blue #3058a1 / navy #1b3668 from flyhaa.com) set like a glass cockpit.
   Type is the device's system font (Segoe UI on Windows, San Francisco on Mac/iPad), with even-width digits for numbers.
   Cool white and steel only, no warm paper tones. Status uses the EFIS/ECAM convention: green ok, amber caution,
   red warning, boxed like an ECAM message. One accent only (HAA blue); status colours carry meaning, never decoration.
   KPIs are display units: black screens with a chamfered bezel corner. Navigation and buttons are type-only (no icon set).
   Checked against the anti-slop rubric in rohitg00/awesome-claude-design (prompts/break-default-aesthetic.md):
   no teal, no glowing status dots, coloured left rules only for row severity, one accent, no default icon stack.
   Light theme below; dark theme ("night cockpit") overrides the same tokens under [data-theme="dark"]. */
:root {
  color-scheme: light;
  --navy-950: #0a1220; --navy-900: #0f1f3d; --navy-800: #1b3668; --navy-700: #264a8a;
  --slate-600: #46536b; --slate-500: #67738a; --slate-400: #95a0b3; --slate-300: #c3cbd8;
  --slate-200: #d9dfe8; --slate-100: #e9edf3; --slate-50: #f4f6f9;
  --bg: #e6eaf0; --surface: #ffffff; --ink: #0a1220; --muted: #56627a; --line: #dde3eb; --line-strong: #b8c3d3;
  --accent: #3058a1; --accent-strong: #1b3668; --accent-soft: #e5ecf8;
  --panel: #0a1322; --panel-2: #12203a; --panel-ink: #e8f0ff; --panel-muted: #8ea3c7; --panel-line: #1f3150;
  --topbar-bg: #3058a1; --topbar-line: #1b3668;
  --nav-bg: #ffffff; --nav-ink: #3a4760; --nav-on-bg: #3058a1; --nav-on-ink: #ffffff; --nav-hover: #eef2f8;
  --thead-bg: #f2f5f9;
  --btn-primary: #3058a1; --btn-primary-hover: #1b3668; --link-strong: #1b3668;
  --row-hover: #f3f7fd; --seg-hover: rgba(48, 88, 161, .08); --input-bg: #ffffff;

  /* Semantic status colours (ECAM: red warning, amber caution, green normal) */
  --over: #d0021b;  --over-bg: #fdecee; --over-ink: #a3001a; --over-line: #f5c3c9;
  --soon: #d98200;  --soon-bg: #fff4dc; --soon-ink: #8a5100; --soon-line: #f1d39a;
  --ok: #128a43;    --ok-bg: #e7f5ec;   --ok-ink: #0d6b34; --ok-line: #bfe3cc;
  --none: #8792a6;  --none-bg: #eef1f5; --none-ink: #56627a;
  --info-bg: #e5ecf8; --info-ink: #1b3668; --info-line: #c4d3ee;
  --tag-over: #d0021b; --tag-soon: #ffb020; --tag-soon-ink: #2a1a00;
  /* EFIS colours on the black display units */
  --lamp-over: #ff5a5a; --lamp-soon: #ffb020; --lamp-ok: #3ddc84; --lamp-neutral: #ffffff;

  /* Spacing scale (4 px base) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px;
  --radius: 2px; --radius-sm: 2px;
  --shadow: 0 1px 2px rgba(10, 18, 32, .06);
  --bezel: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --topbar-h: 56px; --sidebar-w: 236px;
}

/* ---------- Dark theme: night cockpit (same tokens; status colours stay distinct) ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --slate-600: #b4bfd1; --slate-500: #8b97ac; --slate-400: #6a768c; --slate-300: #36435a;
  --slate-200: #26324a; --slate-100: #172133; --slate-50: #111a29;
  --bg: #050911; --surface: #0c1320; --ink: #e6edf8; --muted: #93a1b8; --line: #1a2538; --line-strong: #2a3a55;
  --accent: #7aa2ec; --accent-strong: #a9c3f3; --accent-soft: rgba(48, 88, 161, .32);
  --panel: #02050a; --panel-2: #0a1222; --panel-ink: #e6edf8; --panel-muted: #7f90ad; --panel-line: #1a2740;
  --topbar-bg: #0f1f3d; --topbar-line: #3058a1;
  --nav-bg: #08101c; --nav-ink: #aab6ca; --nav-on-bg: #3058a1; --nav-on-ink: #ffffff; --nav-hover: #111b2c;
  --thead-bg: #101a2a;
  --btn-primary: #3058a1; --btn-primary-hover: #3d6cc2; --link-strong: #a9c3f3;
  --row-hover: #101a2a; --seg-hover: rgba(255, 255, 255, .06); --input-bg: #08101c;
  --shadow: 0 1px 0 rgba(0, 0, 0, .4);

  --over: #ff5a5a;  --over-bg: rgba(255, 90, 90, .14);  --over-ink: #ffb0b0; --over-line: rgba(255, 90, 90, .4);
  --soon: #ffb020;  --soon-bg: rgba(255, 176, 32, .14); --soon-ink: #ffd27a; --soon-line: rgba(255, 176, 32, .4);
  --ok: #3ddc84;    --ok-bg: rgba(61, 220, 132, .12);   --ok-ink: #8ef0b8; --ok-line: rgba(61, 220, 132, .38);
  --none: #7d8aa1;  --none-bg: #141e30; --none-ink: #aab6ca;
  --info-bg: rgba(122, 162, 236, .14); --info-ink: #a9c3f3; --info-line: rgba(122, 162, 236, .35);
  --tag-over: #e0142b; --tag-soon: #ffb020;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); font: 14px/1.55 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 1px; }
.num, .tnum, td.num, th.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Type-only navigation and buttons: icons stay only where they do a job (search, theme, sign out) */
.nav svg.i, .btn svg.i { display: none; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- App shell ---------- */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: var(--s4);
  padding: 0 var(--s5); background: var(--topbar-bg); color: #fff; border-bottom: 3px solid var(--topbar-line); }
.brand { display: flex; align-items: center; gap: var(--s3); color: #fff; min-width: 0; }
.brand:hover { color: #fff; text-decoration: none; }
.brand-mark { width: 44px; height: 30px; background: #fff; color: #3058a1; clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
  display: grid; place-items: center; font: 700 14px/1 var(--mono); letter-spacing: .04em; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font: 700 15px/1.15 var(--display); letter-spacing: .02em; white-space: nowrap; }
.brand-text strong span { color: rgba(255, 255, 255, .7); font-weight: 400; }
.brand-text small { color: rgba(255, 255, 255, .7); font-size: 11.5px; white-space: nowrap; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: var(--s4); }
.demo-badge { font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: #fff; border: 1px solid rgba(255,255,255,.55);
  padding: 2px 8px; white-space: nowrap; }
.user { display: flex; align-items: center; gap: var(--s2); color: #fff; border-radius: var(--radius-sm); padding: 2px 6px 2px 2px; }
.user:hover { color: #fff; text-decoration: none; background: rgba(255,255,255,.1); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--navy-800); color: #fff; display: grid; place-items: center;
  font: 700 11.5px var(--mono); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.35); }
.user-text { display: flex; flex-direction: column; line-height: 1.2; white-space: nowrap; }
.user-text strong { font-size: 13px; font-weight: 700; }
.user-text small { font-size: 11px; color: rgba(255, 255, 255, .7); }
.signout { margin: 0; }
.btn-ghost-dark { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.4); border-radius: var(--radius-sm);
  font: 700 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; padding: 7px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn-ghost-dark:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn-ghost-dark.icon-only { padding: 6px; }

/* Theme toggle: shows a moon in light mode and a sun in dark mode */
.theme-toggle { cursor: pointer; display: inline-grid; place-items: center; }
.theme-toggle .when-dark, :root[data-theme="dark"] .theme-toggle .when-light { display: none; }
:root[data-theme="dark"] .theme-toggle .when-dark { display: inline-flex; }
.theme-toggle span { display: inline-flex; }
.theme-toggle.floating { position: absolute; top: var(--s4); right: var(--s4); width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface); color: var(--slate-600); border: 1px solid var(--line-strong); box-shadow: var(--shadow); }
.theme-toggle.floating:hover { color: var(--ink); border-color: var(--accent); }

.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: calc(100vh - var(--topbar-h)); }
.sidebar { background: var(--nav-bg); border-right: 1px solid var(--line-strong); padding: var(--s4) var(--s3); position: sticky;
  top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto; display: flex; flex-direction: column; }
.nav-label { font: 700 10.5px var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--slate-500);
  padding: var(--s3) var(--s3) var(--s2); display: flex; align-items: center; gap: var(--s2); }
.nav-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a, .nav span { display: flex; align-items: center; gap: var(--s3); padding: 7px var(--s3); border-radius: var(--radius-sm);
  color: var(--nav-ink); font-size: 13.5px; white-space: nowrap; position: relative; }
.nav a:hover { background: var(--nav-hover); color: var(--ink); text-decoration: none; }
.nav a.on { background: var(--nav-on-bg); color: var(--nav-on-ink); font-weight: 700; }
.nav .soon { color: var(--slate-400); cursor: not-allowed; }
.nav .soon em { margin-left: auto; font-style: normal; font: 700 9.5px var(--mono); letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid var(--line-strong); color: var(--slate-500); padding: 0 5px; }
.sidebar-foot { margin-top: auto; padding: var(--s4) var(--s3) 0; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line); }

.main { min-width: 0; display: flex; flex-direction: column; }
.content { padding: var(--s6) var(--s8) var(--s8); width: 100%; max-width: 1480px; flex: 1; }
.app-footer { padding: var(--s4) var(--s8); border-top: 1px solid var(--line-strong); color: var(--muted); font-size: 11.5px;
  display: flex; flex-wrap: wrap; gap: var(--s2) var(--s6); justify-content: space-between; background: var(--surface); }

/* ---------- Page header ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font: 11.5px var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: var(--s2); }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--accent); }
.crumbs .sep { color: var(--slate-300); }
.page-head { position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s3) var(--s6); margin-bottom: var(--s5);
  padding-bottom: var(--s4); border-bottom: 1px solid var(--line-strong); }
.page-head::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 88px; height: 3px; background: var(--accent); }
.page-head h1 { margin: 0; font: 700 28px/1.15 var(--display); letter-spacing: -.01em; color: var(--ink); }
.page-head h1 .sub { color: var(--muted); font: 400 17px var(--display); letter-spacing: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s2) var(--s4); margin: var(--s8) 0 var(--s3);
  padding-bottom: 6px; border-bottom: 1px solid var(--line-strong); }
.section-head h2 { margin: 0; font: 700 13px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--accent-strong); display: flex; align-items: center; gap: 10px; }
.section-head .count { color: var(--muted); font-weight: 400; }
.note { font-size: 12px; color: var(--muted); margin: var(--s2) 0 0; max-width: 980px; }

/* ---------- Controls ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; margin-bottom: var(--s5); }
.toolbar .spacer { flex: 1; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 2px; gap: 2px; max-width: 100%; overflow-x: auto; }
.seg a { padding: 5px 12px; border-radius: 1px; color: var(--slate-600); font: 700 11.5px var(--mono); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.seg a:hover { color: var(--ink); text-decoration: none; background: var(--seg-hover); }
.seg a.on { background: var(--accent); color: #fff; }
.search { display: flex; align-items: center; gap: var(--s2); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 0 var(--s2) 0 var(--s3); height: 36px; min-width: 220px; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search svg { color: var(--slate-500); width: 16px; height: 16px; }
.search input { border: 0; outline: 0; font: 13px var(--mono); background: transparent; flex: 1; min-width: 0; color: var(--ink); text-transform: uppercase; }
.search input::placeholder { text-transform: none; font-family: var(--font); color: var(--slate-400); }
.search a { font-size: 12px; color: var(--muted); }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--slate-600); padding: 6px 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); }
.toggle:hover { text-decoration: none; color: var(--ink); border-color: var(--line-strong); }
.toggle .box { width: 14px; height: 14px; border: 1.5px solid var(--slate-400); border-radius: 2px; display: grid; place-items: center; font-size: 10px; line-height: 1; }
.toggle.on .box { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); height: 38px; padding: 0 var(--s4); border-radius: var(--radius-sm);
  font: 700 12.5px var(--mono); text-transform: uppercase; letter-spacing: .06em; border: 1px solid transparent; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--btn-primary); color: #fff; }
.btn-primary:hover { background: var(--btn-primary-hover); color: #fff; text-decoration: none; }
.btn-outline { background: var(--surface); color: var(--accent-strong); border-color: var(--line-strong); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); text-decoration: none; }
.btn-sm { height: 30px; padding: 0 var(--s3); font-size: 11.5px; }
.btn-danger-outline { background: var(--surface); color: var(--over-ink); border-color: var(--over-line); }
.btn-danger-outline:hover { background: var(--over-bg); }
.btn[disabled], .btn.disabled { opacity: .55; cursor: not-allowed; }

/* ---------- KPI display units ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--s3); }
.kpi { position: relative; background: var(--panel); color: var(--panel-ink);
  padding: var(--s3) var(--s4) var(--s3); overflow: hidden; box-shadow: inset 0 0 0 1px var(--panel-line); }
.kpi::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--panel-muted); }
.kpi.overdue::before { background: var(--lamp-over); } .kpi.soon::before { background: var(--lamp-soon); }
.kpi.ok::before { background: var(--lamp-ok); } .kpi.accent::before { background: var(--lamp-neutral); }
.kpi .l { font: 700 10.5px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--panel-muted); margin-top: 4px; }
.kpi .n { font: 700 28px/1.2 var(--font); font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin-top: 2px; color: var(--lamp-neutral); }
.kpi .n small { font: 400 12px var(--mono); color: var(--panel-muted); letter-spacing: 0; }
.kpi .h { font-size: 11.5px; color: var(--panel-muted); margin-top: 2px; }
.kpi .h a, .kpi a { color: #fff; text-decoration: underline; text-decoration-color: var(--panel-muted); text-underline-offset: 3px; }
.kpi.overdue .n { color: var(--lamp-over); } .kpi.soon .n { color: var(--lamp-soon); } .kpi.ok .n { color: var(--lamp-ok); }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-body { padding: var(--s4); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s4) var(--s6); }
.facts dt { font: 700 10.5px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--slate-500); }
.facts dd { margin: 3px 0 0; font-weight: 400; }
.status-line { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); background: var(--slate-50); }

/* ---------- Tables ---------- */
.table-wrap { overflow: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); -webkit-overflow-scrolling: touch; }
.table-wrap.tall { max-height: min(72vh, 900px); }
table.data { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; }
table.data th, table.data td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data thead th { position: sticky; top: 0; z-index: 2; background: var(--thead-bg); color: var(--accent-strong); font: 700 10.5px var(--mono);
  text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; border-bottom: 2px solid var(--accent); }
table.data tbody tr:hover td { background: var(--row-hover); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; }
table.data td.num { font-family: var(--font); font-size: 13px; font-variant-numeric: tabular-nums; }
table.data td.nowrap { white-space: nowrap; }
table.data tr.total td { background: var(--slate-50); font-weight: 700; border-top: 1px solid var(--line-strong); }
table.data .tail-link { font-family: var(--mono); font-weight: 700; font-size: 13px; color: var(--link-strong); letter-spacing: .01em; }
table.data .tail-link:hover { color: var(--accent); }
/* Severity stripe on the first cell */
tr.sev-overdue > td:first-child { box-shadow: inset 4px 0 var(--over); }
tr.sev-soon > td:first-child { box-shadow: inset 4px 0 var(--soon); }
tr.sev-ok > td:first-child { box-shadow: inset 4px 0 var(--ok); }
tr.sev-none > td:first-child { box-shadow: inset 3px 0 var(--slate-300); }
tr.inactive td { color: var(--slate-500); font-style: italic; }
.indent-1 { padding-left: 32px !important; } .indent-2 { padding-left: 56px !important; }
.tree { color: var(--slate-400); margin-right: 4px; }
.item-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.empty { text-align: center; padding: var(--s10) var(--s4) !important; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-weight: 700; margin-bottom: 4px; }
.empty svg { width: 28px; height: 28px; color: var(--slate-400); margin-bottom: 6px; }

/* Hours freshness strip: when the tach / Hobbs were last pulled, and Sync now. */
.sync-strip { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin: 0 0 var(--s4); padding: var(--s2) var(--s3);
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: 13px; }
.sync-strip .l { font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.sync-strip form { margin-left: auto; }

/* ---------- Status: boxed like ECAM messages ---------- */
.pill { display: inline-flex; align-items: center; padding: 0 7px; font: 700 11px/1.75 var(--mono);
  text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; border: 1.5px solid transparent; }
.pill.overdue { background: var(--tag-over); border-color: var(--tag-over); color: #fff; }
.pill.soon { background: var(--soon-bg); border-color: var(--soon); color: var(--soon-ink); }
.pill.ok { color: var(--ok-ink); border-color: var(--ok-line); } .pill.none { color: var(--none-ink); border-color: var(--line-strong); }
.v.overdue { color: var(--over-ink); font-weight: 700; } .v.soon { color: var(--soon-ink); font-weight: 700; }
.st { display: inline-block; padding: 0 7px; font: 700 11px/1.75 var(--mono); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; border: 1.5px solid transparent; }
.st-available { color: var(--ok-ink); border-color: var(--ok); }
.st-checkflight { color: var(--info-ink); border-color: var(--accent); background: var(--info-bg); }
.st-unavailable { background: var(--tag-over); color: #fff; border-color: var(--tag-over); }
.st-parts { background: var(--soon-bg); color: var(--soon-ink); border-color: var(--soon); }
.st-offrecords, .st-none { color: var(--none-ink); border-color: var(--line-strong); }
.flag { display: inline-block; font: 700 10px/1.6 var(--mono); padding: 0 5px; border: 1px solid var(--line-strong); color: var(--slate-600); margin-right: 3px; background: var(--slate-50); }
.flag.cii { border-color: var(--tag-over); color: var(--tag-over); background: transparent; }   /* Critical Inspection Item (RSM 10.7) */
.base-code { font-family: var(--mono); font-size: 12.5px; font-weight: 700; }

/* ---------- Status board ---------- */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--s3); }
.col { background: var(--slate-50); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s2); min-height: 64px; }
.col h3 { margin: 2px 2px var(--s2); font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent-strong); display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.col h3 .c { font-family: var(--mono); color: var(--muted); font-weight: 400; }
.col .none { font-size: 12px; color: var(--slate-400); padding: 4px 6px; }
.tail { display: block; padding: 7px 9px; margin-top: 6px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); }
.tail:hover { border-color: var(--accent); text-decoration: none; color: var(--ink); }
.tail strong { font-family: var(--mono); font-size: 13px; font-weight: 700; }
.tail .m { color: var(--muted); font-size: 12px; margin-left: 4px; }
.tail .r { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.base-block { margin-top: var(--s6); }
.base-block h2 { font: 700 18px var(--display); margin: 0 0 var(--s3); display: flex; gap: var(--s2); align-items: baseline; }

/* ---------- Alerts ---------- */
.alert { border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; margin-bottom: var(--s4); }
.alert-ok { background: var(--ok-bg); color: var(--ok-ink); border: 1px solid var(--ok-line); }
.alert-error { background: var(--over-bg); color: var(--over-ink); border: 1px solid var(--over-line); }

/* ---------- Fleet status ---------- */
.base-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s3); }
.base-card { padding: var(--s4); }
.base-card header { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); }
.base-card h3 { margin: 0; font: 700 16px var(--display); }
.meter { height: 8px; background: var(--slate-100); border-radius: 0; overflow: hidden; margin: var(--s3) 0; box-shadow: inset 0 0 0 1px var(--line-strong);
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), var(--line-strong) calc(10% - 1px) 10%); }
.meter span { display: block; height: 100%; background: var(--ok); border-radius: 0; }
table.mini { width: 100%; border-collapse: collapse; font-size: 13px; }
table.mini td { padding: 3px 0; color: var(--muted); }
table.mini td.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
table.mini tr.total td { border-top: 1px solid var(--line); padding-top: 6px; color: var(--ink); font-weight: 700; }
.display-mode .display-content { max-width: none; padding: var(--s5) var(--s6); }
.display-mode .kpi .n { font-size: 34px; }
.display-mode table.data { font-size: 16px; }
.display-mode .clock { color: #fff; font: 14px var(--mono); }
.display-mode .topbar a.btn-ghost-dark:hover { text-decoration: none; }

/* ---------- Tracked items & sign-off ---------- */
.form-panel.wide { max-width: 1040px; }
.form-grid.three { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.field select, .field textarea { width: 100%; padding: 8px var(--s3); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font: 14px var(--font); color: var(--ink); background: var(--input-bg); }
.field select { height: 42px; }
.field textarea { resize: vertical; min-height: 64px; }
.field select:focus, .field textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input[type=number], .field input[type=date] { width: 100%; height: 36px; padding: 0 var(--s2); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); font: 14px var(--mono); color: var(--ink); background: var(--input-bg); }
.field input[type=number]:focus, .field input[type=date]:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
fieldset.field input[type=text] { margin-top: var(--s2); width: 100%; height: 38px; padding: 0 var(--s3); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); font: 14px var(--font); color: var(--ink); background: var(--input-bg); }
table.form-table td { vertical-align: top; }
table.form-table input { min-width: 110px; }
table.wb-lines input, table.wb-lines select { width: 100%; min-width: 72px; height: 32px; padding: 0 var(--s2); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); font: 13px var(--font); color: var(--ink); background: var(--input-bg); }
table.wb-lines input:focus, table.wb-lines select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input:disabled { opacity: .7; }
table.form-table tr.row-error td { background: var(--over-bg); }
table.form-table .error { white-space: normal; max-width: 260px; }
.flag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s2); }
.check-card { display: flex; gap: var(--s2); align-items: flex-start; padding: var(--s2) var(--s3); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--input-bg); cursor: pointer; }
.check-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.check-card input { margin-top: 3px; accent-color: var(--accent); }
.check-card strong { display: block; font-size: 13px; font-weight: 700; }
.check-card small { display: block; color: var(--muted); font-size: 11.5px; }
.selection-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s2); }
th.pick, td.pick { width: 34px; text-align: center; padding-left: 8px !important; padding-right: 0 !important; }
td.pick input { width: 17px; height: 17px; accent-color: var(--accent); margin-top: 2px; }
a.item-link { color: var(--ink); }
a.item-link:hover { color: var(--accent); }
.plain-list { margin: 0; padding-left: var(--s5); line-height: 1.9; }
.void-form { display: inline-flex; gap: var(--s2); align-items: center; margin: 0; }
.void-form input { height: 30px; padding: 0 var(--s2); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: 13px var(--font); width: 160px; background: var(--input-bg); color: var(--ink); }
.certify { margin: var(--s3) 0 var(--s4); padding: var(--s3) var(--s4); border: 1px solid var(--accent); border-radius: var(--radius-sm); background: var(--accent-soft); }
.certify .check { margin: 0; align-items: flex-start; }
.certify.has-error { border-color: var(--over); }
.check .error, .certify .error { margin-top: 4px; }

/* ---------- Work orders ---------- */
.alert-info { background: var(--info-bg); color: var(--info-ink); border: 1px solid var(--info-line); }
.alert-info a { color: var(--info-ink); text-decoration: underline; }
.tasks { display: grid; gap: var(--s3); }
.task-card { background: var(--surface); border: 1px solid var(--line-strong); border-top: 3px solid var(--soon); border-radius: var(--radius-sm); padding: var(--s3) var(--s4); box-shadow: var(--shadow); }
.task-card.done { border-top-color: var(--ok); }
.task-card.not_done { border-top-color: var(--slate-300); }
.task-card header { display: flex; justify-content: space-between; gap: var(--s3); align-items: flex-start; flex-wrap: wrap; }
.task-card header > div:last-child { display: flex; gap: 6px; flex-wrap: wrap; }
.task-kind { font: 700 10.5px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-right: 6px; }
.task-line { margin: var(--s2) 0 0; font-size: 13px; }
.task-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s3); align-items: center; }
.task-actions form { margin: 0; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.inline-form input[type=text], .inline-form input[type=password], .wide-input { height: 30px; padding: 0 var(--s2); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font: 13px var(--font); width: 230px; background: var(--input-bg); color: var(--ink); }
.wide-input { width: 100%; max-width: 520px; margin: var(--s3) var(--s2) var(--s3) 0; }
.add-tasks { margin-top: var(--s4); }
.add-tasks summary { cursor: pointer; padding: var(--s3) var(--s4); font: 700 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent-strong); }
fieldset.field > input[type=text] + input[type=text] { margin-top: 6px; }

/* ---------- Status change ---------- */
.status-change { margin-top: var(--s3); }
.status-change summary { cursor: pointer; padding: var(--s3) var(--s4); font: 700 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent-strong); }
.status-forms { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: var(--s6); border-top: 1px solid var(--line); }
.base-form { border-left: 1px solid var(--line); padding-left: var(--s6); }
.rts-late { color: var(--over-ink); font-weight: 700; }
@media (max-width: 900px) { .status-forms { grid-template-columns: 1fr; } .base-form { border-left: 0; padding-left: 0; } }

/* ---------- Forecast ---------- */
.fbar { display: inline-block; vertical-align: middle; width: 60%; max-width: 180px; height: 8px; background: var(--slate-100); border-radius: 0; overflow: hidden; margin-right: 8px; }
.fbar span { display: block; height: 100%; background: var(--ok); border-radius: 0; }
.fbar.soon span { background: var(--soon); }
.fbar.overdue span { background: var(--over); width: 100% !important; }

/* ---------- Aircraft details ---------- */
.compass-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0 var(--s3); }
.compass-card { margin-top: var(--s4); }
.compass-card summary { cursor: pointer; font-weight: 700; font-size: 13px; }
/* 12 headings don't fit a phone: the card scrolls sideways on its own instead of being cut off. */
.compass-scroll { overflow-x: auto; max-width: 100%; }
table.mini-compass { margin-top: var(--s2); font-size: 12.5px; }
table.mini-compass th, table.mini-compass td { padding: 4px 6px; }

/* ---------- Users & account ---------- */
.user-cell { display: flex; align-items: center; gap: var(--s3); }
.user-cell strong { font-weight: 700; }
.user-cell .item-meta { display: block; }
.avatar.sm { width: 30px; height: 30px; font-size: 10.5px; flex: none; background: var(--accent); }
.you { font: 700 10px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: #fff;
  background: var(--accent); padding: 1px 5px; margin-left: 6px; vertical-align: 1px; }
.role { display: inline-block; font: 700 10.5px var(--mono); text-transform: uppercase; letter-spacing: .07em; padding: 2px 8px; border: 1px solid var(--line-strong); color: var(--slate-600); white-space: nowrap; }
.role-admin { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.row-actions { display: inline-flex; flex-wrap: wrap; gap: var(--s2); justify-content: flex-end; }
.row-actions .btn { white-space: nowrap; }
/* Per-aircraft record links: one quiet strip under the page head instead of a row of buttons. */
.record-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2) var(--s4); margin: calc(-1 * var(--s2)) 0 var(--s5); font: 700 11.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.record-links span { color: var(--muted); }
.record-links a { color: var(--accent); text-decoration: none; border-bottom: 1.5px solid transparent; }
.record-links a:hover { border-bottom-color: currentColor; }
[data-theme="dark"] .record-links a { color: var(--ink); }
.row-actions form { margin: 0; }
.form-panel { padding: var(--s6); max-width: 820px; }
.form-panel.narrow { max-width: 460px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 var(--s5); }
.field .help { font-size: 12px; color: var(--muted); margin-top: 6px; }
fieldset.field { border: 0; padding: 0; margin: 0 0 var(--s4); min-width: 0; }
fieldset.field legend { font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent-strong); margin-bottom: 6px; padding: 0; }
.role-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s2); }
.role-option { display: flex; gap: var(--s2); align-items: flex-start; padding: var(--s3); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; background: var(--input-bg); }
.role-option:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.role-option input { margin-top: 3px; accent-color: var(--accent); }
.role-option strong { display: block; font-size: 13.5px; }
.role-option small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; margin-top: 2px; }
.form-actions { display: flex; gap: var(--s2); margin-top: var(--s2); }
.form-actions .btn { width: auto; }

/* ---------- Responsive: tablet & phone — sidebar becomes a top nav strip ---------- */
@media (max-width: 1024px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }   /* short pages: extra height goes to the content, not the nav strip */
  .sidebar { position: sticky; top: var(--topbar-h); z-index: 20; height: auto; flex-direction: row; align-items: center; padding: 0 var(--s4);
    border-right: 0; border-bottom: 1px solid var(--line-strong); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .sidebar::-webkit-scrollbar { display: none; }
  .nav-label, .sidebar-foot { display: none; }
  .nav { flex-direction: row; gap: 0; }
  .nav + .nav-label + .nav { margin-left: var(--s2); padding-left: var(--s2); border-left: 1px solid var(--line); }
  .nav a, .nav span { padding: 12px var(--s3); border-radius: 0; }
  .nav a.on { background: transparent; color: var(--accent-strong); box-shadow: inset 0 -3px var(--accent); }
    .nav .soon em { display: none; }
  .user-text { display: none; }
  .brand-text strong span.long { display: none; }   /* room for the Feedback button and badge */
  .content { padding: var(--s5) var(--s5) var(--s8); }
  .app-footer { padding: var(--s4) var(--s5); }
  .table-wrap.tall { max-height: 70vh; }
}
@media (max-width: 700px) {
  :root { --topbar-h: 52px; }
  .topbar { padding: 0 var(--s4); gap: var(--s2); }
  .brand-text small, .user-text, .demo-badge { display: none; }
  .brand-text strong span.long { display: none; }
  .btn-ghost-dark .label { display: none; }
  .nav .soon { display: none; }
  .content { padding: var(--s4) var(--s4) var(--s6); }
  .page-head h1 { font-size: 22px; } .page-head h1 .sub { font-size: 14px; display: block; }
  .search { min-width: 0; flex: 1 1 100%; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .n { font-size: 22px; }
  table.data th, table.data td { padding: 8px 9px; }
  .hide-sm { display: none; }
  .app-footer { padding: var(--s3) var(--s4); }
}

/* ---------- Sign-in page ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
/* Left panel: HAA ramp photo (painted runway diagram, greyscale) barely showing through a flat navy layer */
.auth-brand { position: relative; overflow: hidden; color: #fff; padding: var(--s10) clamp(28px, 5vw, 64px);
  background: linear-gradient(rgba(27, 54, 104, .88), rgba(27, 54, 104, .88)), url("../img/login-ramp.jpg") 50% 72% / cover no-repeat, #1b3668;
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--s8); }
.auth-brand .brand-text strong { font-size: 16px; }
.auth-brand h2 { font: 700 clamp(30px, 3.6vw, 46px)/1.08 var(--display); letter-spacing: -.01em; margin: 0 0 var(--s3); max-width: 15ch; position: relative; z-index: 1; }
.auth-brand p { color: rgba(255, 255, 255, .82); max-width: 44ch; margin: 0; font-size: 14.5px; position: relative; z-index: 1; }
.auth-points { list-style: none; padding: 0; margin: var(--s6) 0 0; display: grid; gap: var(--s2); color: #fff; font-size: 13px; position: relative; z-index: 1; }
.auth-points li { display: flex; gap: var(--s3); align-items: center; }
.auth-points li::before { content: ""; width: 14px; height: 2px; background: rgba(255, 255, 255, .7); flex: none; }
.auth-meta { font-size: 11.5px; color: rgba(255, 255, 255, .7); position: relative; z-index: 1; display: flex; gap: var(--s4); flex-wrap: wrap; font-family: var(--mono); }
/* Right panel: riveted skin from the HAA aircraft photo, cropped to the plain top section (the painted logo sits lower
   and would repeat the card's logo), washed with the page colour so the card stands out */
.auth-form { position: relative; display: grid; place-items: center; padding: var(--s10) var(--s6);
  background: linear-gradient(var(--auth-wash), var(--auth-wash)), url("../img/login-aircraft.jpg") 30% 0 / auto 260% no-repeat, var(--bg); }
:root { --auth-wash: rgba(230, 234, 240, .45); }
:root[data-theme="dark"] { --auth-wash: rgba(5, 9, 17, .84); }
.auth-logo { display: block; width: 100%; max-width: 260px; height: auto; margin: 0 auto var(--s6); }
[data-theme="dark"] .auth-logo { filter: brightness(0) invert(1); opacity: .92; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line-strong); border-top: 4px solid var(--accent); border-radius: var(--radius); padding: var(--s8); box-shadow: 0 12px 32px rgba(10, 18, 32, .08); }
.auth-card h1 { margin: 0; font: 700 26px/1.15 var(--display); letter-spacing: -.01em; }
.auth-card .lead { color: var(--muted); margin: 4px 0 var(--s6); }
.field { margin-bottom: var(--s4); }
.field label { display: block; font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent-strong); margin-bottom: 6px; }
.field input[type=email], .field input[type=password], .field input[type=text] { width: 100%; height: 42px; padding: 0 var(--s3); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font: 14px var(--font); color: var(--ink); background: var(--input-bg); }
.field input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field.has-error input { border-color: var(--over); }
.field .error { color: var(--over-ink); font-size: 12.5px; margin-top: 6px; }
.check { display: flex; align-items: center; gap: var(--s2); font-size: 13px; color: var(--slate-600); margin-bottom: var(--s5); }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.auth-card .btn { width: 100%; }
.divider { display: flex; align-items: center; gap: var(--s3); color: var(--slate-400); font-size: 12px; margin: var(--s5) 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.ms-logo { width: 16px; height: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.ms-logo i { display: block; } .ms-logo i:nth-child(1) { background: #f25022; } .ms-logo i:nth-child(2) { background: #7fba00; }
.ms-logo i:nth-child(3) { background: #00a4ef; } .ms-logo i:nth-child(4) { background: #ffb900; }
.sso-note { font-size: 12px; color: var(--muted); text-align: center; margin: var(--s2) 0 0; }
.auth-foot { font-size: 12px; color: var(--muted); text-align: center; margin-top: var(--s6); }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: var(--s6) var(--s5); gap: var(--s4); }
  .auth-brand h2 { font-size: 24px; max-width: none; } .auth-points, .auth-meta { display: none; }
  .auth-form { padding: 64px var(--s4) var(--s8); place-items: start center; }
  .theme-toggle.floating { top: var(--s3); right: var(--s3); }
  .auth-card { padding: var(--s6); }
}

/* Small pop-over forms (tool calibration, deferral close) */
.pop { position: relative; display: inline-block; }
.pop > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; }
.pop > summary::-webkit-details-marker { display: none; }
.pop[open] > form { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; width: 300px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(10, 18, 32, .12); text-align: left; white-space: normal; }
dialog.panel { padding: 0; width: min(380px, calc(100vw - 32px)); color: var(--ink); }
dialog.panel::backdrop { background: rgba(10, 18, 32, .45); }
dialog.panel.wide { width: min(560px, calc(100vw - 32px)); }
/* Feedback: kind picker as large tap targets, status chips on the list */
.fb-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--s2); margin-bottom: var(--s4); }
.fb-kinds label { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; }
.fb-kinds input { accent-color: var(--accent); }
.fb-kinds label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.fb-comment { white-space: pre-line; }
.avail-chart { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding: var(--s3) var(--s3) var(--s2); margin-bottom: var(--s4); }
.avail-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.avail-col span { display: block; width: 100%; max-width: 22px; border-radius: 0; background: var(--ok); }
.avail-col span.soon { background: var(--soon); } .avail-col span.overdue { background: var(--over); }
.avail-col small { font-size: 10px; color: var(--muted); margin-top: 3px; }
.band-chart { display: flex; align-items: stretch; gap: 6px; height: 190px; padding: var(--s4) var(--s4) var(--s2); margin-bottom: var(--s4); }
.band-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; }
.band-col b { font: 700 12px var(--font); font-variant-numeric: tabular-nums; margin-bottom: 3px; }
.band-col span { display: block; width: 100%; max-width: 44px; background: var(--slate-500); }
.band-col span.ok { background: var(--accent); } .band-col span.soon { background: var(--soon); } .band-col span.overdue { background: var(--over); }
.band-col small { font: 400 10px var(--mono); color: var(--muted); margin-top: 5px; white-space: nowrap; }
@media (max-width: 640px) { .band-col small { writing-mode: vertical-rl; transform: rotate(180deg); } .band-chart { height: 230px; } }
.path { word-break: break-all; }

/* Vendor document checklist (edit page) */
.doc-checklist { margin-bottom: var(--s4); padding: var(--s3) var(--s4); }
.doc-checklist header { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s2); }
.doc-checklist h2 { margin: 0; font-size: 15px; }
.doc-checklist ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 var(--s4); }
.doc-checklist li { display: grid; grid-template-columns: 34px 1fr; column-gap: var(--s2); padding: 6px 0; border-top: 1px solid var(--line); }
.doc-checklist li small { grid-column: 2; color: var(--muted); font-size: 12px; }
.doc-checklist .mark { grid-row: span 2; font: 700 11px var(--mono); text-transform: uppercase; }
.doc-checklist li.ok .mark { color: var(--ok, #2f9e62); } .doc-checklist li.missing .mark { color: var(--over, #c2410c); } .doc-checklist li.na { opacity: .6; }

/* Electronic signature password box inside the task forms */
.inline-form .esign-pw { width: 170px; flex: 0 0 auto; }
@media (max-width: 700px) { .inline-form .esign-pw { width: 100%; } }
.sign-form { flex-wrap: wrap; }
.sign-form input[name=reason] { width: 180px; }

/* ---------- Touch screens (iPad, iPhone): finger-sized controls ----------
   Only where the main pointer is a finger, so desktop density is unchanged. Text boxes use 16px text
   (iOS Safari zooms the page into any smaller box when it is tapped); tap targets are about 40-44px
   (Apple's guideline is 44pt). Small inline links get a taller hit area through padding with a
   matching negative margin, so the layout does not move. */
@media (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea { font-size: 16px !important; }
  .field input[type=email], .field input[type=password], .field input[type=text], .field input[type=number], .field input[type=date],
  fieldset.field input[type=text], .field select, table.wb-lines input, table.wb-lines select { height: 44px; }
  input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=submit]):not([type=button]), select { min-height: 40px; }
  .search input { align-self: stretch; }
  .brand { min-height: 44px; }
  details:not(.pop) > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
  .pop > summary { min-height: 44px; }
  input[type=checkbox], input[type=radio] { width: 22px; height: 22px; }
  .search { height: 44px; }
  .btn { height: 44px; }
  .btn-sm { height: 40px; }
  .seg a { display: inline-flex; align-items: center; min-height: 40px; }
  .toggle { min-height: 40px; }
  .nav a, .nav span { min-height: 44px; display: flex; align-items: center; }
  .check { min-height: 44px; }
  .crumbs a, .search a, .record-links a, table.data td a, .app-footer a, .item-link, .tail-link, a.small, dd a, .page-head a:not(.btn) {
    display: inline-block; padding-block: 12px; margin-block: -12px; }
  .theme-toggle, .btn-ghost-dark, .topbar .user { min-width: 44px; min-height: 44px; }
}
