/* =====================================================================
   CCTS design system, aligned with the JPMC HR Training System:
   hospital-sketch backdrop, translucent white shell, white rounded panels,
   JPMC burgundy and gold, pill buttons, soft borderless inputs.
   Station state keeps its meaning: green = done, gold = in progress.
   ===================================================================== */

:root {
  --brand-burgundy: #86374a;
  --brand-burgundy-hover: #702b3c;
  --brand-burgundy-soft: #f7edf0;
  --brand-gold: #e1b442;
  --brand-gold-hover: #edc768;
  --brand-gold-soft: #fbf4df;
  --brand-gold-line: #e8d6a6;
  --brand-gold-ink: #725414;
  --brand-ink: #3b222b;

  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --sunken: #f1f3f5;
  --hover: #f7f8fa;
  --line: #e8eaed;
  --line-strong: #d9dde2;
  --ink: #20272c;
  --ink-2: #41454d;
  --ink-3: #66717a;

  --accent: var(--brand-burgundy);
  --accent-hover: var(--brand-burgundy-hover);
  --accent-soft: var(--brand-burgundy-soft);
  --accent-ink: #ffffff;
  --icon: var(--brand-burgundy);
  --secondary-bg: var(--brand-gold-soft);
  --secondary-hover: #f3e5bd;
  --secondary-line: var(--brand-gold-line);
  --secondary-text: var(--brand-burgundy-hover);

  --done: #276650;
  --done-soft: #e5f1eb;
  --active: #e1b442;
  --active-ink: #725414;
  --active-soft: #fbf4df;
  --danger: #9f293a;
  --danger-soft: #f8e9ec;
  --info: #2f5e8c;
  --info-soft: #e8eff7;
  --pending: #dfe3e7;
  --focus: var(--brand-burgundy);
  --scrim: rgba(12, 20, 28, .52);

  --shadow: 0 20px 70px rgba(30, 39, 43, .07);
  --shadow-card: 0 5px 25px rgba(30, 39, 43, .03);
  --shadow-overlay: 0 24px 90px rgba(0, 0, 0, .25);
  --shadow-pop: 0 12px 32px rgba(11, 15, 25, .16), 0 2px 6px rgba(11, 15, 25, .06);
  --curve: cubic-bezier(.22, 1, .36, 1);
  --ease: var(--curve);

  --font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: var(--font);
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 30px;
  --r-sm: 10px;
  --r-md: 12px;
  --r-lg: 21px;
  --sidebar: 278px;
  --topbar: 86px;

  --scrollbar-thumb: var(--brand-burgundy);
  --scrollbar-thumb-hover: var(--brand-burgundy-hover);
  --scrollbar-track: #f5efdf;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --brand-burgundy-soft: #382830;
  --brand-gold-soft: #332e22;
  --brand-gold-line: #665735;
  --brand-gold-ink: var(--brand-gold-hover);

  --bg: #12191e;
  --surface: #1b252b;
  --surface-2: #212d34;
  --sunken: #182127;
  --hover: #212d34;
  --line: #303d45;
  --line-strong: #3d4b54;
  --ink: #edf1f3;
  --ink-2: #c3ccd5;
  --ink-3: #a8b5be;

  --accent: var(--brand-gold);
  --accent-hover: var(--brand-gold-hover);
  --accent-soft: #332e22;
  --accent-ink: var(--brand-ink);
  --icon: var(--brand-gold);
  --secondary-bg: var(--brand-gold-soft);
  --secondary-hover: #463b25;
  --secondary-line: var(--brand-gold-line);
  --secondary-text: var(--brand-gold-hover);

  --done: #91d2b5;
  --done-soft: rgba(145, 210, 181, .13);
  --active: #e1b442;
  --active-ink: #edc768;
  --active-soft: rgba(225, 180, 66, .14);
  --danger: #f5a8b6;
  --danger-soft: rgba(245, 168, 182, .12);
  --info: #9cc2e8;
  --info-soft: rgba(156, 194, 232, .12);
  --pending: #3a4650;
  --focus: var(--brand-gold);

  --shadow: 0 20px 70px rgba(0, 0, 0, .14);
  --shadow-card: 0 5px 25px rgba(0, 0, 0, .12);
  --shadow-overlay: 0 24px 90px rgba(0, 0, 0, .5);
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, .32);
  --scrollbar-thumb: var(--brand-gold);
  --scrollbar-thumb-hover: var(--brand-gold-hover);
  --scrollbar-track: #352832;
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-size: 16px; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--ink); font-family: var(--font); font-size: var(--fs-md); line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(135deg, rgba(248, 248, 246, .48), rgba(235, 238, 237, .62)), url("../img/menu_bg.png") center / cover fixed no-repeat, var(--bg);
}
[data-theme="dark"] body { background: linear-gradient(135deg, rgba(19, 28, 33, .68), rgba(27, 36, 41, .78)), url("../img/menu_bg.png") center / cover fixed no-repeat, var(--bg); }
h1, h2, h3, h4 { margin: 0; font-family: var(--font); font-weight: 650; letter-spacing: -.02em; line-height: 1.25; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.num, time, .tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
[tabindex="-1"]:focus { outline: none; }
::selection { background: var(--secondary-bg); }
svg { stroke-width: 1.7; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }

/* scrollbars (burgundy on light, gold on dark) */
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track); }
@supports selector(::-webkit-scrollbar) {
  * { scrollbar-width: auto; scrollbar-color: auto; }
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: var(--scrollbar-track); border-radius: 999px; }
  ::-webkit-scrollbar-thumb { min-width: 32px; min-height: 32px; background: var(--scrollbar-thumb); border: 2px solid var(--scrollbar-track); border-radius: 999px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }
  ::-webkit-scrollbar-corner { background: var(--scrollbar-track); }
  ::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
  /* Scroll areas inside cards, panels, dialogs and menus: a slim rounded thumb on a clear track, held clear of the
     rounded corners. The page's own scrollbar (above) keeps the full style. */
  body *::-webkit-scrollbar { width: 8px; height: 8px; }
  body *::-webkit-scrollbar-track { background: transparent; margin: 14px; }
  body *::-webkit-scrollbar-thumb { min-width: 36px; min-height: 36px; border: 2px solid transparent; background-clip: padding-box; background-color: color-mix(in srgb, var(--scrollbar-thumb) 40%, transparent); }
  body *:hover::-webkit-scrollbar-thumb { background-color: color-mix(in srgb, var(--scrollbar-thumb) 70%, transparent); }
  body *::-webkit-scrollbar-thumb:hover, body *::-webkit-scrollbar-thumb:active { background-color: var(--scrollbar-thumb); }
  body *::-webkit-scrollbar-corner { background: transparent; }
}
@supports not selector(::-webkit-scrollbar) {
  body * { scrollbar-color: color-mix(in srgb, var(--scrollbar-thumb) 55%, transparent) transparent; }
}

/* ------------------------------------------------------------------ shell */
.shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar {
  width: var(--sidebar); flex-shrink: 0; position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column;
  padding: 18px 12px; background: rgba(255, 255, 255, .94); box-shadow: 10px 0 28px rgba(30, 39, 43, .035); z-index: 40;
}
[data-theme="dark"] .sidebar { background: rgba(20, 29, 39, .96); box-shadow: 10px 0 28px rgba(0, 0, 0, .12); }
.brand { display: flex; align-items: center; gap: 12px; padding: 9px; color: var(--ink); flex-shrink: 0; }
.brand-mark { display: grid; place-items: center; width: 45px; height: 45px; flex-shrink: 0; border-radius: 13px; background: #fff; box-shadow: 0 8px 20px rgba(30, 39, 43, .05); }
.brand-mark img { width: 35px; height: 35px; object-fit: contain; }
.brand-name { display: block; font-size: 14px; line-height: 1.5; font-weight: 700; }
.brand-sub { display: block; font-size: 11px; line-height: 1.5; color: var(--ink-3); margin-top: 2px; }
.sidebar-nav { flex: 1; min-height: 0; margin-top: 22px; padding: 4px 2px 22px; overflow-y: auto; overscroll-behavior: contain; }
.nav-group { margin: 0 10px 11px; color: var(--ink-3); font-size: 10px; font-weight: 700; line-height: 1.4; letter-spacing: .06em; text-transform: uppercase; }
.sidebar-nav .nav-group:not(:first-child) { margin-top: 26px; }
.nav-link {
  width: 100%; display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 9px 11px; margin-bottom: 2px; border: 0; border-radius: 9px;
  color: var(--ink-2); background: transparent; font-size: 13px; font-weight: 600; line-height: 1.5; text-align: left; text-decoration: none;
  transition: background .25s var(--curve), color .25s var(--curve);
}
.nav-link svg { width: 19px; height: 19px; flex: none; color: var(--icon); }
.nav-link:hover, .nav-link[aria-current="page"] { background: var(--secondary-bg); color: var(--ink); }
.nav-link[aria-current="page"] { box-shadow: inset 4px 0 0 var(--accent); }
.nav-count { margin-left: auto; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.sidebar-foot { flex-shrink: 0; padding: 13px 4px 0; margin-top: 14px; border-top: 1px solid var(--line); }
.account-link { display: flex; align-items: center; gap: 12px; padding: 8px; margin: 0 0 7px; border-radius: 9px; color: var(--ink); text-decoration: none; min-width: 0; }
.account-link:hover { background: var(--hover); }
.account-link .who { min-width: 0; }
.account-link b { display: block; font-size: 12px; font-weight: 700; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-link .who span { display: block; color: var(--ink-3); font-size: 11px; line-height: 1.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 12px; background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 700; letter-spacing: .02em;
}
.theme-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; margin: 0 2px 5px; padding: 7px 10px; border-radius: 9px; font-size: 11px; font-weight: 600; color: var(--ink-3); cursor: pointer; }
.theme-switch:hover { background: var(--hover); }
.theme-switch input {
  appearance: none; -webkit-appearance: none; width: 38px; height: 22px; flex-shrink: 0; margin: 0; padding: 0; border: 0; border-radius: 20px;
  background: #d5dce1; position: relative; cursor: pointer; transition: background .3s var(--curve);
}
.theme-switch input::before { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(30, 39, 43, .15); transition: transform .3s var(--curve); }
.theme-switch input:checked { background: var(--accent); }
.theme-switch input:checked::before { transform: translateX(16px); }
[data-theme="dark"] .theme-switch input:checked::before { background: var(--brand-ink); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar); position: sticky; top: 0; z-index: 30; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 15px;
  padding: 0 42px; background: rgba(255, 255, 255, .9); box-shadow: 0 8px 24px rgba(30, 39, 43, .035); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
[data-theme="dark"] .topbar { background: rgba(20, 29, 39, .92); }
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 14px; min-width: 0; }
.breadcrumb { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb > span { margin: 0 10px; opacity: .5; }
.breadcrumb b { font-weight: 600; color: var(--ink-2); }
.access-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.demo-badge { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; margin-left: 12px; padding: 0 11px; border-radius: 999px; background: var(--active-soft); color: var(--active-ink); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.demo-badge svg { width: 13px; height: 13px; }
.access-badge svg { width: 16px; height: 16px; color: var(--icon); }
.search-trigger {
  display: inline-flex; align-items: center; gap: 10px; width: 280px; min-height: 42px; padding: 0 8px 0 14px; border: 1px solid transparent; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-3); font-size: 13px; cursor: pointer; text-align: left;
}
.search-trigger:hover { border-color: var(--line); }
.search-trigger svg { width: 16px; height: 16px; flex: none; color: var(--icon); }
.search-trigger span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-trigger kbd { white-space: nowrap; flex: none; }
.mobile-menu { display: none !important; }
.content { width: 100%; max-width: 1480px; margin: 0 auto; padding: 30px 42px 44px; flex: 1; outline: none; }
.workspace-footer { display: flex; justify-content: space-between; gap: 20px; padding: 0 42px 23px; font-size: 11px; color: var(--ink-3); }

/* ------------------------------------------------------------------ page heading */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin: 0 0 28px; }
.page-title { min-width: 0; }
.page-head h1 { font-size: clamp(1.85rem, 2.6vw, 2.45rem); font-weight: 650; letter-spacing: -.035em; line-height: 1.18; overflow-wrap: anywhere; }
.page-head .sub { display: block; margin-top: 12px; color: var(--ink-3); font-size: 15px; line-height: 1.6; max-width: 640px; }
.page-head .sub:empty { display: none; }
.page-head .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; flex-shrink: 0; margin-top: 6px; }
.page-body { padding: 0; }
.page-body.flush { padding: 0; }

/* ------------------------------------------------------------------ controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 19px; border-radius: 999px;
  border: 1px solid var(--secondary-line); background: var(--secondary-bg); color: var(--secondary-text); font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; text-decoration: none; line-height: 1.2;
  transition: transform .25s var(--curve), background-color .2s var(--curve), color .2s var(--curve), border-color .2s var(--curve);
}
.btn:hover { background: var(--secondary-hover); }
.btn:active { transform: scale(.98); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.quiet:hover { background: var(--surface-2); color: var(--ink); }
.btn.quiet svg { color: var(--icon); }
.btn.danger { color: var(--danger); background: var(--accent-soft); border-color: transparent; }
.btn.danger.solid { background: var(--brand-burgundy); border-color: var(--brand-burgundy); color: #fff; }
.btn.danger.solid:hover { background: var(--brand-burgundy-hover); }
.btn.sm { min-height: 32px; padding: 0 13px; font-size: 12px; gap: 6px; }
.btn.sm svg { width: 14px; height: 14px; }
.btn.icon { width: 42px; padding: 0; }
.btn.sm.icon { width: 32px; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; cursor: not-allowed; }
.btn.go { background: var(--done); border-color: var(--done); color: #fff; }
[data-theme="dark"] .btn.go { color: #10241b; }
.btn.go:hover { filter: brightness(.95); }
.btn.go-in { background: var(--surface); border-color: var(--done); color: var(--done); }
.btn.go-in:hover { background: var(--done-soft); }
.button-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(225, 180, 66, .18); color: var(--brand-gold-hover); transition: transform .3s var(--curve); }
.button-icon svg { width: 16px; height: 16px; }
.btn:hover .button-icon { transform: translate(2px, -2px); }
[data-theme="dark"] .btn.primary .button-icon { background: rgba(59, 34, 43, .12); color: var(--brand-ink); }

kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-3); font: 600 11px var(--font);
}

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .field > .label { font-size: 13px; font-weight: 600; color: var(--ink); }
.field .hint { font-size: 12px; color: var(--ink-3); line-height: 1.6; }
.field .error { font-size: 12px; color: var(--danger); }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid transparent; border-radius: var(--r-md); background: var(--surface-2); color: var(--ink);
  font-size: 14px; transition: border-color .2s var(--curve), background .2s var(--curve);
}
textarea.input { min-height: 84px; padding: 11px 14px; resize: vertical; line-height: 1.55; }
.input:hover { border-color: var(--line); }
/* background-color, not the background shorthand: the shorthand would reset the select arrow to a tiled pattern. */
.input:focus { background-color: var(--surface); border-color: var(--accent); outline: 2px solid var(--accent-soft); outline-offset: 1px; }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input.sm { min-height: 38px; padding: 7px 12px; border-radius: var(--r-sm); font-size: 13px; }
select.input.sm { padding-right: 32px; background-position: right 11px center; }
select.input { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2386374a' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; }
[data-theme="dark"] select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23e1b442' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.check { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; }
.form-grid .span-2 { grid-column: span 2; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.form-actions .left { margin-right: auto; font-size: 12px; color: var(--ink-3); }

.search-box { position: relative; }
.search-box svg { position: absolute; left: 13px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--icon); pointer-events: none; }
.search-box .input { padding-left: 38px; }

.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); }
.segmented button { min-height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: none; font-size: 12px; font-weight: 600; color: var(--ink-3); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--accent); box-shadow: 0 2px 8px rgba(30, 39, 43, .08); }

/* ------------------------------------------------------------------ tabs (bordered chips) */
.tabs { display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: thin; border-bottom: 1px solid var(--line); margin: 0 0 18px; padding: 0 0 16px; }
.tab {
  display: inline-flex; align-items: center; gap: 9px; flex-shrink: 0; min-height: 39px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--ink-3); font-size: 13px; font-weight: 600; white-space: nowrap; text-decoration: none; cursor: pointer;
}
.tab:hover { color: var(--accent); border-color: var(--accent); }
.tab[aria-selected="true"] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
.tab .count { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 22px; padding: 1px 7px; border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 11px; font-variant-numeric: tabular-nums; }
.content > .tabs { border-bottom: 0; padding-bottom: 2px; margin-bottom: 20px; }
.tabs { scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }

/* ------------------------------------------------------------------ pills and flags */
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 2px 10px; border-radius: 18px; font-size: 11px; font-weight: 600;
  white-space: nowrap; background: var(--surface-2); color: var(--ink-3); line-height: 1.5;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.plain::before { display: none; }
.pill[data-tone="success"] { background: var(--done-soft); color: var(--done); }
.pill[data-tone="progress"], .pill[data-tone="warning"] { background: var(--active-soft); color: var(--active-ink); }
.pill[data-tone="danger"] { background: var(--danger-soft); color: var(--danger); }
.pill[data-tone="info"] { background: var(--info-soft); color: var(--info); }
.pill[data-tone="accent"] { background: var(--accent-soft); color: var(--accent); }
.tag { display: inline-flex; align-items: center; min-height: 20px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-size: 11px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.flags { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.flag { display: inline-flex; align-items: center; gap: 5px; min-height: 22px; padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.flag svg { width: 12px; height: 12px; }
.flag.overdue { background: var(--danger-soft); color: var(--danger); }
.flag.results { background: var(--info-soft); color: var(--info); }
.flag.roi { background: var(--active-soft); color: var(--active-ink); }
.flag.fu { background: var(--surface-2); color: var(--ink-2); }
.flag.ready { background: var(--done-soft); color: var(--done); }

/* ------------------------------------------------------------------ the circuit */
.circuit { display: flex; gap: 3px; align-items: center; min-width: 80px; }
.circuit i { flex: 1 1 0; height: 8px; border-radius: 3px; background: var(--pending); min-width: 5px; }
.circuit i[data-s="Completed"] { background: var(--done); }
.circuit i[data-s="In Progress"] { background: repeating-linear-gradient(-45deg, var(--active) 0 3px, color-mix(in srgb, var(--active) 45%, var(--surface)) 3px 6px); }
.circuit-cell { display: flex; align-items: center; gap: 10px; }
.circuit-cell .pct { font-size: 12px; color: var(--ink-3); width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.circuit.empty { color: var(--ink-3); font-size: 12px; }
.track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(66px, 1fr); gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.track-step { display: flex; flex-direction: column; gap: 7px; min-width: 0; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; color: inherit; }
.track-step .bar { height: 10px; border-radius: 4px; background: var(--pending); }
.track-step[data-s="Completed"] .bar { background: var(--done); }
.track-step[data-s="In Progress"] .bar { background: repeating-linear-gradient(-45deg, var(--active) 0 4px, color-mix(in srgb, var(--active) 45%, var(--surface)) 4px 8px); }
.track-step .name { font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-step .when { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; min-height: 15px; }
.track-step[data-s="Completed"] .name { color: var(--ink); }
.track-step:hover .bar { filter: brightness(.95); }

/* ------------------------------------------------------------------ panels, lists, metric cards */
.panel { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-card); min-width: 0; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 22px 26px 12px; }
.panel-head h2, .panel-head h3 { font-size: 16px; font-weight: 650; letter-spacing: -.015em; }
.panel-head .meta { color: var(--ink-3); font-size: 13px; }
.panel-head .actions { margin-left: auto; display: flex; gap: 6px; }
.panel-body { padding: 6px 26px 24px; }
.panel-foot { padding: 14px 26px 20px; border-top: 1px solid var(--line); font-size: 13px; }
.list-panel { padding: 24px 26px 22px; }
.filter-panel { padding: 22px 26px; margin-bottom: 24px; }
.filter-panel .toolbar { margin: 0; }

.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px; }
.strip > * {
  position: relative; display: block; min-width: 0; padding: 22px 23px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-card);
  color: inherit; text-decoration: none; transition: transform .4s cubic-bezier(.32, .72, 0, 1), box-shadow .4s cubic-bezier(.32, .72, 0, 1);
}
.strip a:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(30, 39, 43, .06); }
.strip .metric-icon { position: absolute; top: 20px; right: 20px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--secondary-bg); color: var(--brand-gold-ink); }
.strip .metric-icon svg { width: 18px; height: 18px; }
.strip .value { font-size: var(--fs-2xl); font-weight: 650; line-height: 1.1; letter-spacing: -.05em; font-variant-numeric: tabular-nums; padding-right: 40px; }
.strip .value small { font-size: 15px; color: var(--ink-3); font-weight: 600; margin-left: 2px; letter-spacing: 0; }
.strip .label { font-size: 12px; color: var(--ink-3); margin-top: 8px; line-height: 1.6; }
.strip .value.danger { color: var(--danger); }
.strip .value.good { color: var(--done); }

.rows { list-style: none; margin: 0; padding: 0; }
.rows > li + li { box-shadow: 0 -1px 0 var(--line); }
.panel > .rows:last-child > li:last-child > .row-link { border-radius: 0 0 var(--r-lg) var(--r-lg); }
.panel-note { padding: 2px 26px 22px; color: var(--ink-3); font-size: 13px; }
.row-link { display: flex; align-items: center; gap: 14px; padding: 14px 26px; text-decoration: none; color: inherit; min-width: 0; transition: background .25s var(--curve); }
.row-link:hover { background: var(--surface-2); }
.row-link .grow { flex: 1; min-width: 0; }
.row-link .title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.row-link .meta { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.row-link .side { text-align: right; font-size: 13px; color: var(--ink-2); flex: none; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 40px 20px; text-align: center; color: var(--ink-3); font-size: 13px; }
.empty > svg { width: 30px; height: 30px; color: var(--icon); opacity: .8; }
.empty strong { color: var(--ink); font-size: 15px; }

/* ------------------------------------------------------------------ data table */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 0 16px; }
.toolbar .search-box { width: 280px; max-width: 100%; }
.toolbar .spacer { flex: 1; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; margin: 0 0 18px; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 4px 0 11px; border-radius: 999px; background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--ink-2); }
.chip button { display: grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 50%; background: none; color: var(--ink-3); cursor: pointer; }
.toggle-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--ink-3); cursor: pointer; }
.toggle-chip:hover { color: var(--accent); }
.toggle-chip[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }

/* position: relative keeps absolutely placed content (such as .sr-only labels) inside the scroll area. */
.table-wrap { position: relative; overflow-x: auto; border-radius: var(--r-md); }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.data th { background: var(--surface-2); text-align: left; font-size: 11px; font-weight: 600; color: var(--ink-3); padding: 12px 11px; white-space: nowrap; }
table.data th:first-child { border-radius: var(--r-md) 0 0 var(--r-md); }
table.data th:last-child { border-radius: 0 var(--r-md) var(--r-md) 0; }
table.data th button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
table.data th button:hover { color: var(--accent); }
table.data th button:focus-visible { outline: 2px solid var(--focus); border-radius: 3px; }
table.data th[aria-sort] { color: var(--accent); }
table.data th svg { width: 12px; height: 12px; }
table.data td { padding: 14px 11px; border-bottom: 1px solid var(--line); vertical-align: middle; line-height: 1.5; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr { cursor: pointer; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data tbody tr[aria-selected="true"] td { background: var(--accent-soft); }
table.data tbody tr[aria-selected="true"] td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
table.data td:first-child, table.data th:first-child { padding-left: 16px; }
table.data td:last-child, table.data th:last-child { padding-right: 16px; }
table.data .name { font-weight: 600; color: var(--ink); }
table.data td[data-col="client"] { min-width: 170px; }
table.data .sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
table.data .nowrap { white-space: nowrap; }
table.data.compact td { padding-top: 11px; padding-bottom: 11px; }
table.data.static tbody tr { cursor: default; }
table.data.static tbody tr:hover td { background: none; }
.cell-trunc { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-trunc.narrow { max-width: 96px; }
.pager { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); flex-wrap: wrap; }
.pager .spacer { flex: 1; }
.skeleton { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--sunken) 25%, var(--surface-2) 50%, var(--sunken) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* bulk selection */
th.pick, td.pick { width: 46px; padding-right: 0 !important; }
th.pick input, td.pick input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; vertical-align: middle; cursor: pointer; }
.bulk-bar {
  position: fixed; z-index: 40; bottom: 24px; left: calc(50% + var(--sidebar) / 2); transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 18px; border-radius: 999px; background: var(--brand-ink); color: #fff; box-shadow: var(--shadow-pop); font-size: 13px; animation: toast-in .18s var(--curve);
}
.bulk-bar[hidden] { display: none; }
.bulk-bar .btn.primary { background: var(--brand-gold); border-color: var(--brand-gold); color: var(--brand-ink); }
.bulk-bar .btn.quiet { color: #fff; }
.bulk-bar .btn.quiet:hover { background: rgba(255, 255, 255, .12); }
.bulk-bar .btn.quiet svg { color: currentColor; opacity: .85; }

/* ------------------------------------------------------------------ overlays */
.scrim { position: fixed; inset: 0; z-index: 60; background: var(--scrim); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transition: opacity .2s var(--curve); }
.scrim.open { opacity: 1; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(820px, 100vw); display: flex; flex-direction: column; background: var(--surface);
  border-radius: 24px 0 0 24px; box-shadow: var(--shadow-overlay); transform: translateX(28px); opacity: 0; transition: transform .25s var(--curve), opacity .18s var(--curve); overflow: hidden;
}
.drawer.open { transform: none; opacity: 1; }
.drawer.narrow { width: min(580px, 100vw); }
.drawer-head { display: flex; align-items: flex-start; gap: 14px; padding: 24px 28px 18px; border-bottom: 1px solid var(--line); }
.drawer-head .grow { flex: 1; min-width: 0; }
.drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.drawer-section { padding: 22px 28px; border-bottom: 1px solid var(--line); }
.drawer-section:last-child { border-bottom: 0; }
.drawer-foot { padding: 14px 28px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; align-items: center; background: var(--surface-2); }
.drawer-foot .left { margin-right: auto; font-size: 12px; color: var(--ink-3); }
.drawer .tabs { padding: 14px 28px; margin: 0; }

.dialog-layer { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: var(--scrim); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.dialog { width: min(500px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border-radius: 23px; box-shadow: var(--shadow-overlay); }
.dialog.wide { width: min(660px, 100%); }
.dialog h2 { font-size: 22px; letter-spacing: -.03em; padding: 28px 30px 0; }
.dialog .body { padding: 12px 30px 6px; color: var(--ink-3); font-size: 14px; line-height: 1.7; }
.dialog .form-actions { padding: 18px 30px 26px; margin: 0; }

.menu { position: fixed; z-index: 90; min-width: 210px; padding: 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-pop); }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 10px; border: 0; border-radius: 7px; background: none; font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer; text-align: left; text-decoration: none; }
.menu button:hover, .menu a:hover, .menu button:focus-visible { background: var(--surface-2); outline: none; }
.menu button.danger { color: var(--danger); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }
.menu svg { width: 16px; height: 16px; color: var(--icon); }

.toasts { position: fixed; z-index: 100; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: min(540px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 13px;
  background: var(--brand-ink); color: #fff; font-size: 13px; box-shadow: var(--shadow-pop); pointer-events: auto; animation: toast-in .2s var(--curve);
}
.toast svg { width: 17px; height: 17px; flex: none; color: var(--brand-gold); }
.toast.error { background: var(--brand-burgundy); }
.toast.error svg { color: #fff; }
.toast button { margin-left: auto; border: 0; background: none; color: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.palette-layer { position: fixed; inset: 0; z-index: 95; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: var(--scrim); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.palette { width: min(640px, 100%); background: var(--surface); border-radius: 23px; box-shadow: var(--shadow-overlay); overflow: hidden; }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.palette-input svg { width: 19px; height: 19px; color: var(--icon); }
.palette-input input { flex: 1; height: 58px; border: 0; background: none; font-size: 16px; outline: none; }
.palette-list { max-height: 50vh; overflow-y: auto; padding: 8px; }
.palette-group { padding: 10px 12px 5px; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.palette-item { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 42px; padding: 8px 12px; border: 0; border-radius: 10px; background: none; text-align: left; cursor: pointer; font-size: 14px; }
.palette-item svg { width: 17px; height: 17px; color: var(--icon); flex: none; }
.palette-item .meta { margin-left: auto; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.palette-item[aria-selected="true"] { background: var(--secondary-bg); }
.palette-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); background: var(--surface-2); }

/* ------------------------------------------------------------------ client workspace */
.ws-name { font-size: 24px; letter-spacing: -.035em; line-height: 1.2; }
.ws-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.ws-meta span { display: inline-flex; align-items: center; gap: 6px; }
.ws-meta svg { width: 15px; height: 15px; color: var(--icon); }
.ws-state { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ws-progress { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.ws-progress h3 { font-size: 15px; }
.ws-progress .meta { font-size: 13px; color: var(--ink-3); }
.stations { list-style: none; margin: 0; padding: 0; }
.station { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.station:last-child { border-bottom: 0; }
.station .dot { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--pending); background: var(--surface); }
.station[data-s="Completed"] .dot { border-color: var(--done); background: var(--done); }
.station[data-s="In Progress"] .dot { border-color: var(--active); background: var(--active-soft); box-shadow: 0 0 0 3px var(--active-soft); }
.station .st-name { font-weight: 600; }
.station .st-times { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; }
.station .st-times b { color: var(--ink-2); font-weight: 600; }
.station .st-actions { display: flex; gap: 6px; align-items: center; }
.station-edit { grid-column: 2 / -1; padding: 12px 0 4px; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin: 0; }
.kv > div { min-width: 0; }
.kv dt { font-size: 12px; color: var(--ink-3); margin-bottom: 3px; }
.kv dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; white-space: pre-line; }
.kv dd.empty-val { color: var(--ink-3); }
.kv .span-2 { grid-column: span 2; }
.section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.section-head h3 { font-size: 15px; }
.section-head .actions { margin-left: auto; display: flex; gap: 6px; }
.draft-note { font-size: 11px; font-weight: 600; color: var(--active-ink); background: var(--active-soft); padding: 2px 9px; border-radius: 999px; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 18px 24px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: -6px; width: 1px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 1px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.timeline li[data-kind="close"]::after { border-color: var(--done); background: var(--done); }
.timeline li[data-kind="create"]::after { border-color: var(--accent); }
.timeline .t-head { font-size: 13px; }
.timeline .t-head b { font-weight: 600; }
.timeline .t-when { font-size: 12px; color: var(--ink-3); }
.changes { margin: 7px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; }
.changes dt { color: var(--ink-3); }
.changes dd { margin: 0; overflow-wrap: anywhere; }
.changes del { color: var(--ink-3); }
.changes ins { text-decoration: none; color: var(--ink); font-weight: 600; }
.note { padding: 14px 0; border-bottom: 1px solid var(--line); }
.note:last-child { border-bottom: 0; }
.note .who { font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.note .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.dropzone { border: 1.5px dashed var(--secondary-line); border-radius: var(--r-md); padding: 18px; text-align: center; color: var(--ink-3); font-size: 13px; background: var(--surface-2); }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.file-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.file-row:last-child { border-bottom: 0; }
.file-row .icon { width: 38px; height: 38px; border-radius: 11px; background: var(--secondary-bg); display: grid; place-items: center; flex: none; color: var(--brand-gold-ink); }
.file-row .icon svg { width: 18px; height: 18px; }
.file-row .grow { flex: 1; min-width: 0; }
.file-row .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-row .meta { font-size: 12px; color: var(--ink-3); }

/* Edit a station: activity date, time in and time out */
.times-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.times-edit { padding: 14px 16px 4px; margin: 10px 0 6px; border-radius: 14px; background: var(--surface-2); }
.times-edit .input { background-color: var(--surface); }
.times-edit .form-actions { margin-top: 12px; }
@media (max-width: 640px) {
  .times-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .times-fields > .field:first-child { grid-column: 1 / -1; }
}
/* ------------------------------------------------------------------ today */
.today-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 24px; margin-top: 24px; align-items: start; }
.today-side { display: flex; flex-direction: column; gap: 24px; }
.date-stepper { display: inline-flex; align-items: center; gap: 6px; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--active); box-shadow: 0 0 0 3px var(--active-soft); }
.attention-list .row-link .count { font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; min-width: 36px; text-align: right; }
.attention-list .row-link .count.danger { color: var(--danger); }

/* ------------------------------------------------------------------ schedule */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow { padding: 10px 12px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); background: var(--surface-2); }
.cal-day { min-height: 112px; padding: 8px 12px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; cursor: pointer; background: var(--surface); text-align: left; border-top: 0; border-left: 0; font: inherit; color: inherit; min-width: 0; }
.cal-day:nth-of-type(7n) { border-right: 0; }
.cal-day:hover { background: var(--surface-2); }
.cal-day.out { background: var(--surface-2); color: var(--ink-3); }
.cal-day[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day .d { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; }
.cal-day.today .d span { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 8px; }
.cal-ev { display: flex; align-items: center; gap: 5px; font-size: 11px; line-height: 1.35; padding: 2px 6px; border-radius: 6px; background: var(--surface-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.appointment { background: var(--accent-soft); color: var(--accent); }
.cal-ev.follow_up { background: var(--active-soft); color: var(--active-ink); }
.cal-ev.station { background: var(--done-soft); color: var(--done); }
.cal-ev.more { background: none; color: var(--ink-3); font-weight: 600; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.schedule-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }

/* ------------------------------------------------------------------ insights / charts */
.insight-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; margin-top: 24px; }
.insight-grid.top { align-items: start; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; } .span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; }
.chart { width: 100%; height: auto; max-height: 300px; display: block; overflow: visible; }
.chart text { fill: var(--ink-3); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .bar-done { fill: var(--done); }
.chart .bar-open { fill: var(--pending); }
.chart .bar-accent { fill: var(--accent); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; }
.chart .line-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.chart .sla { stroke: var(--brand-gold); stroke-dasharray: 5 4; stroke-width: 1.5; }
.chart rect:hover { opacity: .85; }
.legend-inline { display: flex; gap: 14px; font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }
.legend-inline i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 160px) minmax(0, 1fr) 70px; gap: 12px; align-items: center; font-size: 13px; }
.hbar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.hbar .track-bg { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; display: flex; }
.hbar .fill { height: 100%; background: var(--done); }
.hbar .fill.open { background: var(--pending); }
.hbar .fill.accent { background: var(--accent); }
.hbar .fill.danger { background: var(--danger); }
.hbar .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.heatmap { display: grid; grid-template-columns: 40px repeat(var(--cols), minmax(18px, 1fr)); gap: 3px; font-size: 11px; color: var(--ink-3); }
.heatmap .hm { aspect-ratio: 1.4; border-radius: 4px; background: var(--surface-2); }
.heatmap .hl { display: flex; align-items: center; }
.heatmap .hh { text-align: center; }

/* ------------------------------------------------------------------ sign in (JPMC frame, CCTS circuit artwork) */
.login-stage { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 36px; }
.login-frame { width: 100%; max-width: 1120px; display: grid; grid-template-columns: 1fr 1fr; min-height: 700px; padding: 7px; background: var(--surface); border-radius: 30px; box-shadow: var(--shadow); overflow: hidden; animation: enter .7s var(--curve) both; }
@keyframes enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.login-visual {
  position: relative; isolation: isolate; overflow: hidden; border-radius: 24px; padding: 33px 36px; color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(ellipse at 95% 65%, rgba(225, 160, 123, .27), transparent 60%), linear-gradient(155deg, #682435, #8f3045 56%, #752a3a);
  box-shadow: inset 0 0 0 2px var(--brand-gold);
}
[data-theme="dark"] .login-visual { background: radial-gradient(ellipse at 95% 65%, rgba(225, 160, 123, .14), transparent 60%), linear-gradient(155deg, #42202e, #672c3c 56%, #432733); }
.login-visual::after { content: ""; position: absolute; width: 600px; height: 600px; border: 1px solid rgba(255, 255, 255, .07); border-radius: 50%; left: 110px; top: 180px; z-index: -1; }
.visual-wordmark { display: flex; align-items: center; gap: 14px; font-size: 9px; letter-spacing: .19em; color: #efdce2; font-weight: 600; }
.monogram { font-size: 22px; font-weight: 700; letter-spacing: -.05em; color: #fff; }
.monogram span { display: inline-block; width: 5px; height: 5px; background: #f6c77b; border-radius: 50%; margin-left: 3px; }
.visual-main { transform: translateY(-20px); }
.visual-eyebrow { font-size: 10px; letter-spacing: .17em; color: #ead2d8; font-weight: 600; }
.visual-main h1 { font-size: clamp(2.7rem, 4.6vw, 3.9rem); line-height: 1.05; letter-spacing: -.055em; margin: 20px 0 22px; font-weight: 550; }
.visual-main p { font-size: 14px; line-height: 1.75; color: #efdce1; }
.login-circuit { position: relative; max-width: 330px; margin: 30px 0 0; padding: 20px 22px 18px; border-radius: 18px; background: linear-gradient(135deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .05)); box-shadow: inset 0 1px rgba(255, 255, 255, .2); }
.login-circuit .lc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #ead2d8; }
.login-circuit .lc-head b { font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: #fff; }
.lc-steps { position: relative; display: grid; gap: 11px; margin: 0; padding: 0 0 0 4px; list-style: none; }
.lc-steps::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; border-radius: 2px; background: linear-gradient(#f6d49e 0 56%, rgba(255, 255, 255, .2) 56%); }
.lc-steps li { position: relative; display: flex; align-items: center; gap: 14px; font-size: 13px; color: #f4e6ea; }
.lc-steps li i { position: relative; z-index: 1; width: 12px; height: 12px; flex: none; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); background: #7b2c3e; }
.lc-steps li.d i { border-color: #f6d49e; background: #f6d49e; }
.lc-steps li.a i { border-color: #f6d49e; box-shadow: 0 0 0 4px rgba(246, 212, 158, .25); }
.lc-steps li small { margin-left: auto; font-size: 11px; color: #e3c8cf; font-variant-numeric: tabular-nums; }
.lc-steps li.a small { color: #f6d49e; font-weight: 600; }
.lc-steps li.p { color: #d7bcc4; }
.login-panel { padding: 30px 43px 25px; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.login-brand-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.login-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-size: 13px; font-weight: 650; }
.login-brand img { width: 44px; height: 44px; object-fit: contain; }
.login-form-area { padding: 44px 3px 28px; text-align: center; }
.login-form-area .field { text-align: left; margin-bottom: 20px; }
.login-form-area h2 { font-size: 32px; font-weight: 600; line-height: 1.2; letter-spacing: -.045em; }
.login-intro { font-size: 14px; color: var(--ink-3); margin: 15px 0 30px; }
.login-form-area .notice { text-align: left; margin-bottom: 20px; }
.login-submit { width: 100%; position: relative; min-height: 52px; padding: 8px 54px; font-size: 14px; }
.login-submit .button-icon { position: absolute; right: 10px; }
.account-help { color: var(--ink-3); font-size: 12px; line-height: 1.8; margin-top: 24px; }
.account-help strong { font-weight: 500; color: var(--ink); }
.login-footer { display: flex; justify-content: space-between; gap: 10px; align-items: center; color: var(--ink-3); font-size: 10px; }
.login-footer > span { display: flex; align-items: center; gap: 5px; }
.login-footer svg { width: 15px; height: 15px; color: var(--icon); }
.login-footer small { font-size: 10px; text-align: right; line-height: 1.7; }
.password-control { position: relative; }
.password-control .input { padding-right: 52px; }
.password-control .btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: inline; }
[data-theme="dark"] .theme-toggle .moon { display: none; }

/* compact password card (first sign-in and account security) */
.password-stage { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 28px 16px; }
.password-panel { width: min(100%, 520px); padding: 36px 38px 32px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.password-card-heading { text-align: center; margin-bottom: 22px; }
.password-card-icon { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 19px; border-radius: 18px; background: var(--accent-soft); color: var(--icon); }
.password-card-icon svg { width: 25px; height: 25px; }
.password-card-heading h1 { font-size: clamp(1.55rem, 2.4vw, 1.85rem); line-height: 1.2; letter-spacing: -.035em; }
.password-card-intro { max-width: 390px; margin: 11px auto 0; color: var(--ink-3); font-size: 13px; line-height: 1.7; }
.password-panel .field { margin-bottom: 18px; }
.password-card-actions { display: grid; gap: 8px; margin-top: 6px; }
.password-card-actions .btn { width: 100%; min-height: 50px; }
.password-card-actions .btn.quiet { min-height: 42px; color: var(--ink-3); }

.notice { padding: 13px 16px; border-radius: 13px; font-size: 13px; line-height: 1.6; background: var(--surface-2); color: var(--ink-2); }
.notice.error { background: var(--accent-soft); color: var(--danger); }
.notice.warn { background: var(--active-soft); color: var(--active-ink); }
.notice.info { background: var(--info-soft); color: var(--info); }

/* ------------------------------------------------------------------ misc */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.perm-matrix th, .perm-matrix td { text-align: center; }
.perm-matrix th:first-child, .perm-matrix td:first-child { text-align: left; }
.temp-pass { font-family: Consolas, "Cascadia Mono", monospace; font-size: 18px; letter-spacing: .04em; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); user-select: all; margin-top: 8px; color: var(--ink); }
.inline-list { display: flex; flex-wrap: wrap; gap: 6px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-page { display: grid; place-items: center; min-height: 40vh; }
.help-grid { display: grid; grid-template-columns: max-content 1fr; gap: 9px 16px; font-size: 13px; align-items: center; }

/* ------------------------------------------------------------------ spacing contract
   Everything inside a panel sits on the panel inset: 26px (18px on phones); tables keep a 20px gutter. */
.panel > .panel-body:first-child { padding-top: 24px; }
.panel > .table-wrap { margin: 0 20px 20px; }
.panel > .table-wrap:first-child { margin-top: 20px; }
.panel > .pager { margin: 0 26px; padding-bottom: 18px; }
.list-panel > .table-wrap, .list-panel > .table-wrap:first-child { margin: 0; }
.list-panel > .pager { margin: 8px 0 0; padding-bottom: 0; }
.panel > .panel-note:first-child { padding-top: 22px; }
.panel > .empty { padding: 36px 26px; }
.dialog form.body { color: var(--ink); padding-bottom: 28px; }
.dialog .body .form-actions { padding: 0; margin: 22px 0 0; }
.dialog .body .hint-line { font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.cal-panel { overflow: hidden; }
.cal-panel .panel-head { flex-wrap: wrap; padding-bottom: 16px; }
.cal-panel .legend { margin-left: auto; }
.account-card { display: flex; gap: 16px; align-items: center; }
.account-card .avatar { width: 48px; height: 48px; font-size: 15px; border-radius: 14px; }
.account-card b { display: block; font-size: 16px; font-weight: 650; }
.account-card span { font-size: 13px; color: var(--ink-3); }
.stack { display: grid; gap: 24px; }
.narrow-page { max-width: 760px; }

/* ------------------------------------------------------------------ drill-down: every figure opens the records behind it */
.strip > a { cursor: pointer; }
.strip > a:hover .label { color: var(--ink-2); }
.strip > a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.strip .go { position: absolute; right: 20px; bottom: 18px; width: 16px; height: 16px; color: var(--ink-3); opacity: 0; transition: opacity .2s var(--curve), transform .2s var(--curve); }
.strip > a:hover .go, .strip > a:focus-visible .go { opacity: 1; transform: translate(2px, -2px); }
a.hbar { color: inherit; text-decoration: none; margin: -5px -10px; padding: 5px 10px; border-radius: 10px; transition: background .2s var(--curve); }
a.hbar:hover, a.hbar:focus-visible { background: var(--surface-2); }
a.hbar:hover .lbl, a.hbar:focus-visible .lbl { color: var(--accent); }
.chart a { cursor: pointer; }
.chart a:hover rect, .chart a:focus rect { opacity: .78; }
.chart a:focus { outline: none; }
.chart a:focus-visible rect { stroke: var(--focus); stroke-width: 2; }
.chart a:hover text { fill: var(--accent); }
.heatmap a.hm { display: block; }
.heatmap a.hm:hover, .heatmap a.hm:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.drill { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 18px; padding: 10px 12px 10px 16px; border-radius: 14px; background: var(--secondary-bg); color: var(--secondary-text); font-size: 12px; }
.drill .lead { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; margin-right: 4px; }
.drill .lead svg { width: 15px; height: 15px; }
.drill .chip { background: var(--surface); color: var(--ink); }
.drill .btn { margin-left: auto; }

/* ------------------------------------------------------------------ live floor status (top bar) */
.live-status { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--done-soft); color: var(--done); font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.live-status:hover { filter: brightness(.97); }
.live-status .pulse { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 2s infinite; }
.live-status.quiet { background: var(--surface-2); color: var(--ink-3); }
.live-status.quiet .pulse { animation: none; opacity: .6; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 45%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ------------------------------------------------------------------ circuit board */
.board-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 20px; padding: 14px 16px 14px 24px; }
.board-bar .updated { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); }
.board-bar .spacer { flex: 1; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); grid-template-rows: auto; gap: 16px; overflow-x: auto; padding: 2px 2px 10px; align-items: start; scroll-snap-type: x proximity; }
.board.focus { grid-auto-flow: row; grid-template-columns: minmax(0, 1fr); max-width: 760px; }
.board-col { display: flex; flex-direction: column; min-width: 0; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-card); scroll-snap-align: start; }
.board-col-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 14px; border-bottom: 1px solid var(--line); }
.board-col-head .t { flex: 1; min-width: 0; }
.board-col-head h3 { font-size: 14px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-col.idle { background: color-mix(in srgb, var(--surface) 82%, transparent); box-shadow: none; }
.board-col.idle .col-icon { opacity: .7; }
.board-col-head .col-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 10px; background: var(--surface-2); color: var(--icon); }
.board-col-head .col-icon svg { width: 16px; height: 16px; }
.board-col.expected .col-icon { background: var(--info-soft); color: var(--info); }
.board-col.finished .col-icon { background: var(--done-soft); color: var(--done); }
.board-col-head .counts { display: block; margin-top: 3px; font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.board-col-head .counts b { font-weight: 600; }
.board-col-head .counts b.in { color: var(--active-ink); font-weight: 700; }
.board-col-body { display: flex; flex-direction: column; gap: 8px; padding: 12px 12px 14px; max-height: calc(100vh - 300px); overflow-y: auto; }
.board-label { padding: 6px 6px 2px; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.board-note { padding: 4px 6px; font-size: 12px; color: var(--ink-3); }
.board-card { display: grid; gap: 9px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid transparent; }
.board-card.in { background: var(--active-soft); border-color: color-mix(in srgb, var(--active) 35%, transparent); }
.board-card.long { border-color: color-mix(in srgb, var(--danger) 55%, transparent); }
.board-card .top { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.board-card .who { flex: 1; min-width: 0; padding: 0; border: 0; background: none; text-align: left; color: inherit; cursor: pointer; }
.board-card .who b { display: block; font-size: 13px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.board-card .who span { display: block; margin-top: 2px; font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-card .who:hover b { color: var(--accent); }
.board-card .clock { flex: none; font-size: 12px; font-weight: 650; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.board-card.in .clock { color: var(--active-ink); }
.board-card.long .clock { color: var(--danger); }
.board-card .bottom { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-height: 30px; }
.board-card .bottom .steps-left { margin-right: auto; }
.board-card .progress { display: block; height: 4px; border-radius: 999px; background: var(--pending); overflow: hidden; }
.board-card .progress i { display: block; height: 100%; border-radius: inherit; background: var(--done); }
.board-card .steps-left { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.board-card .btn.sm { min-height: 30px; padding: 0 12px; }

/* ------------------------------------------------------------------ company profile */
.profile-head { display: flex; align-items: flex-start; gap: 20px; min-width: 0; }
.profile-head h1 { font-size: clamp(1.6rem, 2.2vw, 2.1rem); line-height: 1.2; }
.company-mark { display: grid; place-items: center; width: 64px; height: 64px; flex: none; border-radius: 20px; background: var(--secondary-bg); color: var(--brand-gold-ink); font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.profile-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.profile-facts span { display: inline-flex; align-items: center; gap: 6px; }
.profile-facts svg { width: 15px; height: 15px; color: var(--icon); }
.day-badge { display: grid; place-items: center; width: 54px; flex: none; padding: 6px 0; border-radius: 12px; background: var(--surface-2); line-height: 1.1; }
.day-badge b { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.day-badge span { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.day-badge.upcoming { background: var(--info-soft); color: var(--info); }
.day-badge.upcoming span { color: inherit; }
.rows.scroll-list { max-height: 452px; overflow-y: auto; overscroll-behavior: contain; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.day-bar { display: flex; width: 120px; height: 6px; border-radius: 999px; background: var(--pending); overflow: hidden; }
.day-bar .c { background: var(--done); }
.day-bar .a { background: var(--active); }

/* ------------------------------------------------------------------ booking import */
.steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; padding: 0; counter-reset: step; }
.steps li { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 16px 6px 7px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-card); list-style: none; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.steps li::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: var(--surface-2); font-size: 12px; }
.steps li[aria-current="step"] { color: var(--ink); }
.steps li[aria-current="step"]::before { background: var(--accent); color: var(--accent-ink); }
.steps li.done::before { content: "\2713"; background: var(--done-soft); color: var(--done); }
.import-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
.import-drop { display: grid; justify-items: center; gap: 10px; padding: 34px 24px; border: 1.5px dashed var(--secondary-line); border-radius: 18px; background: var(--surface-2); text-align: center; font-size: 13px; color: var(--ink-3); }
.import-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.import-drop > svg { width: 34px; height: 34px; color: var(--icon); }
.import-drop strong { font-size: 15px; color: var(--ink); }
.or-line { display: flex; align-items: center; gap: 12px; margin: 18px 0; font-size: 12px; color: var(--ink-3); }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }
textarea.paste-area { min-height: 130px; font-family: Consolas, "Cascadia Mono", monospace; font-size: 12px; white-space: pre; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.map-item { display: grid; gap: 8px; min-width: 0; padding: 14px; border-radius: 14px; background: var(--surface-2); }
.map-item .col-name { font-size: 13px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-item .sample { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-item.unused { opacity: .7; }
.row-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.row-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.row-status.ready { color: var(--done); }
.row-status.warning { color: var(--active-ink); }
.row-status.error { color: var(--danger); }
.issue-list { display: grid; gap: 3px; margin: 6px 0 0; padding: 0; list-style: none; font-size: 12px; line-height: 1.5; }
.issue-list .err { color: var(--danger); }
.issue-list .warn { color: var(--active-ink); }
.issue-list a { color: inherit; text-decoration: underline; }
.sticky-actions { position: sticky; bottom: 18px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; padding: 10px 10px 10px 22px; border-radius: 999px; background: var(--brand-ink); color: #fff; box-shadow: var(--shadow-pop); font-size: 13px; }
.sticky-actions .grow { flex: 1; min-width: 0; }
.sticky-actions .btn.primary { background: var(--brand-gold); border-color: var(--brand-gold); color: var(--brand-ink); }
.sticky-actions .btn.quiet { color: #fff; }
.sticky-actions .btn.quiet:hover { background: rgba(255, 255, 255, .12); }
.defaults-grid { display: grid; gap: 16px; }

/* ------------------------------------------------------------------ my account (HR layout: summary beside the forms) */
.avatar.has-photo { overflow: hidden; background: var(--surface-2); }
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.account-layout { display: grid; grid-template-columns: minmax(260px, .72fr) minmax(0, 1.65fr); gap: 24px; align-items: start; }
.account-summary { position: sticky; top: calc(var(--topbar) + 24px); min-width: 0; max-height: calc(100vh - var(--topbar) - 48px); overflow-y: auto; overscroll-behavior: contain; padding: 32px 26px 26px; text-align: center; }
.account-photo { display: inline-grid; place-items: center; width: 104px; height: 104px; margin-bottom: 18px; overflow: hidden; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 32px; font-weight: 700; letter-spacing: .02em; box-shadow: 0 0 0 5px var(--surface), 0 0 0 6px var(--line); }
.account-photo img, .account-photo canvas { display: block; width: 100%; height: 100%; object-fit: cover; }
.account-photo.sm { width: 76px; height: 76px; margin: 0; flex: none; font-size: 24px; box-shadow: 0 0 0 4px var(--surface); }
.account-summary h2 { font-size: 20px; overflow-wrap: anywhere; }
.account-role { margin: 6px 0 14px; font-size: 13px; color: var(--ink-3); overflow-wrap: anywhere; }
.account-meta { display: grid; gap: 16px; margin: 26px 0 0; text-align: left; }
.account-meta dt { margin-bottom: 3px; font-size: 11px; color: var(--ink-3); }
.account-meta dd { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.account-meta dd small { display: block; font-size: 12px; color: var(--ink-3); }
.account-access, .account-nav { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); text-align: left; }
.account-access h3, .account-nav h3 { margin-bottom: 10px; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.account-access summary { display: flex; align-items: center; gap: 8px; min-height: 30px; list-style: none; cursor: pointer; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.account-access summary::-webkit-details-marker { display: none; }
.account-access summary .count { padding: 1px 8px; border-radius: 999px; background: var(--surface-2); letter-spacing: 0; color: var(--ink-2); }
.account-access summary svg { width: 15px; height: 15px; margin-left: auto; color: var(--icon); transition: transform .2s var(--curve); }
.account-access[open] summary svg { transform: rotate(180deg); }
.account-access summary:hover { color: var(--ink); }
.account-access[open] ul { margin-top: 10px; }
.account-access ul { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--ink-2); }
.account-access li { display: flex; align-items: flex-start; gap: 8px; line-height: 1.5; }
.account-access li svg { width: 14px; height: 14px; flex: none; margin-top: 3px; color: var(--done); }
.account-nav a { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 6px 10px; border-radius: 9px; color: var(--ink-2); font-size: 13px; font-weight: 600; text-decoration: none; }
.account-nav a:hover { background: var(--secondary-bg); color: var(--ink); }
.account-nav a svg { width: 16px; height: 16px; color: var(--icon); }
.account-note { margin-top: 20px; font-size: 12px; line-height: 1.7; color: var(--ink-3); text-align: left; }
.account-stack { display: grid; gap: 24px; min-width: 0; }
.account-panel { min-width: 0; padding: 30px 31px; scroll-margin-top: calc(var(--topbar) + 24px); }
.account-panel .panel-heading { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; margin-bottom: 22px; }
.account-panel .panel-heading .eyebrow { margin-bottom: 6px; }
.account-panel .panel-heading h2 { font-size: 20px; letter-spacing: -.02em; }
.account-panel .form-actions { margin-top: 22px; }
.account-hint { margin-top: 16px; font-size: 12px; line-height: 1.7; color: var(--ink-3); }
.photo-row { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; padding: 16px 18px; border-radius: 16px; background: var(--surface-2); }
.photo-row.over { outline: 2px dashed var(--accent); outline-offset: 2px; }
.photo-row .grow { flex: 1; min-width: 0; }
.photo-row b { display: block; font-size: 14px; }
.photo-row p { margin-top: 3px; font-size: 12px; line-height: 1.6; color: var(--ink-3); }
.photo-row .inline-list { gap: 8px; margin-top: 12px; }
.password-control [data-reveal] svg { width: 16px; height: 16px; }
.strength { display: flex; align-items: center; gap: 10px; font-size: 12px; line-height: 1.5; color: var(--ink-3); }
.strength .bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; width: 120px; flex: none; }
.strength .bar i { height: 5px; border-radius: 3px; background: var(--pending); }
.strength[data-score="1"] .bar i:nth-child(-n+1) { background: var(--danger); }
.strength[data-score="2"] .bar i:nth-child(-n+2) { background: var(--active); }
.strength[data-score="3"] .bar i:nth-child(-n+3), .strength[data-score="4"] .bar i { background: var(--done); }
.strength[data-score="1"] .text { color: var(--danger); }
.hint.caps { display: flex; align-items: center; gap: 6px; color: var(--active-ink); }
.hint.caps svg { width: 14px; height: 14px; }
.hint.match.ok { color: var(--done); }
.hint.match.no { color: var(--danger); }
.device-list, .event-list { margin: 0; padding: 0; list-style: none; }
.device, .event { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.device:first-child, .event:first-child { padding-top: 0; }
.device:last-child, .event:last-child { border-bottom: 0; padding-bottom: 0; }
.device .icon, .event .icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--surface-2); color: var(--icon); }
.device .icon svg, .event .icon svg { width: 18px; height: 18px; }
.event .icon { width: 34px; height: 34px; border-radius: 50%; }
.event.warn .icon { background: var(--danger-soft); color: var(--danger); }
.device .grow, .event .grow { flex: 1; min-width: 0; }
.device b, .event b { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.event b { font-size: 13px; }
.device .meta, .event .meta { margin-top: 2px; font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.event .when { flex: none; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.pref-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.pref-row:first-of-type { padding-top: 0; }
.pref-row:last-child { border-bottom: 0; padding-bottom: 0; }
.pref-row b { font-size: 14px; font-weight: 600; }
.pref-row p { margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.account-panel .strip { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.account-panel .strip > * { background: var(--surface-2); box-shadow: none; }

/* ------------------------------------------------------------------ command centre (Today) */
.cc-clock { display: grid; justify-items: end; margin-right: 6px; line-height: 1.1; }
.cc-clock b { font-size: 26px; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.cc-clock span { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.cc-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.cc-kpis > * { padding: 18px 16px 16px; border-top: 3px solid transparent; }
.cc-kpis > [data-tone="good"] { border-top-color: var(--done); }
.cc-kpis > [data-tone="warning"] { border-top-color: var(--active); }
.cc-kpis > [data-tone="danger"] { border-top-color: var(--danger); }
.cc-kpis > [data-tone="info"] { border-top-color: var(--info); }
.cc-kpis .value { font-size: 26px; padding-right: 34px; white-space: nowrap; }
.cc-kpis > [data-tone="warning"] .value { color: var(--active-ink); }
.cc-kpis .metric-icon { top: 16px; right: 14px; width: 28px; height: 28px; }
.cc-kpis .metric-icon svg { width: 15px; height: 15px; }
.cc-kpis .trend { margin-top: 6px; padding-right: 8px; font-size: 11.5px; line-height: 1.45; color: var(--ink-3); }
.cc-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 20px; margin-top: 22px; align-items: start; }
.cc-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.cc-panel .panel-head { padding: 20px 22px 10px; }
.cc-panel .panel-body { padding: 4px 22px 20px; }
.cc-panel .panel-note { padding-left: 22px; padding-right: 22px; }
.cc-panel > .table-wrap { margin: 0 16px 16px; }
.cc-panel .row-link { padding: 12px 22px; }
.cc-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0 22px 10px; font-size: 12px; color: var(--ink-3); }
.cc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cc-legend i { width: 10px; height: 10px; border-radius: 3px; }
.cc-legend .in, .load-bar .in { background: var(--active); }
/* Waiting uses the danger tone (a queue is the thing to act on), striped so it reads without colour too. */
.cc-legend .wait, .load-bar .wait { background: repeating-linear-gradient(-45deg, var(--danger) 0 3px, color-mix(in srgb, var(--danger) 40%, var(--surface)) 3px 6px); }
.cc-legend .done, .load-bar .done { background: var(--done); }
.load-list { margin: 0; padding: 0 22px 18px; list-style: none; }
.load-row { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(0, 1.6fr) 190px 82px; align-items: center; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.load-row:last-child { border-bottom: 0; }
.load-name { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.load-name b { font-size: 13px; font-weight: 650; }
.load-name .pill { min-height: 20px; font-size: 10.5px; padding: 1px 8px; }
.load-bar { display: flex; height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.load-bar i { display: block; height: 100%; }
.load-nums { display: flex; gap: 10px; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.load-nums b { color: var(--ink); font-variant-numeric: tabular-nums; }
.load-row[data-status="bottleneck"] .load-nums span:nth-child(2) b { color: var(--danger); }
.load-time { display: grid; justify-items: end; line-height: 1.25; font-variant-numeric: tabular-nums; }
.load-time b { font-size: 13px; }
.load-time small { font-size: 11px; color: var(--ink-3); }
.load-row[data-status="slow"] .load-time b { color: var(--active-ink); }
.count-badge { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface-2); }
.count-badge[data-tone="danger"] { background: var(--danger-soft); color: var(--danger); }
.count-badge[data-tone="warning"] { background: var(--active-soft); color: var(--active-ink); }
.count-badge[data-tone="info"] { background: var(--info-soft); color: var(--info); }
.cc-alerts { display: flex; flex-direction: column; }
.alert-list { flex: 1; max-height: 460px; margin: 0; padding: 4px 16px 16px; overflow-y: auto; list-style: none; }
.alert-item { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; padding: 12px 12px 12px 14px; border-radius: 14px; background: var(--surface-2); border-left: 3px solid var(--line-strong); }
.alert-item[data-level="danger"] { background: var(--danger-soft); border-left-color: var(--danger); }
.alert-item[data-level="warning"] { background: var(--active-soft); border-left-color: var(--active); }
.alert-item[data-level="info"] { background: var(--info-soft); border-left-color: var(--info); }
.alert-item .ai { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 9px; background: var(--surface); }
.alert-item .ai svg { width: 15px; height: 15px; }
.alert-item[data-level="danger"] .ai { color: var(--danger); }
.alert-item[data-level="warning"] .ai { color: var(--active-ink); }
.alert-item[data-level="info"] .ai { color: var(--info); }
.alert-item .grow { flex: 1; min-width: 0; }
.alert-item b { display: block; font-size: 13px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.alert-item span { display: block; margin-top: 2px; font-size: 12px; line-height: 1.5; color: var(--ink-2); }
.alert-item .btn { flex: none; background: var(--surface); }
.cc-clear { display: grid; justify-items: center; gap: 6px; padding: 30px 22px 34px; text-align: center; color: var(--ink-3); font-size: 13px; }
.cc-clear svg { width: 34px; height: 34px; color: var(--done); }
.cc-clear b { font-size: 15px; color: var(--ink); }
.company-progress { margin: 0; padding: 0 22px 18px; list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.company-progress li { min-width: 0; }
.company-progress a { display: block; padding: 10px 10px; margin: 0 -10px; border-radius: 12px; color: inherit; text-decoration: none; }
.company-progress a:hover { background: var(--surface-2); }
.cp-top { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; }
.cp-top b { min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-top span { flex: none; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cp-bar { display: flex; height: 7px; margin-top: 7px; border-radius: 999px; background: var(--pending); overflow: hidden; }
.cp-bar i { display: block; height: 100%; }
.cp-bar .done { background: var(--done); }
.cp-bar .arrived { background: var(--active); }
.cp-meta { margin-top: 5px; font-size: 11px; color: var(--ink-3); }
.cc-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.cc-panel .row-link .grow { min-width: 0; }
.cc-panel .row-link .side { flex: none; }
.time-badge { flex: none; min-width: 52px; padding: 4px 0; border-radius: 9px; background: var(--surface-2); text-align: center; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.row-icon { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 10px; background: var(--surface-2); color: var(--icon); }
.row-icon svg { width: 15px; height: 15px; }
.attention-list.cc-panel .row-link .count { font-size: 16px; }
.week-bars { margin: 0; padding: 4px 22px 18px; list-style: none; display: grid; gap: 4px; }
.week-bars a { display: grid; grid-template-columns: 58px minmax(0, 1fr) 28px; align-items: center; gap: 10px; padding: 5px 8px; margin: 0 -8px; border-radius: 9px; color: inherit; text-decoration: none; font-size: 12px; }
.week-bars a:hover { background: var(--surface-2); }
.week-bars .wd { color: var(--ink-2); font-weight: 600; }
.week-bars .wb { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.week-bars .wb i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.week-bars b { text-align: right; font-variant-numeric: tabular-nums; }
.team-list { margin: 0; padding: 4px 22px 18px; list-style: none; display: grid; gap: 12px; }
.team-list li { display: flex; align-items: center; gap: 12px; min-width: 0; }
.team-list .avatar { width: 34px; height: 34px; font-size: 11px; border-radius: 11px; }
.team-list .grow { flex: 1; min-width: 0; }
.team-list b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-list .grow > span { display: block; font-size: 11.5px; color: var(--ink-3); }
.team-list .tb { height: 4px; margin-top: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.team-list .tb i { display: block; height: 100%; border-radius: inherit; background: var(--done); }
.chart .line-soft { fill: none; stroke: var(--info); stroke-width: 2; }
.chart .line-soft-dot { fill: var(--surface); stroke: var(--info); stroke-width: 2; }
.chart .now { stroke: var(--danger); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart .now-label { fill: var(--danger); font-weight: 700; }

/* Display mode: the command centre on a wall screen, without the app chrome. */
.display-mode .sidebar, .display-mode .topbar, .display-mode .workspace-footer { display: none !important; }
.display-mode .shell { display: block; }
.display-mode .content { max-width: none; padding: 22px 28px 28px; }
.display-mode .cc-head { margin-bottom: 18px; }
.display-mode .cc-head h1 { font-size: 34px; }
.display-mode .cc-clock b { font-size: 34px; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .today-grid, .schedule-layout { grid-template-columns: minmax(0, 1fr); }
  .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; }
  .search-trigger { width: 220px; }
  .access-badge span { display: none; }
}
@media (max-width: 1440px) {
  .topbar, .workspace-footer { padding-left: 30px; padding-right: 30px; }
  .content { padding: 26px 30px 40px; }
  .list-panel { padding: 20px; }
}
@media (max-width: 1060px) {
  .login-panel { padding: 28px 31px 25px; }
  .login-visual { padding: 32px; }
}
@media (max-width: 900px) {
  :root { --topbar: 72px; }
  .shell { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; width: min(278px, 88vw); transform: translateX(-100%); visibility: hidden; transition: transform .35s var(--curve), visibility 0s linear .35s; }
  .sidebar, [data-theme="dark"] .sidebar { background: var(--surface); }
  .shell.nav-open .sidebar { transform: none; visibility: visible; transition: transform .35s var(--curve); box-shadow: var(--shadow-overlay); }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; z-index: 35; background: rgba(15, 24, 29, .35); }
  .mobile-menu { display: inline-flex !important; }
  .topbar { padding: 0 14px; }
  .search-trigger { width: 42px; padding: 0; justify-content: center; }
  .search-trigger span, .search-trigger kbd, .topbar [data-shortcuts], .access-badge { display: none; }
  .content { padding: 22px 16px 34px; }
  .workspace-footer { padding: 0 16px 20px; font-size: 10px; }
  .page-head { flex-wrap: wrap; margin-bottom: 22px; }
  .page-head .actions { flex-shrink: 1; min-width: 0; max-width: 100%; }
  .page-head h1 { font-size: 28px; }
  .page-head .sub { font-size: 14px; }
  .list-panel, .filter-panel { padding: 18px 16px; }
  .panel-head { padding: 18px 18px 10px; }
  .panel-body { padding: 4px 18px 20px; }
  .row-link { padding: 13px 18px; }
  .panel-note { padding: 2px 18px 18px; }
  .panel-foot { padding: 12px 18px 16px; }
  .toolbar .search-box { width: 100%; }
  .toolbar > select.input, .toolbar > .btn[data-dates] { flex: 1 1 40%; min-width: 0; max-width: none !important; }
  .form-grid, .kv, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2, .kv .span-2 { grid-column: auto; }
  .login-stage { padding: 22px 16px; align-items: start; }
  .login-frame { display: block; max-width: 460px; min-height: 0; padding: 0; border-radius: 24px; }
  .login-visual { display: none; }
  .login-panel { padding: 27px 26px; }
  .login-form-area { padding: 40px 0 30px; }
  .login-form-area h2 { font-size: 28px; }
  .login-footer { flex-direction: column; gap: 8px; }
  .login-footer small { text-align: center; }
  .drawer { border-radius: 0; }
  .drawer-head, .drawer-section, .drawer-foot { padding-left: 18px; padding-right: 18px; }
  .drawer .tabs { padding: 12px 18px; }
  .cal-day { min-height: 64px; padding: 6px 5px 8px; }
  .cal-ev { display: none; }
  .cal-day .dots { display: flex; gap: 3px; margin-top: auto; }
  .cal-day .cal-n { display: none; }
  .hide-mobile { display: none !important; }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .strip > * { padding: 18px; }
  .strip .value { font-size: 24px; }
  .bulk-bar { left: 50%; }
}
@media (min-width: 901px) { .cal-day .dots { display: none; } }
@media (max-width: 640px) {
  table.data.cards thead { display: none; }
  table.data.cards, table.data.cards tbody, table.data.cards tr, table.data.cards td { display: block; width: 100%; }
  table.data.cards tr { padding: 14px 4px; border-bottom: 1px solid var(--line); }
  table.data.cards td { border: 0; padding: 2px 0 !important; }
  table.data.cards td[data-optional] { display: none; }
  table.data.client-cards tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; }
  table.data.client-cards td[data-col="appointment"] { text-align: right; }
  table.data.client-cards td[data-col="circuit"] { min-width: 0 !important; }
  table.data.client-cards td[data-col="flags"] { grid-column: 1 / -1; }
  table.data.client-cards td[data-col="flags"]:has(.flags:empty) { display: none; }
  table.data.client-cards .pick { display: none; }
  .station { grid-template-columns: 14px minmax(0, 1fr) auto; gap: 10px; }
  .drawer-head { flex-wrap: wrap; }
  .drawer-head > .avatar { display: none; }
  .drawer-head > .grow { order: 2; flex-basis: 100%; }
  .drawer-head > div:last-child { order: 1; margin-left: auto; }
  .ws-state { gap: 6px; }
  .password-panel { padding: 29px 25px 25px; }
}

@media (max-width: 1180px) {
  .import-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .panel > .table-wrap { margin: 0 12px 14px; }
  .panel > .table-wrap:first-child { margin-top: 12px; }
  .panel > .pager { margin: 0 18px; }
  .list-panel > .table-wrap, .list-panel > .table-wrap:first-child { margin: 0; }
  .list-panel > .pager { margin: 8px 0 0; }
  .live-status .label { display: none; }
  .live-status { padding: 0 11px; }
  .board:not(.focus) { grid-template-columns: none !important; grid-auto-columns: 86%; scroll-snap-type: x mandatory; }
  .board-bar { padding: 12px 14px; }
  .board-col-body { max-height: none; }
  .profile-head { gap: 14px; }
  .company-mark { width: 52px; height: 52px; border-radius: 16px; font-size: 17px; }
  .sticky-actions { border-radius: 20px; padding: 12px 14px; }
  .drill .btn { margin-left: 0; }
}

@media (max-width: 1000px) {
  .account-layout { grid-template-columns: minmax(0, 1fr); }
  .account-summary { position: static; max-height: none; overflow: visible; }
  .account-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .account-panel { padding: 22px 18px; }
  .account-summary { padding: 26px 18px 20px; }
  .account-meta { grid-template-columns: minmax(0, 1fr); }
  .photo-row { flex-wrap: wrap; gap: 14px; }
  .device { flex-wrap: wrap; }
  .device .btn { margin-left: 54px; }
  .event .when { display: none; }
  .account-panel .form-actions .btn { width: 100%; }
}
@media (max-width: 1300px) {
  .cc-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .cc-grid { grid-template-columns: minmax(0, 1fr); }
  .cc-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 900px) {
  .cc-clock { display: none !important; }
  .demo-badge { margin-left: 8px; padding: 0 8px; font-size: 10px; }
  .demo-badge svg { display: none; }
  .cc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .cc-kpis .value { font-size: 22px; }
  .cc-side { grid-template-columns: minmax(0, 1fr); }
  .load-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .load-bar { grid-column: 1 / -1; order: 3; }
  .load-nums { grid-column: 1 / -1; order: 4; }
  .load-time { grid-row: 1; grid-column: 2; }
  .cc-panel .panel-head { flex-wrap: wrap; }
  .cc-panel .panel-head .actions { margin-left: 0; }
  [data-display] { display: none !important; }
}
/* ------------------------------------------------------------------ audit trail */
.audit-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.audit-kpis > * { padding: 18px 18px 16px; border-top: 3px solid transparent; }
.audit-kpis > [data-tone="danger"] { border-top-color: var(--danger); }
.audit-kpis > [data-tone="warning"] { border-top-color: var(--active); }
.audit-kpis > .on, .audit-kpis > .on:hover { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); box-shadow: inset 0 0 0 2px var(--accent), var(--shadow-card); }
.audit-kpis > .on .label { color: var(--accent); font-weight: 600; }
.audit-kpis .value { font-size: 26px; padding-right: 34px; }
.audit-kpis .metric-icon { top: 16px; right: 14px; width: 28px; height: 28px; }
.audit-kpis .metric-icon svg { width: 15px; height: 15px; }
.audit-kpis .trend { margin-top: 6px; padding-right: 8px; font-size: 11.5px; line-height: 1.45; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Sensitive slices must stand apart from the bars: gold on burgundy in light, rose on gold in dark. */
.audit-overview { --bar: color-mix(in srgb, var(--accent) 62%, var(--surface)); --sens: var(--active); display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 20px; margin: 20px 0 24px; align-items: stretch; }
[data-theme="dark"] .audit-overview { --sens: var(--danger); }
.audit-overview > .panel { display: flex; flex-direction: column; }
.audit-overview .panel-head .actions { gap: 14px; }
.audit-overview .legend-inline .sw-events { background: var(--bar); }
.audit-overview .legend-inline .sw-sensitive { background: var(--sens); }

.activity-bars { flex: 1 1 auto; display: flex; align-items: flex-end; gap: 3px; min-height: 132px; margin: 6px 22px 0; padding-bottom: 1px; border-bottom: 1px solid var(--line); }
.activity-bars .slot { flex: 1 1 0; min-width: 0; align-self: stretch; display: flex; align-items: flex-end; border-radius: 5px 5px 0 0; }
.activity-bars a.slot { cursor: pointer; }
.activity-bars a.slot:hover { background: var(--surface-2); }
.activity-bars a.slot:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.activity-bars .bar { position: relative; display: flex; align-items: flex-end; width: 100%; max-width: 26px; margin: 0 auto; border-radius: 4px 4px 1px 1px; overflow: hidden;
  background: var(--bar); transition: background .2s var(--curve); }
.activity-bars .slot:hover .bar { background: var(--accent); }
.activity-bars .bar i { display: block; width: 100%; background: var(--sens); }
.activity-axis { display: flex; justify-content: space-between; gap: 12px; padding: 8px 22px 20px; font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.activity-axis .hint-mid { text-align: center; }

.person-filter { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; padding: 6px 8px; margin: -6px -8px; border: 0; border-radius: 11px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; box-sizing: content-box; }
.person-filter:hover { background: var(--surface-2); }
.person-filter[aria-pressed="true"] { background: var(--accent-soft); }
.team-list .person-filter .tb { display: block; }

.audit-filters { display: grid; gap: 14px; }
.audit-filters .chips { margin: 0; }
.audit-filters .toolbar .search-box { flex: 1 1 260px; width: auto; }
.audit-filters .toolbar > select.input { width: 210px; }
.date-range { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 13px; }
.date-range .input { width: auto; }
.category-chips .toggle-chip { white-space: nowrap; }
.category-chips .toggle-chip svg { width: 14px; height: 14px; }
.category-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.category-chips .spacer { flex: 1; }
.cat-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 8px 0 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font: 600 12px var(--font); color: var(--ink-2); cursor: pointer; }
.cat-chip svg { width: 14px; height: 14px; color: var(--icon); }
.cat-chip .tnum { min-width: 22px; padding: 2px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-3); font-size: 11px; text-align: center; }
.cat-chip:hover { border-color: var(--accent); color: var(--accent); }
.cat-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.cat-chip[aria-pressed="true"] .tnum { background: var(--surface); color: var(--accent); }
.cat-chip:first-child { padding-left: 15px; }

.btn[data-live] .live-dot { animation: live-pulse 2s infinite var(--curve); }
.btn[data-live].paused .live-dot { animation: none; background: var(--pending); box-shadow: 0 0 0 3px var(--surface-2); }
@keyframes live-pulse { 0%, 100% { box-shadow: 0 0 0 3px var(--active-soft); } 50% { box-shadow: 0 0 0 6px transparent; } }

.fresh-banner { position: sticky; top: calc(var(--topbar) + 12px); z-index: 6; display: flex; align-items: center; gap: 8px; width: fit-content; margin: 0 auto 14px; padding: 9px 18px;
  border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: 600 13px var(--font); box-shadow: var(--shadow-pop); cursor: pointer; }
.fresh-banner svg { width: 15px; height: 15px; }
.fresh-banner:hover { background: var(--accent-hover); }

.audit-feed { overflow: clip; }
.day-head { position: sticky; top: var(--topbar); z-index: 2; display: flex; align-items: baseline; gap: 10px; margin: 0; padding: 14px 26px; background: var(--surface-2);
  border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 650; color: var(--ink); }
.day-group + .day-group .day-head { border-top: 1px solid var(--line); }
.day-head small { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.day-head .count { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.event-list-feed { list-style: none; margin: 0; padding: 0; }
.event-row { position: relative; display: grid; grid-template-columns: 52px 34px minmax(0, 1fr) 20px; grid-template-areas: "time who main go"; gap: 14px; align-items: start;
  padding: 12px 22px 12px 26px; cursor: pointer; outline: none; transition: background .2s var(--curve); }
.event-row + .event-row { box-shadow: 0 -1px 0 var(--line); }
.event-row:hover { background: var(--surface-2); }
.event-row[aria-selected="true"], .event-row:focus-visible { background: var(--accent-soft); }
.event-row::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: transparent; }
.event-row.sensitive::before { background: var(--active); }
.event-row.failed::before { background: var(--danger); }
.ev-time { grid-area: time; padding-top: 8px; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.ev-who { grid-area: who; }
.ev-who .avatar, .avatar.sm { width: 34px; height: 34px; font-size: 11px; border-radius: 11px; }
.avatar.system { background: var(--surface-2); color: var(--ink-3); }
.avatar.system svg { width: 16px; height: 16px; }
.event-row.failed .avatar.system { background: var(--danger-soft); color: var(--danger); }
.ev-main { grid-area: main; min-width: 0; }
.ev-text { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ev-text b { font-weight: 650; color: var(--ink); }
.ev-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 4px; font-size: 12px; color: var(--ink-3); }
.ev-cat { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--cat, var(--ink-3)); }
.ev-cat svg { width: 13px; height: 13px; }
.ev-ip { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 11.5px; }
.ev-go { grid-area: go; align-self: center; display: grid; place-items: center; color: var(--ink-3); opacity: 0; transition: opacity .2s var(--curve), transform .2s var(--curve); }
.ev-go svg { width: 16px; height: 16px; }
.event-row:hover .ev-go, .event-row[aria-selected="true"] .ev-go { opacity: 1; transform: translateX(2px); }
.rec-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 260px; min-height: 22px; padding: 0 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font: 600 12px var(--font); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.rec-chip svg { width: 12px; height: 12px; flex: none; color: var(--icon); }
.rec-chip:hover { border-color: var(--accent); color: var(--accent); }
.rec-chip.static { cursor: default; }
.rec-chip.static:hover { border-color: var(--line); color: var(--ink-2); }
:is(.ev-cat, .event-icon, .mini-events .dot)[data-cat="security"] { --cat: var(--accent); }
:is(.ev-cat, .event-icon, .mini-events .dot)[data-cat="clients"] { --cat: var(--info); }
:is(.ev-cat, .event-icon, .mini-events .dot)[data-cat="stations"] { --cat: var(--done); }
:is(.ev-cat, .event-icon, .mini-events .dot)[data-cat="notes"] { --cat: var(--active-ink); }
:is(.ev-cat, .event-icon, .mini-events .dot)[data-cat="people"] { --cat: var(--ink-2); }
:is(.ev-cat, .event-icon, .mini-events .dot)[data-cat="settings"] { --cat: var(--ink-3); }
.feed-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 26px 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }

.event-icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 13px; background: color-mix(in srgb, var(--cat, var(--accent)) 12%, var(--surface)); color: var(--cat, var(--accent)); }
.event-icon svg { width: 20px; height: 20px; }
.event-foot { flex-wrap: wrap; }
.event-kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
.event-kv > div { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.event-kv > div:first-child { padding-top: 0; }
.event-kv > div:last-child { border-bottom: 0; padding-bottom: 0; }
.event-kv dt { margin: 0; }
.who-cell { display: flex; align-items: center; gap: 10px; white-space: normal !important; }
.who-cell b { display: block; font-weight: 600; }
.who-cell small { display: block; font-size: 12px; color: var(--ink-3); }
.diff { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.diff th, .diff td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.diff thead th { padding-top: 0; font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.diff tbody th { width: 32%; font-weight: 600; color: var(--ink-2); }
.diff tr > :first-child { padding-left: 0; }
.diff tr > :last-child { padding-right: 0; }
.diff tbody tr:last-child > * { border-bottom: 0; }
.diff del, .diff ins { display: inline; padding: 1px 6px; border-radius: 5px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.diff del { background: var(--danger-soft); color: var(--danger); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.diff ins { background: var(--done-soft); color: var(--done); text-decoration: none; }
.raw-entry { margin: 0; padding: 12px 14px; max-height: 240px; overflow: auto; border-radius: 10px; background: var(--surface-2); font: 12.5px/1.55 ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.mini-events { list-style: none; margin: 0 -10px; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.mini-events button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 9px; background: none; color: var(--ink-2); font: 13px/1.45 var(--font); text-align: left; cursor: pointer; }
.mini-events button:hover { background: var(--surface-2); }
.mini-events .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-events b { color: var(--ink); font-weight: 600; }
.mini-events .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--cat, var(--ink-3)); }
.mini-events time { flex: none; font-size: 11.5px; color: var(--ink-3); }

@media (max-width: 1300px) {
  .audit-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1060px) {
  .audit-overview { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .audit-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .audit-kpis .value { font-size: 22px; }
  .audit-kpis .trend { white-space: normal; }
  .audit-kpis > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .audit-overview .panel-head { flex-wrap: wrap; }
  .audit-overview .panel-head .actions { margin-left: 0; }
  .activity-axis .hint-mid { display: none; }
}
@media (max-width: 640px) {
  .audit-filters .segmented { display: flex; width: 100%; }
  .audit-filters .segmented button { flex: 1 1 0; padding: 0 4px; }
  .audit-filters .toolbar > select.input { flex: 1 1 100%; width: auto; }
  .date-range { display: flex; width: 100%; }
  .date-range .input { flex: 1 1 0; min-width: 0; }
  .category-chips .spacer { display: none; }
  .event-row { grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "who main time"; gap: 12px; padding: 14px 18px; }
  .ev-time { padding-top: 2px; }
  .ev-go { display: none; }
  .ev-ip { display: none; }
  .day-head { padding: 12px 18px; }
  .feed-foot { padding: 14px 18px 18px; }
  .feed-foot .btn { width: 100%; justify-content: center; }
  .drawer-head.event-head { flex-wrap: nowrap; }
  .event-head > .event-icon { display: none; }
  .event-head > .grow { order: 0; flex-basis: auto; }
  .event-kv > div { grid-template-columns: 64px minmax(0, 1fr); }
  .event-foot .btn { flex: 1 1 auto; justify-content: center; }
}

/* ------------------------------------------------------------------ people and access */
.back-link { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 16px; font-size: 13px; font-weight: 600; color: var(--ink-3); text-decoration: none; }
.back-link svg { width: 16px; height: 16px; }
.back-link:hover { color: var(--accent); }
.audit-kpis > [data-tone="good"] { border-top-color: var(--done); }
.person-kpis, .role-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.people-kpis, .role-kpis { margin-bottom: 22px; }
.people-table th.num-col { text-align: right; }
.people-filters { display: grid; gap: 14px; }
.people-filters .toolbar .search-box { flex: 1 1 280px; width: auto; }
.people-filters .toolbar > select.input { width: 220px; }
.list-summary { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 14px; font-size: 13px; color: var(--ink-2); }
.list-summary > span > svg { width: 14px; height: 14px; margin-right: 7px; vertical-align: -2px; color: var(--icon); }
.list-summary b { font-weight: 650; color: var(--ink); }
.list-panel.refreshed .table-wrap, .list-panel.refreshed .empty { animation: list-in .4s var(--curve); }
@keyframes list-in { from { opacity: .25; transform: translateY(6px); } }
.category-chips .toggle-chip svg { width: 14px; height: 14px; }

.avatar-wrap { position: relative; display: inline-flex; flex: none; }
.presence-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--done); box-shadow: 0 0 0 2px var(--surface); }
.avatar-wrap > .presence-dot { position: absolute; right: -2px; bottom: -2px; }
.presence-text { display: inline-flex; align-items: center; gap: 7px; color: var(--done); font-weight: 600; }
.presence-text .presence-dot { box-shadow: 0 0 0 3px var(--done-soft); }
.role-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 2px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; white-space: nowrap; }
.role-pill svg { width: 13px; height: 13px; }
.person-cell { display: flex; align-items: center; gap: 12px; min-width: 0; color: inherit; text-decoration: none; }
.person-cell .grow { min-width: 0; }
.person-cell .name, .person-cell .sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-cell .avatar { width: 38px; height: 38px; }
.people-table td[data-col="person"] { min-width: 220px; }
.people-table .person-cell .grow { max-width: 228px; }
.people-table .num-col { text-align: right; }
.people-table th.num-col button { justify-content: flex-end; }
.people-table .row-actions { width: 1%; text-align: right; white-space: nowrap; }
.people-table tr.inactive td[data-col="person"], .people-table tr.inactive td[data-col="role"] { opacity: .62; }
.skip-list { list-style: none; margin: 12px 0 0; padding: 0; }
.skip-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.skip-list li:last-child { border-bottom: 0; }
.skip-list li > span { font-size: 12px; color: var(--ink-3); text-align: right; }
.confirm-check { margin-top: 16px; font-size: 13px; color: var(--ink); }
.paste-area { min-height: 170px; font: 12.5px/1.55 ui-monospace, "Cascadia Mono", Consolas, monospace; resize: vertical; }
.map-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.map-col { flex: 1 1 140px; }
.map-col .label { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 10px; }
.import-table { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 14px; }
.import-table table.data th { position: sticky; top: 0; z-index: 1; border-radius: 0 !important; }
.import-table tr.error td { background: var(--danger-soft); }
.import-table .problems { font-size: 12px; color: var(--danger); }
.temp-pass.sm { display: inline-block; margin: 0; padding: 3px 8px; font-size: 13px; border-radius: 8px; }

.role-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.role-choice { position: relative; display: flex; gap: 12px; padding: 16px 44px 16px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); cursor: pointer; transition: border-color .2s var(--curve), background .2s var(--curve); }
.role-choice input { position: absolute; opacity: 0; pointer-events: none; }
.role-choice:hover { border-color: var(--accent); }
.role-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.role-choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.role-choice:has(input:disabled) { opacity: .55; cursor: not-allowed; }
fieldset:disabled .role-choice { cursor: default; }
fieldset:disabled .role-choice:hover { border-color: var(--line); }
fieldset:disabled .role-choice:has(input:checked):hover { border-color: var(--accent); }
.rc-body { display: grid; gap: 6px; min-width: 0; }
.rc-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.rc-head b { font-size: 14px; }
.rc-desc { font-size: 12.5px; line-height: 1.55; color: var(--ink-3); }
.rc-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--ink-2); }
.rc-check { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-strong); color: transparent; }
.rc-check svg { width: 13px; height: 13px; }
.role-choice:has(input:checked) .rc-check { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.sens { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--active-ink); white-space: nowrap; }
.sens svg { width: 12px; height: 12px; }

.perm-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px 24px; }
.perm-group h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.perm-group h4 .count { margin-left: auto; font-weight: 600; letter-spacing: 0; text-transform: none; }
.perm-group ul { list-style: none; margin: 0; padding: 0; }
.perm-group li { display: flex; align-items: flex-start; gap: 10px; padding: 8px 6px; margin: 0 -6px; border-bottom: 1px solid var(--line); border-radius: 8px; font-size: 13px; line-height: 1.5; }
.perm-group li:last-child { border-bottom: 0; }
.perm-group li .grow { flex: 1; min-width: 0; }
.perm-group .mark { display: grid; place-items: center; width: 20px; height: 20px; flex: none; margin-top: 1px; border-radius: 50%; background: var(--done-soft); color: var(--done); }
.perm-group .mark svg { width: 12px; height: 12px; }
.perm-group li.off { color: var(--ink-3); }
.perm-group li.off .mark { background: var(--surface-2); color: var(--ink-3); }
.perm-group li.gain { background: var(--done-soft); }
.perm-group li.lose { background: var(--danger-soft); }
.perm-group li.lose .grow { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.perm-group li .pill { flex: none; }

.choice-list { margin: 18px 0 0; padding: 0; border: 0; min-width: 0; }
.choice-list legend { margin-bottom: 10px; padding: 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.choice { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; color: var(--ink); }
.choice input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.choice b { display: block; font-size: 14px; }
.choice small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.55; color: var(--ink-3); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice.disabled { opacity: .55; cursor: not-allowed; }
.handover p { margin: 0 0 10px; color: var(--ink-2); }
.handover.sent { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 14px; background: var(--done-soft); color: var(--ink-2); }
.handover.sent > svg { width: 22px; height: 22px; flex: none; color: var(--done); }
.handover.sent p { margin: 4px 0 0; }
.temp-pass-row { display: flex; align-items: center; gap: 10px; }
.temp-pass-row .temp-pass { flex: 1; margin: 0; min-width: 0; overflow-wrap: anywhere; }

.person-head { display: flex; align-items: center; gap: 20px; padding: 24px 28px; margin-bottom: 18px; }
.avatar.xl { width: 72px; height: 72px; border-radius: 22px; font-size: 22px; }
.avatar.xl svg { width: 28px; height: 28px; }
.person-head .avatar-wrap > .presence-dot { width: 16px; height: 16px; box-shadow: 0 0 0 3px var(--surface); }
.person-title { flex: 1; min-width: 0; }
.tab svg { width: 16px; height: 16px; flex: none; }
.person-title .eyebrow { margin-bottom: 4px; }
.person-title h1 { font-size: clamp(1.5rem, 2.2vw, 2rem); font-weight: 650; letter-spacing: -.03em; line-height: 1.2; overflow-wrap: anywhere; }
.person-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 8px 0 0; font-size: 13px; color: var(--ink-3); }
.person-meta span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.person-meta svg { width: 14px; height: 14px; flex: none; color: var(--icon); }
.person-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; }
.person-head > .actions { display: flex; gap: 8px; align-self: flex-start; flex: none; }
.self-note { margin: 0 0 18px; }
.person-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; align-items: start; }
.person-facts { padding: 4px 22px 22px; }
.person-facts dd { white-space: normal; }
.fact-hint { display: block; margin-top: 3px; font-size: 12px; color: var(--ink-3); }
.feed-mini { list-style: none; margin: 0 0 6px; padding: 0; }
.feed-mini .row-link { padding: 11px 22px; align-items: flex-start; }
.feed-mini .title, .feed-mini .meta { display: block; }
.account-panel .feed-mini .row-link { margin: 0 -12px; padding: 10px 12px; border-radius: 12px; }
.feed-mini .title { white-space: normal; font-weight: 400; color: var(--ink-2); line-height: 1.5; }
.feed-mini .title b { color: var(--ink); font-weight: 600; }
.feed-mini .side { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.ev-icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 10px; background: color-mix(in srgb, var(--cat, var(--accent)) 12%, var(--surface)); color: var(--cat, var(--accent)); }
.ev-icon svg { width: 16px; height: 16px; }
:is(.ev-icon)[data-cat="security"] { --cat: var(--accent); }
:is(.ev-icon)[data-cat="clients"] { --cat: var(--info); }
:is(.ev-icon)[data-cat="stations"] { --cat: var(--done); }
:is(.ev-icon)[data-cat="notes"] { --cat: var(--active-ink); }
:is(.ev-icon)[data-cat="people"] { --cat: var(--ink-2); }
:is(.ev-icon)[data-cat="settings"] { --cat: var(--ink-3); }
.person-feed .ev-time { line-height: 1.4; padding-top: 3px; }
.person-feed .event-row { cursor: pointer; }
.sec-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.sec-head h2 { font-size: 18px; letter-spacing: -.02em; }
.sec-head p { margin-top: 4px; font-size: 13px; line-height: 1.6; }
.sec-head > div:not(.actions) { flex: 1; min-width: 0; }
.sec-head .actions { margin-left: auto; flex: none; }
.panel-mark { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--secondary-bg); color: var(--brand-gold-ink); }
.panel-mark svg { width: 19px; height: 19px; }
.person-form + .person-form { margin-top: 20px; }
.person-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.status-row .pill { margin-right: auto; }
hr.soft { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.access-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.access-layout .role-choices { grid-template-columns: minmax(0, 1fr); }
.access-layout fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.access-layout .form-actions .left { flex-basis: 100%; margin: 0 0 4px; font-size: 13px; color: var(--ink-2); }
.form-actions .gain { color: var(--done); font-weight: 600; }
.form-actions .lose { color: var(--danger); font-weight: 600; }

.wizard { overflow: hidden; }
.identity-card { display: flex; align-items: center; gap: 16px; padding: 22px 28px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.identity-card .grow { min-width: 0; }
.identity-card .eyebrow { margin-bottom: 4px; }
.identity-card h2 { font-size: 20px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.identity-card p { margin-top: 3px; font-size: 13px; overflow-wrap: anywhere; }
.wizard-steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 18px 28px 0; list-style: none; }
.step { display: inline-flex; align-items: center; gap: 10px; min-height: 42px; padding: 6px 14px 6px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink-3); font: 600 13px var(--font); cursor: pointer; }
.step .num { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--surface-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.step .num svg { width: 14px; height: 14px; }
.step:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.step[aria-current="step"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.step[aria-current="step"] .num { background: var(--accent); color: var(--accent-ink); }
.step:disabled { opacity: .5; cursor: not-allowed; }
.wizard-body { padding: 24px 28px 28px; }
.step-title { margin-bottom: 12px; font-size: 14px; }
.review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.review-box { padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; }
.review-box .kv { gap: 12px 18px; }
.review-box p + p { margin-top: 8px; font-size: 13px; }
.review-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.review-head h3 { font-size: 15px; }
.save-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; padding: 13px 16px; border-radius: 13px; background: var(--surface-2); font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.save-note svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--icon); }
.wizard-foot { display: flex; align-items: center; gap: 10px; padding: 16px 28px; border-top: 1px solid var(--line); background: var(--surface-2); }
.wizard-foot .spacer { flex: 1; }

.role-section { margin: 22px 0 24px; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.role-card { display: flex; flex-direction: column; gap: 16px; padding: 22px 22px 18px; cursor: pointer; text-align: left; transition: transform .3s var(--curve), box-shadow .3s var(--curve); }
.role-card:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(30, 39, 43, .08); }
.role-card:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.role-card header { display: flex; align-items: flex-start; gap: 12px; }
.role-card header .grow { flex: 1; min-width: 0; }
.role-card h3 { font-size: 16px; letter-spacing: -.01em; }
.role-card header p { margin-top: 4px; font-size: 12.5px; line-height: 1.55; color: var(--ink-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.role-mark { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.role-mark svg { width: 19px; height: 19px; }
.role-mark.admin { background: var(--secondary-bg); color: var(--brand-gold-ink); }
.role-meter { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.role-meter .bar { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.role-meter .bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.role-areas { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 0; padding: 0; list-style: none; }
.role-areas li { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-3); }
.role-areas i { width: 8px; height: 8px; border-radius: 50%; background: var(--pending); }
.role-areas .some i { background: var(--active); }
.role-areas .all i { background: var(--done); }
.role-areas .all { color: var(--ink-2); }
.role-card footer { display: flex; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; }
.role-card footer .spacer { flex: 1; }
.open-hint { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-weight: 600; }
.open-hint svg { width: 14px; height: 14px; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { width: 30px; height: 30px; border-radius: 50%; font-size: 10px; letter-spacing: 0; box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .avatar + .avatar { margin-left: -5px; }
.avatar-stack .avatar.more { background: var(--surface-2); color: var(--ink-3); }
.role-card.new { align-items: center; justify-content: center; gap: 8px; min-height: 220px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); background: transparent; box-shadow: none; color: var(--ink-3); font: inherit; text-align: center; }
.role-card.new > svg { width: 26px; height: 26px; color: var(--accent); }
.role-card.new b { font-size: 15px; color: var(--ink); }
.role-card.new span { max-width: 240px; font-size: 12.5px; line-height: 1.55; }
.role-card.new:hover { border-color: var(--accent); background: var(--surface); }
.role-card.archived { opacity: .78; }
.archived-roles { margin-top: 20px; }
.archived-roles summary { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; list-style: none; }
.archived-roles summary::-webkit-details-marker { display: none; }
.archived-roles summary svg { width: 16px; height: 16px; }
.archived-roles summary .count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); font-size: 11px; text-align: center; }
.archived-roles[open] summary svg:last-child { transform: rotate(180deg); }
.compare-head { margin-bottom: 16px; }
.compare-head h2 { font-size: 18px; letter-spacing: -.02em; }
.compare-head p { margin-top: 4px; font-size: 13px; }
.matrix-wrap { max-height: 70vh; overflow: auto; border: 1px solid var(--line); border-radius: 14px; }
.perm-matrix thead th { position: sticky; top: 0; z-index: 2; border-radius: 0 !important; text-align: center; white-space: normal; min-width: 120px; vertical-align: bottom; }
.perm-matrix thead th:first-child { left: 0; z-index: 3; text-align: left; }
.perm-matrix tbody th[scope="row"] { position: sticky; left: 0; z-index: 1; min-width: 280px; padding: 12px 16px; border-bottom: 1px solid var(--line); border-radius: 0; background: var(--surface); font-size: 13px; font-weight: 500; color: var(--ink); text-align: left; white-space: normal; }
.perm-matrix tbody th[scope="row"] .name { font-weight: 500; }
.perm-matrix tbody th[scope="row"] .sub { font-size: 11.5px; }
.perm-matrix tr.group-row th { position: sticky; left: 0; padding: 12px 16px 8px; border-radius: 0; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); text-align: left; }
.perm-matrix td { text-align: center; }
.perm-matrix tbody tr { cursor: default; }
.perm-matrix tbody tr:hover td, .perm-matrix tbody tr:hover th[scope="row"] { background: var(--hover); }
.perm-matrix td.changed, .perm-matrix tbody tr:hover td.changed { background: var(--active-soft); }
.perm-box { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.perm-box:disabled { cursor: not-allowed; }
.matrix-role { all: unset; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--ink); }
.matrix-role:hover { color: var(--accent); }
.matrix-role:focus-visible { outline: 2px solid var(--focus); border-radius: 3px; }
.perm-set { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.perm-set legend { display: flex; width: 100%; padding: 0; margin-bottom: 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.perm-set legend .count { margin-left: auto; font-weight: 600; letter-spacing: 0; text-transform: none; }
.perm-switch { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.perm-set .perm-switch:last-child { border-bottom: 0; }
.perm-switch .grow { flex: 1; min-width: 0; }
.perm-switch b { font-size: 13.5px; font-weight: 600; margin-right: 6px; }
.perm-switch small { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-3); }
.switch { appearance: none; -webkit-appearance: none; position: relative; width: 40px; height: 23px; flex: none; margin: 0; border-radius: 999px; background: var(--pending); cursor: pointer; transition: background .2s var(--curve); }
.switch::before { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s var(--curve); }
.switch:checked { background: var(--accent); }
.switch:checked::before { transform: translateX(17px); }
.switch:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.switch:disabled { opacity: .6; cursor: not-allowed; }
.sticky-save { position: sticky; bottom: 0; z-index: 2; margin: 8px 0 0; padding: 14px 0; border-top: 1px solid var(--line); background: var(--surface); }
.form-actions.tight { margin-top: 0; }
.member-list { list-style: none; margin: 0; padding: 0; }
.member-list .row-link { margin: 0 -12px; padding: 10px 12px; border-radius: 12px; }
.member-list .avatar { width: 34px; height: 34px; font-size: 11px; }
.member-list .side { font-size: 12px; }
.drawer-foot { flex-wrap: wrap; }

.role-pill .txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1300px) {
  .person-kpis, .role-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Narrower desktops: the clients count stays on each person's page, and long role names shorten. */
  .people-table td[data-col="clients"], .people-table th.num-col { display: none; }
  .people-table .role-pill { max-width: 170px; }
  .people-table .person-cell .grow { max-width: 205px; }
}
/* Up to 1200 px each person is a card, so the list never scrolls sideways: tick, name and actions on the first
   line; role, status and last sign-in under the name (last sign-in gets its own line on phones). */
@media (max-width: 1200px) {
  table.data.people-table thead { display: none; }
  table.data.people-table, table.data.people-table tbody { display: block; width: 100%; }
  table.data.people-table tr { display: flex !important; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 14px 6px; border-bottom: 1px solid var(--line); }
  table.data.people-table tbody tr:last-child { border-bottom: 0; }
  table.data.people-table tbody tr:hover { background: var(--surface-2); }
  table.data.people-table tbody tr:hover td { background: none; }
  table.data.people-table td { display: block; width: auto !important; padding: 2px 0 !important; border: 0; }
  table.data.people-table td.pick { flex: 0 0 22px; }
  table.data.people-table td[data-col="person"] { flex: 1 1 180px; min-width: 0; max-width: none; }
  table.data.people-table .person-cell .grow { max-width: none; }
  table.data.people-table td.row-actions { order: 4; width: auto !important; margin-left: auto; }
  table.data.people-table td[data-col="role"], table.data.people-table td[data-col="status"], table.data.people-table td[data-col="last"] { order: 3; }
  table.data.people-table td[data-col="status"] .sub { display: none; }
  table.data.people-table td[data-col="last"] { margin-left: 6px; font-size: 12px; color: var(--ink-3); }
  table.data.people-table td[data-col="clients"] { display: none; }
  table.data.people-table .role-pill { max-width: 240px; }
}
@media (max-width: 1060px) {
  .person-grid, .access-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .person-head { flex-wrap: wrap; padding: 20px; }
  .person-head > .actions { width: 100%; }
  .person-head > .actions .btn:not(.icon) { flex: 1; }
  .review-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .people-filters .toolbar > select.input { flex: 1 1 100%; width: auto; }
  .category-chips .spacer { display: none; }
  /* The tick box sits in the card's left margin, so every wrapped line lines up under the name. */
  table.data.people-table tr { padding: 14px 6px 14px 38px; }
  table.data.people-table td.pick { margin-left: -32px; }
  table.data.people-table td.row-actions { order: 0; margin-left: 0; }
  table.data.people-table td[data-col="last"] { flex-basis: 100%; margin-left: 0; }
  .person-head { gap: 14px; padding: 18px; align-items: flex-start; }
  .avatar.xl { width: 56px; height: 56px; border-radius: 18px; font-size: 18px; }
  .identity-card, .wizard-body, .wizard-foot { padding-left: 18px; padding-right: 18px; }
  .wizard-steps { padding: 16px 18px 0; }
  .step { flex: 1 1 auto; }
  .wizard-foot { flex-wrap: wrap; }
  .wizard-foot .btn { flex: 1 1 auto; justify-content: center; }
  .wizard-foot .spacer { display: none; }
  .identity-card .role-pill { display: none; }
  .temp-pass-row { flex-wrap: wrap; }
  .temp-pass-row .btn { width: 100%; justify-content: center; }
  .role-grid { grid-template-columns: minmax(0, 1fr); }
  .perm-matrix tbody th[scope="row"] { min-width: 190px; }
  .sec-head { flex-wrap: wrap; }
  .sec-head .actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; margin-left: 0; padding-left: 54px; }
}

/* ------------------------------------------------------------------ settings */
.st-shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 22px; align-items: start; }
.st-side { position: sticky; top: calc(var(--topbar) + 16px); max-height: calc(100vh - var(--topbar) - 32px); overflow-y: auto; padding: 16px 12px 18px; }
.st-find { margin: 0 4px 12px; }
.st-find .input { width: 100%; }
.st-results { margin: 0 4px 12px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-pop); }
.st-results ul { list-style: none; margin: 0; padding: 0; }
.st-results a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: 13px; }
.st-results a:hover, .st-results a:focus-visible { background: var(--hover); }
.st-results a > svg { width: 16px; height: 16px; flex: none; color: var(--icon); }
.st-results small { display: block; font-size: 11.5px; color: var(--ink-3); }
.st-results p { padding: 8px 10px; font-size: 12.5px; }
.st-nav .nav-group { margin: 18px 10px 6px; }
.st-nav a { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 8px 10px; margin-bottom: 2px; border-radius: 10px; color: var(--ink-2); font-size: 13px; font-weight: 600; text-decoration: none; }
.st-nav a > svg { width: 16px; height: 16px; flex: none; color: var(--icon); }
.st-nav a > svg:last-child:not(:first-child) { width: 13px; height: 13px; margin-left: auto; color: var(--ink-3); }
.st-nav a:hover { background: var(--hover); color: var(--ink); }
.st-nav a[aria-current="page"] { background: var(--secondary-bg); color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); }
.st-main { display: grid; gap: 20px; min-width: 0; }
.st-stack { display: grid; gap: 20px; min-width: 0; }
.st-panel { min-width: 0; padding: 28px 30px; }
.st-panel code { padding: 1px 6px; border-radius: 6px; background: var(--surface-2); font: 12px ui-monospace, "Cascadia Mono", Consolas, monospace; }
.st-hint { display: flex; align-items: center; gap: 7px; margin: 0 0 12px; font-size: 12.5px; color: var(--ink-3); }
.st-hint:empty { display: none; }
.st-note { font-size: 12.5px; line-height: 1.7; color: var(--ink-3); }
.st-note svg { width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; color: var(--icon); }
.st-hint svg { width: 14px; height: 14px; flex: none; color: var(--icon); }

.st-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.st-card { display: flex; flex-direction: column; gap: 14px; padding: 22px 24px; color: inherit; text-decoration: none; transition: transform .3s var(--curve), box-shadow .3s var(--curve); }
a.st-card:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(30, 39, 43, .08); }
a.st-card:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.st-card-head { display: flex; align-items: center; gap: 12px; }
.st-card-head h2 { font-size: 16px; letter-spacing: -.01em; }
.st-card-head .go { display: grid; margin-left: auto; color: var(--ink-3); opacity: 0; transition: opacity .2s var(--curve); }
.st-card-head .go svg { width: 16px; height: 16px; }
a.st-card:hover .go, a.st-card:focus-visible .go { opacity: 1; }
.st-card-lines { display: grid; gap: 9px; margin: 0; }
.st-card-lines > div { display: flex; justify-content: space-between; gap: 14px; font-size: 13px; }
.st-card-lines dt { color: var(--ink-3); }
.st-card-lines dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.st-card-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }
.st-list-links { list-style: none; margin: 0; padding: 0; }
.st-list-links a { display: flex; align-items: center; gap: 10px; padding: 8px; margin: 0 -8px; border-radius: 10px; color: var(--ink); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.st-list-links a:hover { background: var(--hover); }
.st-list-links a > svg { width: 16px; height: 16px; flex: none; color: var(--icon); }
.st-list-links a > svg:last-child { width: 14px; height: 14px; color: var(--ink-3); }
.st-list-links .grow { flex: 1; min-width: 0; }
.st-list-links .muted { font-size: 12px; font-weight: 500; }

.st-row { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 26px; padding: 20px 0; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--topbar) + 40px); }
.st-row:first-child { padding-top: 4px; }
.st-row:last-child { border-bottom: 0; }
.st-row-text label { font-size: 14.5px; font-weight: 650; color: var(--ink); }
.st-row-text p { margin-top: 4px; font-size: 13px; line-height: 1.6; color: var(--ink-3); }
.st-row-text .st-row-meta { margin-top: 8px; font-size: 12px; }
.st-row.changed .st-row-text label::after { content: "Unsaved"; margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--active-soft); color: var(--active-ink); font-size: 11px; font-weight: 600; vertical-align: 2px; }
.st-row-control { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.st-row-control .error { max-width: 100%; }
.st-row-control > .input { width: 100%; }
.st-row-control .hint { font-size: 12px; color: var(--ink-3); }
.unit-input { display: flex; align-items: center; gap: 10px; }
.unit-input .input { width: 110px; font-variant-numeric: tabular-nums; }
.unit-input span { font-size: 13px; color: var(--ink-3); }
.st-row.flash { animation: st-flash 1.6s var(--curve); }
@keyframes st-flash { 0%, 40% { background: var(--secondary-bg); box-shadow: 0 0 0 12px var(--secondary-bg); } }
.st-explain { margin-top: 22px; padding: 18px 20px; border-radius: 16px; background: var(--surface-2); }
.st-explain h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13px; color: var(--ink-2); }
.st-explain h3 svg { width: 16px; height: 16px; color: var(--icon); }
.st-explain p { font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }
.today-preview { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.today-preview .eyebrow { margin-bottom: 4px; }
.today-preview b { font-size: 22px; letter-spacing: -.03em; }
.alert-scale { display: flex; height: 12px; margin: 4px 0 6px; border-radius: 999px; overflow: hidden; background: var(--pending); }
.alert-scale .seg { display: block; height: 100%; }
.alert-scale .ok { background: color-mix(in srgb, var(--done) 55%, var(--surface)); }
.alert-scale .warn { background: var(--active); }
.alert-scale .danger { flex: 1; background: var(--danger); }
.alert-scale-labels { position: relative; height: 18px; margin-bottom: 14px; font-size: 11.5px; color: var(--ink-3); }
.alert-scale-labels span { position: absolute; top: 0; white-space: nowrap; transform: translateX(-50%); }
.alert-scale-labels span:first-child { left: 0; transform: none; }
.pv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pv { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.st-explain .pv-label { font-size: 13px; font-weight: 650; line-height: 1.5; color: var(--ink); }
.st-explain .pv-sub { margin: 2px 0 8px; font-size: 12px; line-height: 1.5; color: var(--ink-3); }
.pv-line { display: grid; grid-template-columns: minmax(0, 1fr) auto 48px; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.pv-line b { text-align: right; font-variant-numeric: tabular-nums; }
.pv-line.new { color: var(--accent); font-weight: 600; }
.pv-line .pill { margin-left: 6px; }

.st-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.st-tools .search-box { flex: 1 1 240px; }
.st-tools .search-box .input { width: 100%; }
.st-table .st-name b { font-weight: 600; }
.st-table tr.inactive .st-name { opacity: .55; }
.st-table .handle-col { width: 26px; padding-right: 0 !important; }
.drag-handle { display: inline-block; padding: 2px 4px; border-radius: 6px; color: var(--ink-3); font-size: 16px; line-height: 1; cursor: grab; user-select: none; }
.drag-handle:hover { background: var(--surface-2); color: var(--ink); }
.st-table tr.dragging { opacity: .45; }
.st-table tr.drop-before td { box-shadow: inset 0 2px 0 var(--accent); }
.st-table tr.drop-after td { box-shadow: inset 0 -2px 0 var(--accent); }
.st-table .row-actions { width: 1%; white-space: nowrap; text-align: right; }
.st-table .num-col { text-align: right; }

.circuit { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.circuit-step { display: flex; align-items: center; gap: 10px; padding: 9px 8px 9px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.circuit-step[draggable="true"] { cursor: grab; }
.circuit-step .num { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; }
.circuit-step .cs-text b { display: block; font-size: 13.5px; }
.circuit-step .cs-text small { display: block; font-size: 11.5px; color: var(--ink-3); }
.circuit-step .cs-actions { display: flex; gap: 0; }
.circuit-step.dragging { opacity: .4; }
.circuit-step.drop-before { box-shadow: inset 3px 0 0 var(--accent); }
.circuit-step.drop-after { box-shadow: inset -3px 0 0 var(--accent); }
.circuit-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.circuit-foot .input { width: auto; }
.st-kv { margin-bottom: 18px; }
.st-test { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.st-test .field { flex: 1 1 260px; }
[data-test-result] .notice { margin-top: 14px; display: flex; align-items: center; gap: 8px; }
[data-test-result] .notice svg { width: 16px; height: 16px; flex: none; }
.st-panel > .notice { margin-bottom: 18px; }
.st-panel .notice code { font-size: 12px; }
.st-mail-move { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.st-mail-move > span svg { width: 15px; height: 15px; margin-right: 6px; vertical-align: -2px; }
.st-switch { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.st-mail-port { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 8px; width: 100%; }
.st-mail-check { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; }
[data-mail-result] .notice { margin-top: 14px; display: flex; align-items: center; gap: 8px; }
[data-mail-result] .notice svg { width: 16px; height: 16px; flex: none; }
[data-mail-result] + .st-note { margin-top: 16px; }
.similar-note { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0 0; padding: 10px 12px; font-size: 12.5px; }
.similar-note svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.tone-row { display: flex; align-items: center; gap: 12px; }
.tone-row .input { flex: 1; }

@media (max-width: 1060px) {
  .st-shell { grid-template-columns: minmax(0, 1fr); }
  .st-side { position: static; max-height: none; padding: 12px; }
  .st-nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .st-nav::-webkit-scrollbar { display: none; }
  .st-nav .nav-group { display: none; }
  .st-nav a { flex: none; white-space: nowrap; margin: 0; }
}
@media (max-width: 640px) {
  .st-panel { padding: 22px 18px; }
  .st-row { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .st-cards, .pv-grid { grid-template-columns: minmax(0, 1fr); }
  .st-card { padding: 20px 18px; }
  .st-table .handle-col, .st-table td.handle-col { display: none; }
  /* Each item as a card: tick, name and switch; then where it is used and the actions. */
  table.data.st-table thead { display: none; }
  table.data.st-table, table.data.st-table tbody { display: block; width: 100%; }
  table.data.st-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 4px 12px 34px; border-bottom: 1px solid var(--line); }
  table.data.st-table tbody tr:last-child { border-bottom: 0; }
  table.data.st-table td { display: block; padding: 0 !important; border: 0; background: none !important; }
  table.data.st-table td.pick { flex: 0 0 22px; margin-left: -30px; }
  table.data.st-table td.handle-col { display: none; }
  table.data.st-table td.st-name { flex: 1 1 140px; min-width: 0; }
  table.data.st-table td.row-actions { width: auto; margin-left: auto; }
  table.data.st-table td.num-col { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

@media print {
  body { background: #fff !important; }
  .sidebar, .topbar, .workspace-footer, .page-head .actions, .toolbar, .filter-panel, .no-print, .toasts, .bulk-bar { display: none !important; }
  .shell { display: block; }
  .content { max-width: none; padding: 0; }
  .panel, .strip > * { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}

/* ---------------------------------------------------------------- Companies directory */
.company-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 22px; }
.co-mark { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 12px; background: var(--secondary-bg); color: var(--brand-gold-ink); font-size: 12px; font-weight: 700; letter-spacing: -.01em; }
.co-type { font-weight: 600; color: var(--ink-2); }
.co-type[data-tone="info"] { color: var(--info); }
.co-type[data-tone="warning"] { color: var(--active-ink); }
/* The name column takes the space that is left; long names end in an ellipsis instead of widening the table. */
.company-table td[data-col="company"] { width: 100%; max-width: 0; min-width: 0; }
.company-table .num-col { text-align: right; }
.company-table th.num-col button { justify-content: flex-end; }
.company-table .row-actions { width: 1%; text-align: right; white-space: nowrap; }
.company-table tr.inactive td[data-col="company"] { opacity: .62; }
.company-table .overdue-link { display: block; margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--danger); }
.company-table .alike { color: var(--active-ink); }
.company-table .alike svg { width: 12px; height: 12px; margin-right: 4px; vertical-align: -2px; }
.spark-cell { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-size: 13px; }
.spark { display: inline-flex; align-items: flex-end; gap: 2px; width: 72px; height: 24px; }
.spark i { flex: 1; min-height: 3px; border-radius: 2px 2px 0 0; background: color-mix(in srgb, var(--accent) 55%, transparent); }
.spark i.z { height: 2px; min-height: 2px; background: var(--line); }
a.spark-cell:hover .spark i:not(.z) { background: var(--accent); }
.list-note { display: flex; align-items: flex-start; gap: 8px; margin: -4px 0 16px; }
.list-note svg { width: 15px; height: 15px; flex: none; margin-top: 3px; }
@media (max-width: 1280px) {
  .company-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* Below 1280px the table becomes one card per company: name and actions first, then each figure with its label. */
@media (max-width: 1280px) {
  table.data.company-table thead { display: none; }
  table.data.company-table, table.data.company-table tbody { display: block; width: 100%; }
  table.data.company-table tr { display: flex !important; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 14px 6px; border-bottom: 1px solid var(--line); }
  table.data.company-table tbody tr:last-child { border-bottom: 0; }
  table.data.company-table tbody tr:hover { background: var(--surface-2); }
  table.data.company-table tbody tr:hover td { background: none; }
  table.data.company-table td { display: block; width: auto !important; padding: 2px 0 !important; border: 0; text-align: left; }
  table.data.company-table td.pick { flex: 0 0 22px; }
  table.data.company-table td[data-col="company"] { flex: 1 1 calc(100% - 160px); min-width: 0; max-width: none; }
  table.data.company-table .person-cell .grow { max-width: none; }
  table.data.company-table td.row-actions { order: 2; margin-left: auto; }
  table.data.company-table td[data-label] { order: 3; align-self: flex-start; font-size: 13px; }
  table.data.company-table td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 600; color: var(--ink-3); }
  table.data.company-table td[data-col="clients"] { margin-left: 96px; }
  table.data.company-table td[data-col="activity"] { order: 4; }
  table.data.company-table td.num-col .overdue-link { display: inline; margin-left: 6px; }
}
@media (max-width: 640px) {
  .company-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  table.data.company-table tr { padding: 14px 6px 14px 38px; gap: 8px 18px; }
  table.data.company-table td.pick { margin-left: -32px; }
  table.data.company-table td[data-col="company"] { flex-basis: calc(100% - 120px); }
  table.data.company-table td[data-col="clients"] { margin-left: 0; }
  table.data.company-table td[data-col="activity"] { flex-basis: 100%; }
}

/* ---------------------------------------------------------------- Station presets (packages and companies) */
.plan-editor { display: grid; gap: 14px; }
.plan-editor > p { margin: 0; }
.plan-editor .segmented { justify-self: start; }
.plan-h { margin: 6px 0 -6px; font-size: 14px; font-weight: 650; }
.plan-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; }
.plan-list li { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--line); }
.plan-list li:last-child { border-bottom: 0; }
.plan-list li.off { background: var(--surface-2); }
.plan-list li.off b { color: var(--ink-3); }
.plan-list .num { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 50%; background: var(--secondary-bg); color: var(--brand-gold-ink); font-size: 12px; font-weight: 700; }
.plan-list .grow { min-width: 0; }
.plan-list .grow b { display: block; font-weight: 600; }
.plan-list .grow small { display: block; font-size: 11.5px; color: var(--ink-3); }
.plan-list select.input { width: 128px; flex: none; }
.plan-add { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 13px; }
.plan-add select.input { width: 220px; }
.plan-default { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px 10px; margin: 0; padding: 12px 14px; border-radius: 13px; background: var(--surface-2); font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.plan-default > svg { width: 16px; height: 16px; flex: none; margin-top: 3px; color: var(--icon); }
.plan-default > span { flex: 1 1 260px; }
.plan-editor > .btn { justify-self: start; }
.plan-history { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.plan-history summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.plan-history summary svg { width: 15px; height: 15px; color: var(--icon); }
.plan-history[open] summary { margin-bottom: 10px; }
.plan-history .table-wrap { max-height: 260px; overflow: auto; }
.plan-history tr.sug td:first-child { font-weight: 650; }
.plan-history .hint-line { margin: 10px 0; }
.share { display: inline-block; width: 60px; height: 6px; margin-right: 8px; border-radius: 999px; background: var(--surface-2); vertical-align: 1px; overflow: hidden; }
.share i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.plan-packages { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; max-height: 280px; overflow: auto; }
.plan-packages li { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.plan-packages li:last-child { border-bottom: 0; }
.plan-packages li.on { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.plan-packages li > .check:first-child { flex: 1 1 200px; font-weight: 600; }
.plan-packages li > .muted { font-size: 12px; }
.plan-packages .default-pick { font-size: 12.5px; color: var(--ink-2); }
.plan-btn svg { width: 14px; height: 14px; }
.plan-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.plan-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--ink); text-decoration: none; }
.plan-chip .tnum { color: var(--ink-3); font-size: 12px; }
.plan-chip.default { border-color: var(--accent); background: var(--accent-soft); }
.plan-note { font-size: 12.5px; color: var(--ink-3); }
@media (max-width: 640px) {
  .plan-list li { flex-wrap: wrap; }
  .plan-list .grow { flex: 1 1 calc(100% - 40px); }
  .plan-list select.input { width: auto; flex: 1 1 auto; }
  .plan-add select.input { width: 100%; }
}
.plan-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; }
.plan-summary .plan-note { margin-bottom: 10px; }
@media (max-width: 640px) { .plan-summary { grid-template-columns: minmax(0, 1fr); } }

/* ---------------------------------------------------------------- Client stations: add and remove */
.station-tools { justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
.station-tools select.input { max-width: 240px; }
.station-tools .remove-several { margin-left: auto; }
.station .st-remove:hover { color: var(--danger); }
.remove-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 16px; margin: 14px 0 6px; }
@media (max-width: 640px) {
  .station-tools select.input { max-width: none; flex: 1 1 180px; }
  .station-tools .remove-several { margin-left: 0; }
}

/* ---------------------------------------------------------------- Schedule: figures, filters, month, week, agenda and the day panel */
.sched-kpis { margin-bottom: 22px; }
.sched-filters { display: grid; gap: 14px; margin-bottom: 22px; }
.sched-filters .toolbar .search-box { flex: 1 1 280px; width: auto; }
.sched-filters .toolbar > select.input { width: 300px; max-width: 100%; }
.period-label { display: inline-block; min-width: 150px; text-align: center; font-size: 14px; font-variant-numeric: tabular-nums; }
.cal-day .d { justify-content: space-between; }
.cal-day .cal-n { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 0 7px; }
.cal-day.past:not(.today) .d { color: var(--ink-3); }
.cal-day.busy { background: var(--surface); }
.cal-day.busy.out { background: var(--surface-2); }
.cal-ev b { font-weight: 700; margin-right: 1px; }
.cal-day .dots i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.cal-day .dots i.appointment { background: var(--accent); }
/* A ring, so follow-ups differ from appointments in dark mode too, where both colours are gold. */
.cal-day .dots i.follow_up { background: none; box-shadow: inset 0 0 0 2px var(--active); }
.cal-day .dots i.station { background: var(--done); }
.cal-day:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; z-index: 1; }
/* Week: seven columns with every booking listed, grouped by company. */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.week-day { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--line); }
.week-day:last-child { border-right: 0; }
.week-day.past .week-head { color: var(--ink-3); }
.week-head { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; padding: 12px 12px 10px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface-2); font: inherit; color: inherit; text-align: left; cursor: pointer; }
.week-head .dow { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.week-head b { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; }
.week-head .meta { flex-basis: 100%; font-size: 11.5px; color: var(--ink-3); }
.week-day.today .week-head b { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 8px; }
.week-day.on .week-head { box-shadow: inset 0 -2px 0 var(--accent); }
.week-head:hover { background: color-mix(in srgb, var(--accent) 6%, var(--surface-2)); }
.week-body { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px 14px; min-height: 160px; }
.wk-group { display: flex; flex-direction: column; gap: 2px; }
.wk-co { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 3px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; font-weight: 700; }
.wk-co > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-row { display: flex; align-items: center; gap: 5px; padding: 2px 6px; border-radius: 6px; font-size: 12px; color: var(--ink-2); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wk-row svg { width: 12px; height: 12px; flex: none; color: var(--done); }
.wk-row:hover { background: var(--surface-2); color: var(--ink); }
.wk-row.follow_up { background: var(--active-soft); color: var(--active-ink); }
.wk-row.follow_up svg { color: var(--active-ink); }
.wk-row.station { background: var(--done-soft); color: var(--done); }
.wk-more { align-self: flex-start; padding: 2px 6px; border: 0; background: none; font: 600 11.5px var(--font); color: var(--ink-3); cursor: pointer; }
.wk-more:hover { color: var(--accent); }
/* Agenda: the days with something on, in order. */
.agenda .ag-day { padding: 18px 0 6px; border-top: 1px solid var(--line); }
.agenda .ag-day:first-of-type { border-top: 0; padding-top: 6px; }
.ag-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.ag-head h3 { font-size: 15px; font-weight: 650; }
.ag-head .meta { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.ag-head .actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.ag-day.past .ag-head h3 { color: var(--ink-2); }
.ag-group { margin: 6px 0 4px; }
.ag-co { display: flex; align-items: center; gap: 8px; padding: 8px 0 2px; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.ag-co .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-co .tnum { padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-3); font-size: 11.5px; }
/* Sections of the day panel and the agenda sit inside the panel's side padding; rows keep a hover background that reaches a little past the text. */
.day-panel > :not(.panel-head), .agenda > .ag-day { padding-left: 26px; padding-right: 26px; }
.day-panel > :last-child { padding-bottom: 22px; }
.agenda > .ag-day:last-child { padding-bottom: 22px; }
.ag-group .rows { margin: 0; }
.ag-group .rows .row-link { padding: 9px 10px; margin: 0 -10px; border-radius: 10px; }
.ag-group .rows .side { display: inline-flex; align-items: center; gap: 6px; }
/* The chosen day beside the month grid, or under the week. */
.day-panel .panel-head { flex-wrap: wrap; }
.day-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.day-sum { margin: 0 0 6px; font-size: 13px; color: var(--ink-2); }
.week-panel { margin-bottom: 24px; }
@media (max-width: 1100px) {
  .sched-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* The week stacks into a list of days that read like the agenda. */
  .week { grid-template-columns: minmax(0, 1fr); }
  .week-day { border-right: 0; border-bottom: 1px solid var(--line); }
  .week-day:last-child { border-bottom: 0; }
  .week-body { min-height: 0; flex-direction: row; flex-wrap: wrap; gap: 8px 18px; }
  .wk-group { flex: 1 1 220px; max-width: 320px; }
  .wk-row.follow_up, .wk-row.station { flex: 1 1 220px; max-width: 320px; }
}
@media (max-width: 640px) {
  .sched-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sched-filters .toolbar > select.input { width: 100%; }
  .period-label { min-width: 0; }
  .ag-head .actions { margin-left: 0; flex-basis: 100%; }
  .ag-group .rows { margin-left: 0; }
}
@media print {
  .sched-kpis, .cal-day .dots { display: none !important; }
  .week { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .cal-day, .week-day, .ag-day { break-inside: avoid; }
}
@media (max-width: 900px) {
  .day-panel > :not(.panel-head), .agenda > .ag-day { padding-left: 18px; padding-right: 18px; }
}

/* ---------------------------------------------------------------- Insights: figures with their change, highlights, the breakdown table */
.insight-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.audit-kpis > [data-tone="good"] { border-top-color: var(--done); }
.insight-kpis .trend { display: flex; align-items: center; gap: 3px; white-space: normal; }
.insight-kpis .trend.good { color: var(--done); }
.insight-kpis .trend.bad { color: var(--danger); }
.insight-kpis .trend.flat { color: var(--ink-2); }
.insight-kpis .trend svg { width: 12px; height: 12px; flex: none; }
.insight-kpis .trend span { color: var(--ink-3); }
.highlights { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.highlights li { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; line-height: 1.55; color: var(--ink-2); }
.highlights li svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--icon); }
.highlights li[data-tone="good"] svg { color: var(--done); }
.highlights li[data-tone="bad"] svg { color: var(--danger); }
.seg-head { flex-wrap: wrap; }
.seg-head .actions { align-items: center; flex-wrap: wrap; }
.seg-table th.num-col, .seg-table td.num-col { text-align: right; }
.seg-table th.num-col button { justify-content: flex-end; }
.seg-table td.worse { color: var(--danger); font-weight: 600; }
.seg-table tr.whole td { background: var(--surface-2); font-weight: 650; }
.seg-table .share-col { width: 90px; }
.seg-table td.share-col .share { width: 70px; margin: 0; }
.seg-profile { display: inline-flex; vertical-align: -2px; margin-left: 4px; color: var(--ink-3); }
.seg-profile svg { width: 13px; height: 13px; }
.seg-profile:hover { color: var(--accent); }
.seg-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; font-size: 12.5px; }
table.data td.num-col .share { width: 54px; margin-right: 8px; }
.st-times td.num-col { white-space: nowrap; }
.defs { display: grid; gap: 12px; margin: 14px 0 0; }
.defs dt { font-weight: 650; }
.defs dd { margin: 2px 0 0; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.slowest .row-link { padding-top: 10px; padding-bottom: 10px; }
@media (max-width: 1280px) {
  .insight-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .insight-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  table.data.seg-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 10px; }
  table.data.seg-table td:first-child { grid-column: 1 / -1; }
  table.data.seg-table td.num-col { text-align: left; }
  table.data.seg-table td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 600; color: var(--ink-3); }
  table.data.seg-table td.share-col { display: none; }
  table.data.seg-table tr.whole td:first-child { padding-bottom: 6px !important; }
}

/* ---------------------------------------------------------------- Insights: Chart.js charts, the turnaround section, companies */
/* Chart colours. The three series colours were validated for both themes (lightness band, chroma, colour-vision separation,
   contrast on the panel surface); status colours mean good/bad and are never used for a series. */
:root { --ch-1: #86374a; --ch-2: #4a7fb5; --ch-3: #6c8a3c; --ch-good: var(--done); --ch-bad: var(--danger); --ch-warn: #b98214; --ch-target: #b98214; --ch-muted: #cfd5db; --ch-grid: var(--line); --ch-ink: var(--ink-3); }
:root[data-theme="dark"] { --ch-1: #c0637a; --ch-2: #4f8fd0; --ch-3: #6f9c3a; --ch-warn: var(--brand-gold); --ch-target: var(--brand-gold); --ch-muted: #3a4650; }
.sec-title { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 6px 2px -8px; }
.sec-title .eyebrow { margin: 0; color: var(--ink-2); }
.sec-title .meta { font-size: 13px; color: var(--ink-3); }
.chart-box { position: relative; height: 270px; }
.chart-box.short { height: 230px; }
.chart-box.tall { height: 340px; }
.chart-box canvas { display: block; }
.insight-grid > .self-start { align-self: start; }
.seg-panel .seg-chart { margin: 0 26px 10px; }
.chart-table { margin-top: 10px; }
.chart-table summary { display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; list-style: none; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--ink-3); border-radius: 6px; }
.chart-table summary::-webkit-details-marker { display: none; }
.chart-table summary svg { width: 14px; height: 14px; }
.chart-table summary:hover { color: var(--accent); }
.chart-table summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.chart-table[open] summary { margin-bottom: 8px; }
.chart-table .table-wrap { max-height: 320px; overflow: auto; }
.legend-inline i.line { height: 2px; width: 14px; border-radius: 0; vertical-align: 3px; }
.legend-inline i.dash { height: 0; width: 14px; border-radius: 0; border-top: 2px dashed currentColor; background: none !important; vertical-align: 3px; }
.legend-wrap { margin-top: 12px; justify-content: center; }
.glance { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.glance li > a, .glance li > div { display: flex; align-items: baseline; gap: 10px; padding: 7px 10px; margin: 0 -10px; border-radius: 10px; color: inherit; text-decoration: none; }
.glance li > a:hover, .glance li > a:focus-visible { background: var(--surface-2); }
.glance li > a:hover .k { color: var(--accent); }
.glance .k { flex: 1; font-size: 13px; color: var(--ink-2); }
.glance .v { font-size: 17px; font-weight: 650; letter-spacing: -.02em; white-space: nowrap; }
.glance .v small { font-size: 12px; font-weight: 600; color: var(--ink-3); margin-left: 4px; letter-spacing: 0; }
.glance .v.bad { color: var(--danger); }
.glance .v.good { color: var(--done); }
table.data.compare th.num-col, table.data.compare td.num-col { text-align: right; }
table.data.compare td .trend { display: block; margin-top: 1px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
table.data.compare td .trend.good { color: var(--done); }
table.data.compare td .trend.bad { color: var(--danger); }
table.data.top-co td.worse { color: var(--danger); font-weight: 600; }
table.data.top-co td.num-col, table.data.movers td.num-col { white-space: nowrap; }
table.data.top-co td:first-child, table.data.movers td:first-child { width: 100%; }
table.data.top-co td .name { line-height: 1.4; }
.attention-list .row-link .count.warn { color: var(--active-ink); }
.co-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.co-stats > * { display: block; min-width: 0; padding: 14px 14px 12px; border-radius: 12px; background: var(--surface-2); color: inherit; text-decoration: none; }
.co-stats > a:hover { background: var(--accent-soft); }
.co-stats .v { font-size: 22px; font-weight: 650; letter-spacing: -.03em; line-height: 1.1; }
.co-stats .v.good { color: var(--done); }
.co-stats .l { margin-top: 4px; font-size: 12px; line-height: 1.5; color: var(--ink-3); }
.co-stats .l .trend { color: var(--ink-3); }
.co-list + .co-list { margin-top: 14px; }
.co-list p { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.co-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.co-chips a, .co-chips span { display: inline-flex; align-items: center; gap: 7px; min-height: 26px; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 600; text-decoration: none; }
.co-chips a:hover, .co-chips a:focus-visible { background: var(--accent-soft); color: var(--accent); }
.co-chips .n { color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.co-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.co-two .co-list + .co-list { margin-top: 0; }
table.data.movers td .pill { margin-left: 8px; }
.seg-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 0 26px 12px; font-size: 12px; }
@media (max-width: 1280px) { .insight-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .insight-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seg-tools { padding: 0 18px 12px; }
  .seg-panel .seg-chart { margin: 0 18px 10px; }
  .chart-box { height: 240px; }
  .chart-box.short { height: 210px; }
}
@media (max-width: 900px) { .co-two { grid-template-columns: 1fr; gap: 16px; } }
@media (max-width: 640px) {
  .co-stats { gap: 8px; }
  .co-stats > * { padding: 10px 10px; }
  .co-stats .v { font-size: 18px; }
  table.data.compare td .trend { display: inline; margin-left: 6px; }
  .glance .v { font-size: 15px; }
}
@media print {
  .chart-table, .seg-tools { display: none !important; }
  .chart-box { height: 220px; }
  .sec-title { break-after: avoid; }
}

/* ---------------------------------------------------------------- Searchable dropdowns (components/select.js): selects with five or more choices */
.ss { position: relative; display: inline-block; max-width: 100%; min-width: 0; vertical-align: middle; }
.field > .ss { display: block; }
.ss .ss-native { position: absolute; left: 0; top: 0; width: 1px; height: 1px; margin: 0; padding: 0; opacity: 0; pointer-events: none; }
.ss-btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; cursor: pointer; text-align: left; appearance: none; background-image: none !important; padding-right: 12px !important; color: var(--ink); font-family: inherit; }
.ss-btn .ss-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-btn svg { width: 14px; height: 14px; flex: none; color: var(--accent); transition: transform .2s var(--curve); }
.ss-btn[aria-expanded="true"] { border-color: var(--accent); }
.ss-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.ss-btn:disabled { opacity: .6; cursor: default; }
.ss-pop { position: fixed; z-index: 96; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-pop); }
.ss-pop .ss-search { width: 100%; }
.ss-list { list-style: none; margin: 0; padding: 0; max-height: min(320px, 50vh); overflow-y: auto; overscroll-behavior: contain; }
.ss-list li { padding: 8px 10px; border-radius: 7px; font-size: 13px; line-height: 1.45; color: var(--ink); cursor: pointer; }
.ss-list li.active { background: var(--surface-2); }
.ss-list li[aria-selected="true"] { font-weight: 600; color: var(--accent); }
.ss-list li.ss-any { color: var(--ink-2); font-style: italic; }
.ss-list li.ss-none { color: var(--ink-3); cursor: default; }
.ss-count { min-height: 0; padding: 0 4px; font-size: 11px; color: var(--ink-3); }
.ss-count:empty { display: none; }
