/* FlightOps — one stylesheet for company sites and the provider console. No JavaScript, no inline styles (CSP). */

:root {
  /* The FlightOps look (from the Daily Briefing and Flight Manifest mockups). */
  --paper: #eef0ec;           /* page background */
  --surface: #ffffff;
  --ink: #1b2430;
  --ink-soft: #4a5565;
  --band: #14202e;            /* header */
  --band-ink: #ffffff;
  --band-soft: #b9c4d0;
  --line: #d5dae0;
  --field: #b8c0ca;           /* form field borders */
  --accent: #f2c200;          /* taxiway yellow: active navigation only */
  --link: #1f4e79;
  --primary: #1f4e79;
  --primary-dk: #163e66;
  --go: #1e6b42;
  --go-dk: #17553a;
  --focus: #1f4e79;
  --danger: #b42318;
  --danger-bg: #fbe4e1;
  --ok: #17553a;
  --ok-bg: #ddf0e4;
  --warn: #6b4b00;
  --warn-bg: #fff4d6;
  --info-bg: #e3ecf5;
  --radius: 8px;
  --radius-lg: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--font);
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 .75rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; margin-top: 1.75rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 1rem; }

a { color: var(--link); }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: .5rem; top: .5rem; z-index: 10; background: var(--surface); padding: .5rem .75rem; border-radius: var(--radius); }

/* ---------- Test-site marker (config environment_label) ---------- */

.env-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20; height: 1.75rem;
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(135deg, #f2c200 0 14px, #18242e 14px 28px);
  color: #18242e; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.env-banner span { background: #f2c200; padding: .1rem .75rem; border-radius: 2px; white-space: nowrap; }
body.has-env { padding-top: 1.75rem; }

/* ---------- Header band ---------- */

.band { background: var(--band); color: var(--band-ink); }
.band a { color: var(--band-ink); }

.band-row {
  max-width: 72rem; margin: 0 auto; padding: .75rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; }
.brand-text { display: flex; flex-direction: column; }
/* Company logo (Settings > Company branding): on a white chip so dark logos show on the dark band. */
.brand-logo { display: block; height: 28px; width: auto; max-width: 9rem; object-fit: contain; background: #fff; padding: 3px 5px; border-radius: 4px; box-sizing: content-box; }
.brand-company { font-weight: 700; font-size: 1.1rem; }
.brand-product { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--band-soft); }

.account-menu { display: flex; align-items: center; gap: 1rem; font-size: .9rem; }
.account-menu form { margin: 0; }

.page .link-button { color: var(--link); }
.link-button {
  background: none; border: 0; padding: 0; font: inherit; color: inherit;
  text-decoration: underline; cursor: pointer;
}

.nav { padding-top: 0; padding-bottom: 0; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.nav a {
  display: inline-block; padding: .55rem 0 .45rem; text-decoration: none;
  border-bottom: 3px solid transparent; color: var(--band-soft);
}
.nav a:hover { color: var(--band-ink); }
.nav a[aria-current="page"] { color: var(--band-ink); border-bottom-color: var(--accent); }
.nav-admin { font-size: .9rem; }

/* Modules dropdown: native <details>, so no JavaScript. */
.nav-group { position: relative; }
.nav-menu summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .35rem;
  padding: .55rem 0 .45rem; border-bottom: 3px solid transparent; color: var(--band-soft);
}
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary::after {
  content: ""; width: .4rem; height: .4rem; border: solid currentColor; border-width: 0 2px 2px 0;
  transform: translateY(-2px) rotate(45deg);
}
.nav-menu[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.nav-menu summary:hover, .nav-menu[open] summary { color: var(--band-ink); }
.nav-menu summary.is-active { color: var(--band-ink); border-bottom-color: var(--accent); }
.nav-menu summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav .nav-menu-list {
  position: absolute; top: 100%; left: -.75rem; z-index: 15; min-width: 12rem;
  display: block; margin-top: .25rem; padding: .35rem 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(20, 32, 46, .18);
}
.nav .nav-menu-list a {
  display: block; padding: .5rem 1rem; color: var(--ink);
  border-bottom: 0; border-left: 3px solid transparent;
}
.nav .nav-menu-list a:hover { background: var(--paper); color: var(--ink); }
.nav .nav-menu-list a[aria-current="page"] {
  color: var(--ink); font-weight: 600; border-left-color: var(--accent); background: var(--paper);
}

.console .band { background: #2a2f36; }

/* ---------- Page ---------- */

.page { max-width: 72rem; margin: 0 auto; padding: 1.75rem 1.25rem 3rem; }

.lede { font-size: 1.1rem; color: var(--ink-soft); max-width: 44rem; }
.muted-text, .hint { color: var(--ink-soft); }
.hint { font-size: .875rem; margin: .25rem 0 0; }
.aside { color: var(--ink-soft); font-size: .9rem; }
.empty { padding: 1.5rem; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); color: var(--ink-soft); }
.count { color: var(--ink-soft); font-size: .9rem; }

.heading-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.heading-row h1 { margin: 0; }
.heading-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; margin-bottom: 1.25rem;
}
.panel > h2:first-child { margin-top: 0; }

/* ---------- Notices and state tags ---------- */

.notice { padding: .75rem 1rem; border-radius: var(--radius); border-left: 4px solid; margin: 0 0 1rem; }
.notice-ok { background: var(--ok-bg); border-color: var(--ok); }
.notice-error { background: var(--danger-bg); border-color: var(--danger); }
.notice-info { background: var(--info-bg); border-color: var(--link); }
.notice-warn { background: var(--warn-bg); border-color: var(--warn); }

.state {
  display: inline-block; padding: .05rem .5rem; border-radius: 999px;
  font-size: .8rem; font-weight: 600; white-space: nowrap;
}
.state-ok { background: var(--ok-bg); color: var(--ok); }
.state-warn { background: var(--warn-bg); color: var(--warn); }
.state-bad { background: var(--danger-bg); color: var(--danger); }

/* ---------- Forms ---------- */

.form { max-width: 44rem; }
.form.narrow { max-width: 26rem; }
.form fieldset { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 1rem 1.25rem 1.25rem; margin: 0 0 1.25rem; }
.form legend { font-weight: 700; padding: 0 .35rem; }
.form label { display: block; font-weight: 600; margin: 1rem 0 .3rem; }
.form fieldset > label:first-of-type, .form > label:first-child { margin-top: .25rem; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], input[type="url"], input[type="search"], input[type="tel"],
input:not([type]), select, textarea {
  width: 100%; max-width: 100%; padding: .5rem .6rem; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid #aebbc4; border-radius: var(--radius);
}
textarea { min-height: 6rem; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: 3px solid rgba(47, 125, 209, .3); outline-offset: 0; }
[aria-invalid="true"] { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .875rem; font-weight: 600; margin: .3rem 0 0; }

.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.field-pair > div > label { margin-top: 1rem; }

.affix { display: flex; align-items: stretch; }
.affix input { border-top-right-radius: 0; border-bottom-right-radius: 0; min-width: 0; }
.affix span {
  display: flex; align-items: center; padding: 0 .6rem; white-space: nowrap;
  background: var(--paper); border: 1px solid #aebbc4; border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0; color: var(--ink-soft);
}

.tail-input, .tail { font-family: var(--mono); text-transform: uppercase; letter-spacing: .03em; }
.tail-input { max-width: 12rem; }
.field-label { display: block; font-weight: 600; margin: 1rem 0 .3rem; }
.ink-line { margin-top: 2.5rem; }
.call-sign { font-weight: 400; color: var(--ink-soft); font-size: .9em; }

.form label.check, label.check {
  display: flex; align-items: flex-start; gap: .5rem; font-weight: 400; margin: .6rem 0 0;
}
.check input { margin-top: .3rem; flex: none; width: auto; }
.checks { display: grid; gap: .1rem; }

.roles { display: grid; gap: .25rem; }
.roles select { max-width: 20rem; }

.actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: 1.25rem; }
.secondary-action { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }

.inline-form { display: inline; margin: 0; }
.inline-form.form { max-width: none; }

.filters { display: flex; align-items: flex-end; gap: .5rem 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters label { font-weight: 600; font-size: .9rem; }
.filters select, .filters input { width: auto; min-width: 10rem; }

/* ---------- Buttons ---------- */

.button {
  display: inline-block; padding: .55rem 1rem; font: inherit; font-weight: 600; line-height: 1.2;
  color: #fff; background: var(--band); border: 1px solid var(--band); border-radius: var(--radius);
  text-decoration: none; cursor: pointer;
}
.button:hover { background: #16304a; }
.button-quiet { background: var(--surface); color: var(--band); border-color: #aebbc4; }
.button-quiet:hover { background: var(--paper); }
button.button[name="danger"], .button.danger { background: var(--danger); border-color: var(--danger); }

code.secret { font: 1.35rem/1.3 var(--mono); letter-spacing: .06em; background: var(--paper); padding: .15rem .4rem; border-radius: var(--radius); }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem; }
.data { width: 100%; border-collapse: collapse; font-size: .95rem; }
.data th, .data td { padding: .55rem .75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.data thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); background: var(--paper); }
.data tbody tr:last-child td { border-bottom: 0; }
.data tbody tr:hover { background: #f9fbfc; }
.data tr.muted td { color: var(--ink-soft); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.data th.num, .data td.num { text-align: right; }
.nowrap { white-space: nowrap; }
.muted { color: var(--ink-soft); }

.details summary { cursor: pointer; color: var(--link); }
.details pre { margin: .5rem 0 0; font: .8rem/1.4 var(--mono); white-space: pre-wrap; word-break: break-word; max-width: 32rem; }

.pager { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; }

/* ---------- Definition lists ---------- */

.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.5rem; margin: 0 0 1rem; }
.facts dt { font-weight: 600; color: var(--ink-soft); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }

/* ---------- Dashboard ---------- */

.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1rem; margin: 1.25rem 0; }
.module { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--band); border-radius: var(--radius); padding: 1rem 1.25rem; }
.module h2 { margin-top: 0; }
.module-locked { border-top-color: var(--line); color: var(--ink-soft); }
.module-role { font-size: .875rem; color: var(--ink-soft); margin: 0; }
.fleet-line { color: var(--ink-soft); }

/* ---------- Sign-in pages ---------- */

.guest { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 1rem 2rem; }
.guest-panel {
  width: 100%; max-width: 26rem; background: var(--surface); border: 1px solid var(--line);
  border-top: 6px solid var(--band); border-radius: var(--radius); padding: 1.75rem;
}
.guest.console .guest-panel { border-top-color: #2a2f36; }
.guest-company { font-weight: 700; font-size: 1.25rem; margin: 0; }
.guest-logo { display: block; height: auto; width: auto; max-height: 56px; max-width: 14rem; margin: 0 0 .75rem; }
.guest-product { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 1.5rem; }
.guest-panel .form { max-width: none; }

/* ---------- Error pages ---------- */

.debug { background: #10181f; color: #dfe7ec; padding: 1rem; border-radius: var(--radius); overflow-x: auto; font: .8rem/1.45 var(--mono); white-space: pre-wrap; }

/* ---------- The FlightOps look, app-wide ---------- */

h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; }
.page { max-width: 80rem; }
.band { box-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.brand-company { font-size: 1.15rem; }

.panel, .form fieldset, .table-wrap, .module, .empty, .guest-panel, .bf-card {
  border-radius: var(--radius-lg); border-color: var(--line);
}
.panel { padding: 1.15rem 1.25rem; }
.module { border-top: 1px solid var(--line); padding: 1.1rem 1.25rem; }
.module h2 a { text-decoration: none; }
.module h2 a:hover { text-decoration: underline; }
.module-locked { background: #f7f8f6; }
.empty { background: var(--surface); border-style: solid; }
.guest-panel { border-top: 1px solid var(--line); box-shadow: 0 1px 2px rgba(20, 32, 46, .06); }
.guest-company { font-size: 1.35rem; }

.form label, .field-label, .filters label { font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.form label { margin-top: 1.15rem; }
.form fieldset > label:first-of-type, .form > label:first-child { margin-top: .25rem; }
.field-pair > div > label { margin-top: 1.15rem; }
.form label.check, label.check { font-size: .95rem; letter-spacing: 0; text-transform: none; color: var(--ink); font-weight: 400; }
.form legend { font-size: 1rem; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], input[type="url"], input[type="search"], input[type="tel"],
input:not([type]), select, textarea {
  min-height: 2.5rem; border: 1px solid var(--field); border-radius: var(--radius);
}
textarea { line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: 2px solid var(--primary); outline-offset: 0; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }
.affix input { border-radius: var(--radius) 0 0 var(--radius); }
.affix span { border-color: var(--field); border-radius: 0 var(--radius) var(--radius) 0; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 2.5rem; padding: 0 .95rem; border-radius: var(--radius); font-size: .92rem; font-weight: 700;
  background: var(--primary); border-color: var(--primary);
}
.button:hover { background: var(--primary-dk); }
.button-quiet { background: var(--surface); color: var(--ink); border-color: var(--field); }
.button-quiet:hover { background: #f3f5f7; }
.button-go { background: var(--go); border-color: var(--go); color: #fff; }
.button-go:hover { background: var(--go-dk); }
button.button[name="danger"], .button.danger { background: var(--surface); border-color: var(--danger); color: #8a1c12; }
button.button[name="danger"]:hover, .button.danger:hover { background: var(--danger-bg); }

.data thead th { background: #f6f7f5; font-size: .72rem; font-weight: 700; letter-spacing: .05em; color: var(--ink-soft); }
.data th, .data td { border-bottom-color: #e2e6ea; }
.data tbody tr:hover { background: #fafbf9; }
.table-wrap { box-shadow: 0 1px 2px rgba(20, 32, 46, .04); }

.state { border-radius: 4px; font-size: .75rem; font-weight: 700; padding: .15rem .45rem; }
.notice { border-radius: var(--radius); border-left-width: 4px; }
.notice-info { background: var(--info-bg); border-color: var(--primary); }

.heading-row { align-items: flex-end; }
.lede { color: var(--ink-soft); }

/* Pills and chips for any module (same as the Daily Briefing's). */
.pill { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.3rem; padding: 0 .95rem; border: 1px solid var(--field); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: .85rem; font-weight: 700; text-decoration: none; }
.pill:hover { background: #f3f5f7; }
.pill[aria-current="page"], .pill.on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Briefing pages share these now; keep their wider canvas. */
.page:has(> .bf) { max-width: 90rem; }

/* ---------- Daily Briefing ---------- */

.bf-status { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.bf-sub { color: var(--ink-soft); margin: .25rem 0 0; }
.bf-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; min-width: 0; }
.bf-card > h2:first-child, .bf-card > h3:first-child { margin-top: 0; }
.bf-card h2 { font-size: 1.05rem; margin: 0 0 .5rem; }
.bf-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); display: block; margin: 0 0 .3rem; }
.bf-stack { display: grid; gap: 1rem; margin-bottom: 1rem; }
.bf-top { display: grid; grid-template-columns: minmax(14rem, 1fr) minmax(0, 2fr); gap: 1rem; margin-bottom: 1rem; }
.bf-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(15rem, 19rem); gap: 1rem; align-items: start; margin-bottom: 1rem; }
.bf-perf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.bf-side { display: grid; gap: 1rem; }
.bf-weather { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.bf-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.bf-pre { font: .9rem/1.45 var(--mono); white-space: pre-wrap; word-break: break-word; margin: 0; }
textarea.bf-mono, input.bf-mono { font-family: var(--mono); font-size: .9rem; }
textarea.bf-short { min-height: 3.2rem; }
.bf-big { font: 600 1.45rem/1.2 var(--mono); }
.bf-figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; align-items: end; }
.bf-figures input { max-width: 7rem; }
.bf-sun { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; text-align: center; }
.bf-nogo { color: var(--danger); }
.bf-note { font-size: .85rem; border-radius: var(--radius); padding: .35rem .55rem; margin: .25rem 0 .4rem; background: var(--paper); color: var(--ink-soft); }
.bf-note.warn { background: var(--warn-bg); color: var(--warn); }
.bf-perf { width: 100%; border-collapse: collapse; margin-top: .5rem; }
.bf-perf th, .bf-perf td { text-align: left; padding: .4rem .35rem; border-top: 1px solid var(--line); vertical-align: top; }
.bf-perf thead th { border-top: 0; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.bf-perf td.num { font: 600 1.05rem/1.3 var(--mono); }
.bf-assigned { display: block; font-size: .8rem; color: var(--link); font-weight: 400; }
.bf-prio { list-style: none; margin: 0; padding: 0; }
.bf-prio li { display: flex; gap: .6rem; padding: .25rem 0; font-family: var(--mono); }
.bf-prio-group + .bf-prio-group { border-top: 1px solid var(--line); margin-top: .6rem; padding-top: .6rem; }
.bf-prio-slots { display: grid; grid-template-columns: 1.5rem 1fr; gap: .35rem .5rem; align-items: center; }

.bf-risk { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; border: 0; padding: 0; margin: 0; }
.bf-risk legend { padding: 0; }
.bf-risk label { position: relative; margin: 0; cursor: pointer; }
.bf-risk input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bf-risk span { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 3.4rem; border: 2px solid #c6cfd6; border-radius: var(--radius); background: var(--surface); font-weight: 700; text-align: center; line-height: 1.2; }
.bf-risk span small { font-weight: 600; font-size: .75rem; }
.bf-risk input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.bf-risk input:checked + span.green, .bf-risk-badge.green { background: #1e6b42; border-color: #1e6b42; color: #fff; }
.bf-risk input:checked + span.yellow, .bf-risk-badge.yellow { background: #f2c94c; border-color: #b8901a; color: #18242e; }
.bf-risk input:checked + span.orange, .bf-risk-badge.orange { background: #c2410c; border-color: #c2410c; color: #fff; }
.bf-risk input:checked + span.red, .bf-risk-badge.red { background: #b42318; border-color: #b42318; color: #fff; }
.bf-risk-badge { display: inline-block; padding: .3rem .7rem; border-radius: var(--radius); border: 2px solid; font-weight: 700; }
.bf-nofly { background: #b42318; color: #fff; font-weight: 700; font-size: 1.1rem; padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }

.bf-assign td, .bf-assign th { vertical-align: middle; }
.bf-assign select { min-width: 9rem; }
.bf-assign .bf-name select { min-width: 12rem; }
.bf-assign input[type="checkbox"] { width: 1.15rem; height: 1.15rem; }
.bf-duties { display: flex; flex-wrap: wrap; gap: .2rem .8rem; }
.bf-duties label { display: inline-flex; align-items: center; gap: .3rem; font-weight: 400; margin: 0; white-space: nowrap; }
.bf-duties input { width: auto; }
.bf-tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: .05rem .4rem; border-radius: 3px; background: var(--info-bg); color: var(--link); }
.bf-tag.wb { background: var(--warn-bg); color: var(--warn); }

.bf-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; margin: 1rem 0; }
.bf-area { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--band); border-radius: var(--radius); padding: 1rem 1.2rem; }
.bf-area h2 { margin-top: 0; }

.bf-ack-list { list-style: none; margin: 0; padding: 0; }
.bf-ack-list li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .5rem 0; border-top: 1px solid var(--line); }
.bf-ack-list li:first-child { border-top: 0; }
.bf-ack-list form { margin: 0; }
.bf-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.bf-sticky { position: sticky; bottom: 0; background: var(--paper); border-top: 1px solid var(--line); padding: .75rem 0; margin-top: 1rem; z-index: 2; }
.bf-footer { font-size: .85rem; color: var(--ink-soft); }
.bf-footer p { margin: 0 0 .3rem; }
.bf-matrix td, .bf-matrix th { white-space: nowrap; }
.bf-flush { margin: 0; }
.bf-tight { margin-top: -.35rem; margin-bottom: .6rem; }
.bf-note-cell { border-top: 0 !important; padding-top: 0 !important; }
.bf-station { margin-top: .6rem; color: var(--link); }
.bf-winds { grid-template-columns: 9rem minmax(0, 1fr); margin-top: .75rem; }
.bf-block { display: block; margin: 0; }
.bf-slot-label { margin: 0; font-family: var(--mono); font-weight: 600; }
.bf-review td select { min-width: 9rem; }
.bf-review td:last-child select { min-width: 12rem; }
.bf-plain { font-family: var(--font); font-size: 1rem; }

.bf-print { font-size: 10.5pt; }
.bf-print h1 { font-size: 1.3rem; margin-bottom: .25rem; }
.bf-print .bf-card { padding: .6rem .75rem; }

@media (max-width: 56rem) {
  .bf-main, .bf-top { grid-template-columns: 1fr; }
}
@media (max-width: 40rem) {
  .bf-perf-grid, .bf-weather, .bf-three { grid-template-columns: 1fr; }
  .bf-risk { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
  .bf-print .bf-main { grid-template-columns: minmax(0, 1fr) 14rem; }
  .bf-print .bf-top { grid-template-columns: 1fr 2fr; }
  .bf-print .bf-perf-grid, .bf-print .bf-weather { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bf-print .bf-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bf-card { break-inside: avoid; border: 1px solid #999 !important; }
  .bf-risk-badge, .bf-nofly { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Daily Briefing: the mockup's look (scoped to .bf) ---------- */

.bf { --bf-ink: #1b2430; --bf-soft: #4a5565; --bf-line: #d5dae0; --bf-field: #b8c0ca; --bf-blue: #1f4e79; --bf-blue-dk: #163e66; --bf-go: #1e6b42; --bf-go-dk: #17553a; color: var(--bf-ink); }
.bf h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.bf .heading-row { margin-bottom: 1.1rem; align-items: flex-end; }
.bf .bf-sub { color: var(--bf-soft); font-size: .95rem; margin-top: .3rem; }

.bf-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; background: #fff; border: 1px solid var(--bf-line); border-radius: 12px; padding: .6rem .75rem; margin: 0 0 1.25rem; }
.bf-pill { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.3rem; padding: 0 .95rem; border: 1px solid var(--bf-field); border-radius: 999px; background: #fff; color: var(--bf-ink); font-size: .85rem; font-weight: 700; text-decoration: none; }
.bf-pill:hover { background: #f3f5f7; }
.bf-pill.on { background: var(--bf-blue); border-color: var(--bf-blue); color: #fff; }
.bf-pill-tag { font-size: .65rem; letter-spacing: .06em; opacity: .85; }
.bf-tabs-sep { width: 1px; height: 1.5rem; background: var(--bf-line); margin: 0 .25rem; }

.bf .bf-card, .bf .panel, .bf .bf-area { background: #fff; border: 1px solid var(--bf-line); border-radius: 12px; padding: 1.1rem 1.15rem; }
.bf .bf-area { border-top: 1px solid var(--bf-line); }
.bf .bf-card h2, .bf .panel h2, .bf .bf-area h2 { font-size: 1.1rem; font-weight: 700; }
.bf h2 { font-size: 1.15rem; }
.bf .bf-label, .bf .data thead th { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--bf-soft); }
.bf .data thead th { background: transparent; }
.bf .table-wrap { border-radius: 12px; border-color: var(--bf-line); }
.bf .bf-card .table-wrap { border: 0; border-radius: 0; margin: 0; }
.bf .data td, .bf .data th { border-bottom-color: #e2e6ea; }
.bf .data tbody tr:hover { background: transparent; }

.bf input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .bf select, .bf textarea {
  min-height: 2.5rem; border: 1px solid var(--bf-field); border-radius: 8px; background: #fff; color: var(--bf-ink); }
.bf textarea { padding: .5rem .65rem; line-height: 1.45; }
.bf input:focus, .bf select:focus, .bf textarea:focus { outline: 2px solid var(--bf-blue); outline-offset: 0; border-color: var(--bf-blue); }
.bf .bf-assign input[type="checkbox"] { width: 1.4rem; height: 1.4rem; accent-color: var(--bf-blue); }

.bf .button { border-radius: 8px; min-height: 2.5rem; padding: 0 .9rem; display: inline-flex; align-items: center; font-size: .9rem; background: var(--bf-blue); border-color: var(--bf-blue); }
.bf .button:hover { background: var(--bf-blue-dk); }
.bf .button-quiet { background: #fff; color: var(--bf-ink); border-color: var(--bf-field); }
.bf .button-quiet:hover { background: #f3f5f7; }
.bf .button-go { background: var(--bf-go); border-color: var(--bf-go); color: #fff; }
.bf .button-go:hover { background: var(--bf-go-dk); }

.bf .state { border-radius: 4px; font-size: .75rem; font-weight: 700; padding: .15rem .45rem; }
.bf .state-warn { background: #fff4d6; color: #6b4b00; }
.bf .state-ok { background: #ddf0e4; color: #17553a; }

.bf .bf-risk span { min-height: 3.6rem; border-radius: 8px; font-size: 1.1rem; border-color: #c9d0d8; }
.bf .bf-risk span small { font-size: .75rem; }

.bf-chip { position: relative; display: inline-flex; margin: 0; cursor: pointer; }
.bf-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bf-chip span { display: inline-flex; align-items: center; min-height: 1.9rem; padding: 0 .7rem; border: 1px solid #c9d0d8; border-radius: 999px; background: #fff; color: var(--bf-soft); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.bf-chip input:checked + span { background: #e3ecf5; border-color: var(--bf-blue); color: var(--bf-blue-dk); }
.bf-chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.bf-chip-x span { width: 2.2rem; min-height: 2.2rem; justify-content: center; padding: 0; border-radius: 8px; border-color: var(--bf-field); color: var(--bf-ink); font-size: .95rem; }
.bf-chip-x input:checked + span { background: #fbe4e1; border-color: #b42318; color: #8a1c12; }
.bf .bf-duties { gap: .35rem; }
.bf-chip-on { display: inline-flex; align-items: center; min-height: 1.6rem; padding: 0 .6rem; border-radius: 999px; background: #e3ecf5; color: var(--bf-blue-dk); font-size: .75rem; font-weight: 700; }

.bf .bf-big { font-size: 1.5rem; }
.bf textarea.bf-forecast { min-height: 4.5rem; font-size: .9rem; }
.bf .bf-forecast-text { font-size: .92rem; margin: 0 0 .5rem; }
.bf .bf-sticky { background: #eef0ec; }
.bf .notice { border-radius: 8px; }

/* ---------- Small screens ---------- */

@media (max-width: 40rem) {
  .field-pair { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; gap: .1rem; }
  .facts dd { margin-bottom: .6rem; }
  .page { padding-top: 1.25rem; }
  h1 { font-size: 1.35rem; }
}

@media print {
  .band, .skip, .actions, .filters, .pager, .no-print, .env-banner, .flash, .notice-info { display: none !important; }
  body.has-env { padding-top: 0; }
  .print-sheet { font-size: 11pt; }
  body { background: #fff; }
  .table-wrap, .panel { border: 0; }
}

/* ---------- Demo companies (docs/DEMO.md) ---------- */

.demo-bar { background: #fff4d6; border-bottom: 2px solid #e0a500; color: #3b2a00; font-size: .9rem; }
.demo-bar-row { max-width: 72rem; margin: 0 auto; padding: .45rem 1.25rem; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.1rem; }
.demo-tag { background: #e0a500; color: #1e1500; padding: .1rem .55rem; border-radius: 3px; text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; }
.demo-form { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0; }
.demo-form select { width: auto; max-width: 22rem; padding: .2rem .4rem; }
.demo-form .button { padding: .2rem .7rem; }
.demo-check { display: inline-flex; align-items: center; gap: .3rem; font-weight: 400; }
.demo-check input { width: auto; margin: 0; }
.demo-reset summary { cursor: pointer; text-decoration: underline; }
.demo-reset[open] { flex-basis: 100%; }
.demo-guest-note { background: #fff4d6; border: 1px solid #e0a500; padding: .35rem .6rem; border-radius: 4px; font-size: .9rem; }
.demo-mail { white-space: pre-wrap; font-family: inherit; background: #f6f7f9; padding: .75rem; border-radius: 4px; margin: .5rem 0 0; }
.demo-inbox { display: grid; gap: .5rem; }
.demo-skip { border-color: #e0a500 !important; }
@media print { .demo-bar { display: none !important; } }

/* Maintenance: the MX meter (airframe total time) that every due time counts against */
.badge-mx { display: inline-block; padding: .05rem .45rem; border-radius: 3px; background: var(--band); color: #fff;
  font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; vertical-align: .1em; }
tr.mx-meter td { background: var(--info-bg); }
tr.mx-meter td:first-child { box-shadow: inset 4px 0 0 var(--band); }
.mx-meter-note { margin: .35rem 0 0; font-size: .85rem; color: var(--ink-soft); }

/* Maintenance overview: one meter per line */
.meter-list { list-style: none; margin: 0; padding: 0; }
.meter-list li { white-space: nowrap; line-height: 1.5; }
.meter-list .num { font-variant-numeric: tabular-nums; }

/* Add / edit person: details stay narrow; pilot and admin side by side; module roles flow into
   columns (each module's box kept whole), one column on narrow screens. */
.user-form { max-width: 62rem; }
.user-form .user-basics { max-width: 26rem; }
.user-form .user-flags { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 0 1.25rem; margin-top: 1.25rem; }
.user-form .role-heading { font-size: 1.1rem; margin: .5rem 0 .75rem; }
.user-form .role-columns { columns: 2 20rem; column-gap: 1.25rem; }
.user-form .role-columns > fieldset { break-inside: avoid; page-break-inside: avoid; display: inline-block; width: 100%; margin: 0 0 1.25rem; }

/* Settings > Dashboard layout */
.layout-section { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.layout-section h2 { margin-top: 0; }
/* Company branding (Settings) and the letterhead on printouts */
.brand-preview { margin: 0 0 1rem; padding: .85rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); max-width: 44rem; }
.brand-preview .field-label { margin: 0 0 .5rem; }
.brand-preview .letterhead { margin-bottom: .5rem; }
.brand-preview .hint { margin: 0; }
.brand-preview-footer, .letterhead-line { font-size: .75rem; letter-spacing: .05em; color: var(--ink-soft); }
.brand-preview-footer { margin: 0; text-align: center; }
.letterhead { display: flex; align-items: center; gap: .9rem; border-bottom: 2px solid var(--ink); padding-bottom: .55rem; margin: 0 0 1rem; }
.letterhead-logo { height: auto; width: auto; max-height: 52px; max-width: 13rem; }
.letterhead-text { display: flex; flex-direction: column; }
.letterhead-name { font-weight: 700; font-size: 1.15rem; }
.print-footer-line { margin-top: 1.5rem; padding-top: .4rem; border-top: 1px solid var(--line); font-size: .72rem; letter-spacing: .05em; color: var(--ink-soft); text-align: center; }
.layout-changed { margin: .5rem 0 1rem; padding: .6rem .85rem; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--band); border-radius: var(--radius); max-width: 44rem; }
.layout-tiles { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1rem; }
.layout-tile { display: flex; align-items: center; gap: .6rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .75rem; cursor: grab; }
.layout-tile.is-dragging { opacity: .45; border-style: dashed; }
.layout-pos { flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--paper); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; color: var(--ink-soft); }
.layout-name { flex: 1; font-weight: 600; }
.layout-moves { flex: none; display: inline-flex; gap: .25rem; }
.layout-move { font: inherit; line-height: 1; padding: .35rem .55rem; border: 1px solid #aebbc4; border-radius: var(--radius); background: var(--surface); color: var(--band); cursor: pointer; }
.layout-move:hover:not(:disabled) { background: var(--paper); }
.layout-move:disabled { opacity: .35; cursor: default; }
.layout-unsaved { font-size: .875rem; font-weight: 600; color: var(--warn, #8a5a00); }

/* small red count on a button or tab (e.g. Maintenance › Log sheet items) */
.count-badge { display: inline-block; min-width: 1.3rem; padding: 0 .35rem; margin-left: .3rem; border-radius: 999px; background: #b42318; color: #fff; font-size: .72rem; font-weight: 700; text-align: center; line-height: 1.3rem; }

/* ---------- Maintenance: aircraft status sheet (print, US Letter portrait) ---------- */
.mxs-pages { display: grid; gap: 1.5rem; justify-items: start; overflow-x: auto; }
.mxs-page { width: 8in; min-height: 10.4in; background: #fff; color: #111; box-shadow: 0 4px 18px rgba(20, 32, 46, .25); padding: .4in .45in .3in;
  font: 10px/1.3 Arial, Helvetica, sans-serif; display: flex; flex-direction: column; gap: 10px; box-sizing: border-box; page: mxstatus; }
.mxs-page .letterhead { margin: 0; border-bottom-width: 2px; border-bottom-color: #111; }
.mxs-page .letterhead-line { color: #444; }
.mxs-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; }
.mxs-title h2 { margin: 0; font-size: 9px; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; color: #444; }
.mxs-ac { font-size: 14px; }
.mxs-ac b { font-family: Consolas, "Courier New", monospace; font-size: 20px; letter-spacing: .04em; margin-right: .3rem; }
.mxs-date { text-align: right; font-size: 8.6px; text-transform: uppercase; letter-spacing: .1em; color: #444; }
.mxs-date b { display: block; font-size: 13px; letter-spacing: 0; color: #111; }
.mxs-head { display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; align-items: start; }
.mxs-page table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; margin: 0; }
.mxs-page th, .mxs-page td { border: 1px solid #222; padding: 2px 5px; font-size: 10px; color: #111; vertical-align: top; text-align: left; }
.mxs-page thead th { background: #e3e5df; font-size: 8.4px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; text-align: center; vertical-align: middle; }
.mxs-page thead th.l { text-align: left; }
.mxs-page tbody th { background: #f1f2ee; font-weight: 400; font-size: 9.4px; white-space: nowrap; }
.mxs-page td.n { text-align: right; white-space: nowrap; }
.mxs-page thead th.mxs-sect { background: #14202e; color: #fff; text-align: left; font-size: 8.8px; letter-spacing: .12em; }
.mxs-w-item { width: 36%; }
.mxs-items tbody tr:nth-child(even) td { background: #f7f8f5; }
.mxs-items tr { break-inside: avoid; page-break-inside: avoid; }
.mxs-next { font-weight: 700; }
.mxs-over td { font-weight: 700; }
.mxs-soft { color: #555; font-size: 8.8px; font-weight: 400; }
.mxs-foot { margin-top: auto; display: flex; justify-content: space-between; gap: 14px; font-size: 8px; color: #444; border-top: 1px solid #222; padding-top: 4px; }
.mxs-printed { text-align: right; white-space: nowrap; }
@page mxstatus { size: letter portrait; margin: .4in; }
@media print {
  .mxs-screen { display: none !important; }
  main.page:has(.mxs-pages), .page:has(.mxs-pages) { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .mxs-pages { display: block; overflow: visible; }
  .mxs-page { box-shadow: none; width: auto; min-height: 0; padding: 0; break-after: page; page-break-after: always; }
  .mxs-page:last-child { break-after: auto; page-break-after: auto; }
  .mxs-page thead th, .mxs-page tbody th, .mxs-items tbody tr:nth-child(even) td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Dashboard snapshot (above the module tiles; hidden until "Show") ---------- */
.snap { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 0 0 1.25rem; }
.snap-head { background: var(--band); color: #fff; padding: .7rem 1.1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; }
.snap-head h2 { margin: 0; font-size: 1.05rem; color: #fff; }
.snap-meta { color: #b9c4d0; font-size: .85rem; }
.snap-right { margin-left: auto; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.snap-view { background: var(--accent); color: var(--band); font-weight: 700; font-size: .78rem; padding: .15rem .55rem; border-radius: 999px; }
.snap-toggle { display: inline-block; color: #fff; border: 1px solid #5b6b7d; border-radius: 999px; padding: .2rem .9rem; font-size: .85rem; font-weight: 700; text-decoration: none; min-width: 4.5rem; text-align: center; }
.snap-toggle:hover { border-color: #fff; }
.snap-body { padding: 0 0 .2rem; }
.snap-alerts { display: flex; flex-wrap: wrap; gap: .5rem; padding: .85rem 1.1rem 0; }
.snap-alert { display: inline-flex; align-items: center; gap: .45rem; font-size: .86rem; font-weight: 600; padding: .3rem .7rem; border-radius: 999px; border: 1px solid; text-decoration: none; }
.snap-alert-bad { background: var(--danger-bg); color: var(--danger); border-color: #efb3ab; }
.snap-alert-warn { background: var(--warn-bg); color: var(--warn); border-color: #ecd38b; }
.snap-alert-ok { background: var(--ok-bg); color: var(--ok); border-color: #a9d6b9; }
.snap-dot { width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; flex: none; }
.snap-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem; padding: 1rem 1.1rem 1rem; }
.snap-panel { grid-column: span 6; min-width: 0; border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; background: var(--surface); }
.snap-w4 { grid-column: span 4; } .snap-w8 { grid-column: span 8; } .snap-w12 { grid-column: span 12; }
.sp-head { display: flex; align-items: baseline; gap: .6rem; padding: .55rem .85rem; background: #e2e6de; border-left: 4px solid var(--accent); border-radius: 9px 9px 0 0; }
.sp-head h3 { margin: 0; font-size: .95rem; }
.sp-count { margin-left: auto; font-size: .8rem; color: var(--ink-soft); white-space: nowrap; }
.sp-body { padding: .7rem .85rem; flex: 1; min-width: 0; font-size: .92rem; }
.sp-foot { padding: .5rem .85rem .65rem; border-top: 1px solid #eceee9; font-size: .85rem; display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.sp-foot a { font-weight: 600; text-decoration: none; }
.sp-foot a:hover { text-decoration: underline; }
.snap-empty { color: var(--ink-soft); font-size: .9rem; margin: .2rem 0; }
.snap-empty-all { padding: 1rem 1.1rem; margin: 0; }
.snap-sub { display: block; font-size: .8rem; color: var(--ink-soft); }
.snap-qbar { background: #f0f2ee; border-radius: 6px; padding: .3rem .6rem; font-size: .8rem; font-weight: 700; margin: .6rem 0 .35rem; display: flex; gap: .5rem; align-items: baseline; }
.snap-qbar:first-child { margin-top: 0; }
.snap-qbar .snap-sub { display: inline; font-weight: 400; margin-left: auto; }
.snap-pill { display: inline-block; font-size: .74rem; font-weight: 700; padding: .08rem .45rem; border-radius: 999px; white-space: nowrap; }
.snap-pill-ok { background: var(--ok-bg); color: var(--ok); } .snap-pill-warn { background: var(--warn-bg); color: var(--warn); }
.snap-pill-bad { background: var(--danger-bg); color: var(--danger); } .snap-pill-info { background: var(--info-bg); color: var(--link); }
.snap-pill-mute { background: #eceee9; color: var(--ink-soft); }
.snap-rows { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.snap-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .15rem .65rem; align-items: center; padding: .4rem 0; border-bottom: 1px solid #eceee9; }
.snap-row:last-child { border-bottom: 0; }
.snap-row .k { font-weight: 700; }
.snap-ac { font-family: var(--mono, ui-monospace, Menlo, Consolas, monospace); font-weight: 700; font-size: .85rem; background: var(--band); color: #fff; padding: .1rem .4rem; border-radius: 5px; white-space: nowrap; }
.snap-ac-off { background: #9aa3ad; }
.snap-risk { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; border-radius: 6px; color: #fff; font-weight: 800; font-size: .85rem; flex: none; }
.snap-risk-1 { background: #2e7d4f; } .snap-risk-2 { background: #c9a100; color: var(--band); } .snap-risk-3 { background: #d46b08; } .snap-risk-4 { background: #b42318; }
.snap-table-wrap { overflow-x: auto; }
table.snap-table { width: 100%; border-collapse: collapse; font-size: .86rem; margin: 0; }
table.snap-table th { text-align: left; font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); padding: .3rem .45rem; border-bottom: 1px solid var(--line); white-space: nowrap; background: none; }
table.snap-table td { padding: .4rem .45rem; border-bottom: 1px solid #eceee9; vertical-align: top; }
table.snap-table tr:last-child td { border-bottom: 0; }
.snap-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: .5rem; }
.snap-kpi { background: #f7f8f5; border: 1px solid #e3e6df; border-radius: 8px; padding: .5rem .65rem; }
.snap-kpi b { display: block; font: 700 1.35rem var(--mono, ui-monospace, Menlo, Consolas, monospace); }
.snap-kpi span { font-size: .78rem; color: var(--ink-soft); }
.snap-kpi-warn b { color: var(--warn); } .snap-kpi-bad b { color: var(--danger); }
.snap-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .6rem; }
.snap-card { border: 1px solid #e3e6df; border-radius: 8px; padding: .55rem .7rem; background: #f7f8f5; min-width: 0; }
.snap-card h4 { margin: 0 0 .25rem; font-size: .88rem; display: flex; gap: .5rem; align-items: center; }
.snap-card h4 .snap-sub { display: inline; margin-left: auto; font-weight: 400; }
.snap-card ul { list-style: none; margin: 0; padding: 0; font-size: .86rem; }
.snap-card li { display: flex; gap: .45rem; align-items: baseline; padding: .12rem 0; }
.snap-card li .snap-role { margin-left: auto; font-size: .76rem; color: var(--ink-soft); white-space: nowrap; }
.snap-big { font: 700 1.5rem var(--mono, ui-monospace, Menlo, Consolas, monospace); }
.snap-mono { font-family: var(--mono, ui-monospace, Menlo, Consolas, monospace); font-size: .76rem; color: var(--ink-soft); word-break: break-word; }
.snap-warnline { color: var(--warn); font-weight: 700; }
.snap-lim { margin-top: .5rem; padding: .45rem .6rem; border-radius: 6px; background: var(--warn-bg); color: var(--warn); font-size: .86rem; font-weight: 600; }
.snap-lim-bad { background: var(--danger-bg); color: var(--danger); }
.snap-hero { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.snap-hero .snap-big { font: 700 1.1rem inherit; font-family: inherit; }
progress.snap-bar { display: block; width: 100%; height: .45rem; border: 0; border-radius: 999px; background: #eceee9; margin-top: .25rem; overflow: hidden; appearance: none; }
progress.snap-bar::-webkit-progress-bar { background: #eceee9; border-radius: 999px; }
progress.snap-bar::-webkit-progress-value { background: #2e7d4f; border-radius: 999px; }
progress.snap-bar::-moz-progress-bar { background: #2e7d4f; border-radius: 999px; }
progress.snap-bar-warn::-webkit-progress-value { background: #d46b08; } progress.snap-bar-warn::-moz-progress-bar { background: #d46b08; }
progress.snap-bar-bad::-webkit-progress-value { background: #b42318; } progress.snap-bar-bad::-moz-progress-bar { background: #b42318; }
.snap-check { list-style: none; margin: 0; padding: 0; }
.snap-check li { display: flex; gap: .6rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid #eceee9; }
.snap-check li:last-child { border-bottom: 0; }
.snap-check-text { flex: 1; min-width: 0; }
.snap-check-text a { color: inherit; text-decoration: underline; text-decoration-color: var(--field); text-underline-offset: 2px; }
.snap-check-text a:hover { color: var(--link); text-decoration-color: var(--link); }
.snap-check .button { font-size: .82rem; padding: .3rem .7rem; white-space: nowrap; }
.snap-tick { flex: none; width: 1.3rem; height: 1.3rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 800; }
.snap-tick-done { background: #2e7d4f; color: #fff; } .snap-tick-todo { border: 2px solid var(--field); } .snap-tick-na { background: #eceee9; color: var(--ink-soft); }
.snap-gate { margin: .6rem 0 0; font-size: .84rem; padding: .4rem .55rem; border-radius: 6px; background: var(--danger-bg); color: var(--danger); font-weight: 600; }
.snap-gate-ok { background: var(--ok-bg); color: var(--ok); }
.snap-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .5rem; }
.snap-links a { display: flex; flex-direction: column; gap: .1rem; padding: .6rem .7rem; border: 1px solid var(--field); border-radius: 8px; text-decoration: none; color: var(--ink); background: var(--surface); }
.snap-links a:hover { border-color: var(--band); background: #f7f8f5; }
.snap-links b { font-size: .92rem; }
.snap-links span { font-size: .76rem; color: var(--ink-soft); }
.snap-links a.snap-link-hot { background: var(--band); color: #fff; border-color: var(--band); }
.snap-links a.snap-link-hot span { color: #b9c4d0; }
@media (max-width: 62rem) { .snap-panel, .snap-w4, .snap-w8 { grid-column: span 12; } }
@media (max-width: 40rem) {
  .snap-grid { padding: .8rem; gap: .8rem; }
  .snap-right { margin-left: 0; }
  .snap-row { grid-template-columns: auto minmax(0, 1fr); }
  .snap-row > :nth-child(3) { grid-column: 2; justify-self: start; }
}
@media print { .snap { display: none; } }

/* Settings › Snapshot views */
.snapset-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .9rem; }
.snapset-tabs a { border: 1px solid var(--field); background: var(--surface); border-radius: 999px; padding: .3rem .85rem; font-weight: 600; font-size: .9rem; color: var(--ink); text-decoration: none; }
.snapset-tabs a[aria-current="page"] { background: var(--band); color: #fff; border-color: var(--band); }
.snapset-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: .4rem 0 .8rem; }
.snapset-table th { text-align: left; font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); padding: .35rem .5rem; border-bottom: 1px solid var(--line); }
.snapset-table td { padding: .45rem .5rem; border-bottom: 1px solid #eceee9; vertical-align: top; }
.snapset-table tr.snapset-on td { background: #f7f8f5; }
.snapset-table input[type="checkbox"] { width: 1.1rem; height: 1.1rem; margin: .15rem 0 0; }
.snapset-pos { width: 4rem; padding: .25rem .4rem; }
.snapset-desc, .snapset-needs { display: block; font-size: .8rem; color: var(--ink-soft); }
.snapset-needs { color: var(--link); }
.snapset-mod { font-size: .82rem; color: var(--ink-soft); white-space: nowrap; }
.snapset-add { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: flex-end; border-top: 1px solid #eceee9; padding-top: .8rem; margin-top: .4rem; }
.snapset-add .field { margin: 0; }
.snapset-add .actions { margin: 0; }

/* Dashboard module tiles: the whole tile opens the module (the title link stretches over it). */
.modules .module { position: relative; transition: border-color .12s, box-shadow .12s; }
.modules .module:not(.module-locked) h2 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.modules .module:not(.module-locked):hover { border-color: var(--band); box-shadow: 0 2px 10px rgba(20, 32, 46, .12); }
.modules .module:not(.module-locked):hover h2 a { text-decoration: underline; }
.modules .module:not(.module-locked):focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.modules .module:not(.module-locked) h2 a:focus-visible { outline: none; }
@media (prefers-reduced-motion: reduce) { .modules .module { transition: none; } }

/* Maintenance: "Next due" wraps to fit the screen (desktop and landscape tablet); each limit is its own line, its figure kept together. */
.data td.mx-next { min-width: 11rem; max-width: 22rem; overflow-wrap: anywhere; }
.mx-due-line { display: block; }
.mx-due-line + .mx-due-line { margin-top: .2rem; }

/* Sandbox (test) companies: tag in the Console, a bar on every page. */
.sandbox-tag { display: inline-block; background: #5b3fa8; color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: .12rem .45rem; border-radius: 4px; vertical-align: 1px; }
.sandbox-bar { background: #efe9fb; border-bottom: 2px solid #5b3fa8; color: #2b1d55; font-size: .9rem; }
.sandbox-bar-row { max-width: 72rem; margin: 0 auto; padding: .4rem 1.25rem; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; }
@media print { .sandbox-bar { display: none !important; } }
