/* Emtec Operational Control Room. One handwritten stylesheet (docs/13 sections 8 and 11).
   Workspace style: dark top bar, white side menu that collapses to icons, flat white cards,
   colour only where something needs attention. Light theme only, by decision. */

@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("../fonts/ibm-plex-sans-latin.d28498895ed7.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/ibm-plex-mono-500-latin.6708425c446b.woff2") format("woff2"); }

:root {
  /* Emtec brand: deep blue #2F5C8A, light blue #3485BD, red #E83F31, gold #B8893B, white and black.
     Small text uses a darker shade of a brand colour where the pure one is too light to read. */
  --navy: #2F5C8A; --navy-deep: #244870; --navy-soft: #EAF0F6;
  --sky: #3485BD; --sky-soft: #E7F1F9; --sky-ink: #1F5E8C;
  --gold: #B8893B; --gold-soft: #FAF2E3; --gold-ink: #6E4F17; --gold-text: #8A6420;
  --red-brand: #E83F31; --red-strong: #D0352A;
  /* chrome: the darkest shade of the brand blue */
  --hdr: #152A40; --hdr-2: #1E3854; --hdr-line: #2C4868; --hdr-ink: #E8EEF5; --hdr-ink-2: #A9B9CB;
  /* surfaces and lines, greys leaning to the brand blue */
  --bg: #F1F4F7; --surface: #FFFFFF; --surface-2: #F7F9FB; --surface-3: #ECF0F4;
  --line: #D7DEE6; --line-2: #E9EEF3; --control: #C2CBD6;
  /* text */
  --ink: #121A24; --ink-2: #45515F; --ink-3: #66727F;
  /* roles */
  --accent: var(--navy); --accent-deep: var(--navy-deep); --accent-soft: var(--navy-soft); --link: #2F5C8A;
  --red: #C42F22; --red-soft: #FDEDEB; --red-ink: #A3271C;
  --amber: var(--gold-text); --amber-soft: var(--gold-soft); --amber-ink: var(--gold-ink); --amber-dot: var(--gold);
  --green: #1E7A4C; --green-soft: #E5F4EC; --green-ink: #17653E; --green-dot: #2E9E63;
  --teal: var(--navy); --teal-soft: var(--navy-soft);
  --violet: var(--sky-ink); --violet-soft: var(--sky-soft);
  --note-bg: #FBF5E8; --note-line: #EBD9B4;
  --font-ui: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", Menlo, Consolas, monospace;
  --shadow: 0 1px 2px rgba(18,26,36,.05);
  --shadow-pop: 0 12px 32px rgba(18,26,36,.16);
  --shadow-dialog: 0 24px 60px rgba(18,26,36,.28);
  --r: 8px; --r-sm: 6px;
  --hdr-h: 52px; --rail-w: 232px; --rail-w-min: 60px;
  color-scheme: light;
}

/* ---------------------------------------------------------------- base -- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font-ui); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; font-weight: 600; letter-spacing: -.01em; }
button { font: inherit; cursor: pointer; color: inherit; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:where(button, a, select, input, textarea, [tabindex]):focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.ic { width: 16px; height: 16px; flex: none; }
.label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.red { color: var(--red); } .amber { color: var(--amber); } .green { color: var(--green); }
.ok { color: var(--green); font-weight: 600; } .bad { color: var(--red); font-weight: 600; }
kbd { font-family: var(--font-mono); font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--ink); }

/* ------------------------------------------------------------- top bar -- */
.hdr { position: sticky; top: 0; z-index: 30; height: var(--hdr-h); background: var(--hdr); color: var(--hdr-ink); display: flex; align-items: center; gap: 14px; padding: 0 14px 0 10px; border-bottom: 0; box-shadow: inset 0 -2px 0 var(--gold); }
.hdr a { color: inherit; }
.hdr a:hover { text-decoration: none; }
.hbtn { width: 34px; height: 34px; border-radius: 6px; border: 0; background: transparent; color: var(--hdr-ink-2); display: grid; place-items: center; flex: none; }
.hbtn:hover { background: rgba(255,255,255,.08); color: #fff; }
.hbtn .ic { width: 18px; height: 18px; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; padding-right: 6px; }
/* Emtec's own mark (static/img/emtec-mark.svg): never recoloured or stretched. */
.brand-mark { display: block; width: 32px; height: auto; flex: none; }
.brand b { font-weight: 600; font-size: 14.5px; }
.brand span:last-child { color: var(--hdr-ink-2); font-size: 14.5px; }
.hdr-mid { flex: 1; min-width: 0; display: flex; justify-content: center; }
.hdr-right { display: flex; align-items: center; gap: 8px; }
.search { display: flex; align-items: center; gap: 8px; height: 34px; width: 300px; padding: 0 8px 0 10px; border-radius: 6px; background: var(--hdr-2); border: 1px solid var(--hdr-line); color: var(--hdr-ink-2); font-size: 13px; transition: border-color .12s, background .12s; }
.search:focus-within { border-color: var(--sky); background: #234060; }
.search input[type="search"] { all: unset; flex: 1; min-width: 0; height: 100%; color: var(--hdr-ink); font-size: 13px; }
.search input[type="search"]::-webkit-search-cancel-button { filter: invert(1); opacity: .6; }
.search input[type="search"]::placeholder { color: var(--hdr-ink-2); }
.search kbd { background: transparent; border-color: var(--hdr-line); color: var(--hdr-ink-2); }
.status-group { display: inline-flex; align-items: center; gap: 8px; }
.status, .hpill { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px; border-radius: 999px; font-size: 12.5px; font-weight: 500; border: 1px solid var(--hdr-line); color: var(--hdr-ink); white-space: nowrap; cursor: default; font-variant-numeric: tabular-nums; background: transparent; }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: #3CC47C; box-shadow: 0 0 0 3px rgba(60,196,124,.2); }
.status.warn { color: #F5C66B; border-color: rgba(245,198,107,.4); } .status.warn .dot { background: #F5B941; box-shadow: 0 0 0 3px rgba(245,185,65,.2); }
.pill.amber, .hpill.amber { color: #F5C66B; border-color: rgba(245,198,107,.4); }
a.hpill { cursor: pointer; text-decoration: none; } a.hpill.amber:hover { background: rgba(245,198,107,.12); }
.quiet-run, .hpill.violet { color: var(--hdr-ink); }
.quiet-run::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.avatar { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--sky); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.avatar:hover { box-shadow: 0 0 0 3px rgba(255,255,255,.14); }
.usermenu { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 240px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-pop); padding: 6px; display: none; }
.menu.open { display: block; }
.menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; }
.menu .who b { display: block; font-weight: 600; }
.menu .who small { color: var(--ink-3); font-size: 12px; }
.menu button, .menu a { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; border-radius: 6px; font-size: 13px; text-align: left; color: var(--ink); }
.menu button:hover, .menu a:hover { background: var(--surface-2); text-decoration: none; }
.menu button[disabled] { color: var(--ink-3); cursor: not-allowed; background: none; }
.menu hr { border: 0; border-top: 1px solid var(--line-2); margin: 4px 2px; }
.menu form { margin: 0; }

/* ----------------------------------------------------------- side menu -- */
.app { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: calc(100% - var(--hdr-h)); transition: grid-template-columns .18s ease; }
.rail { --rail-bg: #1B3450; --rail-ink: #D3DDE8; --rail-ink-2: #8EA3BA; --rail-icon: #A9BCD0;
  position: sticky; top: var(--hdr-h); height: calc(100vh - var(--hdr-h)); background: var(--rail-bg); color: var(--rail-ink); padding: 12px 10px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; overflow-x: hidden; color-scheme: dark; }
.grp { font-size: 11.5px; font-weight: 600; color: var(--rail-ink-2); padding: 16px 12px 6px; white-space: nowrap; letter-spacing: .02em; }
.grp:first-child { padding-top: 4px; }
.nav { position: relative; display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border: 0; border-radius: 8px; background: none; width: 100%; text-align: left; color: var(--rail-ink); font-weight: 500; font-size: 14px; white-space: nowrap; transition: background .12s, color .12s; }
.nav:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.nav:hover .ic { color: #fff; }
.nav[aria-current="page"] { background: rgba(52,133,189,.24); color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(52,133,189,.28); }
.nav[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.nav .ic { width: 20px; height: 20px; color: var(--rail-icon); transition: color .12s; }
.nav[aria-current="page"] .ic { color: #E2C68E; }
.nav .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav .count { min-width: 20px; height: 20px; border-radius: 10px; padding: 0 6px; font-size: 11.5px; font-weight: 600; line-height: 20px; text-align: center; color: #fff; background: rgba(255,255,255,.14); }
.nav .count.red { background: var(--red-strong); }
.nav:focus-visible { outline: 2px solid var(--sky); outline-offset: -2px; }
.rail-foot { margin-top: auto; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.09); display: grid; gap: 2px; }
.rail-toggle { width: 100%; color: var(--rail-ink-2); }
.rail-toggle .ic { transition: transform .18s ease; color: var(--rail-ink-2); }
body.rail-collapsed { --rail-w: var(--rail-w-min); }
body.rail-collapsed .rail { padding-left: 10px; padding-right: 10px; }
body.rail-collapsed .nav { justify-content: center; padding: 0; gap: 0; }
body.rail-collapsed .nav .lbl { display: none; }
body.rail-collapsed .nav .count { position: absolute; top: -2px; right: -6px; min-width: 16px; height: 16px; line-height: 16px; font-size: 10px; padding: 0 4px; border: 2px solid var(--rail-bg); box-sizing: content-box; }
body.rail-collapsed .grp { font-size: 0; padding: 0; height: 1px; background: rgba(255,255,255,.1); margin: 10px 8px; }
body.rail-collapsed .grp:first-child { display: none; }
body.rail-collapsed .rail-toggle .ic { transform: scaleX(-1); }

/* --------------------------------------------------------- page header -- */
.main { min-width: 0; display: flex; flex-direction: column; container: main / inline-size; }
.band { background: var(--navy-soft); color: var(--navy-deep); border-bottom: 1px solid #D3DFEB; padding: 6px 24px; font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.band::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.band.admin { background: var(--gold-soft); color: var(--gold-ink); border-bottom-color: #EBD9B4; }
.pagehead { background: var(--surface); border-bottom: 1px solid var(--line); padding: 14px 24px 0; }
.pagehead .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 14px; }
.pagehead:has(.tabs) .row { padding-bottom: 2px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); margin: -4px 0 4px; flex-wrap: wrap; }
.crumbs .ic { width: 12px; height: 12px; }
.crumbs span { color: var(--ink-2); }
.pagehead h1 { font-size: 20px; }
.pagehead .when { color: var(--ink-3); font-size: 13px; }
.pagehead .right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.work { padding: 20px 24px 48px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; align-content: start; }
.work > * { min-width: 0; }
.work.narrow { max-width: 1100px; }

/* ---------------------------------------------------------------- tabs -- */
.tabs { display: flex; gap: 24px; flex-wrap: wrap; }
.tab { position: relative; border: 0; background: none; padding: 10px 0 12px; color: var(--ink-2); font-weight: 500; font-size: 14px; display: inline-flex; gap: 8px; align-items: center; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab[aria-selected="true"], .tab[aria-current="page"] { color: var(--ink); font-weight: 600; }
.tab[aria-selected="true"]::after, .tab[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.tab .n, .count-badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 4px; background: var(--surface-3); color: var(--ink-2); font-size: 11.5px; font-weight: 600; line-height: 19px; text-align: center; font-variant-numeric: tabular-nums; }
.tab[aria-selected="true"] .n, .tab[aria-current="page"] .n { background: var(--accent-soft); color: var(--accent-deep); }
.work > .tabs { border-bottom: 1px solid var(--line); }

/* --------------------------------------------------------------- tiles -- */
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow); text-align: left; display: grid; gap: 2px; align-content: start; color: inherit; transition: border-color .12s, box-shadow .12s; }
.tile:hover { border-color: #AEB9CC; text-decoration: none; }
.tile[aria-pressed="true"] { border-color: var(--navy); box-shadow: inset 0 0 0 1.5px var(--navy), var(--shadow); }
.tile .label { font-size: 11.5px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.tile .v { font-size: 30px; font-weight: 400; line-height: 1.15; margin-top: 4px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile .v.small { font-size: 22px; line-height: 1.55; }
.tile .d { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.red .v { color: var(--red-brand); } .tile.amber .v { color: var(--gold); }
/* Toned tiles: a soft tint fading down the tile, the label in the same colour (docs/13 section 2). */
.tile.red { background: linear-gradient(180deg, #FDEDEB 0%, var(--surface) 78%); border-color: #F2CFCB; }
.tile.red .label { color: var(--red); }
.tile.amber { background: linear-gradient(180deg, #FAF2E3 0%, var(--surface) 78%); border-color: #EBDDBF; }
.tile.amber .label { color: var(--gold-text); }

/* --------------------------------------------------------------- cards -- */

.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 13px 16px; border-bottom: 1px solid var(--line-2); }
.card-h h2 { font-size: 15px; }
.card-h .sub { color: var(--ink-3); font-size: 12.5px; margin-top: 1px; }
.card-h .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-b { padding: 16px; }
.card-b.flush { padding: 0; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; font-size: 13.5px; }
.kv > div span, .kv label span { display: block; color: var(--ink-3); font-size: 12px; }
.kv b { font-weight: 600; }
.note { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 9px 12px; font-size: 13px; color: var(--ink-2); }
.note.warn { background: var(--amber-soft); border-color: #F1DDA8; color: var(--amber-ink); }
.note.quietrun { background: var(--gold-soft); border-color: #EBD9B4; color: var(--ink); }
.empty { padding: 40px 16px; text-align: center; color: var(--ink-3); font-size: 13.5px; }
.empty b { display: block; color: var(--ink); font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.empty .ring { width: 44px; height: 44px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; margin: 0 auto 12px; }
.empty .ring.blue { background: var(--accent-soft); color: var(--accent); }
.foot { padding: 10px 16px; font-size: 12.5px; color: var(--ink-3); border-top: 1px solid var(--line-2); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.messages { display: grid; gap: 8px; }
.messages .msg { padding: 9px 14px; border-radius: var(--r-sm); font-size: 13.5px; border: 1px solid var(--line); background: var(--surface); }
.messages .msg.success { border-color: #BFE0CC; background: var(--green-soft); color: var(--green-ink); }
.messages .msg.error { border-color: #F2C4C0; background: var(--red-soft); color: var(--red-ink); }

/* ------------------------------------------------------------ controls -- */
.filters { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--control); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.seg button, .seg a { border: 0; border-left: 1px solid var(--control); background: var(--surface); color: var(--ink-2); padding: 0 11px; height: 30px; display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 500; }
.seg > :first-child { border-left: 0; }
.seg button:hover, .seg a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.seg [aria-pressed="true"], .seg [aria-current="page"] { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }
select, input[type="text"], input[type="email"], input[type="search"], input[type="number"], input[type="time"], input[type="date"], input[type="datetime-local"], input[type="password"], textarea { font: inherit; font-size: 13.5px; color: var(--ink); background: var(--surface); border: 1px solid var(--control); border-radius: var(--r-sm); padding: 0 10px; height: 32px; max-width: 100%; transition: border-color .12s, box-shadow .12s; }
select { padding-right: 26px; }
textarea { min-height: 76px; height: auto; padding: 8px 10px; resize: vertical; width: 100%; }
select:hover, input:hover, textarea:hover { border-color: #A3ADBD; }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px rgba(52,133,189,.18); }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--accent); }
/* Date and time picker: the Control Room's own, in the brand colours, in place of the browser's. */
.dp-field { display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 10px; font: inherit; font-size: 13.5px; color: var(--ink); background: var(--surface); border: 1px solid var(--control); border-radius: var(--r-sm); text-align: left; cursor: pointer; font-variant-numeric: tabular-nums; transition: border-color .12s, box-shadow .12s; }
.dp-field:hover { border-color: #A3ADBD; }
.dp-field:focus-visible, .dp-field[aria-expanded="true"] { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px rgba(52,133,189,.18); }
.dp-field .ic { width: 15px; height: 15px; color: var(--navy); flex: none; }
.dp-field.empty .dp-text { color: var(--ink-3); }
.has-err .dp-field { border-color: var(--red); }
.dp-pop { position: absolute; z-index: 60; width: 300px; padding: 12px; display: grid; gap: 10px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-pop); }
.dp-pop.time-only { width: 250px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; }
.dp-head b { font-size: 14px; font-weight: 600; }
.dp-nav { width: 30px; height: 30px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.dp-nav:hover { background: var(--navy-soft); color: var(--navy); }
.dp-nav .ic { width: 14px; height: 14px; }
.dp-nav.prev .ic { transform: rotate(180deg); }
.dp-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.dp-dow { padding: 2px 0 6px; text-align: center; font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--ink-3); }
.dp-day { height: 34px; border: 0; border-radius: 7px; background: transparent; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; font-variant-numeric: tabular-nums; transition: background .1s; }
.dp-day:hover { background: var(--navy-soft); color: var(--navy); }
.dp-day.out { color: #A9B3C1; }
.dp-day.today { box-shadow: inset 0 0 0 1.5px var(--gold); font-weight: 600; }
.dp-day.sel, .dp-day.sel:hover { background: var(--navy); color: #fff; font-weight: 600; box-shadow: none; }
.dp-day:focus-visible { outline: 2px solid var(--sky); outline-offset: 1px; }
.dp-time { display: flex; align-items: center; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line-2); color: var(--ink-3); }
.dp-pop.time-only .dp-time { padding-top: 0; border-top: 0; }
.dp-time .ic { width: 15px; height: 15px; color: var(--navy); margin-right: 2px; }
.dp-time select { height: 32px; min-width: 66px; font-variant-numeric: tabular-nums; }
.dp-foot { display: flex; align-items: center; gap: 6px; }
.dp-foot .spacer { flex: 1; }
.dp-link { border: 0; background: none; padding: 5px 6px; border-radius: 6px; font: inherit; font-size: 13px; color: var(--link); cursor: pointer; }
.dp-link:hover { background: var(--navy-soft); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 13px; border-radius: var(--r-sm); border: 1px solid var(--control); background: var(--surface); color: var(--ink); font-weight: 500; font-size: 13px; line-height: 1.2; white-space: nowrap; transition: background .12s, border-color .12s, color .12s; }
.btn .ic { width: 15px; height: 15px; }
.btn:hover { background: var(--surface-2); border-color: #A3ADBD; color: var(--ink); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }
.btn.quiet { border-color: transparent; background: transparent; color: var(--link); }
.btn.quiet:hover { background: var(--accent-soft); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); border-color: #E6A8A2; color: var(--red-ink); }
.btn.icon { width: 32px; padding: 0; color: var(--ink-2); }
.btn.small { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.small.icon { width: 28px; padding: 0; }
.btn.block { width: 100%; height: 40px; font-size: 14px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.actrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* -------------------------------------------------------------- badges -- */
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 22px; padding: 0 8px; border-radius: 4px; font-size: 12px; font-weight: 500; line-height: 1.3; white-space: nowrap; margin: 0; background: var(--surface-3); color: var(--ink-2); }
.chip .ic { width: 12px; height: 12px; }
.chip.type, .chip.blue { background: var(--accent-soft); color: var(--accent-deep); }
.chip.red { background: var(--red-soft); color: var(--red-ink); }
.chip.amber { background: var(--amber-soft); color: var(--amber-ink); }
.chip.green { background: var(--green-soft); color: var(--green-ink); }
.chip.teal { background: var(--teal-soft); color: var(--teal); }
.chip.violet { background: var(--violet-soft); color: var(--violet); }
.chip.slate { background: var(--surface-3); color: var(--ink-2); }
.chip.ghost { background: var(--surface); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.chip.red::before, .chip.amber::before, .chip.green::before, .chip.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.chip.red::before { background: var(--red-brand); } .chip.amber::before { background: var(--amber-dot); } .chip.green::before { background: var(--green-dot); }
/* A state is a fact, not an alarm: an outlined neutral pill with a small dot, blue while the
   ball is with Emtec, grey otherwise. Colour is kept for the reason column. */
/* A state is a soft filled pill on one line with its own icon; the icon carries the meaning,
   the colour stays neutral (light Emtec blue while the ball is with us, light grey otherwise). */
.chip.state { white-space: nowrap; max-width: none; align-items: center; gap: 6px; padding: 4px 11px 4px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 500; background: #EEF1F5; color: #3F4B59; box-shadow: none; }
.chip.state .ic { width: 13px; height: 13px; flex: none; color: #6B7A8C; }
.chip.state.blue { background: #E6EEF7; color: #244870; }
.chip.state.blue .ic { color: var(--navy); }
.chip.state:has(> .ic)::before { display: none; }
.chip.state.slate::before { background: #8792A2; } .chip.state.blue::before { background: var(--navy); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.delta { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.delta.good { color: var(--green-ink); background: var(--green-soft); }
.delta.bad { color: var(--red-ink); background: var(--red-soft); }

/* -------------------------------------------------------------- tables -- */
.tablewrap { overflow-x: auto; }
table.q, table.s { width: 100%; border-collapse: collapse; }
table.q th, table.s th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: var(--surface-2); padding: 9px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.q td { padding: 11px 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; font-size: 13px; }
table.s td { padding: 10px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-size: 13.5px; }
table.s th { padding: 9px 14px; }
table.q tr.row { transition: background .1s; }
table.q tr.row:hover td, table.s tbody tr:hover td { background: #F6F9FC; }
table.q tr.row[aria-selected="true"] td { background: #EDF3F9; }
table.q tr.row[aria-selected="true"] td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
table.s tr:last-child td { border-bottom: 0; }
td.stripe { width: 6px; padding: 12px 0 12px 12px !important; }
td.stripe i { display: block; width: 4px; height: 100%; min-height: 36px; border-radius: 2px; background: transparent; }
.sev-red td.stripe i { background: var(--red-brand); } .sev-amber td.stripe i { background: var(--amber-dot); }
.cust { min-width: 170px; max-width: 250px; }
.cust a { font-weight: 600; font-size: 13.5px; }
.cust small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 1px; }
.snip { color: var(--ink-2); font-size: 13px; margin-top: 1px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.stack { display: flex; flex-wrap: wrap; gap: 4px; max-width: 184px; }
td.why { white-space: nowrap; }
.rec-reasons.why { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
td.why .chip, td.why .mute-reason { vertical-align: middle; }
.chased { display: inline-block; margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--gold-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rec-reasons .chased { margin-left: 0; }
.mute-reason { font-size: 12px; color: var(--ink-3); padding: 2px 0; }
.stack .chip { white-space: normal; align-items: flex-start; padding-top: 3px; padding-bottom: 3px; text-align: left; }
.stack .chip::before { margin-top: 4px; }
.resp { font-size: 12.5px; display: grid; grid-template-columns: auto auto; gap: 1px 8px; white-space: nowrap; justify-content: start; }
.resp > div { display: contents; }
.resp span { color: var(--ink-3); }
.resp b { font-weight: 500; color: var(--ink); }
.resp b.none { color: var(--red); font-weight: 600; }
.wait { font-weight: 600; white-space: nowrap; font-size: 14.5px; letter-spacing: -.005em; }
.wait.red { color: var(--red); } .wait.amber { color: var(--amber); }
/* Waiting follows the row: red on a past-target row, gold on an amber row, ink otherwise. */
tr.sev-red td.wait { color: var(--red); } tr.sev-amber td.wait { color: var(--gold-text); }
.wait small { display: block; font-weight: 400; color: var(--ink-3); font-size: 12px; }
.lmc { font-size: 13px; min-width: 84px; }
.lmc > :first-child, .lmc { white-space: nowrap; }
.lmc small { display: block; color: var(--ink-3); font-size: 12px; white-space: normal; max-width: 92px; line-height: 1.35; }
.lmc b.none { color: var(--red); font-weight: 600; }
table.q th.wrap { white-space: normal; min-width: 84px; max-width: 104px; line-height: 1.3; }
.owner { white-space: nowrap; font-size: 13px; display: inline-flex; align-items: center; gap: 7px; }
.av { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 10.5px; font-weight: 600; color: #fff; flex: none; background: var(--navy); }
.av.b { background: var(--sky-ink); } .av.c { background: var(--gold-text); }
/* One colour per person (docs/13 section 2): soft gradients from Emtec's shades. Identity only. */
.av.t1 { background: linear-gradient(135deg, #52A3DA, #2B79AE); }
.av.t2 { background: linear-gradient(135deg, #D4A85C, #A47628); }
.av.t3 { background: linear-gradient(135deg, #2F5C8A, #142A42); }
.av.t4 { background: linear-gradient(135deg, #9A7234, #5A3F12); }
.av.t5 { background: linear-gradient(135deg, #8C9BAE, #56667B); }
.av.t6 { background: linear-gradient(135deg, #C29445, #2F5C8A); }
.av[class*=" t"] { box-shadow: 0 0 0 2px var(--surface), 0 1px 3px rgba(20, 30, 45, .18); }
.av.ghost { background: var(--surface-3); color: var(--ink-2); }
.av.ghost .ic { width: 13px; height: 13px; }
/* Nobody yet: an empty dashed avatar and plain text. The No owner tile and filter find these. */
.noowner { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.noowner .av.ghost { background: #EEF2F6; color: #7C8899; box-shadow: inset 0 0 0 1px #DCE3EA; }
.facts b.noowner { color: var(--ink-3); font-weight: 500; }

.alert { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; padding: 12px 16px; border-radius: var(--r); border: 1px solid; font-size: 13.5px; }
.alert.red { background: var(--red-soft); border-color: #F4C3BE; color: var(--red-ink); }
.alert.amber { background: var(--amber-soft); border-color: #F1DDA8; color: var(--amber-ink); }
.alert .ic { width: 18px; height: 18px; margin-top: 1px; }
.alert b { display: block; font-weight: 600; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.tile .v.amber-v { color: var(--amber); }
.strong { font-weight: 600; }
.cell-sub { display: block; color: var(--ink-3); font-size: 12px; }
.checks { list-style: none; margin: 0; padding: 4px 16px; display: grid; }
.checks li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.checks li:last-child { border-bottom: 0; }
.checks.controls li { grid-template-columns: 10px minmax(0, 1fr) auto auto; }
.checks b.amber-v { color: var(--amber); }
.col-stack { display: grid; gap: 16px; align-content: start; min-width: 0; }
.fresh { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font-size: 13px; color: var(--ink-2); }
.fresh > .ic { width: 15px; height: 15px; color: var(--ink-3); flex: none; }
.fresh > span { flex: 1 1 320px; min-width: 0; }
.fresh b { color: var(--ink); font-weight: 600; }
.fresh form { margin-left: auto; }
.checks .k { color: var(--ink-2); }
.checks b { font-weight: 600; }
.sdot { width: 9px; height: 9px; border-radius: 50%; background: #8792A2; }
.sdot.green { background: var(--green-dot); box-shadow: 0 0 0 3px var(--green-soft); } .sdot.amber { background: var(--amber-dot); box-shadow: 0 0 0 3px var(--amber-soft); } .sdot.red { background: var(--red-brand); box-shadow: 0 0 0 3px var(--red-soft); }

.chip.low { box-shadow: inset 0 0 0 1.5px var(--amber-dot); }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.lowdot { width: 12px; height: 12px; border-radius: 3px; box-shadow: inset 0 0 0 1.5px var(--amber-dot); }
.confs { display: grid; gap: 4px; min-width: 190px; }
.conf-row { display: grid; grid-template-columns: 64px minmax(60px, 1fr) 38px; gap: 8px; align-items: center; font-size: 12px; color: var(--ink-2); }
.conf-row b { font-weight: 600; text-align: right; color: var(--ink); }
.cbar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.cbar i { display: block; height: 100%; border-radius: 3px; background: var(--sky); }
.conf-row.low { color: var(--amber-ink); } .conf-row.low b { color: var(--amber); } .conf-row.low .cbar i { background: var(--amber-dot); }
td.row-acts { text-align: right; white-space: nowrap; }
td.row-acts form { display: inline; }
table.validate td { vertical-align: top; }

/* --------------------------------------------------------------- forms -- */
.form { display: grid; gap: 14px; max-width: 640px; }
.form .field { display: grid; gap: 5px; }
.form .field > label { font-weight: 500; font-size: 13px; color: var(--ink-2); }
.form .help { color: var(--ink-3); font-size: 12.5px; }
.form .err { color: var(--red); font-size: 12.5px; }
.form .check { display: flex; align-items: center; gap: 10px; }
.form .check label { font-weight: 500; }
.form .acts { display: flex; gap: 8px; align-items: center; padding-top: 6px; flex-wrap: wrap; }
.form .acts .spacer { flex: 1; }
.errorlist { color: var(--red); font-size: 12.5px; margin: 0; padding-left: 0; list-style: none; }

/* ------------------------------------------------------------ settings -- */
.set-group { display: grid; gap: 10px; }
.set-group-h { display: flex; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; }
.set-group-h h2 { font-size: 14px; font-weight: 600; color: var(--ink); }
.set-group-h p { font-size: 12.5px; color: var(--ink-3); }
/* At a glance: the four states that decide what the Control Room does right now. */
.glance { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.glance-item { display: grid; gap: 4px; align-content: start; padding: 13px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); color: inherit; transition: border-color .12s, box-shadow .12s, transform .12s; }
.glance-item:hover { text-decoration: none; border-color: #A9B8C9; box-shadow: 0 4px 14px rgba(18,26,36,.07); transform: translateY(-1px); }
.gl-k { display: flex; align-items: center; gap: 9px; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.gl-v { font-size: 19px; font-weight: 500; color: var(--ink); line-height: 1.3; }
.gl-v.amber { color: var(--amber); } .gl-v.gold { color: var(--gold-text); } .gl-v.slate { color: var(--ink-2); }
.gl-hint { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; color: var(--link); }
.gl-hint .ic { width: 12px; height: 12px; }
.sdot.gold { background: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.sdot.slate { background: #8792A2; box-shadow: 0 0 0 3px #EEF1F5; }
/* What is left to set up: each line a link to its section. */
.setup-todo { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px 16px; background: var(--gold-soft); border: 1px solid rgba(184,137,59,.35); border-radius: var(--r); color: var(--gold-ink); font-size: 13px; }
.st-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface); color: var(--gold-text); }
.st-ic .ic { width: 17px; height: 17px; }
.setup-todo b { font-size: 13.5px; color: var(--gold-ink); }
.setup-todo ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.setup-todo li { display: flex; gap: 6px 10px; flex-wrap: wrap; }
.setup-todo li a { font-weight: 600; color: var(--navy); min-width: 150px; }
/* Section cards: icon in the group's colour, a status line in words, an arrow. */
.sections { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.section-card { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 14px; align-items: stretch; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); color: inherit; transition: border-color .12s, box-shadow .12s, transform .12s; }
.section-card:hover { border-color: #A9B8C9; box-shadow: 0 6px 18px rgba(18,26,36,.08); text-decoration: none; transform: translateY(-1px); }
.section-card:hover h3 { color: var(--link); }
.sc-ic { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--navy-soft); color: var(--navy); flex: none; align-self: start; }
.sc-ic .ic { width: 19px; height: 19px; }
.set-group.tone-sky .sc-ic { background: var(--sky-soft); color: var(--sky-ink); }
.set-group.tone-gold .sc-ic { background: var(--gold-soft); color: var(--gold-text); }
.sc-ic.small { width: 30px; height: 30px; border-radius: 7px; }
.sc-ic.small .ic { width: 16px; height: 16px; }
.sc-body { display: grid; grid-template-rows: auto 1fr auto; gap: 4px; min-width: 0; }
.sc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sc-go { width: 14px; height: 14px; color: var(--ink-3); transition: transform .12s, color .12s; flex: none; }
.section-card:hover .sc-go { color: var(--link); transform: translateX(2px); }
.section-card h3 { font-size: 15px; color: var(--ink); }
.section-card p { color: var(--ink-2); font-size: 12.5px; line-height: 1.45; }
.sc-status { display: flex; align-items: center; gap: 9px; margin-top: 6px; padding-top: 9px; border-top: 1px solid var(--line-2); font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.sc-status .sdot { flex: none; }
.sc-status.amber { color: var(--gold-text); }
.changes { list-style: none; margin: 0; padding: 0; display: grid; font-size: 13px; }
.changes li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line-2); color: var(--ink-2); }
.changes li:first-child { padding-top: 0; }
.changes li:last-child { border-bottom: 0; padding-bottom: 0; }
.changes .av { width: 26px; height: 26px; font-size: 10px; }
.changes .t { color: var(--ink-3); white-space: nowrap; font-size: 12px; padding-top: 3px; }
.changes b { color: var(--ink); font-weight: 600; }
.ch-diffs { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px; font-size: 12.5px; }
.diff { display: inline-block; background: var(--surface-3); border-radius: 4px; padding: 0 6px; color: var(--ink-2); text-decoration: line-through; text-decoration-color: rgba(69,81,95,.4); }
.diff.new { background: var(--navy-soft); color: var(--navy-deep); text-decoration: none; font-weight: 600; }
.settings-table td { vertical-align: middle; }
.settings-table .row-link { color: var(--ink); font-weight: 600; }
.settings-table .row-link:hover { color: var(--link); }
.settings-table .ic.yes { width: 18px; height: 18px; color: var(--green-dot); vertical-align: middle; }
.settings-table .no { color: var(--ink-3); }
.settings-table tr.inactive td { color: var(--ink-3); background: var(--surface-2); }
.settings-table tr.inactive .row-link { color: var(--ink-3); font-weight: 500; }
.btn.danger-solid { background: var(--red-strong); border-color: var(--red-strong); color: #fff; }
.btn.danger-solid:hover { background: var(--red-ink); border-color: var(--red-ink); color: #fff; }
.btn.icon.danger { color: var(--red); }
.set-form { max-width: 860px; }
.fgroup { border: 0; margin: 0; padding: 16px 20px 18px; border-bottom: 1px solid var(--line-2); min-width: 0; }
.fgroup legend { float: left; width: 100%; padding: 0; margin-bottom: 12px; font-size: 13px; font-weight: 600; color: var(--ink); }
.fgrid { clear: both; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.ffield { display: grid; gap: 5px; align-content: start; min-width: 0; }
.ffield.wide { grid-column: 1 / -1; }
.ffield > label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.ffield input[type="text"], .ffield input[type="email"], .ffield input[type="number"], .ffield input[type="time"], .ffield input[type="datetime-local"], .ffield select, .ffield textarea { width: 100%; height: 36px; }
.ffield textarea { height: auto; }
.ffield .err { color: var(--red); font-size: 12.5px; }
.ffield.has-err input, .ffield.has-err select { border-color: var(--red); }
.with-unit { display: flex; align-items: stretch; }
.with-unit input { border-top-right-radius: 0; border-bottom-right-radius: 0; min-width: 0; }
.unit { display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--control); border-left: 0; border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--surface-2); color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }
.switch { position: relative; display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 13.5px; color: var(--ink); cursor: pointer; align-self: end; }
.switch input { position: absolute; opacity: 0; width: 36px; height: 20px; margin: 0; cursor: pointer; }
.switch .track { position: relative; width: 36px; height: 20px; border-radius: 10px; background: var(--control); flex: none; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(18,26,36,.25); transition: transform .15s; }
.switch input:checked + .track { background: var(--navy); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--sky); outline-offset: 2px; }
.sw-label { font-weight: 500; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-choice { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 10px; border: 1px solid var(--control); border-radius: 999px; font-size: 13px; cursor: pointer; background: var(--surface); }
.pill-choice:has(input:checked) { border-color: var(--navy); background: var(--navy-soft); color: var(--navy-deep); font-weight: 500; }
.set-foot { border-radius: 0 0 var(--r) var(--r); }
@media (max-width: 760px) { .fgrid { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------ briefing -- */
.briefing-paused { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.briefing-paused .ic { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.briefing-layout { display: grid; grid-template-columns: minmax(0, 660px) minmax(360px, 1fr); gap: 20px; align-items: start; }
.briefing-side { display: grid; gap: 16px; min-width: 0; }
.mailframe { background: var(--surface-3); padding: 14px; border-radius: 0 0 var(--r) var(--r); }
.mailframe table { max-width: 100% !important; }
.mail-meta { display: grid; grid-template-columns: 70px 1fr; gap: 5px 12px; font-size: 13px; color: var(--ink-2); padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.mail-meta span { color: var(--ink-3); }
.recipients { display: flex; flex-wrap: wrap; gap: 6px; }
.recipient { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px 3px 3px; }
.recipient .av { width: 22px; height: 22px; font-size: 10px; }
.log td { vertical-align: middle; }
.log td:last-child { min-width: 140px; }
.log td, .log th { padding-left: 10px; padding-right: 10px; }

/* -------------------------------------------------------------- detail -- */
/* The request drawer slides over the right of the list, full height under the top bar. */
.drawer { position: fixed; z-index: 22; top: var(--hdr-h); right: 0; bottom: 0; width: min(560px, calc(100vw - 48px)); overflow-y: auto; overscroll-behavior: contain; background: var(--bg); border-left: 1px solid var(--line); box-shadow: -18px 0 40px rgba(20, 30, 45, .14); padding: 16px; animation: drawer-in .18s ease-out; }
.drawer .record { border-radius: var(--r); }
@keyframes drawer-in { from { transform: translateX(24px); opacity: .4; } to { transform: none; opacity: 1; } }
table.q tr.row { cursor: pointer; }
.record { overflow: visible; }
.rec-top { padding: 14px 18px 0; }
.rec-crumb { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); min-height: 28px; }
.rec-crumb > span:first-child { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; min-width: 0; }
.rec-crumb .ic { width: 12px; height: 12px; }
.rec-crumb .tools { margin-left: auto; display: flex; gap: 4px; }
.rec-top h2 { font-size: 21px; line-height: 1.25; margin-top: 2px; }
.rec-top .subj { color: var(--ink-2); font-size: 14px; margin-top: 1px; }
.facts { display: grid; grid-template-columns: 1.3fr 1fr 1.1fr .8fr; gap: 10px; margin-top: 14px; padding: 11px 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.facts > div { min-width: 0; }
/* The label only: a plain .facts span would also catch the owner's avatar and grey out its initials. */
.facts > div > span { display: block; font-size: 12px; color: var(--ink-3); }
.facts b { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; line-height: 1.35; }
.facts b.red { color: var(--red); font-weight: 600; }
.facts .av { width: 20px; height: 20px; font-size: 9.5px; }
.rec-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 12px 0; }
.rec-acts .btn:not(.icon) { padding: 0 10px; }
.rec-acts form { margin: 0; }
.rec-acts .more { margin-left: auto; }
.rec-acts .menu { width: 260px; }
.menu .mi { display: block; }
.menu .mi button[disabled] { pointer-events: none; }
.rec-reasons { padding-bottom: 12px; }
.rec-tabs { padding: 0 18px; border-bottom: 1px solid var(--line); gap: 20px; }
.rec-tabs .tab { padding: 8px 0 10px; font-size: 13.5px; }
.rec-tabs .attn { width: 7px; height: 7px; border-radius: 50%; background: var(--amber-dot); box-shadow: 0 0 0 3px var(--amber-soft); }
.pane { padding: 16px 18px 18px; display: grid; gap: 16px; }
.pane[hidden] { display: none; }
/* The full request page: on a wide screen the conversation sits beside the overview,
   and the tabs on the left switch between the overview and the AI reading. */
.record-page { max-width: 1280px; }
.conv-t { display: none; }
@media (min-width: 1180px) {
  .record-page .record { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto 1fr; }
  .record-page .rec-top { grid-column: 1 / -1; }
  .record-page .rec-tabs { grid-column: 1; grid-row: 2; }
  .record-page .rec-tabs [data-panel-tab="conversation"] { display: none; }
  .record-page .pane { grid-column: 1; grid-row: 3; align-content: start; }
  .record-page .pane[data-pane="conversation"] { display: grid; grid-column: 2; grid-row: 2 / span 2; padding-top: 0; border-left: 1px solid var(--line); }
  .record-page .conv-t { display: flex; align-items: center; gap: 6px; margin: 0 -18px; padding: 8px 18px 10px; border-bottom: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--ink); }
}
.sec-t { font-size: 13px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 2px; margin-bottom: 8px; }
.sec-t .muted { margin-left: auto; font-weight: 400; font-size: 12px; }
.quote { border-left: 3px solid var(--line); padding: 2px 0 2px 12px; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.axes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.axis { border: 1px solid var(--line); border-top: 3px solid var(--green-dot); border-radius: var(--r-sm); padding: 10px 12px; display: grid; gap: 3px; align-content: start; min-width: 0; }
.axis.owed { border-top-color: var(--amber-dot); }
.axis h5 { margin: 0; font-size: 12px; color: var(--ink-3); font-weight: 500; }
.axis .big { font-weight: 600; font-size: 15px; line-height: 1.3; }
.axis .big.green { color: var(--green); } .axis .big.amber { color: var(--amber-ink); } .axis .big.red { color: var(--red); }
.axis .line { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.clock { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 12.5px; padding: 4px 0; }
.clock .lab { color: var(--ink-2); }
.bar { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; background: var(--sky); }
.bar.red i { background: var(--red-brand); } .bar.green i { background: var(--green-dot); }
.clock .v { white-space: nowrap; font-weight: 600; font-size: 12.5px; }
.clock .v small { color: var(--ink-3); font-weight: 400; }
.clock .v.red { color: var(--red); } .clock .v.green { color: var(--green); }
.clock-note { font-size: 12px; color: var(--ink-3); }
.kv label select { width: 100%; }
.kv .check { display: flex; align-items: center; gap: 8px; align-self: end; font-size: 13px; }
.kv-acts { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.composer { border: 1px solid var(--control); border-radius: var(--r-sm); overflow: hidden; transition: border-color .12s, box-shadow .12s; }
.composer:focus-within { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(52,133,189,.18); }
.composer textarea { display: block; border: 0; border-radius: 0; min-height: 60px; box-shadow: none !important; }
.composer > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; background: var(--surface-2); border-top: 1px solid var(--line-2); }
.composer .hint { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.composer .hint .ic { width: 13px; height: 13px; }
.stream { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.stream .act { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; }
.stream .ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--sky); }
.stream .ico .ic { width: 15px; height: 15px; }
.stream .act.outbound .ico { background: var(--green-dot); }
.stream .act.internal .ico { background: var(--navy); }
.stream .act.note .ico { background: var(--gold); }
.stream .body { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 12px; background: var(--surface); min-width: 0; }
.stream .act.note .body { background: var(--note-bg); border-color: var(--note-line); }
.stream .who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }
.stream .who b { color: var(--ink); font-size: 13px; font-weight: 600; }
.stream p { margin-top: 2px; color: var(--ink); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.stream .olk { margin-left: auto; color: var(--ink-3); display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 5px; }
.stream .olk:hover { background: var(--surface-3); color: var(--link); }
.stream .olk .ic { width: 14px; height: 14px; }
.stream .after { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.stream .after .chip { min-height: 20px; font-size: 11.5px; }
.stream .tag { display: inline-flex; align-items: center; height: 19px; padding: 0 7px; border-radius: 4px; font-size: 11px; font-weight: 500; color: var(--accent-deep); background: var(--accent-soft); }
.stream .tag.delivered { color: var(--green-ink); background: var(--green-soft); }
.stream .tag.holding { color: var(--ink-2); background: var(--surface-3); }
.stream .ev { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: center; font-size: 12.5px; color: var(--ink-3); }
.stream .ev .dot { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--control); justify-self: center; }
.stream .ev b { color: var(--ink-2); font-weight: 600; }
.stream .ev.red { color: var(--red); } .stream .ev.red .dot { border-color: var(--red); }
.stream .ev .when { margin-left: 8px; font-size: 11.5px; color: var(--ink-3); }

/* ------------------------------------------------------------- reports -- */
.section-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.section-title h2 { font-size: 15px; }
.section-title .muted { font-size: 12.5px; }
.mtiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mtiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mtile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px 14px 10px; display: grid; gap: 2px; min-width: 0; }
.mtile .label { font-size: 13px; font-weight: 500; }
.mtile-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mtile-value { font-size: 28px; font-weight: 400; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.mtile-prev { font-size: 12px; color: var(--ink-3); }
.mtile-prev b { color: var(--ink-2); font-weight: 600; }
.mtile-spark { margin-top: 6px; height: 36px; }
.mtile-spark .spark { width: 100%; height: 36px; display: block; }
.mtile.warn .mtile-value { color: var(--amber); }
.spark-empty { display: flex; align-items: center; height: 36px; font-size: 11.5px; color: var(--ink-3); border-top: 1px dashed var(--line); }
.spark .hit { cursor: crosshair; }
.spark .hit:hover + .pt { opacity: 1; }
.owed-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.owed-grid .owed { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; display: grid; gap: 2px; border-left: 3px solid var(--line); }
.owed-grid .owed span { font-size: 12.5px; color: var(--ink-2); }
.owed-grid .owed b { font-size: 22px; font-weight: 400; line-height: 1.2; display: flex; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; }
.owed-grid .owed b small { font-size: 12px; color: var(--ink-3); }
.owed-grid .owed.big b { font-size: 28px; }
.owed-grid .owed.red { border-left-color: var(--red-brand); } .owed-grid .owed.red b { color: var(--red-brand); }
.owed-grid .owed.total { grid-column: 1 / -1; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 14px; border-left-color: var(--navy); }
.owed-grid .owed.total span { grid-column: 1 / -1; }
.owed-grid .owed:not(.total) { align-content: space-between; }
.owed-grid .owed.total b { font-size: 40px; }
.owed-grid .owed.total em { font-style: normal; font-size: 12.5px; color: var(--ink-2); }
.owed-grid .owed.total em.red { color: var(--red); font-weight: 600; }
.owed-then { margin: 12px 0 0; font-size: 12.5px; color: var(--ink-2); }
.owed-grid .owed.slate { border-left-color: #8792A2; } .owed-grid .owed.amber { border-left-color: var(--amber-dot); } .owed-grid .owed.teal { border-left-color: var(--teal); }
.signals { list-style: none; margin: 0; padding: 4px 16px 8px; display: grid; }
.signals li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.signals li:last-child { border-bottom: 0; }
.signals b { font-weight: 600; font-size: 14px; min-width: 32px; text-align: right; }
.signals b.warn { color: var(--amber); }
.throughput { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, 1fr); gap: 18px; padding: 16px; align-items: start; }
.throughput .chart svg { width: 100%; height: auto; }
.bar-rect { cursor: pointer; transition: opacity .12s; }
.bar-rect:hover { opacity: .8; }
details.defs { padding: 0; }
details.defs summary { list-style: none; cursor: pointer; padding: 13px 16px; display: flex; align-items: baseline; gap: 12px; }
details.defs summary::-webkit-details-marker { display: none; }
details.defs summary::before { content: "+"; color: var(--ink-3); margin-right: 2px; }
details.defs[open] summary::before { content: "\2212"; }
details.defs summary h2 { font-size: 15px; }
details.defs dl { margin: 0; padding: 0 16px 16px; display: grid; gap: 8px; }
details.defs dl > div { display: grid; grid-template-columns: 240px 1fr; gap: 14px; font-size: 13px; }
details.defs dt { font-weight: 600; color: var(--ink); }
details.defs dd { margin: 0; color: var(--ink-2); }

/* --------------------------------------------------------------- guide -- */
.guide { max-width: 1120px; display: grid; gap: 16px; }
.g-pane { display: grid; gap: 16px; }
.g-pane[hidden] { display: none; }
.card-h > .sub { margin: 0 0 0 4px; }
.g-hero .card-b { display: grid; gap: 6px; padding: 22px 22px 18px; }
.g-hero h2 { font-size: 20px; line-height: 1.3; }
.g-hero p { color: var(--ink-2); font-size: 14.5px; max-width: 70ch; }
.principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line-2); }
.principle { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 16px 20px; align-items: start; }
.principle + .principle { border-left: 1px solid var(--line-2); }
.p-ic { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-ink); }
.p-ic .ic { width: 18px; height: 18px; }
.principle b { display: block; font-size: 14px; }
.principle span { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.ladder { list-style: none; counter-reset: rung; margin: 0; padding: 8px 20px 4px; display: grid; }
.ladder li { counter-increment: rung; display: grid; grid-template-columns: 28px minmax(220px, max-content) minmax(0, 1fr); gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; color: var(--ink-2); }
.ladder li:last-child { border-bottom: 0; }
.ladder li::before { content: counter(rung); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--hdr); color: #fff; font-size: 12px; font-weight: 600; }
.ladder .chip { justify-self: start; }
.g-foot { display: flex; align-items: flex-start; gap: 8px; padding: 12px 20px 16px; font-size: 12.5px; color: var(--ink-3); }
.card-b .g-foot { padding: 12px 0 0; }
.g-foot .ic { width: 14px; height: 14px; margin-top: 2px; flex: none; }
.g-lead { padding: 14px 20px 0; font-size: 13.5px; color: var(--ink-2); max-width: 70em; }
.g-prose { display: grid; gap: 12px; font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.g-prose p { max-width: 70em; }
.g-callout { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; align-items: start; padding: 12px 14px; border-radius: var(--r-sm); background: var(--gold-soft); border: 1px solid rgba(184,137,59,.35); color: var(--gold-ink); }
.g-callout .ic { width: 16px; height: 16px; margin-top: 2px; color: var(--gold-text); }
.g-callout b { color: var(--gold-ink); }
.g-example { padding: 6px 4px 0; }
.g-example table.q tr.row:hover td { background: transparent; }
.g-example td[data-tip]:hover { background: var(--sky-soft) !important; }
.terms { margin: 0; padding: 8px 20px 14px; display: grid; }
.terms > div { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.terms > div:last-child { border-bottom: 0; }
.terms dt { font-weight: 600; color: var(--ink); }
.terms dd { margin: 0; color: var(--ink-2); }
.chip-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; padding: 6px 20px 12px; }
.chip-grid > div { display: grid; grid-template-columns: minmax(200px, max-content) minmax(0, 1fr); gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; color: var(--ink-2); }
.chip-grid .chip, .chip-grid .mute-reason { justify-self: start; }
.g-axes { display: grid; gap: 14px; }
.g-mail { margin: 0; border-left: 3px solid var(--gold); padding: 4px 0 4px 14px; display: grid; gap: 4px; }
.g-mail figcaption { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.g-mail blockquote { margin: 0; color: var(--ink); font-size: 14px; line-height: 1.55; }
.flows { display: grid; gap: 8px; }
.flow { display: grid; grid-template-columns: 250px minmax(0, 1fr) 250px; align-items: center; gap: 12px; }
.flow-from { justify-self: end; }
.flow-how { position: relative; isolation: isolate; font-size: 12.5px; color: var(--ink-2); text-align: center; padding: 0 14px 0 6px; }
.flow-how::before { content: ""; position: absolute; left: 0; right: 8px; top: 50%; border-top: 1.5px dashed var(--control); z-index: -1; }
.flow-how::after { content: ""; position: absolute; right: 2px; top: calc(50% - 4px); border-left: 7px solid var(--ink-3); border-top: 4px solid transparent; border-bottom: 4px solid transparent; }
.flow-how > span { position: relative; background: var(--surface); padding: 0 8px; }
.flow .chip.state { max-width: none; white-space: nowrap; }
.clocks-table td:first-child { white-space: nowrap; width: 200px; }
.actions-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.action { display: grid; grid-template-columns: 180px 1fr; gap: 12px; align-items: center; padding: 11px 20px; border-bottom: 1px solid var(--line-2); }
.action:nth-child(odd) { border-right: 1px solid var(--line-2); }
.action:nth-last-child(-n+2) { border-bottom: 0; }
.action .btn { justify-self: start; pointer-events: none; }
.action p { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.keys { list-style: none; margin: 0; padding: 6px 20px 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.keys li { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; color: var(--ink-2); }
@media (max-width: 1100px) { .principles, .actions-grid, .chip-grid, .keys { grid-template-columns: minmax(0, 1fr); } .principle + .principle { border-left: 0; border-top: 1px solid var(--line-2); } .action:nth-child(odd) { border-right: 0; } .flow { grid-template-columns: 1fr; gap: 4px; } .flow-from { justify-self: start; } .flow-how { text-align: left; } .flow-how::before, .flow-how::after { display: none; } }
@media (max-width: 760px) { .ladder li, .terms > div, .chip-grid > div { grid-template-columns: minmax(0, 1fr); gap: 4px; } .ladder li::before { display: none; } }

/* -------------------------------------------------------------- people -- */
table.people th { white-space: normal; vertical-align: bottom; line-height: 1.3; }
table.people th.n { max-width: 110px; }
table.people .n { text-align: right; }
table.people td { padding: 10px 16px; }
table.people th { padding: 9px 16px; }
table.people tfoot td { font-weight: 600; border-top: 1px solid var(--line); background: var(--surface-2); }
table.people tr.unattributed td { background: var(--amber-soft); }
.notice { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--ink-3); max-width: 100ch; }
.notice .ic { margin-top: 2px; }

/* ------------------------------------------------------------- dialogs -- */
dialog { border: 0; border-radius: 10px; padding: 0; width: min(92vw, 470px); box-shadow: var(--shadow-dialog); color: var(--ink); background: var(--surface); }
dialog[open] { animation: dlg-in .14s ease-out; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
dialog::backdrop { background: rgba(15,23,35,.45); }
dialog form { display: grid; gap: 0; padding: 0; }
.dlg-h { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.dlg-ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-deep); }
.dlg-ic .ic { width: 17px; height: 17px; }
.dlg-h.warn .dlg-ic { background: var(--amber-soft); color: var(--amber-ink); }
.dlg-h.danger .dlg-ic { background: var(--red-soft); color: var(--red-ink); }
.dlg-x { border: 0; background: transparent; color: var(--ink-3); width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; margin: -4px -6px 0 0; }
.dlg-x:hover { background: var(--surface-3); color: var(--ink); }
.dlg-x .ic { width: 16px; height: 16px; }
dialog h3 { font-size: 16px; line-height: 1.35; }
dialog p.lead { color: var(--ink-2); font-size: 13px; margin-top: 2px; line-height: 1.5; }
.dlg-b { display: grid; gap: 14px; padding: 16px 18px; }
dialog label { display: grid; gap: 5px; font-size: 13.5px; }
dialog label > span { color: var(--ink-2); font-size: 12.5px; font-weight: 500; }
dialog label > span em { font-style: normal; font-weight: 400; }
dialog input[type="text"], dialog select, dialog textarea { width: 100%; height: 34px; }
dialog textarea { height: auto; }
dialog .choices { display: grid; gap: 6px; max-height: 46vh; overflow-y: auto; }
dialog .choice { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; font-size: 13.5px; line-height: 1.4; transition: border-color .12s, background .12s; }
dialog .choice:hover { background: var(--surface-2); }
dialog .choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
dialog .choice input { margin: 2px 0 0; }
dialog .choice b { font-weight: 600; }
dialog .choice small { display: block; color: var(--ink-3); font-size: 12.5px; }
dialog .choice .meta { display: flex; gap: 8px; align-items: center; color: var(--ink-3); font-size: 12px; margin-bottom: 3px; }
dialog .acts, .dlg-f { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 10px 10px; }
.dlg-f .hint { margin-right: auto; font-size: 12px; color: var(--ink-3); display: inline-flex; gap: 6px; align-items: center; }
.dlg-f .hint .ic { width: 13px; height: 13px; }

/* ------------------------------------------------------- toast and tip -- */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translateX(-50%) translateY(10px); display: flex; align-items: center; gap: 10px; background: var(--hdr); color: #fff; padding: 10px 16px 10px 12px; border-radius: var(--r); font-size: 13.5px; box-shadow: 0 14px 36px rgba(15,23,35,.3); opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; max-width: min(92vw, 520px); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast::before { content: ""; flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--green-dot) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 13px no-repeat; }
.tip { position: fixed; z-index: 60; left: 0; top: 0; max-width: 290px; background: var(--hdr); color: rgba(255,255,255,.88); font-size: 12.5px; line-height: 1.45; padding: 8px 11px; border-radius: 7px; box-shadow: 0 12px 30px rgba(15,23,35,.3); pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .12s, visibility .12s; text-align: left; white-space: normal; font-weight: 400; letter-spacing: 0; text-transform: none; }
.tip.show { opacity: 1; visibility: visible; }
.tip b { display: block; color: #fff; font-weight: 600; margin-bottom: 2px; }
.tip::after { content: ""; position: absolute; left: var(--ax, 50%); top: 100%; margin-left: -6px; border: 6px solid transparent; border-top-color: var(--hdr); }
.tip.below::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--hdr); }
.tip.side::after { left: -6px; top: 50%; margin: -6px 0 0 -6px; border-top-color: transparent; border-right-color: var(--hdr); }
.info { display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0; margin: 0 0 0 4px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); vertical-align: -4px; cursor: help; }
.info .ic { width: 14px; height: 14px; }
.info:hover, .info:focus-visible { color: var(--accent-deep); background: var(--accent-soft); }
th .info { width: 16px; height: 16px; margin-left: 3px; }
th .info .ic { width: 13px; height: 13px; }
[data-tip]:not(a, button, .tile, .hit, .bar-rect, .info, .nav) { cursor: help; }
.tipped { text-decoration: underline dotted color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.hgroup { display: flex; align-items: center; gap: 2px; }

/* ---------------------------------------------------------- responsive -- */
@media (max-width: 1500px) { .search { width: 272px; } }
@media (max-width: 1360px) {
    .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .sections { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  .briefing-layout, .throughput { grid-template-columns: minmax(0, 1fr); }
  .mtiles, .mtiles.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hdr-mid { display: none; }
  .hdr-right { margin-left: auto; }
}
@media (max-width: 1120px) { .two { grid-template-columns: minmax(0, 1fr); } .hpill { display: none; } .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .action { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .app, body.rail-collapsed .app { grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; z-index: 25; left: 0; top: var(--hdr-h); bottom: 0; height: auto; width: 260px; transform: translateX(-100%); transition: transform .18s ease; box-shadow: var(--shadow-pop); }
  body.rail-open .rail { transform: none; }
  body.rail-collapsed .nav { justify-content: flex-start; padding: 0 10px; gap: 12px; } body.rail-collapsed .nav .lbl { display: inline; }
  .hdr .brand span:last-child, .search, .hpill { display: none; }
  .pagehead, .work, .band { padding-left: 16px; padding-right: 16px; }
  .tiles, .tiles.four, .tiles.three, .sections, .mtiles, .mtiles.four, .owed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .sections { grid-template-columns: minmax(0, 1fr); }
  .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { margin-left: 0; width: 100%; }
  .kv, .axes { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  details.defs dl > div { grid-template-columns: 1fr; }
  /* The list becomes cards: customer, reason, then waiting, status and owner on one line. */
  table.q thead { display: none; }
  table.q, table.q tbody { display: block; }
  table.q tr.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; position: relative; padding: 12px 14px 12px 20px; border-bottom: 1px solid var(--line-2); }
  table.q tr.row td { display: block; padding: 0; border: 0; background: transparent !important; }
  table.q tr.row td.stripe { position: absolute; left: 6px; top: 12px; bottom: 12px; padding: 0 !important; }
  table.q tr.row td.stripe i { min-height: 0; }
  table.q tr.row td.cust, table.q tr.row td.why { flex: 1 0 100%; max-width: none; min-width: 0; }
  table.q tr.row td.wait small { display: inline; margin-left: 6px; }
  .drawer { width: 100vw; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@media print { .hdr, .rail, .filters, .btn { display: none !important; } .app { grid-template-columns: 1fr; } .card { box-shadow: none; } }

/* ---------------------------------------------------------------- auth -- */
body.auth { background: var(--surface); }
.auth-shell { min-height: 100%; display: grid; grid-template-columns: minmax(400px, 46%) minmax(0, 1fr); }
/* The brand panel: deep blue with the logo's two colours as faint glows, the mark as a watermark. */
.auth-brand { position: relative; overflow: hidden; isolation: isolate; box-shadow: inset -3px 0 0 var(--gold); background: radial-gradient(65% 55% at 0% 0%, rgba(52,133,189,.30), transparent 70%), radial-gradient(50% 45% at 100% 100%, rgba(243,120,62,.16), transparent 72%), linear-gradient(165deg, #1C3858 0%, var(--hdr) 52%, #0F2036 100%); color: var(--hdr-ink); padding: 44px 56px; display: flex; flex-direction: column; gap: 36px; }
.auth-watermark { position: absolute; right: -70px; bottom: -50px; width: 440px; opacity: .07; z-index: -1; pointer-events: none; }
.auth-brand .brand b { font-size: 16px; color: #fff; }
.auth-brand .brand span:last-child { color: var(--hdr-ink-2); font-size: 15px; }
.auth-brand .brand-mark { width: 38px; }
.auth-copy { margin-top: auto; display: grid; gap: 14px; max-width: 30em; }
.auth-kicker { font-size: 12px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: #E2C68E; }
.auth-copy h1 { font-size: 34px; line-height: 1.2; color: #fff; letter-spacing: -.02em; text-wrap: balance; }
.auth-copy p { color: var(--hdr-ink-2); font-size: 15.5px; line-height: 1.55; }
.auth-points { list-style: none; margin: 0 0 auto; padding: 20px 22px; display: grid; gap: 18px; max-width: 31em; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.09); border-radius: 14px; backdrop-filter: blur(6px); box-shadow: 0 18px 40px rgba(5,12,22,.25); }
.auth-points li { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 14px; align-items: start; }
.auth-points .ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: rgba(226,198,142,.10); border: 1px solid rgba(226,198,142,.22); color: #E2C68E; }
.auth-points .ico .ic { width: 17px; height: 17px; }
.auth-points b { display: block; color: #fff; font-weight: 600; font-size: 14px; }
.auth-points span { color: var(--hdr-ink-2); font-size: 13px; }
.auth-foot { color: var(--hdr-ink-2); font-size: 12px; }
/* The sign-in side: light ground, one card with the full-colour logo and a brand line on top. */
.auth-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 40px 24px; background: radial-gradient(70% 50% at 50% 0%, #FFFFFF 0%, rgba(255,255,255,0) 70%), var(--bg); }
.auth-card { position: relative; overflow: hidden; width: min(100%, 420px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 2px rgba(20,30,45,.05), 0 18px 44px rgba(20,30,45,.09); padding: 34px 34px 30px; display: grid; gap: 14px; }
.auth-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, #1D61A1 0%, #2A92CD 48%, #EF4F37 72%, #F9A34A 100%); }
.auth-logo { display: block; width: 196px; height: auto; margin: 2px 0 10px; }
.auth-card h2 { font-size: 21px; letter-spacing: -.01em; }
.auth-lead { color: var(--ink-2); font-size: 14px; margin-top: -6px; }
.auth-small { color: var(--ink-3); font-size: 12.5px; }
.auth-form { display: grid; gap: 14px; margin-top: 4px; }
.auth-form .field { display: grid; gap: 6px; }
.auth-form .field > span:first-child { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.auth-form input[type="text"], .auth-form input[type="password"] { width: 100%; height: 42px; font-size: 14.5px; padding: 0 12px; }
.pw { position: relative; display: block; }
.pw input { padding-right: 44px !important; }
.pw-toggle { position: absolute; right: 4px; top: 4px; width: 34px; height: 34px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-3); display: grid; place-items: center; }
.pw-toggle:hover, .pw-toggle[aria-pressed="true"] { background: var(--surface-3); color: var(--ink); }
.auth-form .btn.block { margin-top: 6px; height: 42px; }
.btn.ms { gap: 12px; height: 44px; font-size: 14.5px; }
.ms-logo { display: grid; grid-template-columns: 9px 9px; gap: 2px; }
.ms-logo i { width: 9px; height: 9px; 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; }
.auth-error { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 12px; border-radius: var(--r-sm); background: var(--red-soft); border: 1px solid #F2C4C0; color: var(--red-ink); font-size: 13px; }
.auth-error .ic { width: 17px; height: 17px; margin-top: 1px; }
.auth-badge { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-ink); }
.auth-badge .ic { width: 22px; height: 22px; }
.auth-note { display: flex; align-items: flex-start; gap: 8px; max-width: 400px; color: var(--ink-3); font-size: 12.5px; }
.auth-note .ic { margin-top: 2px; }
.auth-note .ic { width: 14px; height: 14px; flex: none; }
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { display: none; }
  .auth-panel { justify-content: flex-start; padding-top: 48px; }
}
