/* IT Service Desk - bbHub Latest design system (Best Brains).
   Tokens follow bbHub: one action colour (orange), blue for links, slate for text and lines,
   inset 1px rings instead of borders, Inter type, pill buttons. Dark mode swaps the semantic tokens.
   Admin > Appearance can still override the action colour (--brand), accent (--accent) and P1-P4. */

/* ---------------------------------------------------------------- fonts */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(../assets/fonts/inter-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(../assets/fonts/inter-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* --------------------------------------------------------------- tokens */
:root {
  /* corporate brand (logo artwork only) */
  --bb-brand-blue: rgb(2,82,144); --bb-brand-orange: rgb(244,129,31); --bb-brand-yellow: rgb(255,202,6); --bb-brand-ink: rgb(35,31,32);
  /* product: action orange + reference blue */
  --bb-orange: rgb(255,60,0); --bb-orange-press: rgb(230,52,0); --bb-orange-soft: rgb(255,241,235); --bb-orange-tint: rgb(255,247,243); --bb-orange-line: rgb(255,190,160); --bb-orange-ink: rgb(196,50,10);
  --bb-blue: rgb(20,108,181); --bb-blue-hover: rgb(15,90,155); --bb-avatar: rgb(21,94,160);
  /* slate ramp */
  --slate-950: rgb(2,6,23); --slate-900: rgb(15,23,42); --slate-800: rgb(30,41,59); --slate-700: rgb(51,65,85); --slate-600: rgb(71,85,105); --slate-500: rgb(100,116,139); --slate-400: rgb(148,163,184);
  --slate-300: rgb(203,213,225); --slate-250: rgb(215,221,230); --slate-200: rgb(226,232,240); --slate-150: rgb(237,240,244); --slate-100: rgb(241,245,249); --slate-75: rgb(244,246,249); --slate-50: rgb(248,250,252); --slate-25: rgb(250,251,252); --white: #fff;
  /* semantic tones: surface / line / ink / dot */
  --green-surface: rgb(236,253,243); --green-line: rgb(187,247,208); --green-ink: rgb(6,118,71); --green-dot: rgb(23,178,106);
  --amber-surface: rgb(255,250,235); --amber-line: rgb(254,223,137); --amber-ink: rgb(181,71,8); --amber-dot: rgb(247,144,9);
  --red-surface: rgb(254,242,242); --red-line: rgb(254,202,202); --red-ink: rgb(185,28,28); --red-dot: rgb(217,45,32); --red-field: rgb(240,82,82);
  --blue-surface: rgb(239,248,255); --blue-line: rgb(191,219,254); --blue-ink: rgb(23,92,211); --blue-dot: rgb(46,144,250);
  --violet-surface: rgb(244,243,255); --violet-line: rgb(196,181,253); --violet-ink: rgb(89,37,220); --violet-dot: rgb(122,90,248);
  --orange-surface: rgb(255,244,237); --orange-line: rgb(254,215,170); --orange-ink: rgb(196,50,10); --orange-dot: rgb(234,88,12);
  --teal-surface: rgb(230,247,245); --teal-line: rgb(153,230,220); --teal-ink: rgb(15,118,110); --teal-dot: rgb(20,184,166);
  --slate-surface: rgb(241,245,249); --slate-line: rgb(226,232,240); --slate-ink: rgb(71,85,105); --slate-dot: rgb(148,163,184);

  /* semantic */
  --text-strong: var(--slate-950); --text: var(--slate-900); --text-2: var(--slate-700); --text-3: var(--slate-600); --text-muted: var(--slate-500); --text-faint: var(--slate-400);
  --text-link: var(--bb-blue); --text-link-hover: var(--bb-blue-hover);
  --surface-page: var(--white); --surface-app: #f4f6fa; --surface-card: var(--white); --surface-fill: var(--slate-75); --surface-subtle: var(--slate-100);
  --surface-head: var(--slate-50); --surface-row-hover: var(--slate-25); --surface-nav: #f1f4f8; --surface-nav-panel: #e9edf3; --surface-input: var(--white);
  --line: var(--slate-200); --line-hair: var(--slate-150); --line-strong: var(--slate-300);

  /* action colour: Admin > Appearance may override with --brand */
  --action: var(--brand, var(--bb-orange));
  --action-press: color-mix(in srgb, var(--action) 88%, #000);
  --action-soft: color-mix(in srgb, var(--action) 9%, var(--surface-card));
  --action-tint: color-mix(in srgb, var(--action) 5%, var(--surface-card));
  --action-line: color-mix(in srgb, var(--action) 38%, var(--surface-card));
  --action-ink: color-mix(in srgb, var(--action) 82%, #000);
  --accent-c: var(--accent, var(--green-dot));

  /* elevation */
  --ring: inset 0 0 0 1px var(--line);
  --ring-hair: inset 0 0 0 1px var(--line-hair);
  --ring-strong: inset 0 0 0 1px var(--line-strong);
  --ring-focus: 0 0 0 3px var(--action-soft), inset 0 0 0 1px var(--action);
  --ring-error: inset 0 0 0 1px var(--red-field);
  --shadow-field: inset 0 0 0 1px var(--line), 0 1px 2px rgba(0,0,0,.04);
  --shadow-btn: inset 0 0 0 1px var(--line), 0 1px 2px rgba(0,0,0,.05);
  --shadow-primary: 0 7.8px 7.8px color-mix(in srgb, var(--action) 10%, transparent), 0 2.1px 4.3px color-mix(in srgb, var(--action) 12%, transparent);
  --shadow-seg-on: 0 1px 2px rgba(15,23,42,.08);
  --shadow-nav-on: 0 1px 2px rgba(15,23,42,.08), inset 0 0 0 1px var(--line);
  --shadow-menu: 0 12px 32px rgba(15,23,42,.14), 0 0 0 1px var(--line);
  --shadow-dialog: 0 24px 60px rgba(15,23,42,.25);
  --shadow-toast: 0 12px 30px rgba(15,23,42,.25);
  --shadow-login: 0 1px 2px rgba(0,0,0,.05), inset 0 0 0 1px var(--line), 0 12px 32px rgba(15,23,42,.06);
  --scrim: rgba(15,23,42,.42); --scrim-nav: rgba(15,23,42,.35);

  /* type, radii, sizes, motion */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r-4: 4px; --r-5: 5px; --r-6: 6px; --r-8: 8px; --r-10: 10px; --r-12: 12px; --r-14: 14px; --r-16: 16px; --r-20: 20px; --r-pill: 999px;
  --h-grid-ctl: 34px; --h-btn-sm: 32px; --h-btn: 38px; --h-btn-lg: 44px; --h-field: 44px;
  --w-nav: 288px; --w-content: 1280px; --pad-main-y: 32px; --pad-main-x: 44px;
  --dur-press: 60ms; --dur-pop: .14s; --dur-toast: .18s; --press-scale: .975;

  /* priority colours (Admin > Appearance can override --p1..--p4) */
  --p1: var(--red-dot); --p2: var(--amber-dot); --p3: var(--blue-ink); --p4: var(--slate-500);

  /* names used by older markup, mapped onto bbHub */
  --ink: var(--text); --paper: var(--surface-page); --surface: var(--surface-card); --line-soft: var(--line-hair); --muted: var(--text-muted);
  --faint: var(--surface-fill); --link: var(--text-link); --focus: var(--action); --route: var(--accent-c);
  --warn: var(--amber-ink); --warn-soft: var(--amber-surface); --danger: var(--red-dot); --danger-soft: var(--red-surface); --ok-soft: var(--green-surface);
  --display: var(--font-sans); --body: var(--font-sans); --radius: var(--r-10); --radius-lg: var(--r-14);
  color-scheme: light;
}

/* ----------------------------------------------------------- dark mode */
html[data-mode="dark"] {
  --text-strong: #f8fafc; --text: rgb(226,232,240); --text-2: rgb(203,213,225); --text-3: rgb(176,189,205); --text-muted: rgb(148,163,184); --text-faint: rgb(100,116,139);
  --text-link: rgb(110,176,240); --text-link-hover: rgb(150,198,245);
  --surface-page: #0d1424; --surface-app: #0a101d; --surface-card: #131c2e; --surface-fill: #1a2438; --surface-subtle: #1e293b;
  --surface-head: #172133; --surface-row-hover: #182235; --surface-nav: #0a101d; --surface-nav-panel: #141d2f; --surface-input: #0f172a;
  --line: #273449; --line-hair: #1f2a3d; --line-strong: #334155;
  --action-soft: color-mix(in srgb, var(--action) 18%, var(--surface-card));
  --action-tint: color-mix(in srgb, var(--action) 10%, var(--surface-card));
  --action-line: color-mix(in srgb, var(--action) 45%, var(--surface-card));
  --action-ink: color-mix(in srgb, var(--action) 70%, #fff);
  --green-surface: rgba(23,178,106,.14); --green-line: rgba(23,178,106,.35); --green-ink: rgb(110,231,166);
  --amber-surface: rgba(247,144,9,.14); --amber-line: rgba(247,144,9,.35); --amber-ink: rgb(253,186,116);
  --red-surface: rgba(217,45,32,.16); --red-line: rgba(240,82,82,.4); --red-ink: rgb(252,165,165);
  --blue-surface: rgba(46,144,250,.14); --blue-line: rgba(46,144,250,.35); --blue-ink: rgb(147,197,253);
  --violet-surface: rgba(122,90,248,.16); --violet-line: rgba(122,90,248,.4); --violet-ink: rgb(196,181,253);
  --orange-surface: rgba(234,88,12,.16); --orange-line: rgba(234,88,12,.4); --orange-ink: rgb(253,186,140);
  --teal-surface: rgba(20,184,166,.14); --teal-line: rgba(20,184,166,.35); --teal-ink: rgb(94,234,212);
  --slate-surface: rgba(148,163,184,.12); --slate-line: rgba(148,163,184,.25); --slate-ink: rgb(203,213,225); --slate-dot: rgb(148,163,184);
  --p3: rgb(96,165,250); --p4: rgb(148,163,184);
  --shadow-field: inset 0 0 0 1px var(--line); --shadow-btn: inset 0 0 0 1px var(--line-strong);
  --shadow-nav-on: inset 0 0 0 1px var(--line-strong);
  --shadow-menu: 0 12px 32px rgba(0,0,0,.5), 0 0 0 1px var(--line-strong);
  --shadow-dialog: 0 24px 60px rgba(0,0,0,.6); --shadow-toast: 0 12px 30px rgba(0,0,0,.5);
  --shadow-login: inset 0 0 0 1px var(--line), 0 12px 32px rgba(0,0,0,.4);
  --scrim: rgba(0,0,0,.6); --scrim-nav: rgba(0,0,0,.55);
  color-scheme: dark;
}

/* ----------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 14px; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--surface-page);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
h1, h2, h3, h4 { font-family: var(--font-sans); color: var(--text-strong); margin: 0; line-height: 1.25; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }
h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.2px; }
h3 { font-size: 14.5px; font-weight: 600; }
p { margin: 0 0 0.75rem; }
a { color: var(--text-link); text-decoration: none; }
a:hover { color: var(--text-link-hover); text-decoration: underline; }
code { font-family: var(--font-mono); font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
::selection { background: var(--action-soft); }
[hidden] { display: none !important; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--text); color: var(--surface-page); padding: 8px 12px; z-index: 100; border-radius: var(--r-8); }
.skip-link:focus { left: 8px; top: 8px; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------- app shell */
body.has-nav .main { margin-left: var(--w-nav); }
.sidenav {
  position: fixed; inset: 0 auto 0 0; width: var(--w-nav); z-index: 30;
  background: var(--surface-nav); display: flex; flex-direction: column;
  overflow: hidden; border-right: 1px solid var(--line);
}
.nav-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 20px 16px 10px 18px; color: var(--text); }
.nav-brand:hover { text-decoration: none; color: var(--text); }
.nav-logo { height: 48px; width: auto; max-width: 220px; margin: -2px 0 4px -4px; object-fit: contain; object-position: left center; display: block; }
.nav-logo.custom { height: 40px; margin: 0 0 6px; }
.nav-wordmark { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; color: var(--text-strong); }
.nav-app { font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.sidenav .nav-close { display: none; }
.nav { display: flex; flex-direction: column; gap: 8px; flex: 1; overflow-y: auto; padding: 4px 10px 12px; scrollbar-width: thin; }
.nav-head {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; border: 0; border-radius: var(--r-10);
  background: transparent; color: var(--text); font: inherit; font-size: 15px; font-weight: 600; text-align: left; cursor: pointer;
  transition: transform var(--dur-press) ease-out;
}
.nav-head:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.nav-head:active { transform: scale(var(--press-scale)); }
.nav-head > .icon { width: 20px; height: 20px; }
.nav-head .chev { margin-left: auto; display: inline-flex; color: var(--text-muted); transition: transform .15s ease; }
.nav-group.collapsed .chev { transform: rotate(-90deg); }
.nav-group.collapsed .nav-panel { display: none; }
.nav-group.collapsed.holds .nav-head { background: var(--surface-card); box-shadow: var(--ring); }
.nav-panel { margin-top: 4px; padding: 6px; background: var(--surface-nav-panel); border-radius: var(--r-12); display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px;
  border-radius: var(--r-8); color: var(--text-2); font-size: 15px; font-weight: 400; white-space: nowrap;
  transition: transform var(--dur-press) ease-out;
}
.nav a:hover { background: color-mix(in srgb, var(--surface-card) 60%, transparent); color: var(--text-2); text-decoration: none; }
.nav a.active { background: var(--surface-card); box-shadow: var(--shadow-nav-on); color: var(--text); font-weight: 600; }
.nav a:active { transform: scale(var(--press-scale)); }
.nav a .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count, .nav .count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--r-pill); background: var(--action); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 1;
}
.user-chip-wrap { position: relative; border-top: 1px solid var(--line); padding: 12px 10px 14px; }
.user-chip {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: var(--r-12);
  background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.user-chip:hover, .user-chip[aria-expanded="true"] { background: var(--surface-nav-panel); }
.user-chip .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.user-chip .who strong { font-size: 13.5px; font-weight: 600; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who span { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .icon { color: var(--text-muted); width: 16px; height: 16px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--bb-avatar); color: #fff; font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em; }
.menu {
  position: absolute; left: 10px; right: 10px; bottom: calc(100% - 6px); z-index: 40;
  background: var(--surface-card); border-radius: var(--r-10); box-shadow: var(--shadow-menu); padding: 6px;
  animation: bbPop var(--dur-pop) ease-out;
}
.menu-label { font-size: 12.5px; color: var(--text-muted); padding: 8px 10px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu a, .menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 0 10px; border: 0; border-radius: var(--r-8);
  background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.menu a:hover, .menu button:hover { background: var(--surface-subtle); text-decoration: none; color: var(--text-strong); }
.menu .icon { width: 16px; height: 16px; color: var(--text-muted); }
.menu hr { border: 0; border-top: 1px solid var(--line-hair); margin: 6px 4px; }
.menu .warn-dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--amber-dot); }
.mobilebar { display: none; }
.nav-scrim { display: none; }

/* --------------------------------------------------------------- layout */
.main { max-width: none; min-height: 100vh; padding: var(--pad-main-y) var(--pad-main-x) 56px; }
.main > * { max-width: var(--w-content); margin-left: auto; margin-right: auto; }
.main > .login-wrap { max-width: none; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; }
.page-head .lead { color: var(--text-muted); margin: 4px 0 0; font-size: 14px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.stack > * + * { margin-top: 16px; }
.panel { background: var(--surface-card); border: 1px solid var(--line); border-radius: var(--r-14); }
.panel-head { padding: 14px 16px; border-bottom: 1px solid var(--line-hair); display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; }
.panel-head h2, .panel-head h3 { font-size: 15.5px; font-weight: 600; letter-spacing: -0.2px; }
.panel-body { padding: 16px; }
.panel-body.tight { padding: 4px 0; }
.muted { color: var(--text-muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.mono { font-family: var(--font-mono); font-size: 12.5px; }
.ticket-no { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; letter-spacing: 0.01em; color: var(--text-strong); }
.empty { padding: 32px 16px; text-align: center; color: var(--text-muted); }
.empty strong { display: block; color: var(--text-strong); font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.divider { border: 0; border-top: 1px solid var(--line-hair); margin: 16px 0; }

/* -------------------------------------------------------------- buttons */
.btn {
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1;
  height: var(--h-btn); padding: 0 16px; border-radius: var(--r-pill); border: 0;
  background: var(--action); color: #fff;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  transition: background-color .12s ease, transform var(--dur-press) ease-out;
}
.btn:hover { background: var(--action-press); color: #fff; text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(var(--press-scale)); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn .icon { width: 16px; height: 16px; }
.btn-secondary { background: var(--surface-card); color: var(--text); box-shadow: var(--ring); }
.btn-secondary:hover { background: var(--surface-head); color: var(--text); }
html[data-mode="dark"] .btn-secondary { box-shadow: var(--ring-strong); }
html[data-mode="dark"] .btn-secondary:hover { background: var(--surface-fill); }
.btn-ghost { background: transparent; color: var(--text-link); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-subtle); color: var(--text-link-hover); }
.modal-head .btn-ghost, .mobilebar .btn-ghost, .sidenav .nav-close { color: var(--text-2); }
.btn-route { background: var(--accent-c); box-shadow: none; }
.btn-route:hover { background: color-mix(in srgb, var(--accent-c) 86%, #000); }
.btn-danger { background: var(--red-dot); color: #fff; box-shadow: none; }
.btn-danger:hover { background: color-mix(in srgb, var(--red-dot) 86%, #000); }
.btn-sm { height: var(--h-btn-sm); padding: 0 12px; font-size: 13px; }
.btn-lg { height: 40px; padding: 0 18px; font-size: 15.5px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.link-btn { font: inherit; background: none; border: 0; color: var(--text-link); cursor: pointer; padding: 0; text-align: left; }
.link-btn:hover { color: var(--text-link-hover); text-decoration: underline; }

/* --------------------------------------------------------------- badges */
.badge {
  --b-surface: var(--slate-surface); --b-ink: var(--slate-ink); --b-dot: var(--slate-dot); --b-line: var(--slate-line);
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px;
  font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap; vertical-align: middle;
  border-radius: var(--r-pill); background: var(--b-surface); color: var(--b-ink);
}
.badge-status, .badge-breach, .badge-warn, .badge-ok, .badge-paused { border-radius: var(--r-4); }
.badge-status::before, .badge-p::before, .badge-breach::before, .badge-warn::before, .badge-ok::before, .badge-paused::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--b-dot); flex: none;
}
.badge-p { --b-dot: var(--pc); background: color-mix(in srgb, var(--pc) 12%, var(--surface-card)); color: color-mix(in srgb, var(--pc) 78%, var(--text)); }
html[data-mode="dark"] .badge-p { background: color-mix(in srgb, var(--pc) 20%, var(--surface-card)); color: color-mix(in srgb, var(--pc) 60%, #fff); }
.badge-p.P1 { --pc: var(--p1); }
.badge-p.P2 { --pc: var(--p2); }
.badge-p.P3 { --pc: var(--p3); }
.badge-p.P4 { --pc: var(--p4); }
.badge-tier { background: var(--surface-card); box-shadow: var(--ring-strong); color: var(--text-2); border-radius: var(--r-6); }
.badge-status.NEW, .badge-status.ASSIGNED { --b-surface: var(--blue-surface); --b-ink: var(--blue-ink); --b-dot: var(--blue-dot); }
.badge-status.IN_PROGRESS { --b-surface: var(--teal-surface); --b-ink: var(--teal-ink); --b-dot: var(--teal-dot); }
.badge-status.ON_HOLD { --b-surface: var(--amber-surface); --b-ink: var(--amber-ink); --b-dot: var(--amber-dot); }
.badge-status.PENDING_APPROVAL { --b-surface: var(--violet-surface); --b-ink: var(--violet-ink); --b-dot: var(--violet-dot); }
.badge-status.PROCUREMENT { --b-surface: var(--orange-surface); --b-ink: var(--orange-ink); --b-dot: var(--orange-dot); }
.badge-status.RESOLVED { --b-surface: var(--green-surface); --b-ink: var(--green-ink); --b-dot: var(--green-dot); }
.badge-status.CLOSED { --b-surface: var(--slate-surface); --b-ink: var(--slate-ink); --b-dot: var(--slate-dot); }
.badge-status.REJECTED, .badge-status.CANCELLED { --b-surface: var(--red-surface); --b-ink: var(--red-ink); --b-dot: var(--red-dot); }
.badge-breach { --b-surface: var(--red-surface); --b-ink: var(--red-ink); --b-dot: var(--red-dot); }
.badge-warn { --b-surface: var(--amber-surface); --b-ink: var(--amber-ink); --b-dot: var(--amber-dot); }
.badge-ok { --b-surface: var(--green-surface); --b-ink: var(--green-ink); --b-dot: var(--green-dot); }
.badge-paused { --b-surface: var(--slate-surface); --b-ink: var(--slate-ink); --b-dot: var(--slate-dot); }

/* ------------------------------------------------- tables (command grid) */
.table-wrap { overflow-x: auto; }
.panel > .table-wrap:first-child table.grid thead th:first-child { border-top-left-radius: var(--r-14); }
.panel > .table-wrap:first-child table.grid thead th:last-child { border-top-right-radius: var(--r-14); }
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.grid th {
  text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text-muted); background: var(--surface-head);
  padding: 0 14px; height: 40px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.grid td { padding: 11px 14px; border-bottom: 1px solid var(--line-hair); vertical-align: top; color: var(--text); }
table.grid tr:last-child td { border-bottom: 0; }
table.grid tr.clickable { cursor: pointer; }
table.grid tr.clickable:hover td { background: var(--surface-row-hover); }
table.grid tr.clickable:focus-visible { outline: 2px solid var(--action); outline-offset: -2px; }
table.grid td.prio { box-shadow: inset 3px 0 0 transparent; }
table.grid td.prio.P1 { box-shadow: inset 3px 0 0 var(--p1); }
table.grid td.prio.P2 { box-shadow: inset 3px 0 0 var(--p2); }
table.grid td.prio.P3 { box-shadow: inset 3px 0 0 var(--p3); }
table.grid td.prio.P4 { box-shadow: inset 3px 0 0 var(--p4); }
table.grid .sub { display: block; color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }
table.grid input, table.grid select { width: auto; min-width: 5em; height: var(--h-grid-ctl); border-radius: var(--r-6); font-size: 13.5px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line-hair); font-size: 13px; color: var(--text-muted); }

/* ------------------------------------------------------ tabs and filters */
.tabs { display: flex; gap: 4px 20px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs a, .tabs button {
  font: inherit; font-size: 14px; font-weight: 500; padding: 10px 0; color: var(--text-muted);
  background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer;
}
.tabs a:hover, .tabs button:hover { color: var(--text-strong); text-decoration: none; }
.tabs a.active, .tabs button.active { color: var(--text-strong); border-bottom-color: var(--action); font-weight: 600; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
form.filters select, form.filters input:not([type="checkbox"]) { width: auto; height: var(--h-grid-ctl); border-radius: var(--r-pill); font-size: 13.5px; padding-left: 14px; }
form.filters input[type="search"], form.filters input[type="text"] { min-width: 280px; }
form.filters .check { margin: 0; font-size: 13.5px; }
form.filters .btn { height: var(--h-grid-ctl); font-size: 13px; padding: 0 14px; }

/* ---------------------------------------------------------------- forms */
label { display: block; font-size: 13.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
label .hint { font-weight: 400; color: var(--text-muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], input[type="time"], input[type="url"], input[type="tel"], select, textarea {
  font: inherit; font-size: 15px; width: 100%; height: var(--h-field); padding: 0 14px;
  border: 0; border-radius: var(--r-10); background: var(--surface-input); color: var(--text);
  box-shadow: var(--shadow-field); transition: box-shadow .12s ease;
}
select {
  appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
select[multiple] { height: auto; padding: 6px; background-image: none; }
textarea { height: auto; min-height: 6.5rem; padding: 10px 14px; resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:hover, select:hover, textarea:hover { box-shadow: var(--ring-strong); }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: var(--ring-focus); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { box-shadow: var(--ring-error); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--action); width: 16px; height: 16px; }
input[type="file"] { font: inherit; font-size: 13.5px; color: var(--text-2); }
input[type="file"]::file-selector-button { font: inherit; font-size: 13px; font-weight: 600; height: 32px; padding: 0 12px; margin-right: 10px; border: 0; border-radius: var(--r-pill); background: var(--surface-card); color: var(--text); box-shadow: var(--shadow-btn); cursor: pointer; }
input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; color: var(--text); }
.check input { width: 16px; }
.form-error { background: var(--red-surface); color: var(--red-ink); box-shadow: inset 0 0 0 1px var(--red-line); padding: 10px 14px; border-radius: var(--r-10); margin-bottom: 16px; font-size: 13.5px; }
.form-note { background: var(--blue-surface); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--blue-line); padding: 10px 14px; border-radius: var(--r-10); font-size: 13.5px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-subtle); border-radius: var(--r-10); flex-wrap: wrap; }
.seg label { margin: 0; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; font-size: 13.5px; font-weight: 500; color: var(--text-3); border-radius: var(--r-8); cursor: pointer; transition: background-color .12s ease; }
.seg span:hover { color: var(--text-strong); }
.seg input:checked + span { background: var(--surface-card); color: var(--text-strong); font-weight: 600; box-shadow: var(--shadow-seg-on), var(--ring-hair); }
.seg input:focus-visible + span { outline: 2px solid var(--action); outline-offset: 1px; }
.priority-preview { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface-fill); border-radius: var(--r-12); }
.priority-preview .big { font-size: 21px; font-weight: 700; letter-spacing: -0.3px; }
.lookup { position: relative; }
.lookup-list { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface-card); border-radius: var(--r-10); max-height: 240px; overflow: auto; box-shadow: var(--shadow-menu); padding: 4px; animation: bbPop var(--dur-pop) ease-out; }
.lookup-list button { display: block; width: 100%; text-align: left; font: inherit; color: var(--text); background: none; border: 0; padding: 8px 10px; border-radius: var(--r-8); cursor: pointer; }
.lookup-list button:hover, .lookup-list button:focus { background: var(--surface-subtle); outline: none; }
.lookup-list .sub { color: var(--text-muted); font-size: 12.5px; }
.picked { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--action-tint); box-shadow: inset 0 0 0 1px var(--action-line); border-radius: var(--r-10); }

/* ---------------------------------------------------------------- login */
/* bbHub AuthCard: 440 max, r16, 36px padding, logo 44 high, on the edtech line-icon pattern (884 x 942.21 tile). */
.login-wrap { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 40px 16px; margin: calc(-1 * var(--pad-main-y)) calc(-1 * var(--pad-main-x)) -56px; background: var(--surface-page); overflow: hidden; }
.login-wrap::before { content: ""; position: absolute; inset: 0; background: url(../assets/login-pattern-edtech.svg) repeat; background-size: 884px 942.21px; pointer-events: none; }
html[data-mode="dark"] .login-wrap::before { opacity: .07; }
.login-wrap > div { position: relative; width: 100%; max-width: 440px; }
.login-card { position: relative; width: 100%; background: var(--surface-card); border-radius: var(--r-16); padding: 36px 36px 32px; box-shadow: var(--shadow-login); }
.login-card .nav-wordmark { display: block; margin-bottom: 24px; }
.login-card h1 { font-size: 24px; letter-spacing: -0.5px; margin-bottom: 6px; }
.login-card .lead { color: var(--text-muted); margin-bottom: 24px; font-size: 14px; line-height: 21px; }
.login-logo { height: 44px; width: auto; max-width: 100%; object-fit: contain; object-position: left center; display: block; margin-bottom: 24px; }
.login-card label { font-size: 13px; }
.login-card input { border-radius: var(--r-8); }
.login-card form .btn[type="submit"] { width: 100%; height: 44px; font-size: 15px; border-radius: var(--r-8); box-shadow: var(--shadow-primary); }
.login-card .label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.login-card .label-row a { font-size: 13px; font-weight: 600; white-space: nowrap; }
.login-foot { position: relative; margin: 24px 0 0; text-align: center; font-size: 12.5px; color: var(--text-faint); }
.login-alt { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; }

/* ------------------------------------------------------------ dashboard */
.signal-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.signal { background: var(--surface-card); border: 1px solid var(--line); border-radius: var(--r-14); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.signal .n { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; line-height: 1; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.signal .l { color: var(--text-2); font-size: 12.5px; font-weight: 500; }
/* Cards, rows and bars that open a list are whole buttons: hover changes the background only, press scales. */
button.signal, .count-row, button.bar, button.stage-item { font: inherit; text-align: left; cursor: pointer; transition: background-color .12s ease, transform var(--dur-press) ease-out; }
button.signal:active, .count-row:active, button.bar:active, button.stage-item:active { transform: scale(var(--press-scale)); }
button.signal { color: inherit; position: relative; }
button.signal::after { content: "\2192"; position: absolute; top: 12px; right: 14px; color: var(--text-faint); font-size: 15px; opacity: 0; transition: opacity .12s ease; }
button.signal:hover { background: var(--surface-head); border-color: var(--line-strong); }
button.signal:hover::after, button.signal:focus-visible::after { opacity: 1; }
button.signal:hover .l { color: var(--text-link); }
button.signal.alert:hover { background: color-mix(in srgb, var(--red-surface) 80%, var(--red-line)); }
button.signal.warn:hover { background: color-mix(in srgb, var(--amber-surface) 80%, var(--amber-line)); }
.signal.alert { background: var(--red-surface); border-color: var(--red-line); }
.signal.alert .n { color: var(--red-ink); }
.signal.warn { background: var(--amber-surface); border-color: var(--amber-line); }
.signal.warn .n { color: var(--amber-ink); }
.signal a { color: inherit; }
.bars { display: grid; gap: 2px; }
.bar { display: grid; grid-template-columns: 150px 1fr 40px; align-items: center; gap: 12px; font-size: 13.5px; }
button.bar { width: calc(100% + 16px); margin: 0 -8px; padding: 7px 8px; border: 0; border-radius: var(--r-8); background: none; color: var(--text); font-size: 13.5px; }
button.bar:hover { background: var(--surface-subtle); }
.bar .name { color: var(--text-link); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.bar:hover .name { color: var(--text-link-hover); text-decoration: underline; }
.bar .track { height: 8px; background: var(--surface-subtle); border-radius: var(--r-pill); overflow: hidden; }
.bar .fill { height: 100%; background: var(--action); border-radius: var(--r-pill); }
.bar .fill.P1 { background: var(--p1); }
.bar .fill.P2 { background: var(--p2); }
.bar .fill.P3 { background: var(--p3); }
.bar .fill.P4 { background: var(--p4); }
.bar .v { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-strong); }
.cta-panel { background: var(--action-tint); box-shadow: inset 0 0 0 1px var(--action-line); border-radius: var(--r-14); padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.cta-panel h2 { color: var(--text-strong); font-size: 16px; }
.cta-panel p { color: var(--text-3); margin: 4px 0 0; font-size: 13.5px; }
.section-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.section-grid .panel-body.tight { padding: 4px 0; }
.count-list { list-style: none; margin: 0; padding: 0; }
.count-list li { border-top: 1px solid var(--line-hair); }
.count-list li:first-child { border-top: 0; }
.count-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 16px; border: 0; background: none; color: var(--text); font-size: 14px; }
.count-row:hover { background: var(--surface-row-hover); color: var(--text-link); text-decoration: none; }
.count-row:focus-visible { outline-offset: -2px; }
.count-list .n { font-size: 16px; font-weight: 700; min-width: 2em; text-align: right; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.count-list .n.warn { color: var(--amber-ink); }
.count-list .n.alert { color: var(--red-ink); }

/* ------------------------------------------ route map (purchase workflow) */
.route { --dot: 18px; display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); position: relative; padding: 8px 0 4px; gap: 0; }
.route::before { content: ""; position: absolute; left: calc(100% / 18); right: calc(100% / 18); top: calc(8px + var(--dot) / 2 - 2px); height: 4px; background: var(--surface-subtle); border-radius: var(--r-pill); }
.station { position: relative; text-align: center; padding: 0 3px; }
.station .dot {
  width: var(--dot); height: var(--dot); border-radius: 50%; margin: 0 auto 6px;
  background: var(--surface-card); border: 3px solid var(--line-strong); position: relative; z-index: 1;
  display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff;
}
.station .name { font-size: 12px; font-weight: 500; line-height: 1.25; color: var(--text-muted); }
.station .meta { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; line-height: 1.25; }
.station.done .dot { background: var(--accent-c); border-color: var(--accent-c); }
.station.done .name { color: var(--text); }
.station.done::before, .station.current::before { content: ""; position: absolute; top: calc(var(--dot) / 2 - 2px); height: 4px; background: var(--accent-c); left: -50%; width: 100%; z-index: 0; }
.station.done:first-child::before, .station.current:first-child::before { display: none; }
.station.current .dot { background: var(--surface-card); border-color: var(--action); box-shadow: 0 0 0 4px var(--action-soft); }
.station.current .name { color: var(--text-strong); font-weight: 700; }
.station.current.overdue .dot { border-color: var(--red-dot); box-shadow: 0 0 0 4px var(--red-surface); }
.station.current.overdue .meta { color: var(--red-ink); font-weight: 600; }
.station.rejected .dot { background: var(--red-dot); border-color: var(--red-dot); }
.station.skipped .dot { border-style: dashed; }
.station button.dot { cursor: pointer; font: inherit; font-size: 10px; font-weight: 700; padding: 0; }
.route-wrap { overflow-x: auto; }
.route-wrap .route { min-width: 760px; }

/* --------------------------------------------------------- ticket detail */
.ticket-head { margin-bottom: 16px; }
.ticket-head .badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 6px 0; }
.ticket-head h1 { font-size: 21px; letter-spacing: -0.3px; margin-top: 2px; }
.desc { white-space: pre-wrap; word-wrap: break-word; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; color: var(--text); }
.sla-row { display: flex; justify-content: space-between; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line-hair); font-size: 13.5px; }
.sla-row:first-child { border-top: 0; padding-top: 0; }
.sla-row .t { font-weight: 600; font-variant-numeric: tabular-nums; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line-hair); }
.timeline li:first-child { border-top: 0; }
.timeline .av { width: 32px; height: 32px; border-radius: 50%; background: var(--blue-surface); color: var(--blue-ink); display: grid; place-items: center; font-size: 11.5px; font-weight: 700; }
.timeline li.sys .av { background: transparent; box-shadow: inset 0 0 0 1px var(--line); font-size: 10px; color: var(--text-muted); }
.timeline .who { font-size: 12.5px; color: var(--text-muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.timeline .who strong { color: var(--text-strong); font-weight: 600; }
.timeline .msg { white-space: pre-wrap; word-wrap: break-word; margin-top: 4px; }
.timeline li.sys .msg { color: var(--text-muted); font-size: 13px; }
.timeline li.internal .msg { background: var(--amber-surface); box-shadow: inset 0 0 0 1px var(--amber-line); border-radius: var(--r-10); padding: 10px 12px; }
.timeline li.comment .msg { background: var(--surface-fill); border-radius: var(--r-10); padding: 10px 12px; }
.timeline li.escalation .msg { color: var(--red-ink); }
.reply-box textarea { min-height: 5.5rem; }
.attach-list { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.attach-list li { padding: 8px 0; border-top: 1px solid var(--line-hair); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.attach-list li:first-child { border-top: 0; }
.email-log { font-size: 12.5px; }
.email-log td { padding: 8px 10px; }
.purchase-card dl { margin: 0; }

/* ---------------------------------------------------------------- modal */
.modal-backdrop { position: fixed; inset: 0; background: var(--scrim); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface-card); border-radius: var(--r-20); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; box-shadow: var(--shadow-dialog); animation: bbPop var(--dur-pop) ease-out; }
.modal.wide { max-width: 1040px; }
.modal table.grid td:nth-child(2) { min-width: 220px; }
.modal-head { padding: 18px 20px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line-hair); }
.modal-head h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.2px; }
.modal-head .btn-ghost { width: 32px; padding: 0; border-radius: 50%; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px 18px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line-hair); }
.modal iframe { width: 100%; height: 480px; border: 0; box-shadow: var(--ring); border-radius: var(--r-10); background: #fff; }

/* ---------------------------------------------------------------- toast */
.toast-root { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 8px; z-index: 60; }
.toast { background: var(--slate-900); color: #fff; padding: 12px 16px; border-radius: var(--r-12); font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-toast); max-width: 380px; animation: bbUp var(--dur-toast) ease-out; }
.toast.error { background: var(--red-dot); }
html[data-mode="dark"] .toast { background: #f1f5f9; color: var(--slate-900); }
html[data-mode="dark"] .toast.error { background: var(--red-dot); color: #fff; }

/* ----------------------------------------------------------------- misc */
.rating { display: flex; gap: 6px; }
.rating label { margin: 0; }
.rating input { position: absolute; opacity: 0; }
.rating span { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-10); box-shadow: var(--shadow-btn); background: var(--surface-card); font-weight: 600; cursor: pointer; }
.rating span:hover { background: var(--surface-row-hover); }
.rating input:checked + span { background: var(--action); color: #fff; box-shadow: var(--shadow-primary); }
.rating input:focus-visible + span { outline: 2px solid var(--action); outline-offset: 2px; }
.stage-list { display: grid; gap: 6px; }
.stage-item { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; min-height: 44px; padding: 0 14px; border-radius: var(--r-10); background: var(--surface-fill); }
.stage-item .n { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-strong); }
button.stage-item { width: 100%; border: 0; color: var(--text); font-size: 14px; }
button.stage-item:hover { background: var(--surface-subtle); }
.stage-item .name { color: var(--text-link); }
button.stage-item:hover .name { color: var(--text-link-hover); text-decoration: underline; }
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.help { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 4px 0 12px; border-radius: var(--r-pill); background: var(--action-tint); box-shadow: inset 0 0 0 1px var(--action-line); font-size: 13px; color: var(--text); }
.chip button { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 15px; line-height: 1; width: 22px; height: 22px; border-radius: 50%; }
.chip button:hover { color: var(--red-ink); background: var(--red-surface); }
.qr { background: #fff; padding: 10px; box-shadow: var(--ring); border-radius: var(--r-12); display: inline-block; }
.qr svg { width: 200px; height: 200px; display: block; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; font-family: var(--font-mono); font-size: 14px; letter-spacing: 0.05em; }
.key-list { list-style: none; padding: 0; margin: 0; }
.key-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-hair); }
.key-list li:first-child { border-top: 0; }
.theme-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.theme-swatches label { margin: 0; }
.theme-swatches input { position: absolute; opacity: 0; }
.theme-swatches .sw { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: var(--r-pill); box-shadow: var(--shadow-btn); background: var(--surface-card); color: var(--text); font-weight: 500; cursor: pointer; }
.theme-swatches input:checked + .sw { background: var(--action-tint); box-shadow: inset 0 0 0 1px var(--action); font-weight: 600; }
.theme-swatches input:focus-visible + .sw { outline: 2px solid var(--action); outline-offset: 2px; }
.theme-swatches .dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
input[type="color"] { width: 48px; height: 38px; padding: 4px; border: 0; border-radius: var(--r-10); box-shadow: var(--shadow-field); background: var(--surface-input); cursor: pointer; }
.report-section + .report-section { margin-top: 20px; }
.report-section h3 { margin-bottom: 6px; }
.event-row .ev { font-family: var(--font-mono); font-size: 12.5px; }
.sev-SECURITY { color: var(--red-ink); font-weight: 600; }
.sev-WARN { color: var(--amber-ink); font-weight: 600; }
.brand-logo { height: 28px; width: auto; max-width: 140px; object-fit: contain; }
.mode-toggle { font-size: 13px; }

/* --------------------------------------------------------------- motion */
@keyframes bbPop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes bbUp { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bbSlideIn { from { transform: translateX(-24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  .station.current .dot { animation: pulse 1.8s ease-out 1; }
  @keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--action-line); } 100% { box-shadow: 0 0 0 10px transparent; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ----------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  :root { --pad-main-x: 28px; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  :root { --pad-main-y: 20px; --pad-main-x: 16px; }
  body.has-nav .main { margin-left: 0; padding-top: calc(56px + var(--pad-main-y)); }
  .mobilebar {
    display: flex; align-items: center; gap: 10px; position: fixed; inset: 0 0 auto 0; height: 56px; z-index: 25;
    padding: 0 12px; background: var(--surface-page); border-bottom: 1px solid var(--line-hair);
  }
  .mobilebar .btn-ghost { width: 44px; height: 44px; padding: 0; border-radius: var(--r-10); }
  .mobilebar .icon { width: 22px; height: 22px; }
  .mobilebar a { display: inline-flex; align-items: center; }
  .mobilebar img { height: 36px; width: auto; max-width: 170px; object-fit: contain; }
  .mobilebar .nav-wordmark { font-size: 16px; }
  .mobilebar .title { font-weight: 700; font-size: 15px; color: var(--text-strong); }
  .mobilebar .count { margin-left: auto; }
  .sidenav { transform: translateX(-100%); transition: transform .2s ease-out; box-shadow: none; z-index: 45; width: min(var(--w-nav), 86vw); }
  body.nav-open .sidenav { transform: none; box-shadow: var(--shadow-dialog); }
  body.nav-open .nav-scrim { display: block; position: fixed; inset: 0; background: var(--scrim-nav); z-index: 44; }
  .sidenav .nav-close { display: inline-flex; position: absolute; top: 14px; right: 12px; width: 36px; height: 36px; padding: 0; border-radius: 50%; }
  .page-head h1 { font-size: 22px; }
  .signal-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kv { grid-template-columns: 110px 1fr; }
  .bar { grid-template-columns: 110px 1fr 36px; }
  form.filters input[type="search"], form.filters input[type="text"] { min-width: 0; flex: 1 1 100%; }
  .login-wrap { margin: calc(-1 * var(--pad-main-y)) calc(-1 * var(--pad-main-x)) -56px; }
  .login-card { padding: 24px 20px; }
}

/* ---------------------------------------------------------------- print */
@media print {
  .sidenav, .mobilebar, .nav-scrim, .actions, .reply-box, .toast-root { display: none !important; }
  body.has-nav .main { margin-left: 0; padding: 0; }
  .main > * { max-width: none; }
}

/* ------------------------------------------- dashboard: figures and charts
   Chart series colours are validated as a pair for colour-blind separation in both modes (blue + aqua).
   Orange stays the action colour and is never a data series; red/amber/green appear only as status. */
:root { --series-1: #146cb5; --series-2: #1baf7a; }
html[data-mode="dark"] { --series-1: #3987e5; --series-2: #199e70; }

.section-title { font-size: 16px; font-weight: 700; letter-spacing: -0.2px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.seg a { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; font-size: 13.5px; font-weight: 500; color: var(--text-3); border-radius: var(--r-8); }
.seg a:hover { color: var(--text-strong); text-decoration: none; }
.seg a.on { background: var(--surface-card); color: var(--text-strong); font-weight: 600; box-shadow: var(--shadow-seg-on), var(--ring-hair); }
.filter-note { margin-bottom: 12px; }

/* stat cards: one main button (number + label) and an optional second line */
.signal { padding: 0; gap: 0; position: relative; overflow: hidden; }
.signal-main { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 14px 16px 6px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: transform var(--dur-press) ease-out; }
.signal-main:hover .l { color: var(--text-link); text-decoration: underline; }
.signal-main:active { transform: scale(var(--press-scale)); }
.signal:has(.signal-main:hover) { border-color: var(--line-strong); }
.signal-sub { display: block; width: 100%; padding: 0 16px 12px; border: 0; background: none; font: inherit; font-size: 12.5px; color: var(--text-muted); text-align: left; }
button.signal-sub { cursor: pointer; color: var(--text-link); }
button.signal-sub:hover { text-decoration: underline; }
button.signal-sub.bad { color: var(--red-ink); font-weight: 600; }
/* The whole card is the button: the note under the number and the sparkline open the same list as the number. */
.signal[data-action] { cursor: pointer; transition: background-color .12s ease, border-color .12s ease, transform var(--dur-press) ease-out; }
.signal[data-action]:hover { background: var(--surface-head); border-color: var(--line-strong); }
.signal[data-action].alert:hover { background: color-mix(in srgb, var(--red-surface) 80%, var(--red-line)); }
.signal[data-action].warn:hover { background: color-mix(in srgb, var(--amber-surface) 80%, var(--amber-line)); }
.signal[data-action]:hover .l { color: var(--text-link); text-decoration: underline; }
.signal[data-action]:has(button.signal-sub:hover) .l { color: var(--text-2); text-decoration: none; }
.signal[data-action]:active { transform: scale(var(--press-scale)); }
.signal[data-action] .signal-main:active { transform: none; }
.spark { position: absolute; top: 14px; right: 14px; pointer-events: none; }
.spark-line { fill: none; stroke: var(--text-faint); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark-dot { fill: var(--series-1); stroke: var(--surface-card); stroke-width: 2; }

/* period figures with the change against the previous period */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--surface-card); border: 1px solid var(--line); border-radius: var(--r-14); font: inherit; color: inherit; text-align: left; cursor: pointer; transition: background-color .12s ease, transform var(--dur-press) ease-out; }
.kpi:hover { background: var(--surface-head); border-color: var(--line-strong); }
.kpi:active { transform: scale(var(--press-scale)); }
.kpi-label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.kpi:hover .kpi-label { color: var(--text-link); text-decoration: underline; }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; line-height: 1.15; color: var(--text-strong); }
.kpi-note { font-size: 12px; color: var(--text-muted); }
.delta { font-size: 12.5px; font-weight: 600; }
.delta .vs { font-weight: 400; color: var(--text-muted); }
.delta.good { color: var(--green-ink); }
.delta.bad { color: var(--red-ink); }
.delta.flat { color: var(--text-muted); font-weight: 500; }

/* charts */
.chart-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chart { min-height: 200px; }
.chart-svg { display: block; overflow: visible; }
.chart-svg .chart-grid { stroke: var(--line-hair); stroke-width: 1; }
.chart-svg .chart-axis { stroke: var(--line-strong); stroke-width: 1; }
.chart-tick { fill: var(--text-muted); font-size: 11.5px; font-variant-numeric: tabular-nums; pointer-events: none; }
.chart-value { fill: var(--text-strong); font-size: 12px; font-weight: 600; pointer-events: none; }
.chart-bar { pointer-events: none; }
.chart-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; pointer-events: none; }
.chart-area { opacity: .1; pointer-events: none; }
.chart-dot { stroke: var(--surface-card); stroke-width: 2; opacity: 0; pointer-events: none; }
.chart-dot.end { opacity: 1; }
.chart-cross { stroke: var(--line-strong); stroke-width: 1; opacity: 0; pointer-events: none; }
.chart-band { fill: var(--surface-subtle); opacity: 0; pointer-events: none; }
.chart-hit { fill: transparent; cursor: pointer; outline: none; }
.chart-slot:hover .chart-cross, .chart-slot:focus-within .chart-cross, .chart-slot:hover .chart-band, .chart-slot:focus-within .chart-band,
.chart-slot:hover .chart-dot, .chart-slot:focus-within .chart-dot { opacity: 1; }
.chart-hit:focus-visible { stroke: var(--action); stroke-width: 2; }
.legend { display: inline-flex; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.chart-tip { position: absolute; z-index: 70; pointer-events: none; min-width: 120px; padding: 8px 10px; border-radius: var(--r-10); background: var(--surface-card); color: var(--text-2); box-shadow: var(--shadow-menu); font-size: 12.5px; }
.chart-tip-title { color: var(--text-muted); margin-bottom: 4px; }
.chart-tip-row { display: flex; align-items: center; gap: 6px; }
.chart-tip-row strong { color: var(--text-strong); font-weight: 700; }
.chart-tip-key { width: 10px; height: 3px; border-radius: 2px; flex: none; }

/* ranked bars: one hue, growing from a shared baseline */
.bars.ranked .bar { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) 30px; }
.bars.ranked .track { height: 12px; background: none; border-radius: 0; overflow: visible; }
.bars.ranked .fill { display: block; height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; }
.bars.ranked .fill.P1 { background: var(--p1); }
.bars.ranked .fill.P2 { background: var(--p2); }
.bars.ranked .fill.P3 { background: var(--p3); }
.bars.ranked .fill.P4 { background: var(--p4); }

/* engineer capacity: a meter per engineer; the fill colour follows the state and the text says it too */
.meter-list { display: grid; gap: 4px; }
.meter-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.meter-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 5px 12px; padding: 8px; margin-left: -8px; border: 0; border-radius: var(--r-8); background: none; color: var(--text); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; transition: transform var(--dur-press) ease-out; }
.meter-main .meter, .meter-main .sub { grid-column: 1 / -1; }
.meter-main:hover { background: var(--surface-subtle); }
.meter-main:active { transform: scale(var(--press-scale)); }
.meter-main .name { min-width: 0; color: var(--text-link); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter-main .sub, .count-row .sub { display: block; font-size: 12px; font-weight: 400; color: var(--text-muted); }
.meter-main .v { text-align: right; font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.meter { display: block; height: 8px; border-radius: var(--r-pill); overflow: hidden; background: color-mix(in srgb, var(--series-1) 18%, var(--surface-card)); }
.meter > span { display: block; height: 100%; border-radius: var(--r-pill); background: var(--series-1); }
.meter.high { background: color-mix(in srgb, var(--amber-dot) 22%, var(--surface-card)); }
.meter.high > span { background: var(--amber-dot); }
.meter.over { background: color-mix(in srgb, var(--red-dot) 20%, var(--surface-card)); }
.meter.over > span { background: var(--red-dot); }
.chip-btn { height: 26px; padding: 0 10px; border: 0; border-radius: var(--r-pill); background: var(--surface-subtle); color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.chip-btn:hover { background: var(--line); }
.chip-btn.bad { background: var(--red-surface); color: var(--red-ink); }
.count-row > span:first-child { min-width: 0; text-align: left; }

/* purchase pipeline: approvals by age, then each stage */
.age-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.age { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 0; border-radius: var(--r-10); background: var(--surface-fill); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: transform var(--dur-press) ease-out; }
.age:hover { background: var(--surface-subtle); }
.age:active { transform: scale(var(--press-scale)); }
.age .n { font-size: 19px; font-weight: 700; color: var(--text-strong); }
.age .l { font-size: 12.5px; color: var(--text-2); }
.age.late { background: var(--amber-surface); box-shadow: inset 0 0 0 1px var(--amber-line); }
.age.late .n { color: var(--amber-ink); }
.stage-item { grid-template-columns: 1fr auto auto auto; }
.age-note { font-size: 12.5px; color: var(--text-muted); }

@media (max-width: 1100px) {
  .chart-cards { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .kpi-grid, .age-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage-item { grid-template-columns: 1fr auto auto; }
  .stage-item .age-note { display: none; }
}

/* ------------------------------------------- dashboard: compact, one screen
   The staff dashboard is one grid: a header, a row of live figures, a row of period figures and a grid of
   panels. On a wide monitor the grid fills the window exactly, so nothing scrolls. Below that size the same
   panels wrap and the page scrolls as usual. */
.main:has(> .dash) { padding: 12px 24px 24px; }
.main:has(> .dash) > * { max-width: none; }
.dash { display: flex; flex-direction: column; gap: 10px; }
.dash-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 40px; }
.dash-head h1 { font-size: 20px; letter-spacing: -0.3px; }
.dash-head .seg a { height: 30px; padding: 0 12px; font-size: 13px; }
a.chip-btn { display: inline-flex; align-items: center; }
a.chip-btn:hover { text-decoration: none; }
.chip-btn.warn { height: 28px; background: var(--action-soft); color: var(--action-ink); box-shadow: inset 0 0 0 1px var(--action-line); }

.dash .signal-strip, .dash .kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.dash .signal { border-radius: var(--r-12); }
.dash .signal-main { flex-direction: row; align-items: baseline; gap: 8px; padding: 8px 12px 0; }
.dash .signal .n { font-size: 22px; }
.dash .signal .l { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash .signal-sub { padding: 0 12px 8px; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash .spark { top: 7px; right: 8px; width: 48px; height: 16px; }
.dash .kpi { padding: 8px 12px; gap: 1px; border-radius: var(--r-12); min-width: 0; }
.dash .kpi-value { font-size: 20px; }
.dash .kpi-label, .dash .kpi .delta { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash .kpi-note, .dash .delta .vs { display: none; }
.dash .delta { font-size: 12px; }

.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.dash .panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-radius: var(--r-12); overflow: hidden; }
.dash .panel-head { padding: 8px 12px; min-height: 36px; gap: 8px; }
.dash .panel-head h2 { min-width: 0; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash .panel-head .small, .dash .panel-head .legend { flex: none; white-space: nowrap; font-size: 12px; }
.dash .panel-body { flex: 1; min-height: 0; padding: 8px 12px; overflow: auto; scrollbar-width: thin; }
.dash .panel-body.tight { padding: 2px 0; }
.dash .panel-body.chart-body { display: flex; flex-direction: column; overflow: hidden; }
.dash .chart { flex: 1; min-height: 0; height: 190px; overflow: hidden; }
.dash .count-row { min-height: 27px; padding: 0 12px; font-size: 13px; }
.dash .count-list .n { font-size: 14px; }
.dash .count-row .sub { display: none; }
.dash .count-row > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash .bars { gap: 0; }
.dash button.bar { padding: 2px 8px; font-size: 12.5px; line-height: 1.25; gap: 8px; }
.dash .bars.ranked .track { height: 10px; }
.dash .divider { margin: 6px 0; }
.dash .meter-list { gap: 0; }
.dash .meter-main { grid-template-columns: minmax(0, 1fr) 40px 34px; gap: 8px; padding: 5px 8px; font-size: 13px; }
.dash .meter-main .meter { grid-column: auto; }
.dash .chip-btn { height: 22px; padding: 0 8px; font-size: 12px; }
.dash .chip-btn.warn { height: 28px; padding: 0 12px; font-size: 12.5px; }
.dash .pipe { display: grid; grid-template-columns: 1fr; gap: 10px; }
.dash .section-label { margin-bottom: 2px; font-size: 11px; line-height: 1.3; }
.dash .stage-list { gap: 1px; }
.dash .stage-item { min-height: 18px; padding: 0 8px; gap: 8px; font-size: 12.5px; line-height: 1.3; border-radius: var(--r-6); background: none; }
.dash .stage-item:nth-child(odd) { background: var(--surface-fill); }
.dash button.stage-item:hover { background: var(--surface-subtle); }
.dash .stage-item .n { font-size: 13px; }
.dash .stage-item .badge { height: 16px; padding: 0 6px; font-size: 11px; }
.dash .age-note { font-size: 11.5px; }
.dash .age { flex-direction: row; align-items: baseline; gap: 8px; padding: 5px 10px; border-radius: var(--r-8); }
.dash .age .n { font-size: 16px; }
.dash .age .l { font-size: 12px; }
.dash table.grid td { padding: 4px 12px; font-size: 12.5px; }
.dash table.grid .sub { display: none; }
.dash .empty { padding: 16px 12px; font-size: 12.5px; }
@media (min-width: 700px) { .dash .span-2 { grid-column: span 2; } }

@media (min-width: 1500px) and (min-height: 800px) {
  .main:has(> .dash) { height: 100vh; min-height: 0; padding: 12px 24px; overflow: hidden; }
  .dash { height: 100%; }
  .dash .signal-strip, .dash .kpi-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .dash-grid { flex: 1; min-height: 0; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); }
  .dash .chart { height: auto; }
  .dash .pipe { grid-template-columns: 150px minmax(0, 1fr); }
  .dash .age-strip { grid-template-columns: 1fr; gap: 3px; }
  .dash .stage-item .name, .dash .stage-item .age-note { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
/* the same one-screen layout on a smaller monitor: tighter rows, and the least important extras drop out */
@media (min-width: 1500px) and (max-width: 1749px) and (min-height: 800px) {
  .dash .stage-item { grid-template-columns: minmax(0, 1fr) auto auto; }
  .dash .stage-item .age-note, .dash .spark { display: none; }
  .dash .pipe { grid-template-columns: 124px minmax(0, 1fr); }
  .dash .meter-main { grid-template-columns: minmax(0, 1fr) 34px; }
  .dash .meter-main .meter { display: none; }
}
@media (min-width: 1500px) and (min-height: 800px) and (max-height: 899px) {
  .dash .panel-body { padding: 6px 12px; }
  .dash .panel-body.tight { padding: 0; }
  .dash .count-row { min-height: 25px; }
  .dash button.bar { padding: 1px 8px; }
  .dash .divider { margin: 4px 0; }
  .dash .stage-item { min-height: 16px; line-height: 1.2; }
  .dash .section-label { margin-bottom: 0; }
  .dash .age { padding: 2px 10px; }
  .dash .meter-main { padding: 3px 8px; }
}

/* ------------------------------------------------------------ ticket page
   Header with the actions, three tabs (Details, Related, Activity) and a details sidebar. On a wide screen the
   header stays put and the two columns scroll on their own. */
.main:has(> .tk) { padding: 16px 24px 24px; }
.main:has(> .tk) > * { max-width: none; }
.tk-top { margin-bottom: 16px; }
.tk-crumb { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; font-size: 13px; color: var(--text-muted); }
.tk-headline { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.tk-title { flex: 1 1 380px; min-width: 0; }
.tk-title h1 { font-size: 21px; letter-spacing: -0.3px; overflow-wrap: anywhere; }
.tk-title .badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.tk-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.menu-wrap { position: relative; }
.menu.down { top: calc(100% + 6px); bottom: auto; left: auto; right: 0; width: 260px; }
.tk .tabs { margin-bottom: 0; }
.tab-n { display: inline-grid; place-items: center; min-width: 20px; height: 18px; margin-left: 4px; padding: 0 6px; border-radius: var(--r-pill); background: var(--surface-subtle); color: var(--text-2); font-size: 11.5px; font-weight: 600; }
.tk-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.tk-main > * + *, .tab-panel > * + *, .tk-side > * + * { margin-top: 16px; }
.tk-main > .form-note { margin-bottom: 0; }
.tab-panel.is-hidden, .feed-item.is-hidden { display: none; }
.print-only { display: none; }
.form-note.hold { background: var(--amber-surface); box-shadow: inset 0 0 0 1px var(--amber-line); }
.reply-box { border-top: 1px solid var(--line-hair); }
.who-card { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.who-card .sub { display: block; font-size: 12.5px; color: var(--text-muted); }
.tk-side .kv { grid-template-columns: 124px 1fr; }
.tk-side .panel-head h3 { font-size: 15px; font-weight: 600; }

/* activity categories: one tone each, used by the filter chips and the feed icons */
.tone-blue { --tone-surface: var(--blue-surface); --tone-ink: var(--blue-ink); }
.tone-amber { --tone-surface: var(--amber-surface); --tone-ink: var(--amber-ink); }
.tone-slate { --tone-surface: var(--slate-surface); --tone-ink: var(--slate-ink); }
.tone-teal { --tone-surface: var(--teal-surface); --tone-ink: var(--teal-ink); }
.tone-red { --tone-surface: var(--red-surface); --tone-ink: var(--red-ink); }
.tone-violet { --tone-surface: var(--violet-surface); --tone-ink: var(--violet-ink); }
.tone-green { --tone-surface: var(--green-surface); --tone-ink: var(--green-ink); }
.chips-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 0; border-radius: var(--r-pill); background: var(--surface-card); box-shadow: var(--ring); color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.fchip .icon { width: 14px; height: 14px; color: var(--tone-ink, var(--text-muted)); }
.fchip .c { font-weight: 700; color: var(--text-muted); }
.fchip:hover { background: var(--surface-head); }
.fchip.on { background: var(--action-soft); box-shadow: inset 0 0 0 1px var(--action); color: var(--text-strong); font-weight: 600; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed-item { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-hair); }
.feed-item:first-child { border-top: 0; padding-top: 0; }
.feed-ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--tone-surface); color: var(--tone-ink); }
.feed-ico .icon { width: 15px; height: 15px; }
.feed .who, .conv .who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; color: var(--text-muted); }
.feed .who strong, .conv .who strong { font-size: 13.5px; font-weight: 600; color: var(--text-strong); }
.feed .tag { font-weight: 600; color: var(--tone-ink); }
.feed .msg, .conv .msg { margin-top: 3px; white-space: pre-wrap; overflow-wrap: anywhere; }
.feed .msg .sub { display: block; font-size: 12.5px; color: var(--text-muted); white-space: normal; }

/* conversation: the requester's messages are tinted blue, internal notes amber */
.conv { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.conv-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; }
.conv .av { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-subtle); color: var(--text-2); font-size: 11.5px; font-weight: 700; }
.conv-body { padding: 10px 14px; border-radius: var(--r-12); background: var(--surface-card); box-shadow: var(--ring); }
.conv-item.requester .conv-body { background: var(--blue-surface); box-shadow: inset 0 0 0 1px var(--blue-line); }
.conv-item.requester .av { background: var(--blue-surface); color: var(--blue-ink); }
.conv-item.note .conv-body { background: var(--amber-surface); box-shadow: inset 0 0 0 1px var(--amber-line); }

@media (min-width: 1200px) and (min-height: 700px) {
  .main:has(> .tk) { height: 100vh; min-height: 0; padding: 16px 24px 0; overflow: hidden; }
  .tk { display: flex; flex-direction: column; height: 100%; }
  .tk-top { flex: none; margin-bottom: 12px; }
  .tk-body { flex: 1; min-height: 0; align-items: stretch; }
  .tk-main, .tk-side { min-height: 0; padding: 2px 6px 24px 2px; overflow: auto; scrollbar-width: thin; }
}
@media (max-width: 1100px) {
  .tk-body { grid-template-columns: 1fr; }
}
@media print {
  .tk-actions, .tk .tabs, .reply-box, .chips-filter, .lookup, .tk-crumb a { display: none !important; }
  .tab-panel.is-hidden { display: block !important; }
  .feed-item.is-hidden { display: grid !important; }
  .print-only { display: block; margin: 20px 0 8px; font-size: 16px; }
  .main:has(> .tk) { height: auto; padding: 0; overflow: visible; }
  .tk { display: block; height: auto; }
  .tk-body { display: block; }
  .tk-main, .tk-side { height: auto; padding: 0; overflow: visible; }
  .tk-side { margin-top: 16px; }
  .panel { break-inside: avoid; }
}

/* --------------------------------------------------------- knowledge base
   Browse: category rail on the left, search and article cards on the right. Read: numbered steps with
   screenshots. The same article body is reused in the popup that opens from the raise-a-ticket form. */
.main:has(> .kb) > * { max-width: 1480px; }
.kb { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 28px; align-items: start; }
.kb-rail { position: sticky; top: 16px; }
.kb-rail .section-label { padding: 0 12px; }
.kb-cat { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border-radius: var(--r-8); color: var(--text-2); font-size: 13.5px; font-weight: 500; }
.kb-cat > span:not(.c) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-cat .icon { width: 16px; height: 16px; color: var(--text-muted); }
.kb-cat .c { font-size: 12px; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.kb-cat:hover { background: var(--surface-subtle); color: var(--text-strong); text-decoration: none; }
.kb-cat.on { background: var(--action-soft); box-shadow: inset 0 0 0 1px var(--action-line); color: var(--text-strong); font-weight: 600; }
.kb-cat.on .icon, .kb-cat.on .c { color: var(--action-ink); }
.kb-search { position: relative; display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.kb-search > .icon { position: absolute; left: 14px; color: var(--text-muted); pointer-events: none; }
.kb-search input[type="search"] { padding-left: 42px; }
.kb-search .btn { height: var(--h-field); flex: none; }
.kb-home { margin-bottom: 20px; }
.kb-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.kb-tools form.filters .check { color: var(--text-muted); font-size: 13px; }
.seg-btn { display: inline-grid; place-items: center; width: 36px; height: 30px; border: 0; border-radius: var(--r-8); background: none; color: var(--text-3); cursor: pointer; }
.seg-btn:hover { color: var(--text-strong); }
.seg-btn.on { background: var(--surface-card); color: var(--text-strong); box-shadow: var(--shadow-seg-on), var(--ring-hair); }
.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.kb-card { position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 176px; padding: 16px; border-radius: var(--r-14); background: var(--surface-card); box-shadow: var(--ring); transition: box-shadow .12s ease; }
.kb-card:hover { box-shadow: var(--ring-strong), 0 6px 18px rgba(15,23,42,.07); }
.kb-card:focus-within { box-shadow: inset 0 0 0 1px var(--action); }
.kb-card.draft { background: var(--surface-head); }
.kb-card-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 30px; padding-right: 34px; }
.kb-card h3 { margin: 0; font-size: 15.5px; font-weight: 600; letter-spacing: -0.2px; line-height: 1.3; }
.kb-card h3 a { color: var(--text-strong); outline: none; }
.kb-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-14); }
.kb-card:hover h3 a { color: var(--text-link); text-decoration: none; }
.kb-card p { margin: 0; color: var(--text-3); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kb-card-foot { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line-hair); }
.kb-card-foot .who { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-card-foot .muted { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.kb-card-foot .icon { width: 13px; height: 13px; }
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }
.star { position: relative; z-index: 1; display: inline-grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; background: none; color: var(--text-faint); cursor: pointer; }
.kb-card .star { position: absolute; top: 14px; right: 12px; }
.star:hover { background: var(--surface-subtle); color: var(--text-2); }
.star.on { color: var(--amber-dot); }
.star.on .icon, .btn[aria-pressed="true"] .icon.fillable { fill: currentColor; }

/* reading an article */
.kb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.kb-read { font-size: 15px; line-height: 1.6; }
.panel-body.kb-read { padding: 24px 28px; }
.kb-intro { margin-bottom: 20px; color: var(--text-2); overflow-wrap: anywhere; }
.kb-steps { list-style: none; margin: 0; padding: 0; }
.kb-steps > li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 14px; padding: 16px 0; border-top: 1px solid var(--line-hair); }
.kb-steps > li:first-child { border-top: 0; padding-top: 0; }
.kb-steps > li:last-child { padding-bottom: 0; }
.kb-step-n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--blue-surface); color: var(--blue-ink); box-shadow: inset 0 0 0 1px var(--blue-line); font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.kb-step-body h3 { margin: 3px 0 4px; font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--text-strong); }
.kb-text { color: var(--text-2); overflow-wrap: anywhere; }
.kb-shot { display: block; width: fit-content; max-width: min(100%, 760px); margin-top: 12px; border-radius: var(--r-10); overflow: hidden; box-shadow: 0 0 0 1px var(--line); background: var(--surface-fill); }
.kb-shot img { display: block; max-width: 100%; height: auto; }
.kb-closing { margin-top: 20px; }
.kb-closing strong { display: block; margin-bottom: 2px; color: var(--text-strong); }
.kb-article .count-row { min-height: 0; padding: 10px 16px; }
.kb-article .count-row .sub { display: block; font-size: 12.5px; color: var(--text-muted); }
.modal .kb-read { margin-top: 12px; }

/* writing an article */
.kb-edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.kb-step-edit { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line-hair); }
.kb-step-edit:first-child { border-top: 0; padding-top: 0; }
.kb-step-edit:last-child { padding-bottom: 0; }
.kb-step-edit .field { margin-bottom: 10px; }
.kb-step-tools { display: flex; flex-direction: column; gap: 2px; }
.kb-step-tools .btn { width: 32px; padding: 0; }
.kb-thumb { width: 38px; height: 28px; margin-right: 4px; object-fit: cover; border-radius: var(--r-4); vertical-align: middle; box-shadow: 0 0 0 1px var(--line); }

/* suggestions while a ticket is being written, and the article picker on a ticket */
.kb-suggest { margin: 0 0 16px; padding: 14px 16px; border-radius: var(--r-12); background: var(--blue-surface); box-shadow: inset 0 0 0 1px var(--blue-line); }
.kb-suggest h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14.5px; font-weight: 600; color: var(--text-strong); }
.kb-suggest h3 .icon { color: var(--blue-ink); }
.kb-suggest > p { margin: 2px 0 0; font-size: 13px; color: var(--text-3); }
.kb-pick { list-style: none; display: grid; gap: 6px; margin: 10px 0 0; padding: 0; }
.kb-pick button { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: var(--r-10); background: var(--surface-card); box-shadow: var(--ring); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.kb-pick button:hover { box-shadow: var(--ring-strong); }
.kb-pick button.on { background: var(--action-soft); box-shadow: inset 0 0 0 1px var(--action); }
.kb-pick strong { font-size: 14px; font-weight: 600; color: var(--text-strong); }
.kb-pick .sub { grid-column: 1; font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-pick .go { grid-row: 1 / span 2; grid-column: 2; font-size: 12.5px; font-weight: 600; color: var(--text-link); white-space: nowrap; }

/* the settings and the Save buttons stay in view while a long list of steps scrolls */
@media (min-width: 1101px) and (min-height: 860px) {
  .kb-edit-grid > .stack:last-child { position: sticky; top: 16px; }
}
@media (max-width: 1100px) {
  .kb-layout, .kb-edit-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .kb-home { flex-wrap: wrap; }
  .kb-home input[type="search"] { flex: 1 1 100%; }
}
@media (max-width: 900px) {
  .kb { grid-template-columns: 1fr; gap: 16px; }
  .kb-rail { position: static; display: flex; flex-wrap: wrap; gap: 6px; }
  .kb-rail .section-label, .kb-rail .divider { display: none; }
  .kb-cat { min-height: 32px; border-radius: var(--r-pill); box-shadow: var(--ring); }
  .kb-cat > span:not(.c) { flex: none; }
  .panel-body.kb-read { padding: 16px; }
  .kb-step-edit { grid-template-columns: 30px minmax(0, 1fr); }
  .kb-step-tools { grid-column: 2; flex-direction: row; }
}
@media print {
  .kb-rail, .kb-search, .kb-tools, .kb-feedback, .kb-article aside, .kb-article .tk-crumb { display: none !important; }
  .kb-layout { display: block; }
  .kb-steps > li { break-inside: avoid; }
}

/* ------------------------------------------------------ purchase management
   Purchase request page: progress strip, details with a summary rail, budget check, quotations, decision.
   The same two-column layout serves the vendor and asset pages. */
.main:has(> .pr) > * { max-width: 1480px; }
.pr-steps-panel { margin-bottom: 16px; padding: 16px 12px; overflow-x: auto; scrollbar-width: thin; }
.pr-steps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(128px, 1fr); gap: 0; list-style: none; margin: 0; padding: 0; }
.pr-step { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; padding: 0 8px; }
.pr-step::after { content: ""; position: absolute; top: 13px; left: 44px; right: -8px; height: 2px; background: var(--line); }
.pr-step:last-child::after { display: none; }
.pr-step.done::after { background: var(--green-dot); }
.pr-num { position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-card); box-shadow: inset 0 0 0 1.5px var(--line-strong); color: var(--text-muted); font-size: 12.5px; font-weight: 700; }
.pr-num .icon { width: 16px; height: 16px; }
.pr-step.done .pr-num { background: var(--green-surface); box-shadow: inset 0 0 0 1.5px var(--green-dot); color: var(--green-ink); }
.pr-step.skipped .pr-num { box-shadow: inset 0 0 0 1.5px var(--line-strong); background: var(--surface-subtle); color: var(--text-muted); }
.pr-step.current .pr-num { background: var(--bb-blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bb-blue) 18%, transparent); color: #fff; }
.pr-step.rejected .pr-num { background: var(--red-surface); box-shadow: inset 0 0 0 1.5px var(--red-dot); color: var(--red-ink); }
.pr-step-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 4px 6px 0 0; background: var(--surface-card); position: relative; z-index: 1; font-size: 12px; color: var(--text-muted); line-height: 1.35; }
.pr-step-text strong { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.pr-step.current .pr-step-text strong, .pr-step.done .pr-step-text strong { color: var(--text-strong); }
.pr-step-text .badge { align-self: flex-start; margin-top: 3px; }

.pr-layout { display: grid; grid-template-columns: minmax(0, 1fr) 348px; gap: 16px; align-items: start; }
.pr-rail .panel-head h3 { font-size: 15px; font-weight: 600; }
.pr-rail .kv { grid-template-columns: 118px 1fr; }
.kv2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 32px; }
.kv .sub, .kv dd .sub { display: block; font-size: 12.5px; color: var(--text-muted); }
.kv-wide { grid-template-columns: 170px 1fr; }
.sec-title { margin: 20px 0 8px; padding-top: 16px; border-top: 1px solid var(--line-hair); font-size: 14px; font-weight: 600; color: var(--text-strong); }
.file-row { display: flex; flex-wrap: wrap; gap: 8px; }
.file-chip { display: inline-flex; align-items: center; gap: 10px; min-width: 200px; max-width: 320px; padding: 8px 12px; border-radius: var(--r-10); background: var(--surface-card); box-shadow: var(--ring); color: var(--text); }
.file-chip:hover { box-shadow: var(--ring-strong); text-decoration: none; }
.file-chip .icon { color: var(--text-muted); }
.file-chip strong { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.file-chip .sub { display: block; font-size: 12px; color: var(--text-muted); }

/* budget check */
.budget-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 20px; margin-bottom: 12px; }
.budget-figs > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.budget-figs .l { font-size: 12.5px; color: var(--text-muted); }
.budget-figs .n { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.budget-figs .sub { font-size: 12px; color: var(--text-muted); }
.budget-figs .bad .n { color: var(--red-ink); }
.budget-figs .good .n { color: var(--green-ink); }
.budget-meter, .pr-progress { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; gap: 8px; }
.budget-meter strong, .pr-progress strong { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
tr.row-alert td { background: var(--red-surface); }
.neg { color: var(--red-ink); }
table.grid td a:not(.btn) { font-variant-numeric: tabular-nums; }

/* quotations and documents */
table.quotes tr.selected td { background: var(--green-surface); }
table.quotes td { vertical-align: top; }
.badge.doc-PO { --b-surface: var(--blue-surface); --b-ink: var(--blue-ink); }
.badge.doc-INVOICE { --b-surface: var(--violet-surface); --b-ink: var(--violet-ink); }
.badge.doc-DELIVERY { --b-surface: var(--teal-surface); --b-ink: var(--teal-ink); }
.badge.doc-WARRANTY { --b-surface: var(--green-surface); --b-ink: var(--green-ink); }
.badge.doc-QUOTE { --b-surface: var(--amber-surface); --b-ink: var(--amber-ink); }

/* decision: three choices as cards, or the fields of a procurement step */
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { margin: 0; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-10); background: var(--surface-card); box-shadow: var(--ring); color: var(--text-2); font-size: 14px; font-weight: 600; cursor: pointer; }
.choice span:hover { box-shadow: var(--ring-strong); }
.choice .icon { width: 16px; height: 16px; }
.choice.ok .icon { color: var(--green-dot); }
.choice.bad .icon { color: var(--red-dot); }
.choice.warn .icon { color: var(--amber-dot); }
.choice.ok input:checked + span { background: var(--green-surface); box-shadow: inset 0 0 0 1.5px var(--green-dot); color: var(--green-ink); }
.choice.bad input:checked + span { background: var(--red-surface); box-shadow: inset 0 0 0 1.5px var(--red-dot); color: var(--red-ink); }
.choice.warn input:checked + span { background: var(--amber-surface); box-shadow: inset 0 0 0 1.5px var(--amber-dot); color: var(--amber-ink); }
.choice input:focus-visible + span { outline: 2px solid var(--action); outline-offset: 2px; }
.stage-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 16px; }
.stage-form .field.wide { grid-column: 1 / -1; }
.stage-form .stage-form { margin-top: 4px; }
#decision { scroll-margin-top: 16px; }

/* approval history */
.tl { list-style: none; margin: 0; padding: 0; }
.tl-item { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding-bottom: 16px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-item.done::before { background: var(--green-dot); }
.tl-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-card); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.tl-dot .icon { width: 14px; height: 14px; }
.tl-item.done .tl-dot { background: var(--green-dot); box-shadow: none; color: #fff; }
.tl-item.current .tl-dot { box-shadow: inset 0 0 0 6px var(--bb-blue); }
.tl-item.rejected .tl-dot { background: var(--red-dot); box-shadow: none; color: #fff; }
.tl-item.current .tl-body { margin: -6px -8px -6px -6px; padding: 6px 8px 6px 6px; border-radius: var(--r-8); background: var(--blue-surface); }
.tl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.tl-head strong { font-size: 13.5px; font-weight: 600; color: var(--text-strong); }
.tl-item.todo .tl-head strong { color: var(--text-2); font-weight: 500; }
.tl-body .sub { display: block; font-size: 12.5px; color: var(--text-muted); }
.tl-note { display: block; margin-top: 4px; padding: 6px 8px; border-radius: var(--r-8); background: var(--surface-fill); font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
.pr-actions .count-row { min-height: 42px; font-size: 13.5px; text-align: left; cursor: pointer; font-family: inherit; }
.pr-actions .count-row > span:first-child { display: inline-flex; align-items: center; gap: 10px; }
.pr-actions .count-row .icon { width: 16px; height: 16px; color: var(--text-muted); }

/* register tiles (assets, budgets) */
.budget-tiles { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.asset-tiles { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
a.kpi:hover { text-decoration: none; }
.kpi.static { cursor: default; }
.kpi.static:hover { background: var(--surface-card); border-color: var(--line); }
.kpi.static:hover .kpi-label { color: var(--text-2); text-decoration: none; }
.kpi.static:active { transform: none; }
.kpi.on { background: var(--action-soft); border-color: var(--action); }
.kpi.warn .kpi-value { color: var(--amber-ink); }
.kpi.alert .kpi-value { color: var(--red-ink); }
.budget-tiles .kpi-value, .asset-tiles .kpi-value { font-size: 22px; }

@media (max-width: 1100px) {
  .pr-layout { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .kv2 { grid-template-columns: 1fr; gap: 8px; }
  .kv-wide { grid-template-columns: 110px 1fr; }
}
@media print {
  .pr-actions, #decision, .panel-head .btn, .pr .tk-crumb a { display: none !important; }
  .pr-layout { display: block; }
  .pr-rail { margin-top: 16px; }
  .pr-steps { grid-auto-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------- SLA cards
   Response and resolution shown separately on the ticket: state, a countdown that runs to the second,
   how much of the target is used, and why it was missed. */
.sla-panel .panel-body { display: flex; flex-direction: column; gap: 10px; }
.sla-card { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: var(--r-12); background: var(--surface-card); box-shadow: var(--ring); }
.sla-card.state-DUE_SOON { background: var(--amber-surface); box-shadow: inset 0 0 0 1px var(--amber-line); }
.sla-card.is-over { background: var(--red-surface); box-shadow: inset 0 0 0 1px var(--red-line); }
.sla-card.state-MET { background: var(--green-surface); box-shadow: inset 0 0 0 1px var(--green-line); }
.sla-card.state-PAUSED, .sla-card.state-NONE { background: var(--surface-fill); }
.sla-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.sla-head strong { display: block; font-size: 14px; font-weight: 600; color: var(--text-strong); }
.sla-what { display: block; font-size: 12px; color: var(--text-muted); }
.sla-main { display: flex; flex-direction: column; gap: 1px; }
.sla-label { font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.sla-time { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; line-height: 1.15; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.sla-time.over { color: var(--red-ink); }
.sla-time.good { color: var(--green-ink); }
.sla-card.state-DUE_SOON .sla-time { color: var(--amber-ink); }
.sla-sub { font-size: 12.5px; color: var(--text-3); }
.sla-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); }
.sla-foot .esc { font-weight: 600; color: var(--red-ink); }
.sla-reason { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding-top: 8px; border-top: 1px solid var(--red-line); font-size: 12.5px; color: var(--text-2); }
.sla-reason .sub { display: block; color: var(--text-muted); }
.sla-reason .link-btn { flex: none; }
.sla-note { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: var(--r-10); font-size: 12.5px; color: var(--text-2); }
.sla-note .icon { width: 16px; height: 16px; margin-top: 1px; }
.sla-note.paused { background: var(--slate-surface); }
.sla-note.running { background: var(--amber-surface); box-shadow: inset 0 0 0 1px var(--amber-line); }
.esc-list { list-style: none; margin: 0; padding: 0; }
.esc-list li { padding: 10px 0; border-top: 1px solid var(--line-hair); }
.esc-list li:first-child { border-top: 0; padding-top: 0; }
.esc-list li:last-child { padding-bottom: 0; }
.esc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.esc-head strong { font-size: 13.5px; font-weight: 600; color: var(--text-strong); }
.esc-list .sub { display: block; font-size: 12.5px; color: var(--text-muted); overflow-wrap: anywhere; }
.esc-list .sub.act { color: var(--text-2); }
@media print {
  .sla-reason .link-btn, .sla-panel .link-btn { display: none !important; }
}

/* ------------------------------------------------- administration extras
   Bulk selection, CSV import check, skills, subcategories, template placeholders,
   event log filters, backup and restore, notification choices. */
.sub-tabs { margin-bottom: 12px; }
.bulk-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; border-radius: var(--r-12); background: var(--action-tint); box-shadow: inset 0 0 0 1px var(--action-line); font-size: 13.5px; position: sticky; top: 8px; z-index: 5; }
.import-tiles { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin-bottom: 12px; }
.import-tiles .kpi-value { font-size: 22px; }
.import-table td { vertical-align: top; }
.import-table .issue { display: block; font-size: 12.5px; color: var(--red-ink); }
.import-table .issue.warn { color: var(--amber-ink); }
.badge.skill { background: var(--surface-subtle); color: var(--text-2); border-radius: var(--r-pill); }
.badge.skill.used { --b-surface: var(--teal-surface); --b-ink: var(--teal-ink); background: var(--teal-surface); color: var(--teal-ink); }
.badge.ph { font-family: var(--font-mono); font-size: 11.5px; background: var(--surface-subtle); color: var(--text-2); }
.cat-row td { background: var(--surface-head); }
.subcat-row td:first-child { padding-left: 34px; position: relative; }
.subcat-row td:first-child::before { content: ""; position: absolute; left: 18px; top: 0; bottom: 50%; width: 9px; border-left: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); border-bottom-left-radius: 4px; }
.ph-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.tpl-preview { white-space: pre-wrap; overflow-wrap: anywhere; padding: 12px 14px; border-radius: var(--r-10); background: var(--surface-fill); box-shadow: var(--ring-hair); font-size: 13.5px; color: var(--text); min-height: 3.2em; }
.filter-panel { margin-bottom: 4px; }
.filter-panel .filters { margin-bottom: 8px; }
.filter-panel input[type=text], .filter-panel input[type=search] { min-width: 190px; flex: 1 1 190px; max-width: 320px; }
.quick-ranges { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-subtle); border-radius: var(--r-10); }
.quick-ranges a { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; font-size: 13px; font-weight: 500; color: var(--text-3); border-radius: var(--r-8); white-space: nowrap; }
.quick-ranges a:hover { color: var(--text-strong); text-decoration: none; }
.quick-ranges a.on { background: var(--surface-card); color: var(--text-strong); font-weight: 600; box-shadow: var(--shadow-seg-on), var(--ring-hair); }
.audit-bar { margin: 4px 0 12px; font-size: 13.5px; }
.event-row a.ev { color: var(--text); }
.event-row a.ev:hover { color: var(--text-link); }
.backup-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.backup-grid h3 { font-size: 14.5px; font-weight: 600; margin-bottom: 4px; }
.backup-grid .help { margin: 0 0 12px; font-size: 13px; }
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; }
.staff-missing { color: var(--amber-ink); font-weight: 600; }
.pref-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 4px 24px; }
.pref-list li { padding: 8px 0; border-bottom: 1px solid var(--line-hair); }
.pref-list .check { align-items: flex-start; font-weight: 400; }
.pref-list .check input { margin-top: 3px; flex: none; }
.pref-list .check strong { display: block; font-weight: 600; }
.pref-list .sub { display: block; font-size: 12.5px; color: var(--text-muted); }
@media (max-width: 900px) {
  .backup-grid { grid-template-columns: 1fr; }
}

/* Users: the Delete action of a deactivated account */
.btn-ghost.del-btn { color: var(--red-ink); }
.btn-ghost.del-btn:hover { background: var(--red-surface); color: var(--red-ink); }
