/* ============================================================
   GenesysConfig360 — Premium UI  v2.1
   Brand palette: Deep Navy · Electric Orange · Slate
   ============================================================ */

@import url('vendor/fonts/fonts.css?v=20261025'); /* B2449: self-hosted, no Google request */

/* ── tokens ── */
:root {
  /* Brand */
  --brand-orange:    #FF6B00;
  --brand-orange-lt: #FF8C38;
  --brand-orange-dark: #e05f00;
  /* B2445: brand-coloured TEXT on a brand tint (badges, chips). The brand colour itself is
     2.1–4.2:1 there in light mode; each preset gets a darker shade of its hue (>= 5.8:1).
     Dark mode uses the preset's -lt shade (dark-mode block). tests/test_contrast_b2445_b2448.py */
  --brand-text: #963F00;
  --brand-rgb: 255, 107, 0;  /* comma-separated RGB for rgba(var(--brand-rgb), .15) tints */
  /* Coordinated chart palette, one set per data-brand theme — chart-1 always
     matches the theme's primary color, chart-2..4 are picked to read well
     alongside it (a warm primary pairs with cool supports and vice versa)
     rather than every theme just repeating one hue across a multi-series
     chart. Read at draw-time via app.js's chartColor(n), not hardcoded. */
  --chart-1: var(--brand-orange);
  --chart-2: #3B82F6;
  --chart-3: #10B981;
  --chart-4: #8B5CF6;
  --brand-navy:      #0B1120;
  --brand-navy-mid:  #111827;
  --brand-navy-lt:   #1E2D45;
  /* B: was #3B82F6/#60A5FA — the same blue as the new default --brand-orange
     (2026-09-08 rebrand), which made every link look identical to a primary
     button. Shifted to a distinct cyan so links/secondary accents stay
     visually separate from the primary brand color regardless of which
     data-brand palette is active. */
  --brand-accent:    #0E7490;   /* B1422: was #0891B2 (3.33:1 on --bg) -> 4.85:1 */
  --brand-accent-lt: #22D3EE;

  /* UI */
  --bg:        #F0F4F8;
  --surface:   #FFFFFF;
  --surface-2: #F8FAFC;
  --border:    #E2E8F0;
  --border-2:  #CBD5E1;
  --text:      #0F172A;
  --text-2:    #475569;
  /* B1422: was #94A3B8 (2.56:1 on white, 2.31:1 on --bg). #5B6B82 = 4.91:1 on
     --bg #F0F4F8 and 5.4:1 on white (#64748B, slate-500, is only 4.31:1 on --bg,
     still failing for page subtitles that sit directly on the page background). */
  --muted:     #5B6B82;

  /* Status */
  --success:   #10B981;
  --success-bg:#D1FAE5;
  --danger:    #EF4444;
  --danger-bg: #FEE2E2;
  --warning:   #F59E0B;
  --warning-bg:#FEF3C7;
  --info:      #3B82F6;
  --info-bg:   #DBEAFE;

  /* Layout */
  --sidebar-w: 248px;
  --header-h:  60px;
  --global-header-h: 68px; /* workspace strip (32px) + platform tabs (36px) — single source of truth */
  --radius:    10px;
  --radius-lg: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.14), 0 4px 12px rgba(0,0,0,.06);
  --shadow-xl: 0 24px 80px rgba(0,0,0,.22), 0 8px 24px rgba(0,0,0,.1);

  /* Sidebar gradient */
  --sidebar-bg: linear-gradient(180deg, #0B1120 0%, #111827 50%, #0F1E35 100%);

  /* Aliases for template compatibility */
  --card-bg: var(--surface);
  --primary: var(--brand-orange);
  --text-muted: var(--muted);
  --accent: var(--brand-orange);
  --accent-ok: #22c55e;
  --success-text: #155724;
  --danger-text: #7F1D1D;
  --warning-text: #92400E;
  --info-text: #1E3A8A;
  --surface-alt: var(--surface-2);
  --hover: #F1F5F9;

  /* B1422: text-on-brand surfaces (primary buttons, chips, badges). Each preset
     picks a solid background + text colour pair that is >= 4.5:1 — bright
     presets (orange/green/gold) keep their brand hue with navy text, darker
     presets (blue/purple) keep white text on a deeper shade. */
  --brand-solid:   var(--brand-orange);
  --brand-solid-2: var(--brand-orange-lt);
  --on-brand:      #0B1120;

  /* B1865 badge tokens, light theme: background + text pairs, each >= 4.5:1
     (checked by tests/test_design_foundation.py). Dark values: body.dark-mode. */
  --badge-success-bg: #D1FAE5; --badge-success-fg: #065F46;
  --badge-warn-bg:    #FEF3C7; --badge-warn-fg:    #78350F;
  --badge-danger-bg:  #FEE2E2; --badge-danger-fg:  #7F1D1D;
  --badge-info-bg:    #DBEAFE; --badge-info-fg:    #1E3A8A;
  --badge-muted-bg:   #F1F5F9; --badge-muted-fg:   #475569;
  --purple-text:      #6D28D9;  /* B2445: purple text on a purple tint (5.9:1); dark: #C4B5FD */

  /* B1865: always-dark surfaces (the demo decks, the sign-in backdrop). Fixed values
     that never follow light/dark mode — the slides stay Deep Navy either way.
     Mapped to the brand palette: navy background, slate text, Electric Orange
     light for kickers/links, the preset's primary as the accent. No dark-mode
     override on purpose. */
  --deck-bg:        var(--brand-navy);  /* #0B1120 */
  --deck-bg-2:      #16213C;            /* gradient end */
  --deck-text:      #E2E8F0;
  --deck-heading:   #FFFFFF;
  --deck-muted:     #94A3B8;
  --deck-faint:     #64748B;
  --deck-line:      #24304D;
  --deck-accent:    var(--brand-orange);
  --deck-accent-lt: #FF8C38;            /* Electric Orange light — fixed, like the original kicker */
  --deck-ok:        #4ADE80;
  --deck-warn:      #FBBF24;
  --deck-bad:       #F87171;
  --deck-pink:      #FF2D78;

  /* B1865 app shell (always-dark top bar / strips, no dark-mode override): secondary text on
     the navy bar (12.7:1 on #0B1120), and the white tile behind the MFA QR code, which must
     stay white in both themes or phones can't scan it. */
  --shell-text: #CBD5E1;
  --qr-bg:      #FFFFFF;
}

/* Swappable brand palette — set via <html data-brand="..."> (see app.js applyBrand).
   Variable NAMES stay identical to the default (:root) block above, so every existing
   var(--brand-orange) / var(--brand-orange-lt) usage follows the chosen color. */
:root[data-brand="blue"] {
  /* B1422: primary was #3B82F6 (white text 3.68:1) -> #2563EB (5.17:1). */
  --brand-orange:       #2563EB;
  --brand-orange-lt:    #60A5FA;
  --brand-orange-dark:  #1D4ED8;
  --brand-text:         #1E4FBC;
  --brand-rgb: 37, 99, 235;
  --brand-solid:   #2563EB;
  --brand-solid-2: #1D4ED8;
  --on-brand:      #FFFFFF;
  --chart-1: var(--brand-orange);
  --chart-2: #F59E0B;   /* amber — warm counterpoint to the cool primary */
  --chart-3: #10B981;
  --chart-4: #8B5CF6;
}
:root[data-brand="green"] {
  --brand-orange:       #10B981;
  --brand-orange-lt:    #34D399;
  --brand-orange-dark:  #0d9668;
  --brand-text:         #09694A;
  --brand-rgb: 16, 185, 129;
  --chart-1: var(--brand-orange);
  --chart-2: #3B82F6;
  --chart-3: #F59E0B;
  --chart-4: #F43F5E;
}
:root[data-brand="gold"] {
  --brand-orange:       #D4A017;
  --brand-orange-lt:    #E0B44A;
  --brand-orange-dark:  #b08612;
  --brand-text:         #75580D;
  --brand-rgb: 212, 160, 23;
  --chart-1: var(--brand-orange);
  --chart-2: #3B82F6;
  --chart-3: #14B8A6;
  --chart-4: #8B5CF6;
}
:root[data-brand="purple"] {
  --brand-orange:       #8B5CF6;
  --brand-orange-lt:    #A78BFA;
  --brand-orange-dark:  #6d3fe0;
  --brand-text:         #6442B1;
  --brand-rgb: 139, 92, 246;
  --brand-solid:   #7C3AED;   /* B1422: white 5.7:1 (was #8B5CF6, 4.23:1) */
  --brand-solid-2: #6D28D9;
  --on-brand:      #FFFFFF;
  --chart-1: var(--brand-orange);
  --chart-2: #F59E0B;
  --chart-3: #14B8A6;
  --chart-4: #F43F5E;
}

/* B1422: the default blue preset's primary moved to #2563EB for white-on-primary
   contrast in light mode. Brand-coloured TEXT sitting on dark surfaces needs the
   opposite (lighter) shade, so: (1) the always-dark chrome (header strips, top
   bar, sidebars) uses the preset's -lt shade for brand text/indicators, and
   (2) in dark mode the blue preset keeps its previous #3B82F6 (4.8:1 on #111827).
   Buttons are unaffected — they use --brand-solid / --on-brand. */
.global-header, .top-bar, .sidebar { --brand-orange: var(--brand-orange-lt); }
:root.dark-mode[data-brand="blue"] { --brand-orange: #3B82F6; --brand-rgb: 59, 130, 246; }

/* Pre-paint dark-mode bridge: the early inline script in base.html adds
   'dark-mode' to <html> before the CSS paints; app.js mirrors it onto <body>
   at DOMContentLoaded so the body.dark-mode rules below also apply. */
html.dark-mode {
  color-scheme: dark;
  background-color: #0B1120;
}
html.dark-mode body { background-color: #0B1120; }

/* ── reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-accent-lt); }

/* B1422 (WCAG 1.4.1 link-in-text-block): links inside running text must not rely
   on colour alone. Scoped to prose containers only, so nav links, tabs, buttons,
   badges and table/tile links keep their current look. */
:where(p, .page-sub, .a360-page-header-sub, .help-text, .form-hint, .empty-state, .alert)
  a:not(.btn):not(.badge):not(.platform-tab):not(.workspace-tab):not([class*="chip"]) {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

/* ── scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }


/* ════════════════════════════════════════════
   HEADER / TOP BAR
   ════════════════════════════════════════════ */
.top-bar {
  position: fixed; top: var(--global-header-h); left: 0; right: 0;
  height: var(--header-h);
  background: var(--brand-navy);
  display: flex; align-items: center;
  padding: 0 24px 0 calc(var(--sidebar-w) + 24px);
  gap: 16px;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 2px 20px rgba(0,0,0,.3);
}

.top-bar .brand {
  font-size: 17px; font-weight: 800;
  color: #FFF;
  letter-spacing: -.4px;
  flex: 1;
  display: flex; align-items: center; gap: 10px;
}
.top-bar .brand .logo-icon {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.top-bar .brand .logo-icon-img {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
.top-bar .brand .brand-name { color: #FFF; }
.top-bar .brand .brand-sub  { color: var(--brand-orange); font-weight: 500; font-size: 13px; margin-left: 4px; }

.top-bar .org-badge {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  color: #CBD5E1;
  padding: 5px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
  display: flex; align-items: center; gap: 6px;
}
.top-bar .org-badge::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

.top-bar .btn-sm { font-size: 12px; padding: 5px 14px; }

.top-bar .global-search-wrap {
  position: relative; flex: 1; max-width: 320px;
}
.top-bar .global-search-wrap #global-search {
  width: 100%; padding: 6px 12px 6px 32px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.08);
  color: #FFF; font-size: 12px;
}
.top-bar .global-search-wrap #global-search::placeholder { color: rgba(255,255,255,.5); }
.top-bar .global-search-wrap .global-search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  font-size: 13px; pointer-events: none;
}
.top-bar .global-search-wrap .global-search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: #1E2D45; border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 12px 40px rgba(0,0,0,.3); z-index: 9999;
  max-height: 320px; overflow: auto;
}

/* ── Environment Indicator Badge ── */
.env-indicator {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: .03em;
  white-space: nowrap; cursor: default;
  transition: all .2s;
}
.env-indicator .env-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.env-indicator .env-label {
  line-height: 1;
}

/* Production: red pulsing badge */
.env-indicator.env-prod {
  background: rgba(220,53,69,.18);
  border: 1.5px solid #DC3545;
  color: #FF6B6B;
  animation: env-pulse-prod 2s ease-in-out infinite;
}
.env-indicator.env-prod .env-dot {
  background: #DC3545;
  box-shadow: 0 0 8px #DC3545;
}
.env-indicator.env-prod:hover {
  background: rgba(220,53,69,.28);
}

/* Non-production: green badge */
.env-indicator.env-normal {
  background: rgba(16,185,129,.12);
  border: 1.5px solid rgba(16,185,129,.4);
  color: #6EE7B7;
}
.env-indicator.env-normal .env-dot {
  background: #10B981;
  box-shadow: 0 0 6px #10B981;
}

/* Not connected: gray badge */
.env-indicator.env-disconnected {
  background: rgba(100,116,139,.12);
  border: 1.5px solid rgba(100,116,139,.3);
  color: #94A3B8;
}
.env-indicator.env-disconnected .env-dot {
  background: #64748B;
}

@keyframes env-pulse-prod {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,53,69,.0); }
  50%      { box-shadow: 0 0 0 4px rgba(220,53,69,.18); }
}

/* ── Org Switcher Dropdown ── */
.org-switcher { position: relative; }
.org-switcher-btn {
  cursor: pointer; border: none; background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1); color: #CBD5E1;
  padding: 5px 14px; border-radius: 20px; font-size: 12px; font-weight: 500;
  display: flex; align-items: center; gap: 6px;
}
.org-switcher-btn::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--success); box-shadow: 0 0 6px var(--success);
}
.org-dropdown {
  display: none; position: absolute; top: calc(100% + 10px); right: 0;
  min-width: 240px; background: var(--brand-navy-mid);
  border: 1px solid rgba(255,255,255,.12); border-radius: 10px;
  box-shadow: var(--shadow-xl); z-index: 9999; padding: 4px;
}
.org-dropdown.open { display: block; }
.org-dropdown-item {
  display: flex; flex-direction: column; gap: 2px;
  width: 100%; text-align: left; padding: 8px 12px; border-radius: 6px;
  border: none; background: transparent; color: #CBD5E1;
  font-size: 13px; cursor: pointer; text-decoration: none;
}
.org-dropdown-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.org-dropdown-active { background: rgba(var(--brand-rgb),.12) !important; color: var(--brand-orange) !important; }

/* ════════════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════════════ */
.sidebar {
  position: fixed; top: calc(var(--global-header-h) + var(--header-h)); left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  overflow-y: auto; overflow-x: hidden;
  z-index: 101;
  display: flex; flex-direction: column;
  border-right: 1px solid rgba(255,255,255,.04);
}

/* Brand block inside sidebar */
.sidebar-brand {
  padding: 20px 20px 18px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.sidebar-brand .s-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-orange) 0%, var(--brand-orange-lt) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  box-shadow: 0 0 16px rgba(var(--brand-rgb),.35);
}
.sidebar-brand .s-name {
  font-weight: 800; font-size: 15px; color: #FFF;
  letter-spacing: -.3px; line-height: 1.2;
}
.sidebar-brand .s-sub {
  font-size: 10px; color: rgba(255,255,255,.62);  /* B1865: was .35 (3.2:1) -> 7:1 */
  text-transform: uppercase; letter-spacing: .1em;
  font-weight: 500;
}

/* Sidebar quick-filter (2026-09-13) — standard pattern across all 3
   sidebars (Config360/Audit360/Analytics360), each ~15-30 items long.
   Styled for the dark sidebar background, distinct from .toolbar's light
   search input used in the main content area. */
.sidebar-filter {
  padding: 10px 16px 4px;
  flex-shrink: 0;
}
.sidebar-filter input[type="search"] {
  width: 100%;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  padding: 7px 10px;
  color: #FFF;
  font-size: 12.5px;
  font-family: inherit;
}
.sidebar-filter input[type="search"]::placeholder {
  color: rgba(255,255,255,.55);
}
.sidebar-filter input[type="search"]:focus {
  outline: none;
  border-color: var(--brand-orange);
  background: rgba(255,255,255,.09);
}
/* B1423: visible keyboard focus ring (the rule above removes the outline). */
.sidebar-filter input[type="search"]:focus-visible {
  outline: 2px solid var(--brand-orange-lt);
  outline-offset: 2px;
}

/* Nav */
.sidebar nav { padding: 12px 0; flex: 1; }

.sidebar-section {
  font-size: 9.5px; font-weight: 700;
  letter-spacing: .12em; color: rgba(255,255,255,.62);  /* B1865: was .2 (1.9:1) -> 7:1 */
  padding: 16px 20px 6px;
  text-transform: uppercase;
}

/* B2353: collapsible group in the Analytics360 sidebar (Live settings) --
   same look as .sidebar-section; audit360.css carries the Audit360 sidebar's
   own copy, this one also loads on base.html pages. */
#analytics-sidebar .sidebar-details { border: none; }
#analytics-sidebar .sidebar-details > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 9.5px; font-weight: 700; letter-spacing: .12em;
  color: rgba(255,255,255,.62); padding: 16px 20px 6px; text-transform: uppercase;
}
#analytics-sidebar .sidebar-details > summary::-webkit-details-marker { display: none; }
#analytics-sidebar .sidebar-details > summary::after {
  content: '\203A'; font-size: 14px; opacity: .5;
  display: inline-block; transform: rotate(90deg); transition: transform .2s;
}
#analytics-sidebar .sidebar-details:not([open]) > summary::after { transform: rotate(0deg); }
#analytics-sidebar .sidebar-details > summary:hover { color: rgba(255,255,255,.85); }

.sidebar nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 20px;
  color: rgba(255,255,255,.55);
  font-size: 13.5px; font-weight: 500;
  border-left: 3px solid transparent;
  transition: all .18s;
  position: relative;
}
.sidebar nav a .nav-icon {
  width: 18px; height: 18px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.5);
  transition: transform .2s, color .18s;
}
.sidebar nav a .nav-icon svg { width: 100%; height: 100%; display: block; }
.sidebar nav a:hover .nav-icon { color: rgba(255,255,255,.85); }
.sidebar nav a:hover {
  color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.05);
  text-decoration: none;
}
.sidebar nav a:hover .nav-icon { transform: scale(1.1); }
.sidebar nav a.active {
  color: #FFF;
  background: rgba(var(--brand-rgb),.12);
  border-left-color: var(--brand-orange);
}
.sidebar nav a.active .nav-icon { color: var(--brand-orange); }

/* Active pill glow */
.sidebar nav a.active::after {
  content: '';
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 20px; border-radius: 2px 0 0 2px;
  background: var(--brand-orange);
  box-shadow: -2px 0 8px rgba(var(--brand-rgb),.6);
}

/* Locked add-on nav item (2026-09-28) — visible-but-locked, distinct from a
   pillar the workspace can't see at all (those are fully {% if %}-hidden,
   never rendered with this class). Dimmer than a normal item, not fully
   hidden, cursor:not-allowed instead of a pointer, and never gets .active or
   the hover lift — the goal is "discoverable, clearly not clickable yet,"
   the concrete shape of an in-app upsell. templates/macros/entitlement_nav.html
   is the one place this class is applied. */
.sidebar nav a.nav-locked {
  color: rgba(255,255,255,.32);
  cursor: not-allowed;
}
.sidebar nav a.nav-locked .nav-icon { color: rgba(255,255,255,.24); }
.sidebar nav a.nav-locked:hover {
  color: rgba(255,255,255,.32);
  background: transparent;
}
.sidebar nav a.nav-locked:hover .nav-icon { transform: none; color: rgba(255,255,255,.24); }
.nav-lock-badge { margin-left: auto; font-size: 11px; opacity: .8; }

/* Sidebar favorite star (2026-09-28) — injected by JS onto every
   [data-menu-id] nav item in all 3 sidebars (base.html/_analytics_sidebar.html/
   audit/base.html), not hand-authored per <a> in the template. Subtle by
   default, visible on hover, always visible (filled) once favorited so a
   pinned item's star stays legible without hovering. */
.nav-fav-star {
  margin-left: auto; flex-shrink: 0;
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1;
  color: rgba(255,255,255,.22);
  opacity: 0; transition: opacity .15s, color .15s, transform .15s;
  cursor: pointer; border-radius: 5px;
}
.sidebar nav a:hover .nav-fav-star,
.sidebar nav a .nav-fav-star.is-fav,
.sidebar nav a .nav-fav-star:focus-visible {
  opacity: 1;
}
.nav-fav-star:hover { color: rgba(255,255,255,.85); transform: scale(1.15); }
.nav-fav-star.is-fav { color: var(--brand-orange); }
.sidebar-fav-section { color: var(--brand-orange); opacity: .85; }

/* Log panel at bottom of sidebar */
.sidebar-log {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.sidebar-log-title {
  font-size: 9.5px; font-weight: 700; letter-spacing: .1em;
  color: rgba(255,255,255,.2); text-transform: uppercase;
  margin-bottom: 10px;
}
.log-panel { font-size: 11px; }
.log-entry {
  display: flex; flex-direction: column; gap: 2px;
  padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.04);
}
.log-entry:last-child { border-bottom: none; }
.log-ts  { color: rgba(255,255,255,.2); font-size: 10px; font-family: 'JetBrains Mono', monospace; }
.log-msg { color: rgba(255,255,255,.55); line-height: 1.4; }
.log-badge { display: inline-block; }


/* ════════════════════════════════════════════
   MAIN CONTENT
   ════════════════════════════════════════════ */
.main {
  margin-left: var(--sidebar-w);
  padding-top: calc(var(--global-header-h) + var(--header-h));
  min-height: 100vh;
}

/* 2026-09-15 (B1279): was a flat max-width:1280px + fixed 56px side padding --
   on any screen wider than ~1392px CSS pixels (common even on a physically
   "small" laptop with a Retina/scaled display, since logical CSS width isn't
   the same as physical pixel count) that left a large, fixed, non-adaptive
   margin on both sides of every single page in the app. Made fluid: width
   now tracks the viewport up to a 1600px ceiling (so lines never get
   absurdly long on an ultrawide monitor), and padding scales down smoothly
   on a narrower viewport instead of eating a fixed 56px regardless of how
   little room there is. Was first tried as a one-page override on AI
   Observability (see that template's own history) then generalized here
   once the user confirmed the same narrowness applied app-wide. */
.page { padding: 32px clamp(12px, 3vw, 56px) 72px; max-width: min(1600px, 96vw); margin: 0 auto; }

.page-header { margin-bottom: 28px; }
.page-title {
  font-size: 24px; font-weight: 800;
  color: var(--text); letter-spacing: -.4px;
  display: flex; align-items: center; gap: 10px;
}
.page-title .title-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  background: linear-gradient(135deg, var(--brand-orange) 0%, var(--brand-orange-lt) 100%);
  box-shadow: 0 4px 12px rgba(var(--brand-rgb),.3);
}
.page-sub { color: var(--text-2); margin-top: 4px; font-size: 13.5px; }
/* B1865: page titles are moving from <div class="page-title"> to <h1 class="page-title">
   (macros/page_header.html page_title). Pin what a browser's h1 defaults would change so
   both render identically. */
h1.page-title { margin: 0; line-height: inherit; font-family: inherit; }

/* B1865: visually hidden but read by screen readers (labels for compact controls,
   macros/form_controls.html hide_label=True). */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* App-wide CSP fix (docs/DESIGN_REFRESH_QA.md, 2026-09-28 finding): the CSP's
   style-src has no unsafe-inline, so a literal style="vertical-align:-3px"
   attribute on an inline SVG icon was silently dropped on every page load,
   app-wide. Replaces that inline style everywhere it appeared. */
.icon-va-nudge { vertical-align: -3px; }
.icon-va-nudge-2 { vertical-align: -2px; }
.icon-va-nudge-1 { vertical-align: -1px; }
.icon-va-nudge-0 { vertical-align: 0; }
.help-ul-tight { margin: 6px 0 0 18px; padding: 0; }
.empty-icon-row { display: flex; justify-content: center; color: var(--muted); }

/* Shared page header (macros/page_header.html) — B1424: moved here from
   css/audit360.css, which only /audit/* pages load. */
.a360-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.a360-page-header-left { flex: 1 1 240px; min-width: 240px; }
/* B-design: was `flex:1; min-width:0`, which let a wide actions toolbar
   (a long <select> + several buttons, e.g. Executive Summary's Refresh /
   saved-run picker / Export HTML / Export CSV) squeeze the title+subtitle
   down to a ~90px sliver instead of wrapping the header onto two rows —
   "Executive Summary" was breaking mid-word ("Executi" / "Summary") on
   narrower viewports. min-width:240px plus flex-wrap:wrap on the parent
   forces a real wrap once the actions row genuinely needs the space,
   instead of the title collapsing to make room for it. */
.a360-page-header-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.a360-page-header-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}
.a360-page-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
/* Shared toolbar (design review #21): actions stay right-aligned even when
   they wrap under the title; exports sit in their own group at the far right;
   the page's .dl-timestamp line follows the header directly. */
.a360-page-header--toolbar { margin-bottom: 8px; }
.a360-page-header--toolbar .a360-page-header-actions { margin-left: auto; justify-content: flex-end; flex-shrink: 1; }
.a360-page-header-org { white-space: nowrap; }
.a360-page-header-exports {
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-left: auto; padding-left: 8px; border-left: 1px solid var(--border);
}
.a360-page-header--toolbar + .dl-timestamp { margin-bottom: 16px; }

/* ── Grouped pages: shared tab strip (templates/_page_group_tabs.html, 2026-10-24) ── */
.pg-tabs { display: flex; align-items: flex-end; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin: 0 0 16px; }
.pg-tabs-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); padding: 8px 12px 9px 0; margin-right: 4px; }
.pg-tab { padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--text-2, var(--text-muted)); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 6px 6px 0 0; }
.pg-tab:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.pg-tab:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.pg-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
@media print { .pg-tabs { display: none !important; } }



/* ════════════════════════════════════════════
   CARDS
   ════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-title {
  font-size: 14px; font-weight: 700;
  color: var(--text); margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.card-title::before {
  content: ''; width: 3px; height: 16px;
  background: var(--brand-orange); border-radius: 2px;
}


/* ════════════════════════════════════════════
   STAT CARDS — dashboard
   ════════════════════════════════════════════ */
.stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px; margin-bottom: 28px;
}
/* Was grid auto-fill: with 9 fixed stat-cards, a row that doesn't divide
   evenly left the trailing tile(s) stranded in a narrow column instead of
   filling the row (same dead-space bug fixed for .kpi-strip). */
.stats-grid > .stat-card { flex: 1 1 180px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  position: relative; overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  box-shadow: var(--shadow-sm);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
/* B1290: resource tile whose target page is hidden via Menu Settings -- still
   clickable (routes to Menu Settings instead), just visually de-emphasized so
   it doesn't read as a normal, working shortcut. */
/* B1424: a tile whose page is hidden via Menu Settings. Was a flat opacity:.5,
   which read as "broken/disabled" and failed contrast. Now: full-contrast number,
   dashed outline, muted surface and an explicit "Hidden in menu" pill, so the
   state reads as a deliberate choice with an obvious way back. */
.stat-card-hidden-for-demo {
  background: var(--surface-2);
  border: 1px dashed var(--border-2);
  box-shadow: none;
}
.stat-card-hidden-for-demo .stat-val { color: var(--text-2); }
.stat-card-hidden-for-demo:hover { border-color: var(--brand-orange); }
.stat-hidden-pill {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 8px; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none;
  background: var(--surface); border: 1px solid var(--border-2); color: var(--text-2);
}
.stat-card-hidden-for-demo:hover .stat-hidden-pill { color: var(--text); border-color: var(--brand-orange); }
.btn-hidden-in-menu { border-style: dashed; color: var(--text-2); }
.stat-card .stat-glow {
  position: absolute; top: -20px; right: -20px;
  width: 80px; height: 80px; border-radius: 50%;
  opacity: .08;
}
.stat-card:nth-child(1) .stat-glow { background: var(--brand-orange); }
.stat-card:nth-child(2) .stat-glow { background: var(--brand-accent); }
.stat-card:nth-child(3) .stat-glow { background: var(--success); }
.stat-card:nth-child(4) .stat-glow { background: var(--warning); }
.stat-card:nth-child(5) .stat-glow { background: var(--danger); }
.stat-card:nth-child(6) .stat-glow { background: #8B5CF6; }

/* Per-page KPI summary widget */
.kpi-strip {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}
.kpi-strip.cols-2 { grid-template-columns: repeat(2, 1fr); }
.kpi-strip.cols-3 { grid-template-columns: repeat(3, 1fr); }
.kpi-strip.cols-4 { grid-template-columns: repeat(4, 1fr); }
.kpi-strip.cols-5 { grid-template-columns: repeat(5, 1fr); }
.kpi-strip.cols-6 { grid-template-columns: repeat(6, 1fr); }
/* For a kpi-strip whose tile count is variable (rendered from a loop that can
   produce fewer items than the page's usual count) — fills the row instead of
   leaving fixed-count columns empty. 2026-09-27 whitespace-bug sweep. */
.kpi-strip.cols-auto { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

/* Credentials page — workspace counts (small stat cards, CSP-safe classes) */
.ws-count-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.ws-count-card { min-width: 120px; padding: 12px 18px; margin: 0; }
.ws-count-val { font-size: 18px; color: var(--text); }
.ws-count-card .muted { color: var(--text-2); }   /* override #94A3B8 (2.5:1) → #475569 (7:1) in light mode */
.ws-org-select { padding: 2px 6px; color: var(--text); }
.ws-opt-current { font-weight: 700; }

/* Top bar / org switcher — CSP-safe classes */
.ws-add-tab { padding: 0 10px; }
.ws-strip-label { color: rgba(255,255,255,.62); font-size: 11px; padding-right: 12px; letter-spacing: .05em; }  /* B1422: was .25 (2.16:1) */
.nav-alerts-badge { background: #ef4444; color: #fff; font-weight: 800; padding: 1px 6px; border-radius: 999px; line-height: 1.6; }
.org-caret { font-size: 10px; opacity: .7; }
.org-dropdown-head { padding: 8px 12px; color: rgba(255,255,255,.5); border-bottom: 1px solid rgba(255,255,255,.08); }
.org-ws-chip { font-size: 9px; background: rgba(var(--brand-rgb),.2); padding: 1px 6px; border-radius: 99px; margin-left: 6px; }
.org-region { font-size: 10px; opacity: .6; }
.org-dropdown-divider { border-top: 1px solid rgba(255,255,255,.08); padding-top: 4px; }
.org-disconnect { color: rgba(255,80,80,.8); font: inherit; }
.btn-connect-org { color: rgba(255,255,255,.75); border-color: rgba(255,255,255,.15); background: rgba(255,255,255,.06); }
.sync-status-text { font-size: 11px; color: rgba(255,255,255,.65); margin-left: 4px; }  /* B1422: was .4 @10px (3.8:1) */
.theme-toggle-btn { color: rgba(255,255,255,.6); }
/* Demo Mode button (top-bar, alongside theme/settings) */
#demo-mode-btn { color: rgba(255,255,255,.6); font-size: 13px; padding: 4px 8px; border-radius: 4px; }
#demo-mode-btn:hover { color: #fff; background: rgba(255,255,255,.08); }
#demo-mode-btn.demo-mode-active { color: var(--brand-orange, #FF6B00); background: rgba(var(--brand-rgb),.12); }
.demo-mode-badge { display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: .06em;
  background: var(--brand-solid, #2563EB); color: var(--on-brand, #fff); padding: 1px 4px; border-radius: 3px; margin-left: 2px; vertical-align: middle; }

/* Bulk provision — CSP-safe layout classes */
.bp-m0 { margin: 0; }
.bp-mt1 { margin-top: 1rem; }
.bp-mt05 { margin-top: .5rem; }
.bp-mb1 { margin-bottom: 1rem; }
.bp-mt125-right { margin-top: 1.25rem; text-align: right; }
.bp-mt125-flex { margin-top: 1.25rem; display: flex; gap: .75rem; justify-content: space-between; align-items: center; }
.bp-mt125-flex-nocenter { margin-top: 1.25rem; display: flex; gap: .75rem; justify-content: space-between; }
.bp-flex1 { flex: 1; }
.bp-flex { display: flex; gap: .75rem; }
.bp-flexrow { display: flex; gap: .5rem; margin-bottom: .5rem; }
.bp-flex-between { display: flex; justify-content: space-between; margin-bottom: .25rem; }
.bp-disabled { opacity: .5; pointer-events: none; }
.bp-hidden { display: none; }
.bp-hidden-mt1 { display: none; margin-top: 1rem; }
.bp-hidden-mb1 { display: none; margin: 1rem 0; }
.bp-list180 { max-height: 180px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; display: none; }
.bp-list140 { max-height: 140px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; display: none; }
.bp-list240 { max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; display: none; }
.bp-list320 { max-height: 320px; overflow-y: auto; display: none; }
.bp-list160 { max-height: 160px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; padding: .5rem; min-height: 40px; background: var(--surface-alt); }

/* Diff page — CSP-safe grid/color classes (inline styles are stripped) */
.diff-org-grid { grid-template-columns: 1fr 1fr 1fr auto; align-items: end; padding: 16px 0 4px; }
.diff-summary-grid { grid-template-columns: repeat(5, 1fr); }
.diff-blue { color: #3b82f6; }
.diff-filter-all { background: var(--brand-accent); color: #fff; }
.diff-row-only1 { background: rgba(239, 68, 68, 0.08); }
.diff-row-only2 { background: rgba(59, 130, 246, 0.08); }
.diff-row-diff { background: rgba(245, 158, 11, 0.08); }
.diff-row-same { opacity: 0.6; }
.diff-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.diff-dot-red { background: #ef4444; }
.diff-dot-blue { background: #3b82f6; }
.diff-dot-amber { background: #f59e0b; }
.diff-dot-green { background: #22c55e; }
.diff-badge-red { background: rgba(239, 68, 68, 0.15); }
.diff-badge-blue { background: rgba(59, 130, 246, 0.15); color: var(--badge-info-fg); }  /* B2445 */
.diff-badge-amber { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.diff-badge-green { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.kpi-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color .15s, transform .2s, box-shadow .2s;
  min-height: 78px;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.kpi-delta{position:absolute;bottom:8px;left:18px;min-height:14px;font-size:.68rem;font-weight:600;letter-spacing:.01em;}
.kpi-delta.up{color:#15803D;}.kpi-delta.dn{color:#B91C1C;}  /* B1422: was #22c55e/#ef4444 (<3.8:1) */
body.dark-mode .kpi-delta.up{color:#4ADE80;} body.dark-mode .kpi-delta.dn{color:#F87171;}
.kpi-delta.neu{color:var(--text-muted);}
/* Was border-color only -- every other card component in the app (.stat-card,
   .scope-card, .mod-card) already got a translateY+shadow-md hover lift; this
   shared, ~72-page-wide component hadn't (2026-09-28 deeper Config360 pass).
   Same tokens, no new colors. */
.kpi-tile:hover { border-color: var(--brand-orange); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-tile.warn { border-color: #f59e0b; background: rgba(245,158,11,.06); }
.kpi-tile.danger { border-color: #ef4444; background: rgba(239,68,68,.06); }
.kpi-tile.ok { border-color: #22c55e; background: rgba(34,197,94,.06); }
.kpi-val { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1; }
.kpi-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
/* B1422: status numbers were #f59e0b/#ef4444/#22c55e on tinted tiles (1.9–3.8:1). */
/* B2448: #B45309/#DC2626/#15803D were 4.0–4.4:1 at the 18px tile size (/queues); the
   B1865 badge text tokens switch per theme, so no separate dark-mode rules. */
.kpi-tile.warn .kpi-val { color: var(--badge-warn-fg); }
.kpi-tile.danger .kpi-val { color: var(--badge-danger-fg); }
.kpi-tile.ok .kpi-val { color: var(--badge-success-fg); }

.stat-icon {
  font-size: 22px; margin-bottom: 10px; display: block;
}
.stat-val {
  font-size: 34px; font-weight: 800;
  letter-spacing: -1.5px; color: var(--text);
  line-height: 1;
}
.stat-lbl {
  font-size: 11.5px; color: var(--muted); margin-top: 5px;
  text-transform: uppercase; letter-spacing: .07em; font-weight: 600;
}


/* ════════════════════════════════════════════
   TOOLBAR
   ════════════════════════════════════════════ */
.toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.search-wrap {
  position: relative; flex: 1; min-width: 200px; max-width: 380px;
}
.search-wrap .search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 14px; pointer-events: none;
}
.toolbar input[type=search] {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border);
  border-radius: 8px; font-size: 13.5px;
  font-family: inherit; outline: none;
  background: var(--surface);
  transition: border-color .2s, box-shadow .2s;
}
.toolbar input[type=search]:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

/* ── B1106: chip-based multi-term search ──────────────────────────────── */
.chip-search-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  width: 100%; margin-top: 6px;
}
.chip-search-row.hidden { display: none; }
.search-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface-2, #F1F5F9); color: var(--text);
  border: 1px solid var(--border); border-radius: 20px;
  padding: 3px 6px 3px 10px; font-size: 12px; font-weight: 500;
  line-height: 1.4; white-space: nowrap;
}
.search-chip-rm {
  border: none; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 14px; line-height: 1; padding: 2px 4px;
  border-radius: 50%; font-family: inherit;
}
.search-chip-rm:hover { background: rgba(239,68,68,.15); color: #EF4444; }
.search-chip-mode {
  border: 1px solid var(--brand-orange, #FF6B00);
  background: rgba(var(--brand-rgb),.1); color: var(--brand-orange, #FF6B00);
  border-radius: 20px; padding: 3px 10px; font-size: 11px; font-weight: 700;
  letter-spacing: .04em; cursor: pointer; font-family: inherit;
}
.search-chip-mode:hover { background: rgba(var(--brand-rgb),.2); }


/* ════════════════════════════════════════════
   DRY-RUN TOGGLE
   ════════════════════════════════════════════ */
.dryrun-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 16px;
  border: 1.5px solid var(--success);
  border-radius: 8px;
  background: var(--success-bg); color: #065F46;
  cursor: pointer; font-weight: 600; font-size: 12.5px;
  transition: all .2s; user-select: none;
}
.dryrun-toggle.live {
  border-color: var(--danger);
  background: var(--danger-bg); color: #7F1D1D;
}
.dryrun-toggle .indicator {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  animation: pulse-dot 2s ease-in-out infinite;
}
.dryrun-toggle.live .indicator {
  background: var(--danger);
  box-shadow: 0 0 6px var(--danger);
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .6; transform: scale(.85); }
}


/* ════════════════════════════════════════════
   TABLE
   ════════════════════════════════════════════ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
/* Scroll-only wrapper (no border) for tables whose card clips them */
.table-scroll { overflow-x: auto; }
/* limits table on /alerts sits directly in a card — let it scroll, not clip */
#limits-card { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
thead th {
  background: var(--surface-2);
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left; white-space: nowrap;
}
thead th:first-child { border-radius: var(--radius) 0 0 0; }
thead th:last-child  { border-radius: 0 var(--radius) 0 0; }

tbody tr {
  border-bottom: 1px solid rgba(226,232,240,.6);
  transition: background .12s;
}
tbody tr:hover { background: #F8FAFB; }
tbody tr:last-child { border-bottom: none; }
tbody td { padding: 11px 16px; font-size: 13.5px; }
tbody td.mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px; color: var(--text-2);
}

th.col-check, td.col-check { width: 40px; text-align: center; }
input[type=checkbox] { cursor: pointer; width: 15px; height: 15px; accent-color: var(--brand-orange); }


/* ════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 18px;
  border: 1px solid transparent;
  border-radius: 8px; font-size: 13px; font-weight: 600;
  font-family: inherit; cursor: pointer; white-space: nowrap;
  transition: all .18s; text-decoration: none;
  letter-spacing: -.1px;
}
.btn:hover { text-decoration: none; filter: brightness(.92); transform: translateY(-1px); }
.btn:active { transform: translateY(0); filter: brightness(.88); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; filter: none !important; }

.btn-primary {
  background: linear-gradient(135deg, var(--brand-solid) 0%, var(--brand-solid-2) 100%);
  color: var(--on-brand); border: none;
  box-shadow: 0 2px 10px rgba(var(--brand-rgb),.3);
}
.btn-primary:hover { box-shadow: 0 4px 16px rgba(var(--brand-rgb),.45); }

.btn-blue {
  background: linear-gradient(135deg, #0E7490 0%, #155E75 100%);  /* B1422: fixed pair, white >= 5.3:1 in both themes */
  color: #FFF; border: none;
  box-shadow: 0 2px 10px rgba(59,130,246,.25);
}
.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #F87171 100%);
  color: #FFF; border: none;
  box-shadow: 0 2px 8px rgba(239,68,68,.25);
}
.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, #34D399 100%);
  color: #FFF; border: none;
  box-shadow: 0 2px 8px rgba(16,185,129,.25);
}
.btn-teal {
  background: linear-gradient(135deg, #0D9488 0%, #2DD4BF 100%);
  color: #FFF; border: none;
  box-shadow: 0 2px 8px rgba(13,148,136,.25);
}
.btn-outline {
  background: var(--surface); color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--surface-2); border-color: var(--border-2); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }

.btn-secondary { background: var(--surface); color: var(--text-2); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-2); }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-xs { padding: 3px 9px; font-size: 11px; border-radius: 6px; }


/* ════════════════════════════════════════════
   BADGES
   ════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 99px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
}
/* B1865: badge colours come from the --badge-* tokens (light in :root, dark in
   body.dark-mode). Page-local badges should reuse these classes or tokens, never hex. */
.badge-success, .badge-ok { background: var(--badge-success-bg); color: var(--badge-success-fg); }
.badge-danger  { background: var(--badge-danger-bg);  color: var(--badge-danger-fg); }
.badge-warning, .badge-warn { background: var(--badge-warn-bg); color: var(--badge-warn-fg); }
.badge-info    { background: var(--badge-info-bg);    color: var(--badge-info-fg); }
.badge-muted   { background: var(--badge-muted-bg);   color: var(--badge-muted-fg); }
.badge-orange  { background: #FFF3E0;           color: #92400E; }

.badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: .6;
}


/* ════════════════════════════════════════════
   TOGGLE SWITCH (Audit360 visibility)
   ════════════════════════════════════════════ */
.switch {
  position: relative; display: inline-block;
  width: 36px; height: 20px; vertical-align: middle;
  cursor: pointer;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; inset: 0; border-radius: 20px;
  background: #CBD5E1; transition: background .15s ease;
}
.switch-slider::before {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.25);
  transition: transform .15s ease;
}
.switch input:checked + .switch-slider { background: #10B981; }
.switch input:checked + .switch-slider::before { transform: translateX(16px); }
.switch input:disabled + .switch-slider { opacity: .5; cursor: not-allowed; }


/* ════════════════════════════════════════════
   ACTION BAR
   ════════════════════════════════════════════ */
.action-bar {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.bulk-bar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(var(--brand-rgb),.08);
  border: 1px solid rgba(var(--brand-rgb),.3);
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 13px;
}
.bulk-bar.active { display: flex; }


/* ════════════════════════════════════════════
   MODAL
   ════════════════════════════════════════════ */
.modal-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center; justify-content: center;
  animation: fadeIn .18s;
}
.modal-backdrop.show { display: flex; }
.modal-box {
  background: var(--surface);
  border-radius: 16px;
  padding: 32px; max-width: 580px; width: 94%;
  max-height: 82vh; overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp .22s ease;
  border: 1px solid var(--border);
}
.modal-title {
  font-size: 18px; font-weight: 800; margin-bottom: 20px;
  color: var(--text); letter-spacing: -.3px;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-close {
  cursor: pointer; color: var(--muted); font-size: 22px;
  line-height: 1; transition: color .15s;
}
.modal-close:hover { color: var(--text); }
/* B1865 modal pattern (static/js/modal.js, docs/design/ui_states.md): the close
   control is a real <button class="modal-close" data-modal-close aria-label="Close">. */
button.modal-close { background: none; border: 0; padding: 4px; font-family: inherit; }
.modal-close:focus-visible, .modal-box:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }
.modal-box:focus:not(:focus-visible) { outline: none; }

/* ── Workspace management modal (base.html) ── */
.ws-modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.6); z-index: 9999;
  align-items: center; justify-content: center;
}
.ws-modal.show { display: flex; }
.ws-modal-box {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  width: 620px; max-width: 95vw; max-height: 85vh;
  border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,.45);
}
.ws-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.ws-modal-head h3 { margin: 0; font-weight: 700; color: var(--text); font-size: 16px; }
.ws-modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 20px; line-height: 1;
}
.ws-modal-close:hover { color: var(--text); }
.ws-modal-body { overflow: auto; flex: 1; padding: 20px; }
.ws-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 16px; margin-bottom: 16px;
}
body.dark-mode .ws-panel { background: #0d1829; border-color: rgba(var(--brand-rgb),.18); }
.ws-section-label {
  font-size: 11px; text-transform: uppercase; margin-bottom: 8px;
  letter-spacing: .08em; color: var(--text-2);
}
.ws-label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.ws-input {
  width: 100%; box-sizing: border-box;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 7px 12px; color: var(--text); font-size: 14px;
  border-radius: 6px; margin-bottom: 8px;
}
.ws-checklist {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 160px; overflow: auto; padding-right: 4px; margin-bottom: 8px;
}
.ws-checklist-compact { gap: 5px; max-height: 140px; margin-bottom: 4px; }
.ws-btn {
  border: none; border-radius: 6px; cursor: pointer;
  font-size: 14px; font-weight: 600;
}
.ws-btn-primary { background: var(--brand-solid); color: var(--on-brand); padding: 7px 18px; }
.ws-btn-primary:hover { background: var(--brand-solid-2); }
.ws-msg { font-size: 12px; margin-top: 8px; min-height: 16px; }
.ws-list { display: flex; flex-direction: column; gap: 12px; }
/* Full-page variant (templates/admin.html's "Workspaces" card, 2026-10-03) --
   the same .ws-card markup/data this file's own .ws-list already rendered
   inside a cramped 620px modal now has a full page to use; lay multiple
   workspace cards out side by side instead of one narrow stacked column. */
.ws-list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; align-items: start; }
.ws-admin-link-panel { font-size: 13px; color: var(--text-2); }
.ws-admin-link-panel a { color: var(--brand-orange); font-weight: 600; }
.ws-card {
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 12px 14px; border-radius: 8px;
}
.ws-card-head { display: flex; align-items: center; justify-content: space-between; }
.ws-card-title { font-weight: 700; font-size: 14px; color: var(--text); }
.ws-badges-row { min-height: 22px; }
.ws-badge {
  font-size: 11px; display: inline-block; color: var(--brand-text);
  background: rgba(var(--brand-rgb),.15); padding: 2px 9px;
  border-radius: 99px; margin: 2px 2px;
}
.ws-badge-rm { display: inline-flex; align-items: center; }
.ws-badge-rm button {
  background: none; border: none; cursor: pointer;
  color: rgba(var(--brand-rgb),.5); font-size: 13px; line-height: 1;
  padding: 0 2px;
}
.ws-badge-rm button:hover { color: var(--brand-orange); }
.ws-btn-edit {
  color: var(--brand-text); font-size: 11px; cursor: pointer;
  background: rgba(var(--brand-rgb),.12); border: 1px solid rgba(var(--brand-rgb),.3);
  border-radius: 5px; padding: 3px 10px;
}
.ws-btn-del {
  color: var(--badge-danger-fg); font-size: 11px; font-weight: 600; cursor: pointer;
  background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.4);
  border-radius: 5px; padding: 3px 10px;
}
.ws-btn-del:hover { background: rgba(239,68,68,.28); }
/* B2445: #f87171 was 2.18:1 on the light red tint (now the danger badge token) */
.ws-btn-save {
  background: var(--brand-solid); color: var(--on-brand); border: none; border-radius: 5px;
  padding: 5px 14px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.ws-btn-save:hover { background: var(--brand-solid-2); }
.ws-edit-panel {
  display: none; margin-top: 10px;
  border-top: 1px solid var(--border); padding-top: 10px;
}
.ws-edit-panel.show { display: block; }
.ws-edit-msg { font-size: 12px; margin-left: 10px; }
.ws-muted { color: var(--muted); font-size: 11px; }

/* Dark-mode overrides for the workspace modal (always-dark look preserved) */
body.dark-mode .ws-modal-box { background: #131d30; border-color: rgba(var(--brand-rgb),.25); }
body.dark-mode .ws-modal-head { border-bottom-color: rgba(255,255,255,.08); }
body.dark-mode .ws-modal-head h3 { color: #fff; }
body.dark-mode .ws-modal-close { color: rgba(255,255,255,.5); }
body.dark-mode .ws-modal-close:hover { color: #fff; }
body.dark-mode .ws-modal-box .ws-panel { background: #131d30; border-color: rgba(var(--brand-rgb),.18); }
body.dark-mode .ws-section-label { color: var(--text-2); }  /* B1865: was white .4 (3.7:1) */
body.dark-mode .ws-label { color: rgba(255,255,255,.8); }
body.dark-mode .ws-input { background: #0b1120; border-color: rgba(255,255,255,.15); color: #fff; }
body.dark-mode .ws-card { background: #0d1829; border-color: rgba(255,255,255,.07); }
body.dark-mode .ws-card-title { color: #fff; }
body.dark-mode .ws-edit-panel { border-top-color: rgba(255,255,255,.07); }
body.dark-mode .ws-muted { color: var(--muted); }  /* B1865: was white .25 (2.3:1) -> 6.6:1 */

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}


/* ════════════════════════════════════════════
   FORMS
   ════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 12.5px; font-weight: 700;
  color: var(--text); margin-bottom: 6px; letter-spacing: -.1px;
}
.form-control {
  width: 100%; padding: 9px 13px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 13.5px; font-family: inherit; outline: none;
  background: var(--surface); color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.form-control::placeholder { color: var(--muted); }
select.form-control { cursor: pointer; }
.detail-input {
  width: 100%; padding: 9px 13px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 13.5px; font-family: inherit; outline: none;
  background: var(--surface); color: var(--text);
  transition: border-color .2s;
}
.detail-input:focus { border-color: var(--brand-accent); }
.detail-input::placeholder { color: var(--muted); }
body.dark-mode .detail-input { background: #1E2D45; color: var(--text); border-color: var(--border); }


/* ════════════════════════════════════════════
   LANDING PAGE
   ════════════════════════════════════════════ */
.landing {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(var(--brand-rgb),.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(59,130,246,.07) 0%, transparent 55%),
    linear-gradient(160deg, #060D1A 0%, #0B1120 45%, #0F1E35 100%);
  position: relative; overflow: hidden;
}
/* Animated grid background */
.landing::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.02) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

.landing-box {
  background: rgba(255,255,255,.97);
  border-radius: 20px; padding: 44px 52px;
  max-width: 500px; width: 92%;
  box-shadow: var(--shadow-xl);
  position: relative; z-index: 1;
  border: 1px solid rgba(255,255,255,.1);
  animation: slideUp .3s ease;
}
.landing-logo {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 6px;
}
.landing-logo .l-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand-orange) 0%, var(--brand-orange-lt) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 16px rgba(var(--brand-rgb),.4);
}
.landing-logo .l-name {
  font-size: 26px; font-weight: 900;
  color: var(--text); letter-spacing: -.6px;
}
.landing-logo .l-name span { color: var(--brand-orange); }
.landing-sub { color: var(--text-2); margin-bottom: 28px; font-size: 14px; }

.org-list-title {
  font-size: 11px; font-weight: 700; letter-spacing: .09em;
  color: var(--muted); text-transform: uppercase; margin-bottom: 12px;
}
.org-card {
  border: 1.5px solid var(--border);
  border-radius: 10px; padding: 14px 18px;
  margin-bottom: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  transition: all .18s;
  background: var(--surface);
}
.org-card:hover {
  border-color: var(--brand-orange);
  background: #FFF9F5;
  transform: translateX(3px);
  box-shadow: 0 4px 16px rgba(var(--brand-rgb),.1);
}
.org-card .org-left { display: flex; align-items: center; gap: 12px; }
.org-card .org-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.org-card .org-name  { font-weight: 700; font-size: 14px; color: var(--text); }
.org-card .org-region { color: var(--muted); font-size: 11.5px; font-family: 'JetBrains Mono', monospace; }
.org-card .org-status { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.org-card.active-org .org-status {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse-dot 2s ease-in-out infinite;
}
.org-card.failed-org .org-status { background: var(--danger); }


/* ════════════════════════════════════════════
   ALERTS
   ════════════════════════════════════════════ */
.alert {
  padding: 13px 18px; border-radius: 10px;
  margin-bottom: 18px; font-size: 13.5px;
  display: flex; align-items: flex-start; gap: 10px;
  font-weight: 500;
}
.alert-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-danger  { background: var(--danger-bg);  color: var(--danger-text);  border: 1px solid #FECACA; }
.alert-success { background: var(--success-bg); color: var(--success-text); border: 1px solid #A7F3D0; }
.alert-info    { background: var(--info-bg);    color: var(--info-text);    border: 1px solid #BFDBFE; }
.alert-warning { background: var(--warning-bg); color: var(--warning-text); border: 1px solid #FDE68A; }


/* ════════════════════════════════════════════
   SPINNER / LOADING
   ════════════════════════════════════════════ */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2.5px solid rgba(var(--brand-rgb),.2);
  border-top-color: var(--brand-orange);
  border-radius: 50%;
  animation: spin .65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideInRight { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:translateX(0); } }

.loading-row td {
  text-align: center; padding: 52px;
  color: var(--muted); font-size: 14px;
}
.loading-row td .spinner { width: 24px; height: 24px; margin-bottom: 10px; display: block; margin-left: auto; margin-right: auto; }

/* W1-1 — last-updated timestamp (visible before KPI strip on every Audit360 page) */
.dl-timestamp {
  font-size: .78rem; color: var(--muted); margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}
.dl-timestamp::before { content: "🕒"; font-size: .85rem; }

/* W1-4 — threshold-based KPI tile states */
.kpi-tile.kpi-ok    { border-left: 3px solid #22c55e; }
.kpi-tile.kpi-warn  { border-left: 3px solid #f59e0b; }
.kpi-tile.kpi-crit  { border-left: 3px solid #ef4444; }
.kpi-tile.kpi-ok  .kpi-val { color: #16a34a; }
.kpi-tile.kpi-warn .kpi-val { color: #d97706; }
.kpi-tile.kpi-crit .kpi-val { color: #dc2626; }


/* ════════════════════════════════════════════
   CREDENTIAL PAGE
   ════════════════════════════════════════════ */
.cred-card {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px;
  border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 10px; background: var(--surface);
  transition: all .18s;
}
.cred-card:hover { box-shadow: var(--shadow-sm); border-color: var(--border-2); }
.cred-icon { font-size: 20px; }
.cred-info { flex: 1; }
.cred-label { font-weight: 700; font-size: 14px; }
.cred-region { font-size: 11.5px; color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.cred-status { font-size: 20px; }


/* ════════════════════════════════════════════
   EMPTY STATE
   ════════════════════════════════════════════ */
.empty-state {
  text-align: center; padding: 64px 32px;
  color: var(--muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; opacity: .4; }
.empty-state .empty-title { font-size: 16px; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.empty-state .empty-sub { font-size: 13.5px; }
.empty-state .empty-action { margin-top: 16px; }   /* B1864: macros/empty_state.html, ui_states.js */
.value-missing { color: var(--muted); cursor: help; } /* B1864: "—" from ui_states.js renderValue() */
.cx-queue-empty{padding:32px 16px;}
.cx-queue-empty .empty-icon{font-size:32px;opacity:.35;}
.cx-queue-empty .empty-title{font-size:14px;}
.cx-queue-empty .empty-sub{font-size:13px;color:var(--muted);}
.cx-sla-good{color:#22c55e;font-weight:600;}
.cx-sla-warn{color:#f59e0b;font-weight:600;}
.cx-sla-bad{color:#ef4444;font-weight:600;}


/* ════════════════════════════════════════════
   DIVIDER
   ════════════════════════════════════════════ */
.divider {
  height: 1px; background: var(--border);
  margin: 20px 0;
}


/* ════════════════════════════════════════════
   UTILITY
   ════════════════════════════════════════════ */
.text-muted   { color: var(--muted); }
.text-success { color: var(--success-text); }  /* --success #10B981 was 2.54:1 as text; token is #155724 light / #6EE7B7 dark */
.text-danger  { color: #DC2626; }  /* B1422: --danger #EF4444 is 3.76:1 as text */
body.dark-mode .text-danger { color: #F87171; }
body.dark-mode .load-status-ok { color: #6EE7B7; }
.text-orange  { color: var(--brand-orange); }
/* 2026-10-17: real-time SLA state (MBLive.stateClass, static/js/live_thresholds.js).
   Text tokens are >= 4.5:1 on light and dark surfaces; pair with MBLive.stateText()
   so the state is never colour-only. border-color applies where the element has a border. */
.is-good { color: var(--success-text); border-color: var(--success); }
.is-warn { color: var(--warning-text); border-color: var(--warning); }
.is-bad  { color: var(--danger-text);  border-color: var(--danger); }
.text-mono    { font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-4   { margin-top: 4px; }
/* A card-header row pairing a .card-title with a trailing control (a
   <select>, a button) -- space the two apart and let the title shrink/wrap
   rather than collide with the control. Promoted here 2026-10-03: this
   class previously existed ONLY as a page-local rule inside
   templates/portfolio_cx.html's own <style> block (where it was first
   written), so every OTHER page reusing the same class name (e.g.
   templates/portfolio_benchmark.html's "Trend vs Benchmark" header) got a
   bare, unstyled .d-flex instead -- the title text visibly ran straight
   into the metric dropdown with zero gap. Same bug class as B1119/B1378. */
.pf-table-head { justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.pf-table-head .card-title { flex: 1 1 auto; min-width: 0; margin-bottom: 0; }

/* ── Utility classes (shared across templates) ── */
.hidden { display: none; }
.muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-11 { font-size: 11px; }
.block { display: block; }
.inline-block { display: inline-block; }
.center, .text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.p-md { padding: 24px; }
.p-lg { padding: 32px; }
.p-8 { padding: 8px; }
.p-14 { padding: 14px; }
.p-12-14 { padding: 12px 14px; }
.mt-1 { margin-top: 20px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mb-1 { margin-bottom: 8px; }
.mb-10 { margin-bottom: 10px; }
.mb-sm { margin-bottom: 14px; }
.mr-1 { margin-right: 4px; }
.ml-auto { margin-left: auto; }
.min-h { min-height: 20px; }
.flex, .d-flex { display: flex; }
.grid { display: grid; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-14 { gap: 14px; }
.gap-16 { gap: 16px; }
.font-bold, .fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }
.font-mono, .mono { font-family: 'JetBrains Mono', monospace; }
.nowrap { white-space: nowrap; }
.cursor-pointer { cursor: pointer; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }
.uppercase { text-transform: uppercase; }
.w-full { width: 100%; }
.border-rounded { border-radius: 8px; }
.bg-card { background: var(--surface); }
.w-30 { width: 30px; }
.w-35 { width: 35px; }
.w-40 { width: 40px; }
.w-45 { width: 45px; }
.w-50 { width: 50px; }
.w-55 { width: 55px; }
.w-58 { width: 58px; }
.w-60 { width: 60px; }
.w-65 { width: 65px; }
.w-70 { width: 70px; }
.w-75 { width: 75px; }
.w-80 { width: 80px; }
.w-85 { width: 85px; }
.w-90 { width: 90px; }
.w-95 { width: 95px; }
.w-100 { width: 100px; }
.w-110 { width: 110px; }
.w-115 { width: 115px; }
.w-120 { width: 120px; }
.w-130 { width: 130px; }
.w-140 { width: 140px; }
.w-145 { width: 145px; }
.w-150 { width: 150px; }
.w-155 { width: 155px; }
.w-160 { width: 160px; }
.w-165 { width: 165px; }
.w-170 { width: 170px; }
.w-175 { width: 175px; }
.w-180 { width: 180px; }
.w-185 { width: 185px; }
.w-190 { width: 190px; }
.w-195 { width: 195px; }
.w-200 { width: 200px; }
.w-210 { width: 210px; }
.w-220 { width: 220px; }
.w-240 { width: 240px; }
.max-w-560 { max-width: 560px; }
.mw-100 { min-width: 100px; }
.mw-160 { min-width: 160px; }
.mw-200 { min-width: 200px; }
.text-white { color: #fff; }
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-2col:has(#ytd-aht-card.hidden){grid-template-columns:1fr;}
.grid-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.modal-sm { max-width: 380px; }
/* Bulk selection bar highlight */
.bulk-bar-style { padding: 8px 14px; background: rgba(var(--brand-rgb),.08); border: 1px solid rgba(var(--brand-rgb),.3); }
.flag-icon { width: 16px; height: 16px; border-radius: 3px; }
.input-field { padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 12px; background: var(--surface); color: var(--text); }
.flex-end { display: flex; gap: 8px; justify-content: flex-end; }
.gap-sm { gap: 4px; }
.gap-md { gap: 10px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mono { font-family: 'JetBrains Mono', monospace; }
.max-w-420 { max-width: 420px; }
.max-w-520 { max-width: 520px; }
.min-h-40 { min-height: 40px; }
.flex-1 { flex: 1; }
.relative { position: relative; }
.absolute { position: absolute; }
.mb-0   { margin-bottom: 0 !important; }


/* ════════════════════════════════════════════
   FOCUS MODE (2026-09-27, direct user request) — app-wide, toggled by the
   floating control in base.html (mpl-focus.js-equivalent inline script),
   never a per-page decision. Applied as an ADDITIONAL class on <body>
   alongside the existing with-sidebar/no-sidebar Jinja class (JS
   classList.add, never replaces it) — persisted in localStorage
   (mpl_focus_mode) and applied pre-paint (a script right after <body>
   opens, before any chrome markup) so a returning user never sees a flash
   of chrome before it hides. Hides whichever ONE sidebar element the
   current pillar actually rendered (#sidebar / #audit-sidebar /
   #analytics-sidebar — base.html's own routing guarantees exactly one is
   ever present, the same invariant B1297 fixed) plus the platform-tab
   strip and the page-local top bar, then reclaims the space .main was
   reserving for both. Distinct from Studio360's own private s360-page/
   s360-present classes (a hardcoded single-page mechanism, not reusable)
   — this is the generic, any-page version; the two are independent and
   may coexist without conflict since Studio360 hides the identical
   elements by its own class already. */
body.mpl-focus .global-header,
body.mpl-focus #sidebar,
body.mpl-focus #audit-sidebar,
body.mpl-focus #analytics-sidebar,
body.mpl-focus #portfolio-sidebar,
body.mpl-focus #csm360-sidebar {
  display: none !important;
}
/* B1866: the top bar stays as a slim strip holding only the Focus / Full screen
   buttons (so Exit Focus is always reachable) — .main starts below it, so the
   buttons never cover content. */
body.mpl-focus .top-bar {
  top: 0; height: 40px; padding: 0 16px; justify-content: flex-end;
}
body.mpl-focus .top-bar > *:not(#mpl-view-toggle) {
  display: none !important;
}
body.mpl-focus .main {
  margin-left: 0 !important;
  padding-top: 56px !important;
}
body.mpl-focus .main .page {
  max-width: 100% !important;
}
/* B1519: the Audit360 report's own top-level wrapper (.report-page,
   static/style.css:3044) hardcodes max-width:1180px for comfortable
   reading width on a normal page -- a DIFFERENT class than .page above,
   so it never responded to Focus Mode at all (confirmed live: .page
   correctly widened to the full viewport, .report-page stayed pinned at
   1180px regardless). User-reported: "when i click on focus buto, the
   report stay stripped." Widen it the same way .page already is,
   scoped to Focus Mode only -- the 1180px default stays unchanged
   outside Focus Mode. */
body.mpl-focus .report-page {
  max-width: 100% !important;
}

/* ════════════════════════════════════════════
   NO-SIDEBAR LAYOUT (landing / logged-out)
   ════════════════════════════════════════════ */
body.no-sidebar .main {
  margin-left: 0;
}
body.no-sidebar .top-bar {
  padding-left: 24px;
}
/* B1557, direct user report: this used to apply to every no-sidebar page --
   correct for the real full-bleed Connect-to-Org landing page (its own hero
   layout supplies its own spacing), but Credentials and the Admin Console
   (B1555's _no_pillar_chrome also reuses the no-sidebar body class for those
   two, since neither is Config360 content) are normal content pages that need
   the standard .page padding/max-width below -- without it they rendered
   edge-to-edge with zero margin. Scoped to .fullbleed (set only on the
   landing page, base.html) so those two keep the normal layout.
   B2266: the landing page no longer has a hero, so the zero padding left the
   workspace/org panels touching the window edges -- keep the standard .page
   padding and width, only drop the top padding (the page title sits close). */
body.no-sidebar.fullbleed .main .page {
  padding-top: 24px;
}

/* ════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════ */
/* 901–1050px: sidebar visible but narrow — hide non-critical top-bar text, wrap kpi grids */
@media (max-width: 1050px) {
  .sync-status-text { display: none; }
  /* Flexbox, not CSS Grid auto-fit: auto-fit only collapses a track when it's
     unused across the WHOLE grid, not per-row, so a strip that wraps to (e.g.)
     4+1 tiles still strands the trailing lone tile with dead space beside it
     (2026-09-28 TCS re-verify pass 2, /queues and /users 5-tile strips — the
     first auto-fit attempt here looked fixed only by luck of a tile count that
     happened to fit one row). Flexbox rows size independently, so a short
     trailing row's tiles grow to fill it — same mechanism already proven on
     /audit/insights and /recording-policies. */
  /* !important: at least 15 page templates (users.html, queues.html,
     activity.html, and others — see docs/DESIGN_REFRESH_QA.md's "re-verify
     pass 3") reveal their kpi-strip after data loads via an inline
     `el.style.display = 'grid'`, a leftover from before this class was
     flexbox. An inline style beats a plain stylesheet rule regardless of
     specificity, so without !important this rule silently loses at exactly
     this breakpoint on every one of those pages (2026-09-28 TCS re-verify
     pass 3 — confirmed broken at 1024px despite this rule reading correctly
     in the stylesheet). !important is the pragmatic fix that covers all of
     them today; the more correct fix is switching each template's reveal
     call to a class toggle instead of an inline style, same as
     recording_policies.html already does — tracked as follow-up, not done
     here since it's ~15 separate small edits. */
  .kpi-strip { display: flex !important; flex-wrap: wrap !important; }
  .kpi-strip > .kpi-tile { flex: 1 1 140px !important; }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .top-bar { padding-left: 24px; }
  .page { padding: 20px 20px 72px; }
  /* Same flexbox fix as the 1050px breakpoint above, same reason
     (!important needed to beat the ~15 templates' inline style.display='grid'
     reveal calls — see the 1050px block's comment). */
  .kpi-strip { display: flex !important; flex-wrap: wrap !important; }
  .kpi-strip > .kpi-tile { flex: 1 1 140px !important; }

  /* wide multi-column grids reflow to 2 columns instead of cramming */
  .grid-3col, .grid-4, .grid-4-pt, .compare-grid { grid-template-columns: repeat(2, 1fr); }
  /* fixed 240px + fluid health grid stacks */
  .health-grid { grid-template-columns: 1fr; }
  /* bulk selection bar buttons wrap instead of overflowing */
  .bulk-bar { flex-wrap: wrap; }
  /* page titles with trailing action buttons wrap */
  .page-title { flex-wrap: wrap; }
  /* wide fixed inputs (org selects on audit pages etc.) shrink to container */
  .w-260, .w-240, .w-220, .w-200 { max-width: 100%; }
  /* nowrap tab bars scroll horizontally instead of stretching the page */
  .tab-bar { overflow-x: auto; }
}
@media (max-width: 600px) {
  .stats-grid > .stat-card { flex: 1 1 45%; }
  .landing-box { padding: 32px 24px; }

  /* all remaining multi-column grids collapse to a single column */
  .grid-2col, .grid-3col, .grid-4, .grid-4-pt, .compare-grid,
  .health-grid { grid-template-columns: 1fr; }
  /* fixed-width form rows (bulk provision wizard) wrap */
  .bp-flex, .bp-flexrow, .bp-flex-between,
  .bp-mt125-flex, .bp-mt125-flex-nocenter { flex-wrap: wrap; }
  /* search inputs stretch full width */
  .search-wrap { max-width: 100%; }
  /* side drawer takes the whole screen on phones */
  .rec-drawer-panel { width: 100%; }
  /* rpc modal had min-width:380px — would overflow small screens */
  .rpc-modal-box { min-width: 0; width: 100%; }
  /* report domain rows wrap their label + score */
  .domain-row { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  /* KPI + stat cards: single column on phones (768px rule forces 2 cols).
     .kpi-strip is flex now (see 768px breakpoint above), not grid — force
     single-column by giving each tile a 100% flex-basis instead. */
  .kpi-strip > .kpi-tile { flex: 1 1 100% !important; }
  .stats-grid > .stat-card { flex: 1 1 100% !important; }
  /* toasts had min-width:260px — clamp to viewport */
  .toast { min-width: 0; max-width: calc(100vw - 32px); }
}


/* ════════════════════════════════════════════
   SKELETON LOADING
   ════════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-row td { padding: 12px 16px; }
.skeleton-cell { height: 14px; border-radius: 4px; }

/* B1239: generic tile/chart/table-shaped skeleton placeholders — composed with
   .skeleton (shimmer) rather than a new animation, so any report page can
   show real page structure immediately and fill it in on fetch resolve
   instead of gating the whole content area behind a blocking spinner. */
.kpi-val-skeleton { display: inline-block; width: 64px; height: 22px; vertical-align: middle; }
.kpi-tile-skeleton { height: 74px; border-radius: 10px; }
.report-chart-skeleton { height: 200px; border-radius: 10px; }
.report-table-skeleton { height: 160px; border-radius: 8px; }


/* ════════════════════════════════════════════
   DARK MODE
   ════════════════════════════════════════════ */
/* B1422: declared on html.dark-mode too (the pre-paint script in base.html puts
   the class on <html>), so the :root aliases below (--card-bg: var(--surface),
   --text-muted: var(--muted)…) resolve against the DARK values instead of being
   frozen at their light values on :root and inherited white into dark mode.
   The aliases are redeclared here as well for pages where only <body> carries
   the class. --muted is lighter in dark mode: #64748B was 3.72:1 on #111827. */
html.dark-mode,
body.dark-mode {
  --bg: #0B1120; --surface: #111827; --surface-2: #1E2D45;
  --border: #1E2D45; --border-2: #2D3748;
  --text: #F1F5F9; --text-2: #94A3B8; --muted: #94A3B8;
  --card-bg: var(--surface); --text-muted: var(--muted);
  --success-bg: #064E3B; --danger-bg: #450A0A; --warning-bg: #451A03; --info-bg: #0C2A4D;
  --success-text: #6EE7B7; --accent-ok: #22c55e;
  --danger-text: #FCA5A5; --warning-text: #FBBF24;
  --info-text: #93C5FD;
  --surface-alt: #1E2D45;
  --brand-accent: #22D3EE; --brand-accent-lt: #67E8F9;  /* B1422: link colour on dark (9.8:1) */
  --brand-text: var(--brand-orange-lt);  /* B2445: brand text on a brand tint, >= 4.59:1 every preset */
  --hover: #1E2D45;
  /* B1865 badge tokens, dark theme (each pair >= 4.5:1, tests/test_design_foundation.py) */
  --badge-success-bg: #064E3B; --badge-success-fg: #6EE7B7;
  --badge-warn-bg:    #451A03; --badge-warn-fg:    #FBBF24;
  --badge-danger-bg:  #450A0A; --badge-danger-fg:  #FCA5A5;
  --badge-info-bg:    #0C2A4D; --badge-info-fg:    #93C5FD;
  --badge-muted-bg:   #1E2D45; --badge-muted-fg:   #94A3B8;
  --purple-text:      #C4B5FD;
}
body.dark-mode .org-card:hover { background: rgba(var(--brand-rgb),.07); }
body.dark-mode .top-bar { background: #060D1A; }
body.dark-mode .card { box-shadow: none; }
body.dark-mode thead th { background: #1E2D45; }
body.dark-mode tbody tr:hover { background: #1E2D45; }
body.dark-mode tbody tr { border-bottom-color: rgba(148,163,184,.12); }
body.dark-mode .modal-box { background: #111827; border-color: #1E2D45; }
body.dark-mode .form-control { background: #1E2D45; color: var(--text); border-color: var(--border); }
body.dark-mode .skeleton { background: linear-gradient(90deg, #1E2D45 25%, #2D3748 50%, #1E2D45 75%); background-size: 200% 100%; }
body.dark-mode .table-wrap { border-color: var(--border); }
body.dark-mode .action-bar { background: var(--surface-2); border-color: var(--border); }
body.dark-mode .dryrun-toggle { background: #064E3B; border-color: var(--success); color: #6EE7B7; }
body.dark-mode .dryrun-toggle.live { background: #450A0A; border-color: var(--danger); color: #FCA5A5; }
body.dark-mode .btn-outline { background: var(--surface-2); border-color: var(--border-2); color: var(--text-2); }
body.dark-mode .btn-ghost:hover { background: var(--surface-2); }
body.dark-mode .alert-success { background: var(--success-bg); border-color: rgba(16,185,129,.4); }
body.dark-mode .alert-danger  { background: var(--danger-bg);  border-color: rgba(239,68,68,.4); }
body.dark-mode .alert-warning { background: var(--warning-bg); border-color: rgba(245,158,11,.4); }
body.dark-mode .alert-info    { background: var(--info-bg);    border-color: rgba(59,130,246,.4); }
/* B1865: dark badge colours now live in the --badge-* tokens (body.dark-mode block). */
body.dark-mode .badge-orange  { background: rgba(var(--brand-rgb),.15); color: var(--brand-orange-lt); }
body.dark-mode .rpc-mismatch-row { background: rgba(231,76,60,.08); }
body.dark-mode .rpc-mismatch-div-badge { background: #0C2A4D; color: #93C5FD; }
body.dark-mode .rpc-mismatch-policy-badge { background: #450A0A; color: #FCA5A5; }
body.dark-mode .rpc-auto-badge { background: #064E3B; color: #6EE7B7; }
body.dark-mode .tab-count.has-issues { background: rgba(231,76,60,.12); border-color: rgba(254,178,178,.4); color: #FCA5A5; }
body.dark-mode .tab-count.ok { background: rgba(39,174,96,.12); border-color: rgba(169,223,191,.4); color: #6EE7B7; }
body.dark-mode .drawer-mini-table th { border-bottom-color: #2D3748; }

/* ── Toast notifications ─────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: all;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 260px;
  max-width: 400px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  transform: translateX(120%);
  opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
  background: var(--card-bg, #fff);
  border-left: 4px solid #6c757d;
  color: var(--text, #212529);
}
.toast.toast-visible { transform: translateX(0); opacity: 1; }
.toast.toast-success { border-left-color: #28a745; }
.toast.toast-danger  { border-left-color: #dc3545; }
.toast.toast-warning { border-left-color: #ffc107; }
.toast.toast-info    { border-left-color: #17a2b8; }
.toast-close {
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  opacity: .5;
  flex-shrink: 0;
}
.toast-close:hover { opacity: 1; }

/* ── Selection counter badge ─────────────────────────────────────────────── */
#selection-count {
  display: none;
  align-items: center;
  background: var(--brand-solid);
  color: var(--on-brand);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 8px;
}

/* ── Bulk-select header buttons ──────────────────────────────────────────── */
.bulk-select-btns {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}
.bulk-select-btns button {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border, #dee2e6);
  background: transparent;
  cursor: pointer;
  color: var(--muted, #6c757d);
}
.bulk-select-btns button:hover { background: var(--hover, #f8f9fa); }

/* ── Form helpers for modals ─────────────────────────────────────────────── */
.form-group + .form-group { margin-top: 12px; }
.modal-actions { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }

/* ── Delete confirm modal ────────────────────────────────────────────────── */
#delete-modal .modal-box { max-width: 420px; }
.delete-warning { color: var(--muted); font-size: 13px; margin: 8px 0 0; }

/* ── modal-overlay / modal-header / modal-body / modal-footer (queues.html) */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 0;
  font-size: 17px; font-weight: 700; color: var(--text);
}
.modal-body {
  padding: 16px 24px;
  color: var(--text);
}
.modal-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 0 24px 20px;
}

/* ── Slide-in detail drawer ──────────────────────────────────────────────── */
.drawer-overlay {
  display:none; position:fixed; inset:0; background:rgba(0,0,0,.3);
  z-index:300; backdrop-filter:blur(2px);
}
.drawer-overlay.open { display:block; }
.drawer {
  position:fixed; top:0; right:0; bottom:0; width:520px; max-width:95vw;
  background:var(--surface); z-index:301;
  box-shadow:-8px 0 40px rgba(0,0,0,.15);
  transform:translateX(100%); transition:transform .25s ease;
  display:flex; flex-direction:column; overflow:hidden;
}
.drawer.open { transform:translateX(0); }
.drawer-header {
  padding:20px 24px 16px; border-bottom:1px solid var(--border);
  display:flex; align-items:flex-start; gap:12px; flex-shrink:0;
}
.drawer-title { font-size:18px; font-weight:800; color:var(--text); flex:1; letter-spacing:-.3px; }
.drawer-sub { font-size:12px; color:var(--muted); margin-top:2px; }
.drawer-close {
  width:32px; height:32px; border-radius:8px; border:none;
  background:var(--surface-2); cursor:pointer; font-size:18px;
  display:flex; align-items:center; justify-content:center; color:var(--muted);
  transition:all .15s; flex-shrink:0;
}
.drawer-close:hover { background:var(--border); color:var(--text); }
.drawer-tabs {
  display:flex; border-bottom:1px solid var(--border); flex-shrink:0;
  padding:0 24px; gap:0;
}
.drawer-tab {
  padding:10px 16px; font-size:13px; font-weight:600; cursor:pointer;
  color:var(--muted); border-bottom:2px solid transparent;
  transition:all .15s; background:none; border-top:none; border-left:none; border-right:none;
}
.drawer-tab.active { color:var(--brand-orange); border-bottom-color:var(--brand-orange); }
.drawer-tab:hover:not(.active) { color:var(--text-2); }
.drawer-body { flex:1; overflow-y:auto; padding:20px 24px; }
/* Flows drawer "Diagram" tab (2026-09-28, docs/DESIGN_REFRESH_QA.md's "SPEC
   ADDENDUM") -- a scaled-down version of /audit/flow-diagram's own
   .fd-canvas-wrap/.fd-canvas/.fd-zoom-ctl, prefixed .fdd- (flow-diagram-
   drawer) so the two never collide even though app.js and flow_diagram.html
   are two separate template hierarchies loading independently. */
.fdd-canvas-wrap { position:relative; background:var(--bg); border:1px solid var(--border); border-radius:10px; height:380px; overflow:hidden; }
.fdd-canvas { width:100%; height:100%; }
.fdd-zoom-ctl { position:absolute; right:8px; bottom:8px; display:flex; flex-direction:column; gap:4px; z-index:5; }
.fdd-zoom-ctl button { width:28px; height:28px; border-radius:6px; border:1px solid var(--border); background:var(--surface); color:var(--text); cursor:pointer; display:flex; align-items:center; justify-content:center; }
.fdd-zoom-ctl button:hover { background:var(--surface-2, var(--bg)); }
.drawer-footer {
  padding:16px 24px; border-top:1px solid var(--border);
  display:flex; gap:8px; justify-content:flex-end; flex-shrink:0;
}
.detail-field { margin-bottom:16px; }
.detail-label { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.07em; color:var(--muted); margin-bottom:4px; }
.detail-value { font-size:14px; color:var(--text); font-weight:500; }
.detail-value.mono { font-family:'JetBrains Mono',monospace; font-size:12px; color:var(--text-2); }
.detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:0 24px; }
.detail-section { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.07em; color:var(--muted); margin:20px 0 12px; padding-bottom:6px; border-bottom:1px solid var(--border); }
.edit-mode .detail-value { display:none; }
.edit-mode .detail-edit { display:block !important; }
.detail-edit { display:none; }
.detail-edit input, .detail-edit select { width:100%; padding:7px 10px; border:1px solid var(--border); border-radius:7px; font-size:13px; font-family:inherit; outline:none; background:var(--surface); color:var(--text); }
.detail-edit input:focus, .detail-edit select:focus { border-color:var(--brand-accent); box-shadow:0 0 0 3px rgba(59,130,246,.1); }
.member-row { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--border); font-size:13px; }
.member-row:last-child { border-bottom:none; }
.member-avatar { width:30px; height:30px; border-radius:50%; background:var(--surface-2); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; color:var(--muted); flex-shrink:0; }

/* ── HEALTH ALERTS ─────────────────────────────────────────── */
.health-alert-banner {
  display:flex; align-items:flex-start; gap:14px;
  background:linear-gradient(135deg,#fff8f0,#fff3e8);
  border:1.5px solid var(--brand-orange); border-radius:12px;
  padding:16px 20px; margin-bottom:24px;
  box-shadow:0 4px 16px rgba(var(--brand-rgb),.1);
}
.health-alert-icon { font-size:22px; flex-shrink:0; margin-top:1px; }
.health-alert-body { flex:1; }
.health-alert-title { font-weight:700; font-size:14px; color:#0F172A; margin-bottom:8px; }
.health-alert-list { display:flex; flex-wrap:wrap; gap:6px; }
.health-alert-item {
  background:var(--brand-solid); color:var(--on-brand); font-size:11px; font-weight:600;
  padding:3px 10px; border-radius:99px;
  transition:all .15s; font-family:'JetBrains Mono',monospace;
}
.health-alert-item:hover { background:var(--brand-solid-2); transform:translateY(-1px); }
.health-alert-more { font-size:11px; color:#94A3B8; align-self:center; margin-left:4px; }
.health-alert-dismiss {
  background:none; border:none; color:#94A3B8; font-size:20px;
  cursor:pointer; padding:0; flex-shrink:0; line-height:1;
}
.health-alert-dismiss:hover { color:#0F172A; }

body.dark-mode .health-alert-banner {
  background:linear-gradient(135deg,#1a1200,#1a0e00);
  border-color:var(--brand-orange);
}
body.dark-mode .health-alert-title { color:#F1F5F9; }
body.dark-mode .health-alert-dismiss:hover { color:#F1F5F9; }

/* ── GLOBAL HEADER (workspace strip + platform tabs — merged, can't drift) ── */
.global-header {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; flex-direction: column;
  z-index: 300;
  background: #0B1120;
  border-bottom: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 2px 20px rgba(0,0,0,.3);
}
.workspace-strip {
  display:flex; align-items:center; gap:2px;
  background:#060c18; padding:0 12px;
  height:32px; flex-shrink:0; border-bottom:1px solid rgba(255,255,255,.06);
}
.workspace-tab {
  padding:4px 14px; font-size:11px; font-weight:700;
  border:none; background:transparent; cursor:pointer;
  color:rgba(255,255,255,.62); border-radius:6px;  /* B1422: was .4 (3.8:1) */
  transition:all .15s; letter-spacing:.03em; text-transform:uppercase;
}
.workspace-tab:hover { color:rgba(255,255,255,.7); background:rgba(255,255,255,.06); }
.workspace-tab.active {
  color:var(--brand-orange); background:rgba(var(--brand-rgb),.12);
  border-bottom:2px solid var(--brand-orange);
}

/* ── Platform tab strip (child of .global-header) ── */
.platform-tabs {
  display: flex;
  align-items: stretch;
  height: 36px;
  background: #0B1120;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.platform-tabs::-webkit-scrollbar { display: none; }
/* B2134: opt-in platform tabs (AI360) are hidden until switched on in Menu Settings */
.platform-tab[data-topbar-optin]:not(.tb-optin-on) { display: none; }
.platform-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 20px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,.5);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.platform-tab:hover {
  color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.04);
}
.platform-tab.active {
  color: var(--brand-orange);
  border-bottom-color: var(--brand-orange);
}
/* B1032: Anonymisation toggle chip */
.anon-chip {
  margin-left: auto;
  border-left: 1px solid rgba(255,255,255,.1);
  opacity: .7;
  font-size: 11px;
  letter-spacing: .03em;
}
.anon-chip:hover { opacity: 1; }
.anon-chip-on {
  color: var(--brand-orange) !important;
  border-bottom-color: var(--brand-orange) !important;
  opacity: 1;
}

/* ── RECORDING POLICY AUDIT (recording_policies_custom.html) ──── */

/* Settings panel */
.rpc-settings-panel {
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.rpc-settings-summary {
  cursor: pointer;
  padding: 12px 18px;
  background: var(--surface);
  font-weight: 700;
  font-size: 13px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.rpc-settings-summary-icon { font-size: 16px; }
.rpc-settings-summary-hint {
  margin-left: auto;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}
.rpc-settings-body {
  padding: 18px 20px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}
.rpc-settings-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.rpc-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.rpc-field-label {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}
.rpc-field-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.rpc-org-scope-row { margin-top: 8px; }
.rpc-org-scope-badge { margin-left: 8px; }
.rpc-field-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  box-sizing: border-box;
}
.rpc-field-input-mono {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: monospace;
  box-sizing: border-box;
}
.rpc-settings-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.rpc-btn-reset {
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: transparent;
}
.rpc-settings-status {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 8px;
}

/* Action bar */
.rpc-action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.rpc-btn-export {
  border: 1px solid #27AE60;
  color: #27AE60;
  background: transparent;
}
.rpc-btn-audit-all {
  border: 1px solid var(--brand-accent);
  color: var(--brand-accent);
  background: transparent;
}
.rpc-audit-status { font-size: 13px; color: var(--text-muted); }

/* Multi-org summary section */
.rpc-multiorg-section { display: none; margin-bottom: 24px; }
.rpc-multiorg-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--brand-accent);
}
.rpc-multiorg-actions { margin-top: 10px; display: flex; gap: 10px; }

/* KPI strip */
.rpc-kpi-strip {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

/* Tab bar */
.rpc-tab-bar {
  display: none;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}

/* Pane content areas */
.rpc-pane-empty {
  display: none;
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
}
.rpc-pane-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.rpc-pane-hint code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
}
.rpc-pane-hint code.rpc-code-sm {
  background: var(--bg);
  padding: 2px 4px;
  border-radius: 4px;
}
.rpc-filter-row {
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.rpc-search-input {
  min-width: 200px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}
.rpc-fix-all-row { margin-bottom: 12px; }

/* Not-run empty state */
.rpc-not-run {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}
.rpc-not-run-icon { font-size: 40px; margin-bottom: 12px; }
.rpc-not-run-title { font-weight: 600; font-size: 16px; margin-bottom: 6px; }
.rpc-not-run-desc { font-size: 13px; }
.rpc-not-run-note { font-size: 12px; margin-top: 8px; }

/* Add policy modal */
.rpc-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 9000;
  align-items: center;
  justify-content: center;
}
.rpc-modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 32px;
  min-width: 380px;
  max-width: 520px;
  width: 90%;
}
.rpc-modal-title { font-weight: 700; font-size: 15px; margin-bottom: 18px; }
.rpc-modal-field { margin-bottom: 14px; }
.rpc-modal-label {
  font-size: 13px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
}
.rpc-modal-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-family: monospace;
  font-size: 13px;
  box-sizing: border-box;
}
.rpc-modal-hint { font-size: 12px; color: var(--text-muted); margin-bottom: 18px; }
.rpc-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.rpc-btn-cancel {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
}

/* Toast container */
.rpc-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

/* JS-generated card elements */
.rpc-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.rpc-card-body { flex: 1; }
.rpc-card-actions {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
  align-items: center;
}
.rpc-needs-review { color: #E67E22; font-size: 12px; margin-top: 4px; }
.rpc-issue-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.rpc-issue-meta code {
  background: var(--bg);
  padding: 1px 4px;
  border-radius: 3px;
}
.rpc-auto-badge {
  font-size: 11px;
  background: #F0FDF4;
  color: #27AE60;
  border: 1px solid #A9DFBF;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
}
.rpc-new-val-mt { margin-top: 4px; }
.rpc-edit-cancel-btn {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.rpc-edit-label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Dupes tab card elements */
.rpc-dupe-prefix { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.rpc-dupe-prefix code { background: var(--bg); padding: 1px 4px; border-radius: 3px; }
.rpc-dupe-keep-val { margin-bottom: 6px; }
.rpc-dupe-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
.rpc-dupe-row-name { flex: 1; }
.rpc-dupe-refs { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.rpc-dupe-warning { margin-top: 6px; font-size: 12px; color: #E67E22; font-weight: 600; }

/* Orphans tab card elements */
.rpc-orphan-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.rpc-orphan-body { flex: 1; }
.rpc-orphan-refs-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Missing policy tab */
.rpc-missing-num { color: var(--text-muted); font-size: 12px; }
.rpc-missing-key { font-family: monospace; font-size: 13px; font-weight: 600; }
.rpc-missing-div-pill {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
}
.rpc-missing-no-match {
  text-align: center;
  color: var(--text-muted);
  padding: 24px;
}

/* Unused tab */
.rpc-unused-num { color: var(--text-muted); font-size: 12px; }
.rpc-unused-name { font-family: monospace; font-size: 13px; }
.rpc-unused-valid { color: #27AE60; font-weight: 700; }
.rpc-unused-invalid { color: #E74C3C; font-weight: 700; }

/* Mismatch tab */
.rpc-mismatch-row { background: #FFF5F5; }
.rpc-mismatch-key { font-family: monospace; font-size: 12px; }
.rpc-mismatch-div-badge {
  background: #EBF5FB;
  color: #2980B9;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 700;
}
.rpc-mismatch-policy { font-family: monospace; font-size: 12px; color: #E74C3C; }
.rpc-mismatch-policy-badge {
  background: #FDEDEC;
  color: #E74C3C;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 700;
}
.rpc-multiorg-err { color: #E74C3C; }
.rpc-multiorg-done { color: #27AE60; font-weight: 700; }

/* Utility: initially hidden (replaced style="display:none;" on static elements) */
.rpc-hidden { display: none; }

/* Title icon variant for audit page (purple gradient) */
.title-icon-audit { background: linear-gradient(135deg, #7C3AED, #5B21B6); }
.title-icon-purple { background: linear-gradient(135deg, #7C3AED, #5B21B6); }
.title-icon-orange-deep { background: linear-gradient(135deg, var(--brand-orange), var(--brand-orange-dark)); }

/* ── RPC custom tabs (moved from recording_policies_custom.html <style> block) ── */
.cust-tab {
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  margin-bottom: -2px;
  white-space: nowrap;
}
.cust-tab.active {
  border-bottom: 2px solid var(--brand-accent);
  color: var(--brand-accent);
  font-weight: 700;
}
.tab-count {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 11px;
  padding: 1px 6px;
  margin-left: 4px;
  color: var(--text-muted);
  font-weight: 600;
}
.tab-count.has-issues { background: #FFF5F5; border-color: #FEB2B2; color: #E74C3C; }
.tab-count.ok         { background: #F0FAF4; border-color: #A9DFBF; color: #27AE60; }

/* Audit cards */
.audit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 10px;
}
.audit-card.issue { border-left-color: #E74C3C; }
.audit-card.warn  { border-left-color: #E67E22; }
.audit-card.info  { border-left-color: #2980B9; }
.audit-card.ok    { border-left-color: #27AE60; }

/* Value display in audit cards */
.old-val { color: #E74C3C; font-family: monospace; font-weight: 700; font-size: 13px; }
.new-val { color: #27AE60; font-family: monospace; font-weight: 700; font-size: 13px; }
.ref-pill {
  display: inline-block;
  font-size: 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  margin: 1px;
  color: var(--text-muted);
  font-family: monospace;
}

/* Mode badges */
.mode-badge-dry  { background: #E67E22; color: white; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.mode-badge-live { background: #E74C3C; color: white; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; }

/* Fix / Delete ghost buttons */
.btn-fix {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 5px;
  cursor: pointer;
  border: 1px solid var(--brand-accent);
  color: var(--brand-accent);
  background: transparent;
  transition: background .15s, color .15s;
}
.btn-fix:hover    { background: var(--brand-accent); color: #fff; }
.btn-fix:disabled { opacity: .45; cursor: default; }

.btn-del {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 5px;
  cursor: pointer;
  border: 1px solid #E74C3C;
  color: #E74C3C;
  background: transparent;
  transition: background .15s, color .15s;
}
.btn-del:hover    { background: #E74C3C; color: #fff; }
.btn-del:disabled { opacity: .45; cursor: default; }

/* Fix-All buttons */
.btn-fix-all {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--brand-accent);
  color: var(--brand-accent);
  background: transparent;
}
.btn-fix-all:hover  { background: var(--brand-accent); color: #fff; }
.btn-delete-all     { border-color: #E74C3C; color: #E74C3C; }
.btn-delete-all:hover { background: #E74C3C; color: #fff; }

/* Inline rename editor */
.inline-edit-row {
  background: var(--bg);
  border: 1px solid var(--brand-accent);
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.inline-edit-row input {
  flex: 1;
  min-width: 240px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  font-family: monospace;
  font-size: 13px;
}

/* RPC Toast (scoped to recording policy audit page) */
.rpc-toast {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  pointer-events: auto;
  opacity: 0;
  transition: opacity .2s;
  max-width: 340px;
  word-break: break-word;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}
.rpc-toast.ok   { background: #1e3a2b; color: #4ade80; border: 1px solid #27AE60; }
.rpc-toast.err  { background: #3a1e1e; color: #f87171; border: 1px solid #E74C3C; }
.rpc-toast.show { opacity: 1; }

/* ── Inline style cleanup utilities ── */
.template-flex { display: flex; }
.template-flex-col { flex-direction: column; }
.template-flex-wrap { flex-wrap: wrap; }
.template-items-center { align-items: center; }
.template-items-start { align-items: flex-start; }
.template-justify-center { justify-content: center; }
.template-justify-between { justify-content: space-between; }
.template-justify-end { justify-content: flex-end; }
.template-gap-2 { gap: 8px; }
.template-gap-4 { gap: 16px; }
.template-gap-8 { gap: 32px; }
.template-w-full { width: 100%; }
.template-w-auto { width: auto; }
.template-h-full { height: 100%; }
.template-text-left { text-align: left; }
.template-text-center { text-align: center; }
.template-text-right { text-align: right; }
.template-font-bold { font-weight: 700; }
.template-font-normal { font-weight: 400; }
.template-text-xs { font-size: 11px; }
.template-text-sm { font-size: 13px; }
.template-text-lg { font-size: 16px; }
.template-text-xl { font-size: 20px; }
.template-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.template-whitespace-nowrap { white-space: nowrap; }
.template-cursor-pointer { cursor: pointer; }
.template-rounded { border-radius: 4px; }
.template-opacity-50 { opacity: 0.5; }
.template-hidden { display: none; }
.template-inline { display: inline; }
.template-inline-block { display: inline-block; }
.template-overflow-auto { overflow: auto; }
.template-overflow-hidden { overflow: hidden; }
.template-relative { position: relative; }
.template-absolute { position: absolute; }
.template-m-0 { margin: 0; }
.template-mt-4 { margin-top: 16px; }
.template-mt-8 { margin-top: 32px; }
.template-mb-4 { margin-bottom: 16px; }
.template-mb-8 { margin-bottom: 32px; }
.template-ml-4 { margin-left: 16px; }
.template-mr-4 { margin-right: 16px; }
.template-p-4 { padding: 16px; }
.template-p-8 { padding: 32px; }
.template-pt-4 { padding-top: 16px; }
.template-pb-4 { padding-bottom: 16px; }
.template-pl-4 { padding-left: 16px; }
.template-pr-4 { padding-right: 16px; }
.template-border-collapse { border-collapse: collapse; }
.template-vertical-align-middle { vertical-align: middle; }
.template-vertical-align-top { vertical-align: top; }
.template-white-space-nowrap { white-space: nowrap; }
.template-color-inherit { color: inherit; }
.template-text-decoration-none { text-decoration: none; }
.template-list-style-none { list-style: none; }
/* ── utility classes (replace inline styles) ── */
.t-float-right { float: right; }
.t-clear-both { clear: both; }
.t-min-width-0 { min-width: 0; }
.t-max-width-full { max-width: 100%; }
.t-box-border { box-sizing: border-box; }
.t-flex { display: flex; }
.t-flex-col { flex-direction: column; }
.t-flex-wrap { flex-wrap: wrap; }
.t-items-center { align-items: center; }
.t-justify-between { justify-content: space-between; }
.t-justify-end { justify-content: flex-end; }
.t-gap-xs { gap: 4px; }
.t-gap-sm { gap: 8px; }
.t-gap-md { gap: 12px; }
.t-gap-lg { gap: 16px; }
.t-text-xs { font-size: 11px; }
.t-text-sm { font-size: 13px; }
.t-text-muted { color: rgba(255,255,255,.5); }
.t-text-muted-light { color: rgba(255,255,255,.35); }
.t-text-danger { color: #ef4444; }
.t-text-success { color: #28a745; }
.t-text-center { text-align: center; }
.t-font-bold { font-weight: 600; }
.t-font-mono { font-family: 'JetBrains Mono', monospace; }
.t-p-xs { padding: 4px; }
.t-p-sm { padding: 8px; }
.t-p-md { padding: 12px; }
.t-p-lg { padding: 16px; }
.t-px-sm { padding-left: 8px; padding-right: 8px; }
.t-px-md { padding-left: 12px; padding-right: 12px; }
.t-py-xs { padding-top: 4px; padding-bottom: 4px; }
.t-py-sm { padding-top: 8px; padding-bottom: 8px; }
.t-mb-xs { margin-bottom: 4px; }
.t-mb-sm { margin-bottom: 8px; }
.t-mb-md { margin-bottom: 12px; }
.t-mb-lg { margin-bottom: 16px; }
.t-ml-xs { margin-left: 4px; }
.t-ml-sm { margin-left: 8px; }
.t-pl-lg { padding-left: 36px; }
.t-ml-md { margin-left: 12px; }
.t-mr-xs { margin-right: 4px; }
.t-mr-sm { margin-right: 8px; }
.t-border-b { border-bottom: 1px solid rgba(255,255,255,.08); }
.t-border-t { border-top: 1px solid rgba(255,255,255,.08); }
.t-rounded { border-radius: 6px; }
.t-rounded-full { border-radius: 999px; }
.t-overflow-auto { overflow: auto; }
.t-whitespace-nowrap { white-space: nowrap; }
.t-cursor-pointer { cursor: pointer; }
.t-opacity-60 { opacity: .6; }
.t-opacity-70 { opacity: .7; }

/* ── appConfirm() dialog (CSP-safe — no inline styles) ── */
.app-confirm-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
}
.app-confirm-box {
  background: #131d30; border: 1px solid rgba(var(--brand-rgb),.35);
  border-radius: 10px; padding: 28px 32px;
  max-width: 380px; width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.app-confirm-box p {
  margin: 0 0 20px; color: #e2e8f0;
  font-family: 'Inter', sans-serif; font-size: 14px; line-height: 1.5;
}
.app-confirm-actions {
  display: flex; gap: 10px; justify-content: flex-end;
}
.app-confirm-cancel {
  background: transparent; border: 1px solid rgba(255,255,255,.2);
  color: #94a3b8; border-radius: 6px; padding: 7px 18px;
  cursor: pointer; font-family: 'Inter', sans-serif; font-size: 13px;
}
.app-confirm-cancel:hover { background: rgba(255,255,255,.06); }
.app-confirm-ok {
  background: var(--brand-solid); border: none; color: var(--on-brand);
  border-radius: 6px; padding: 7px 18px;
  cursor: pointer; font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 600;
}
.app-confirm-ok:hover { background: var(--brand-solid-2); }
.app-confirm-title {
  margin: 0 0 6px; color: #f1f5f9;
  font-family: 'Inter', sans-serif; font-size: 16px; font-weight: 700;
}
.app-confirm-sub {
  margin: 0 0 18px; color: #94a3b8;
  font-family: 'Inter', sans-serif; font-size: 13px;
}
.app-confirm-sub strong { color: #e2e8f0; font-weight: 600; }
.app-confirm-label {
  display: block; margin-bottom: 6px; color: #94a3b8;
  font-family: 'Inter', sans-serif; font-size: 12px;
  font-weight: 600; letter-spacing: .05em;
}
.app-confirm-select {
  width: 100%; background: #0b1120; border: 1px solid rgba(255,255,255,.15);
  color: #e2e8f0; border-radius: 6px; padding: 8px 10px;
  font-family: 'Inter', sans-serif; font-size: 13px; margin-bottom: 16px;
}
.app-confirm-check {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  margin-bottom: 20px; color: #e2e8f0;
  font-family: 'Inter', sans-serif; font-size: 13px;
}
.app-confirm-check input { accent-color: var(--brand-orange); width: 15px; height: 15px; }
.table-error-cell {
  padding: 12px; color: var(--danger, #dc3545);
  background: rgba(220,53,69,.08); text-align: center;
}
.t-ml-12 { margin-left: 12px; }
.drawer-mini-table { width: 100%; border-collapse: collapse; }
.drawer-mini-table th {
  text-align: left; padding: 6px; border-bottom: 1px solid #dee2e6;
}
.drawer-mini-table td { padding: 5px 6px; }
.drawer-mini-id { font-size: 11px; color: var(--muted); }
.drawer-config-pre {
  font-size: 11px; white-space: pre-wrap; word-break: break-all;
}
.load-status-ok {
  color: #047857; font-size: 12px; font-weight: 600;  /* B1422: was --success (2.29:1) */
}
.load-status-refresh {
  color: var(--brand-orange); text-decoration: none;
}
.load-status-muted { color: var(--muted); font-size: 12px; }
.load-progress-track {
  display: inline-block; width: 80px; height: 4px;
  background: var(--border, #dee2e6); border-radius: 2px;
  margin-left: 8px; vertical-align: middle;
}
.load-progress-bar {
  display: block; height: 4px; background: var(--brand-orange);
  border-radius: 2px; transition: width .3s;
}
.search-result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; color: #CBD5E1; font-size: 12px;
  border-bottom: 1px solid rgba(255,255,255,.05); text-decoration: none;
}
.search-result-item:hover { background: rgba(255,255,255,.06); }
.search-result-badge {
  font-size: 10px; background: rgba(var(--brand-rgb),.2); color: var(--brand-orange-lt);
  padding: 2px 7px; border-radius: 20px; font-weight: 600;
}
.drawer-center-spinner { text-align: center; padding: 40px; }
.drawer-empty-state {
  color: var(--muted); text-align: center; padding: 24px;
}
.drawer-center-spinner-sm { text-align: center; padding: 24px; }
.drawer-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid var(--border);
}
.drawer-row > .drawer-row-main { flex: 1; font-size: 13px; }
.drawer-row + .drawer-row { border-bottom: 1px solid var(--border); }
.btn-danger-outline {
  color: #ef4444; border-color: #ef4444;
}
.drawer-section-divider {
  margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px;
}
.warning-inline { color: #f59e0b; font-size: 13px; padding: 8px 0; }
.mono-inline { font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.drawer-user-info { flex: 1; }
.drawer-user-name { font-weight: 600; font-size: 13px; }
.drawer-user-sub { font-size: 11px; color: var(--muted); }
.btn-danger-outline-sm { color: #ef4444; border-color: #ef4444; font-size: 11px; }
.drawer-row-main-500 { flex: 1; font-weight: 500; }
.badge-mono-rm { margin-right: 8px; }
.drawer-row-input {
  flex: 1; padding: 6px 10px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 12px; background: var(--surface); color: var(--text);
}
.drawer-row-muted {
  flex: 1; font-size: 11px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.drawer-row-key {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  flex: 0 0 auto; color: var(--brand-accent);
}
.t-mt-16 { margin-top: 16px; }
.t-mt-8 { margin-top: 8px; }
.t-mt-12 { margin-top: 12px; }
.t-py-8 { padding: 8px 0; }
.t-fs-11 { font-size: 11px; }
.t-flex-shrink-0 { flex-shrink: 0; }
.t-col-span-2 { grid-column: span 2; }
.danger-inline { color: #ef4444; font-size: 13px; padding: 8px 0; }
.drawer-agent-row { padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.drawer-note { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.drawer-media-pre {
  font-size: 11px; font-family: 'JetBrains Mono', monospace;
  background: var(--surface-2); padding: 12px; border-radius: 8px; overflow-x: auto;
}
.t-w-60 { width: 60px; flex-basis: 60px; }
.t-fs-12 { font-size: 12px; }
.t-muted { color: var(--muted); }
.t-mb-8 { margin-bottom: 8px; }
.t-mb-16 { margin-bottom: 16px; }
.t-fs-13 { font-size: 13px; }
.t-items-center { align-items: center; }
.t-flex-wrap { flex-wrap: wrap; }
.t-neg-mt-12 { margin-top: -12px; }
.t-py-8-4 { padding: 8px 0 4px; }
.t-w-80 { width: 80px; }
.t-px-10 { padding: 6px 10px; }
.t-py-6 { padding: 6px 10px; }
.t-bordered { border: 1px solid var(--border); border-radius: 6px; }
.t-surface { background: var(--surface); }
.t-text { color: var(--text); }
.hidden-panel { display: none; }
.app-confirm-box-lg { max-width: 420px; }

/* ── Dashboard charts & division overview (CSP-safe classes) ── */
.chart-divisions-skeleton { height: 240px; }
#chart-divisions-wrap { min-height: 240px; }
.overview-chart-skeleton { width: min(100%, 280px); aspect-ratio: 1; border-radius: 50%; margin: 0 auto; }
.overview-chart-wrap { width: min(100%, 280px); aspect-ratio: 1; margin: 0 auto; }
.overview-chart-canvas { display: block; width: 100%; height: 100%; }
.div-overview-skeleton { height: 160px; }
.show-all-btn {
  background: none; border: none; padding: 0; cursor: pointer; font: inherit;
  color: var(--brand-orange);
}
.show-all-btn:hover { text-decoration: underline; }
.badge-orange-soft { background: rgba(var(--brand-rgb),.15); padding: 2px 8px; border-radius: 4px; }
.badge-orange-soft.text-orange { color: var(--brand-orange-dark); }  /* B1422 */
body.dark-mode .badge-orange-soft.text-orange { color: var(--brand-orange-lt); }
.card-title-accent { border-left: 3px solid var(--brand-orange); padding-left: 10px; }
.card-title-accent::before { display: none; }
.cell-pad { padding: 8px 12px; }
.table-th-compact { padding: 8px 12px; letter-spacing: .05em; }
#div-overview-tbody tr { border-bottom: 1px solid var(--border); }
#div-overview-tbody tr:nth-child(even) { background: rgba(255,255,255,.02); }

/* ── Inline-style elimination utilities (B651) ── */
/* Max/min width */
.mw-400  { max-width: 400px; }
.mw-480  { max-width: 480px; }
.mw-600  { max-width: 600px; }
.mw-640  { max-width: 640px; }
.mw-700  { max-width: 700px; }
.mw-720  { max-width: 720px; }
.mw-740  { max-width: 740px; }
.mh-260  { max-height: 260px; overflow-y: auto; }
.mw-800  { max-width: 800px; }
.max-h-300 { max-height: 300px; }
.min-w-90  { min-width: 90px; }
.min-w-110 { min-width: 110px; }
.min-w-160 { min-width: 160px; }
.min-w-180 { min-width: 180px; }
.min-w-220 { min-width: 220px; }
.min-h-16  { min-height: 16px; }
.min-h-60vh{ min-height: 60vh; }
.h-160     { height: 160px; }
/* Spacing */
.mt-14 { margin-top: 14px; }
.mt-22 { margin-top: 22px; }
.mt-28 { margin-top: 28px; }
.ml-6  { margin-left: 6px; }
.mb-6  { margin-bottom: 6px; }
.py-6  { padding-top: 6px; padding-bottom: 6px; }
.py-10 { padding-top: 10px; padding-bottom: 10px; }
.pb-4  { padding-bottom: 4px; }
.pl-18 { padding-left: 18px; }
.p-12  { padding: 12px; }
.gap-6 { gap: 6px; }
.mr-auto        { margin-right: auto; }
.my-12-8        { margin: 12px 0 8px; }
.pt-16-pb-8     { padding: 16px 0 8px; }
.py-4-8         { padding: 4px 0 8px; }
/* Typography */
.lh-17     { line-height: 1.7; }
.ls-07     { letter-spacing: .07em; }
.ls-05     { letter-spacing: .05em; }
.italic    { font-style: italic; }
.underline { text-decoration: underline; }
.fw-900    { font-weight: 900; }
.score-display  { font-weight: 900; line-height: 1; }
.text-48        { font-size: 48px; }
.stat-val-amber { font-size: 28px; line-height: 1.1; color: #f59e0b; }
/* Color utilities */
.text-accent  { color: var(--brand-accent, var(--brand-orange)); }
.text-ok      { color: var(--accent-ok, #22c55e); }
.text-indigo  { color: #818cf8; }
.text-slate   { color: #94a3b8; }
.text-warning { color: #f59e0b; }
.bg-inherit   { background: inherit; }
.flex-2       { flex: 2; }
.cursor-default { cursor: default; }
.opacity-50     { opacity: .5; }
/* Sizing */
.mw-300  { max-width: 300px; }
.w-0p    { width: 0%; }
.w-24p   { width: 24px; }
.w-36p   { width: 36px; }
.w-44    { width: 44px; }
/* Error page numbers — merged 404/500 into one complete rule (2026-09-20 design
   consistency pass): .error-code-404 had font-weight/letter-spacing but no
   font-size, .error-code-500 had font-size but no font-weight — neither was
   complete alone and they didn't match each other. */
.error-code { font-size: 96px; font-weight: 900; letter-spacing: -4px; line-height: 1; }
/* Title icons */
.title-icon-purple { background: linear-gradient(135deg, #7C3AED, #5B21B6); }
.title-icon-red    { background: linear-gradient(135deg, #ef4444, #b91c1c); }
/* Score ring */
.score-ring-outer  { border-radius: 50%; background: conic-gradient(var(--accent) 0deg, #1e2a40 0deg); transition: background .6s; }
.score-ring-inner  { height: 110px; border-radius: 50%; }
.score-val-lg      { font-size: 38px; line-height: 1; }
.score-card-body   { padding: 32px 20px; min-height: 220px; }
/* Grid layouts */
.grid-4           { grid-template-columns: repeat(4, 1fr); }
.grid-4-pt        { grid-template-columns: repeat(4, 1fr); padding: 16px 0 4px; }
.health-grid      { grid-template-columns: 240px 1fr; }
.compare-grid     { grid-template-columns: 1fr 1fr 1fr auto; align-items: end; padding: 16px 0 4px; }
.kpi-auto-grid    { display: flex; flex-wrap: wrap; gap: 12px; }
.kpi-auto-grid > a { flex: 1 1 180px; }
/* Was grid+auto-fit: with a tile count that isn't a clean multiple of the
   computed column count, the trailing row's lone/leftover tile(s) sat in
   their own cell with the rest of that row's tracks empty (2026-09-27 QA
   pass, /recording-policies at 1440px — 9 tiles, 8 computed columns, 9th
   tile stranded). Flexbox doesn't share column tracks across rows, so a
   short trailing row's tiles grow to fill it instead of leaving dead space. */
.kpi-auto-grid-sm { display: flex; flex-wrap: wrap; }
.kpi-auto-grid-sm > .kpi-tile { flex: 1 1 130px; }
.status-info-grid { grid-template-columns: 140px 1fr; gap: 8px 0; }
.detail-dl-grid   { grid-template-columns: 120px 1fr; gap: 6px 12px; }
.roadmap-grid     { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
/* Progress bar */
.progress-track    { overflow: hidden; border-radius: 99px; height: 8px; border: 1px solid var(--border); }
.progress-bar-init { width: 0%; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand-orange), var(--brand-orange-lt)); transition: width .4s ease; }
/* Overlays */
.overlay-modal     { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 1000; }
.overlay-modal-40  { position: fixed; inset: 0; background: rgba(0,0,0,.4);  z-index: 1000; }
.overlay-modal-600 { position: fixed; inset: 0; background: rgba(0,0,0,.6);  z-index: 9000; }
.overlay-modal-top { position: fixed; inset: 0; background: rgba(0,0,0,.5);  z-index: 2000; }
.modal-centered    { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 560px; max-width: 95vw; max-height: 90vh; box-shadow: 0 8px 40px rgba(0,0,0,.3); z-index: 2001; overflow: auto; }
.modal-close-pos   { position: absolute; top: 14px; right: 16px; }
.modal-alert-sz    { width: 520px; max-width: 95vw; padding: 28px; }
.modal-wrapup-sz   { border: 1px solid var(--border); padding: 28px 32px; width: 420px; max-width: 95vw; box-shadow: 0 8px 32px rgba(0,0,0,.4); }
.rec-drawer-panel  { position: fixed; top: 0; right: 0; width: 560px; height: 100vh; z-index: 1001; box-shadow: -4px 0 24px rgba(0,0,0,.25); }
/* Notices */
.warn-notice        { padding: 10px 14px; background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.3); }
.warn-banner-yellow { padding: 10px 14px; background: rgba(255,193,7,.1); border: 1px solid rgba(255,193,7,.3); color: var(--warning-text); }
.hint-orange        { background: rgba(var(--brand-rgb),.08); border: 1px solid rgba(var(--brand-rgb),.2); }
.cache-banner-stripe{ background: rgba(var(--brand-rgb),.1); border-left: 3px solid var(--brand-orange); padding: 10px 16px; }
.inline-panel       { margin: -12px 0 20px; padding: 14px 18px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; }
.bulk-action-bar    { padding: 8px 12px; background: var(--surface-2, #1a2236); }
/* Page tabs */
.border-bottom-2    { border-bottom: 2px solid var(--border); }
.page-tab-item      { appearance: none; background: none; border: none; border-bottom: 2px solid transparent; font-family: inherit; cursor: pointer; padding: 8px 20px; transition: color .15s, border-color .15s; margin-bottom: -2px; }
/* Badges */
.badge-lang-chip    { background: rgba(139,92,246,.15); color: #8b5cf6; padding: 1px 7px; border-radius: 99px; font-size: 11px; }
.badge-skill-chip   { background: rgba(59,130,246,.15);  color: #3b82f6; padding: 1px 7px; border-radius: 99px; font-size: 11px; }
/* Forms */
.option-card-input  { padding: 12px; border: 1px solid var(--border); transition: border-color .15s; }
.form-input-card    { padding: 9px 12px; border: 1px solid var(--border); transition: border-color .15s; }
.form-select-styled { padding: 7px 12px; border: 1px solid var(--border); }
/* Empty/loading */
.empty-state-pad    { padding: 60px 20px; }
.loading-center     { text-align: center; padding: 3rem; }
.empty-center       { text-align: center; padding: 3rem; color: var(--text-muted); }
.empty-icon-lg      { font-size: 2rem; margin-bottom: .5rem; }
.empty-hint-sm      { font-size: .85rem; margin-top: .5rem; }
.dismiss-btn        { line-height: 1; padding: 0 4px; }
/* Dropdown */
.autocomplete-drop  { z-index: 9999; border: 1px solid var(--border); max-height: 220px; width: 100%; box-shadow: 0 4px 16px rgba(0,0,0,.18); }
/* Misc */
.lang-filter-bar    { border: 1px solid var(--border); padding: 10px 16px; }
.disabled-tile      { cursor: default; opacity: .5; }
.td-cell-pad        { padding: 8px 16px; }
.td-header-pad      { padding: 8px 16px; letter-spacing: .05em; }

/* ── Inline-style replacement utilities (B641) ── */
.w-24    { width: 24px; }
.w-36    { width: 36px; }
.w-38    { width: 38px; }
.w-44    { width: 44px; }
.w-105   { width: 105px; }
.w-60p   { width: 60%; }
.w-70p   { width: 70%; }
.w-70p-h16 { width: 70%; height: 16px; }
.w-70p-h14 { width: 70%; height: 14px; }
.w-80p-h14 { width: 80%; height: 14px; }
.w-80p   { width: 80%; }
.h-18    { height: 18px; }
.max-w-160 { max-width: 160px; }
.max-w-180 { max-width: 180px; }
.max-w-200 { max-width: 200px; }
.max-w-220 { max-width: 220px; }
.max-w-320 { max-width: 320px; }
.min-w-160 { min-width: 160px; }
.op-7    { opacity: .7; }
.op-6    { opacity: .6; }
.row-divider-6 { padding: 6px 0; border-bottom: 1px solid var(--border); }
.row-divider-7 { padding: 7px 0; border-bottom: 1px solid var(--border); }
.row-divider-8-4 { padding: 8px 4px; border-bottom: 1px solid var(--border); }
.row-divider-10 { padding: 10px 0; border-bottom: 1px solid var(--border); }
.pad-12-border { padding: 12px; border: 1px solid var(--border); }
.pad-10-14-card { padding: 10px 14px; background: var(--card-bg); border: 1px solid var(--border); }
.mt-14   { margin-top: 14px; }
.mt-28   { margin-top: 28px; }
.m-0-0-4 { margin: 0 0 4px; }
.m-10-0-6 { margin: 10px 0 6px; }
.m-0-0-0-16 { margin: 0 0 0 16px; padding: 0; }
.t-italic { font-style: italic; }
.t-slate-3 { color: var(--text-2); }
.t-slate-4 { color: var(--text-2); }
.t-amber-4 { color: var(--warning-text); }
.t-yellow-3 { color: var(--warning-text); }
.t-green-3 { color: var(--success-text); }
.t-indigo-4 { color: var(--brand-accent); }
.t-red-err { color: #e55; }
.t-red-err-2 { color: #E74C3C; }
.grid-cols-120 { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; }
.grid-cols-160 { display: flex; flex-wrap: wrap; }
.grid-cols-160 > * { flex: 1 1 160px; }
.grid-cols-280 { display: flex; flex-wrap: wrap; gap: 18px; }
.grid-cols-280 > * { flex: 1 1 280px; }
.pad-2-10 { padding: 2px 10px; }
.flex-1 { flex: 1; }
.gap-8-center { gap: 8px; align-items: center; }

/* ════════════════════════════════════════════
   SETTINGS MODAL (base.html — theme + brand picker)
   ════════════════════════════════════════════ */
.settings-box { max-width: 460px; }
.settings-section { margin-bottom: 22px; }
.settings-label {
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-2); margin-bottom: 10px;
}
.settings-row { display: flex; gap: 8px; flex-wrap: wrap; }
/* Theme segmented control */
.theme-seg { display: flex; gap: 8px; }
.theme-seg .seg-btn {
  flex: 1; padding: 8px 12px; font-size: 13px; font-weight: 600;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-2); cursor: pointer;
  transition: all .15s;
}
.theme-seg .seg-btn:hover { border-color: var(--brand-orange); color: var(--text); }
.theme-seg .seg-btn.active {
  background: var(--brand-solid); border-color: var(--brand-solid);
  color: var(--on-brand);
}
/* Brand color swatches — CSP-safe (colors defined here, not inline) */
.brand-swatches { display: flex; gap: 12px; flex-wrap: wrap; }
.brand-swatch {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  border: 2px solid var(--border); padding: 0; position: relative;
  box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s;
}
.brand-swatch:hover { transform: scale(1.12); }
.brand-swatch.active {
  border-color: var(--surface); box-shadow: 0 0 0 2px var(--brand-orange), var(--shadow-md);
}
.brand-swatch.active::after {
  content: "✓"; position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; color: #fff;
  font-size: 15px; font-weight: 800;
}
.brand-swatch[data-brand="orange"] { background: #FF6B00; }
.brand-swatch[data-brand="blue"]   { background: #3B82F6; }
.brand-swatch[data-brand="green"]  { background: #10B981; }
.brand-swatch[data-brand="gold"]   { background: #D4A017; }
.brand-swatch[data-brand="purple"] { background: #8B5CF6; }
.settings-hint { font-size: 12px; color: var(--muted); margin-top: 8px; }
.settings-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border);
}
.settings-footer .btn { padding: 7px 16px; font-size: 13px; }

/* ════════════════════════════════════════════
   AUDIT REPORT & INVENTORY — in-app (harmonised with Config360)
   Report body fragments are injected into report_page.html which loads
   this global stylesheet, so the generated report/inventory look exactly
   like the rest of the app. The standalone ?raw=1 deliverables embed
   their own equivalent CSS (REPORT_CSS / INVENTORY_CSS).
   ════════════════════════════════════════════ */
.report-page { max-width: 1180px; }
.report-page h1 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.report-page h2.h5, .report-page .report-panel h2 { font-size: 15px; font-weight: 700; color: var(--text); }
.report-page .muted, .report-page .muted small { color: var(--muted); }

.report-mast { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.score-block { display: flex; align-items: center; gap: 16px; }
.score-value { font-size: 42px; font-weight: 800; color: var(--text); letter-spacing: -.03em; line-height: 1; }
.status-badge { font-size: 13px; font-weight: 700; color: #fff; padding: 7px 16px; border-radius: 999px; display: inline-block; }
.st-ready { background: #22c55e; }
.st-cond  { background: #f59e0b; }
.st-not   { background: #ef4444; }
.st-unk   { background: #94a3b8; }
.sev-crit { background: #ef4444; }
.sev-high { background: #f97316; }
.sev-med  { background: #eab308; color: #1c1917; }
.sev-low  { background: #94a3b8; }

.report-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.report-kpi .kpi-tile { margin: 0; }
.report-kpi .kpi-val.danger { color: #dc2626; }
.report-kpi .kpi-val.warn   { color: #f97316; }

.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.colgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.colgrid .col { min-width: 0; }
.report-grid, .report-page .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.report-page .col, .report-page .col-md-6 { min-width: 0; }
@media (max-width: 760px) { .report-page .row, .report-grid { grid-template-columns: 1fr; } }

.card-body { padding: 18px 20px; }
.card-value { font-size: 26px; font-weight: 800; color: var(--text); }
.card-label { color: var(--muted); font-size: 11px; margin-top: 4px; text-transform: uppercase; letter-spacing: .06em; }
.card-text { color: var(--text-2); font-size: 13px; margin: 0 0 12px; }

.dom-card { border-top: 3px solid var(--dc, #94a3b8); }
.dom-accent { font-size: 30px; font-weight: 800; color: var(--dc, #94a3b8); line-height: 1.1; }
.dom-sublabel { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.dom-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.dom-operations    { --dc: #3b82f6; }
.dom-compliance    { --dc: #a855f7; }
.dom-workforce     { --dc: #22c55e; }
.dom-ai_automation { --dc: #f97316; }
.dom-infrastructure{ --dc: #ef4444; }
.dom-security      { --dc: #14b8a6; }
.dom-unknown       { --dc: #94a3b8; }
.domain-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.domain-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dc, #94a3b8); flex-shrink: 0; }
.domain-name { min-width: 180px; font-weight: 600; }

.mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; color: var(--muted); }
.progress { background: var(--border); border-radius: 999px; height: 8px; overflow: hidden; }
.progress-bar { height: 8px; border-radius: 999px; }
.eb-quick { background: #22c55e; }
.eb-med   { background: #f97316; }
.eb-crit  { background: #ef4444; }
.ebw-0{width:0%}.ebw-1{width:1%}.ebw-2{width:2%}.ebw-3{width:3%}.ebw-4{width:4%}.ebw-5{width:5%}.ebw-6{width:6%}.ebw-7{width:7%}.ebw-8{width:8%}.ebw-9{width:9%}.ebw-10{width:10%}.ebw-11{width:11%}.ebw-12{width:12%}.ebw-13{width:13%}.ebw-14{width:14%}.ebw-15{width:15%}.ebw-16{width:16%}.ebw-17{width:17%}.ebw-18{width:18%}.ebw-19{width:19%}.ebw-20{width:20%}.ebw-21{width:21%}.ebw-22{width:22%}.ebw-23{width:23%}.ebw-24{width:24%}.ebw-25{width:25%}.ebw-26{width:26%}.ebw-27{width:27%}.ebw-28{width:28%}.ebw-29{width:29%}.ebw-30{width:30%}.ebw-31{width:31%}.ebw-32{width:32%}.ebw-33{width:33%}.ebw-34{width:34%}.ebw-35{width:35%}.ebw-36{width:36%}.ebw-37{width:37%}.ebw-38{width:38%}.ebw-39{width:39%}.ebw-40{width:40%}.ebw-41{width:41%}.ebw-42{width:42%}.ebw-43{width:43%}.ebw-44{width:44%}.ebw-45{width:45%}.ebw-46{width:46%}.ebw-47{width:47%}.ebw-48{width:48%}.ebw-49{width:49%}.ebw-50{width:50%}.ebw-51{width:51%}.ebw-52{width:52%}.ebw-53{width:53%}.ebw-54{width:54%}.ebw-55{width:55%}.ebw-56{width:56%}.ebw-57{width:57%}.ebw-58{width:58%}.ebw-59{width:59%}.ebw-60{width:60%}.ebw-61{width:61%}.ebw-62{width:62%}.ebw-63{width:63%}.ebw-64{width:64%}.ebw-65{width:65%}.ebw-66{width:66%}.ebw-67{width:67%}.ebw-68{width:68%}.ebw-69{width:69%}.ebw-70{width:70%}.ebw-71{width:71%}.ebw-72{width:72%}.ebw-73{width:73%}.ebw-74{width:74%}.ebw-75{width:75%}.ebw-76{width:76%}.ebw-77{width:77%}.ebw-78{width:78%}.ebw-79{width:79%}.ebw-80{width:80%}.ebw-81{width:81%}.ebw-82{width:82%}.ebw-83{width:83%}.ebw-84{width:84%}.ebw-85{width:85%}.ebw-86{width:86%}.ebw-87{width:87%}.ebw-88{width:88%}.ebw-89{width:89%}.ebw-90{width:90%}.ebw-91{width:91%}.ebw-92{width:92%}.ebw-93{width:93%}.ebw-94{width:94%}.ebw-95{width:95%}.ebw-96{width:96%}.ebw-97{width:97%}.ebw-98{width:98%}.ebw-99{width:99%}.ebw-100{width:100%}
.effort-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.check-item { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; margin-bottom: 8px; }
.check-item input { flex-shrink: 0; margin-top: 3px; accent-color: var(--brand-orange); }
.check-head { color: var(--dc, #94a3b8); margin: 14px 0 8px; font-weight: 700; font-size: 13px; }

.report-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab-btn {
  appearance: none; background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted);
  padding: 10px 14px; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--brand-orange); border-bottom-color: var(--brand-orange); }
.report-panel { display: none; }
.report-panel.active { display: block; }

.blocker-row td { vertical-align: middle; }
.filter-input {
  max-width: 380px; width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; font-size: 13px; color: var(--text); background: var(--surface);
}
.filter-input:focus { outline: none; border-color: var(--brand-orange); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .15); }

.bp-table { width: 100%; }
.bp-status { white-space: nowrap; }
.bp-examples { max-width: 220px; word-break: break-word; }
.table-responsive { border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; background: var(--surface); }
.subtitle { color: var(--muted); font-size: 13px; }

/* ── CSP-safe inline-style migration (B698) ────────────────────────────────
   Strict style-src CSP strips every style="" attribute, so all layout styles
   must live in classes. Keep new inline styles out of templates; add a
   utility class here instead. Dynamic values (bar widths, colors set from JS)
   are applied via CSSOM (el.style.x = ...), which CSP does not block.        */
.fs-085  { font-size: .85rem; }
.fs-082  { font-size: .82rem; }
.fs-09   { font-size: .9rem; }
.fs-10   { font-size: 1rem; }
.fs-11   { font-size: 1.1rem; }
.fs-11px { font-size: 11px; }
.fs-12   { font-size: 12px; }
.jc-between { justify-content: space-between; }
/* Bootstrap/utility aliases used by Audit360 templates */
.align-items-center  { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.ms-3  { margin-left: 1rem; }
/* Link style for inline table actions */
.ins-view-link { color: var(--brand-orange, #FF6B00); text-decoration: none; font-size: .82rem; }
.ins-view-link:hover { text-decoration: underline; }
/* Card header — title row at top of a .card */
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: .95rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.mb-12   { margin-bottom: 12px; }
.mb-16   { margin-bottom: 16px; }
.mb-075  { margin-bottom: .75rem; }
.ml-12   { margin-left: 12px; }
.ls-wide { letter-spacing: .05em; }
.text-info { color: var(--info); }
.text-primary { color: var(--primary); }
.accent-ok { color: var(--accent-ok, #22c55e); }
.fw-800 { font-weight: 800; }
.score-cell { font-weight: 800; font-size: 16px; }

/* progress / gauge bars */
.flex-track { flex: 1; background: var(--border); border-radius: 4px; height: 12px; overflow: hidden; }
.progress-fill-orange { height: 100%; background: var(--brand-orange); border-radius: 4px; transition: width .4s; }
.bar-thin { height: 6px; }
.bar-fill { height: 100%; }
.pct-label { font-weight: 600; min-width: 50px; }

/* badges & chips */
/* B2445: text was the hue itself (#8b5cf6 3.6:1, #3b82f6 4.0:1 on its own tint) */
.badge-purple { background: rgba(139,92,246,.15); color: var(--purple-text); }
.badge-blue { background: rgba(59,130,246,.15); color: var(--badge-info-fg); }
.badge-red { background: #E74C3C; color: #fff; }
.badge-tint { padding: 1px 8px; border-radius: 10px; margin: 1px; }
.badge-chip { padding: 1px 7px; border-radius: 99px; }
.connected-badge { background: var(--brand-solid); color: var(--on-brand); padding: 1px 6px; border-radius: 3px; margin-left: 6px; }
.level-dot { width: 24px; height: 24px; border-radius: 50%; }
.level-dot-active   { background: var(--brand-solid); color: var(--on-brand); }
.level-dot-inactive { background: var(--surface-2); color: var(--muted); }

/* table / input helpers */
.th-sev { width: 90px; }
.th-check { width: 160px; }
.num-input { width: 70px; }
.prof-input { width: 64px; padding: 2px 4px; border: 1px solid var(--border); border-radius: 4px; background: var(--card-bg); color: var(--text); }
.prof-label { font-size: 11px; color: var(--muted); margin: 0 4px; }

/* misc */
.danger-card { background: rgba(255,59,59,.1); border-left: 3px solid #ff3b3b; padding: 10px; margin: 12px 0; }
.ul-flush { margin: 6px 0 0 16px; }
.empty-note { color: var(--muted); text-align: center; padding: 24px; }
.tint-orange-card { background: rgba(var(--brand-rgb),.08); border: 1px solid rgba(var(--brand-rgb),.2); }
.audit-pad { padding: 2rem; }
.header-inline { margin-bottom: 12px; }
.title-ml { margin-left: 12px; }
.actions-row { margin-left: auto; display: flex; gap: 8px; }
.pad-1rem { padding: 1rem 1.25rem; }
.w-260 { width: 260px; }
.skill-indent { padding-left: 18px; }
.sev-chip { padding: 1px 7px; margin-right: 6px; }
.sev-high  { background: #ef4444; color: #fff; }
.sev-med   { background: #f97316; color: #fff; }
.sev-low   { background: #eab308; color: #000; }
.sev-info  { background: #6b7280; color: #fff; }
.li-2px { margin-bottom: 2px; }
.h-6 { height: 6px; }
.lang-chip-tag { border: 1px solid rgba(148,163,184,.3); padding: 2px 8px; }
.lang-chip-c0 { background: rgba(59,130,246,.15); color: var(--brand-accent); }
.lang-chip-c1 { background: rgba(34,197,94,.15); color: var(--success, #22c55e); }
.lang-chip-c2 { background: rgba(56,189,248,.15); color: var(--info, #38bdf8); }
.media-badge { color: #fff; padding: 2px 8px; border-radius: 10px; margin: 1px; }
.media-badge-call    { background: #7C3AED; }
.media-badge-chat    { background: #0EA5E9; }
.media-badge-email   { background: #059669; }
.media-badge-message { background: #D97706; }
.media-badge-all     { background: #64748B; }

/* alerts page limit bars */
.limit-bar-wrap { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; min-width: 80px; }
.limit-bar-fill { height: 100%; border-radius: 4px; }
.btn-danger-outline { border-color: #E74C3C; color: #E74C3C; }
.btn-danger-outline:hover { border-color: #E74C3C; color: #E74C3C; }

/* recording_policies toggle switch (was JS-injected -> CSP-blocked, B698) */
.toggle-switch { position: relative; display: inline-block; width: 40px; height: 20px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: #CBD5E0; border-radius: 20px; transition: .2s; }
.toggle-switch input:checked + .toggle-slider { background: var(--accent, #FF6B00); }
.toggle-slider:before { content: ""; position: absolute; height: 14px; width: 14px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(20px); }

/* mobile responsive media queries (activity, bugs — were JS-injected -> CSP-blocked, B698) */
@media (max-width: 768px) {
  .page { padding: 16px 16px 72px !important; }
  /* Was a blanket `repeat(2,1fr) !important` on every .kpi-strip regardless of its
     cols-N class — beat the rules added at the wider 1050px/900px breakpoints.
     First fix (2026-09-27) switched this to grid auto-fit, which looked right
     but only by luck of tile count (2026-09-28 TCS re-verify pass 2) — grid
     auto-fit can't fill an uneven trailing row. Flexbox, same as the 1050px/
     900px breakpoints above, actually handles any tile count. */
  .kpi-strip { display: flex !important; flex-wrap: wrap !important; }
  .kpi-strip > .kpi-tile { flex: 1 1 140px !important; }
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 6px 8px !important; }
  .toolbar { flex-direction: column; align-items: stretch !important; }
  .toolbar .flex { gap: 2px; }
  .w-140 { min-width: auto !important; width: 100%; }
  .w-260 { min-width: auto !important; width: 100%; }
  #bug-toolbar { flex-direction: column; align-items: stretch !important; }
  #bug-toolbar select { max-width: none; width: 100%; }
  #bug-count { margin-left: 0; }
}

/* ai_maturity mat-fill base (fill bar; width/color set via CSSOM data-w/data-bg) */
.mat-fill { display: block; height: 100%; border-radius: 3px; min-width: 0; }

/* ── Audit360 CX / Intelligence page utilities ─────────────────────────────── */

/* Config Change Velocity — contribution calendar */
.cc-grid { display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; overflow-x: auto; }
.cc-cell { height: 18px; border-radius: 3px; cursor: default; }
.cc-none { background: var(--bg2, #f5f5f5); }
.cc-low  { background: #f59e0b33; }
.cc-med  { background: #f59e0b; }
.cc-high { background: #ef4444; }
body.dark-mode .cc-none { background: #1e2533; }
body.dark-mode .cc-low  { background: #7c3b10; }
body.dark-mode .cc-med  { background: #c2410c; }
body.dark-mode .cc-high { background: #b91c1c; }

/* Expert Insights — two-column check cards */
.ins-checks-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .ins-checks-grid { grid-template-columns: 1fr; } }

/* AHT Detector — broken queue card */
.aht-queue-card { border: 1px solid var(--border); border-left: 4px solid var(--danger); border-radius: .5rem; padding: 1rem 1.25rem; margin: 1rem; }

/* PR Fit — eligibility heuristics grid */
.heuristics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1rem; }
@media (max-width: 640px) { .heuristics-grid { grid-template-columns: 1fr; } }

/* AI Maturity — checks grid and ladder */
/* Superseded by the template's own inline <style> (audit/ai_maturity.html), which now uses
   flexbox for the same dead-space-bug reason as .kpi-strip/.stats-grid. Left disabled here
   rather than deleted so the two don't drift silently if one gets edited without the other. */
.ai-checks-grid-DEAD-superseded-by-template-style-block { display: flex; flex-wrap: wrap; gap: 1rem; padding: 1rem; }
.ai-ladder { display: flex; flex-direction: column; gap: .35rem; }

/* Severity badge variants (consultant-label badges) */
.sev-medium { background: #f59e0b22; color: #b45309; border-radius: 4px; padding: 1px 6px; font-size: .8rem; font-weight: 600; }
.sev-low    { background: #e0f2fe;   color: #0369a1; border-radius: 4px; padding: 1px 6px; font-size: .8rem; font-weight: 600; }

/* ── Menu Config page (B845) ─────────────────────────────────────── */
.mc-card { max-width: 640px; }
.mc-card-header { justify-content: space-between; align-items: center; }
.mc-btn-row { display: flex; gap: 8px; }
.mc-info { font-size: 12px; margin-bottom: 16px; }
.mc-section { margin-bottom: 20px; }
.mc-section-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
/* B1280 (2026-09-15): "favorite" pin-to-top feature -- the row now shares
   its line with a star toggle button, so .mc-row lost its own flex:1 and
   gained a wrapper that distributes the two. */
.mc-row-wrap { display: flex; align-items: center; gap: 4px; }
.mc-row-wrap .mc-row { flex: 1; }
.mc-fav-btn {
  background: none; border: none; cursor: pointer;
  font-size: 16px; line-height: 1; padding: 6px 8px;
  border-radius: 6px; color: var(--muted); flex-shrink: 0;
}
.mc-fav-btn:hover { background: var(--hover); color: var(--text); }
.mc-fav-btn.is-fav { color: var(--brand-orange, #FF6B00); }
.mc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 4px;
  cursor: pointer;
  border-radius: 6px;
  transition: background .1s;
}
.mc-row:hover { background: var(--hover); }
.mc-row input[type=checkbox] {
  width: 16px; height: 16px;
  cursor: pointer;
  accent-color: var(--brand-accent);
  flex-shrink: 0;
}
.mc-icon { font-size: 15px; display: inline-flex; align-items: center; }
.mc-icon svg { width: 15px; height: 15px; }
.mc-section-title svg { width: 13px; height: 13px; vertical-align: -2px; }
.mc-label { flex: 1; font-size: 14px; }
.mc-row-disabled {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 4px;
  border-radius: 6px;
  opacity: .5;
  cursor: not-allowed;
}
.mc-disabled-cb { width: 16px; height: 16px; accent-color: var(--brand-accent); flex-shrink: 0; }
.mc-always-tag { font-size: 11px; color: var(--muted); }
.mc-saved-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--brand-accent);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  display: none;
}
/* Sidebar Config section separator */
.sidebar-section-config {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* Audit360 sidebar — fixed 248px regardless of Config360 sidebar toggle state */
#audit-sidebar { width: 248px; z-index: 200; }

/* CX Overview division filter select */
.cx-select {
  font-size: .82rem;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  outline: none;
  cursor: pointer;
}
.cx-select:focus { border-color: var(--brand-accent); }

/* Audit run progress bar + log panel (Issue 2 — moved from inline style=) */
.progress-track{height:10px;border-radius:5px;background:var(--border);}
#progress-bar{height:100%;border-radius:5px;background:var(--brand-orange);width:0%;transition:width .4s ease;}
.run-log-pre{max-height:320px;overflow-y:auto;white-space:pre-wrap;word-break:break-all;}
.details-no-select>summary{user-select:none;}

/* Empty-state table cells in JS-built tables (Issue 3 — replaces inline style= in JS strings) */
.tbl-empty{color:#94a3b8;text-align:center;padding:12px;}
.tbl-empty-sm{color:#94a3b8;text-align:center;padding:8px;}

/* Queue Heatmap layout helpers (Issue 5 — moved from inline style=) */
.hm-controls-row{margin-bottom:1rem;align-items:center;}
.hm-org-card{margin-bottom:1rem;}
.hm-scroll{overflow-x:auto;}
.hm-insight-text{margin-top:8px;}
.hm-queue-search{margin-bottom:0.5rem;}
.hm-queue-select{margin-bottom:0.75rem;}
.hm-queue-peak{margin-top:0.5rem;}

/* Heat map grid table (2026-09-22 — moved here from queue_heatmap.html's own
   local <style> block so Agent Heatmap, which reuses the same .hm-table
   markup, gets the identical styling instead of an unstyled default table). */
.hm-table { border-collapse: collapse; font-size: 0.72rem; }
.hm-table th { padding: 2px 6px; text-align: center; color: var(--muted); font-weight: 500; }
.hm-table td { width: 28px; height: 22px; text-align: center; border: 1px solid var(--border); font-size: 0.6875rem; } /* B2211: at least 11 px */
.hm-label { padding: 2px 8px; text-align: right; color: var(--muted); font-weight: 500; white-space: nowrap; }
/* 2026-09-22, direct user request: keep the day-of-week column (and the
   header's own corner cell) visible while scrolling right through a wide
   grid (e.g. 365d at 15-min slots = 96 columns) instead of it scrolling
   out of view with everything else. */
.hm-table thead th:first-child, .hm-table td.hm-label { position: sticky; left: 0; background: var(--card-bg); }
.hm-table thead th:first-child { z-index: 3; }
.hm-table td.hm-label { z-index: 2; }
.hm-legend { display:flex; align-items:center; gap:8px; margin-top:8px; font-size:.75rem; flex-wrap:wrap; }
.hm-legend-item { display:flex; align-items:center; gap:4px; }
.hm-legend-swatch { width:18px; height:12px; border:1px solid var(--border); border-radius:2px; }
/* B2130: report clarity — legend unit, "how to read" line, marked busiest /
   worst cell (outline + marker, so it reads in print and in greyscale too). */
.hm-legend-unit { color: var(--muted); font-weight: 500; }
.hm-howto { margin-top: 4px; }
.hm-table td.hm-cell-mark { outline: 2px solid var(--text); outline-offset: -2px; font-weight: 700; }
.hm-mark-key { display:inline-flex; align-items:center; gap:4px; }
.hm-mark-key-box { width:18px; height:12px; border:2px solid var(--text); border-radius:2px; }
.hm-gap-explain { margin: 4px 0 8px; }
/* B2255 — Queue Heatmap "Compare years" */
.hm-year-block { margin-top: 1rem; }
.hm-year-title { margin: 0 0 4px; font-size: .9rem; }
.hm-year-pair { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.hm-year-pair > div { min-width: 0; max-width: 100%; }
td.hm-ab-ok { background: var(--success-bg); }
td.hm-ab-warn { background: var(--warning-bg); }
td.hm-ab-high { background: var(--warning-bg); font-weight: 600; }
td.hm-ab-crit { background: var(--danger-bg); font-weight: 600; }

/* B936 — datatable keyword search: matched-field display */
.dt-kv { display: inline-flex; gap: 4px; margin: 2px 12px 2px 0; align-items: baseline; max-width: 100%; }
.dt-kv-k { color: var(--muted); font-size: 11px; white-space: nowrap; }
.dt-kv-v { font-size: 12.5px; word-break: break-word; }
.dt-kv-v mark, .dt-detail-table mark, #dt-search-tbody .mono mark {
  background: rgba(255, 199, 0, .35); color: inherit; font-weight: 700; padding: 0 1px; border-radius: 3px;
}
body.dark-mode .dt-kv-v mark, body.dark-mode .dt-detail-table mark, body.dark-mode #dt-search-tbody .mono mark {
  background: rgba(255, 199, 0, .22);
}
.dt-kv-more, .dt-kv-note { color: var(--muted); font-size: 11px; font-style: italic; margin-right: 10px; }
.dt-search-detail > td { background: var(--surface-2); padding: 8px 14px; }
.dt-detail-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.dt-detail-table td { padding: 3px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.dt-detail-table tr:last-child td { border-bottom: none; }
.dt-detail-table td:first-child { width: 220px; color: var(--muted); white-space: nowrap; }

/* B978 — datatables.html peek-button cell width (last inline style= removed for CSP) */
.w-40td { width: 40px; }

/* B981 — datatable actions cell (peek + rows-CSV buttons side by side) */
.dt-actions-cell { width: 74px; white-space: nowrap; }
.dt-actions-cell .dt-peek-btn + .dt-peek-btn { margin-left: 4px; }

/* B1008 — flash message stack (main shell) */
.flash-stack { position: fixed; top: 96px; left: 50%; transform: translateX(-50%); z-index: 5000; width: min(640px, 90vw); }
.flash-stack .alert { box-shadow: 0 8px 24px rgba(0,0,0,.18); margin-bottom: 8px; }

/* B1727: simulated-data marker on live boards (Demo Mode). Fixed so it stays
   on screen in Present mode and kiosk links. */
.sim-chip { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 10000;
  background: var(--warning); color: #111827; font-size: 12px; font-weight: 800; letter-spacing: .08em;
  padding: 4px 12px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0,0,0,.35); pointer-events: auto; }

/* B1867: AND / OR / AND NOT word in front of each Tag-by-Rule condition */
.tr-join { min-width: 5.5em; align-self: center; white-space: nowrap; }

/* ── B1865 app shell ──────────────────────────────────────────────────────────
   Sortable table headers (static/app.js MBSortHeaders): a Tab stop with a visible focus
   ring; Enter / Space sort like a click. */
th[data-sort] { cursor: pointer; }
th[data-sort]:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: -2px; }
/* "Your session has expired" banner (base.html keep-alive) — was inline cssText. */
.session-expiry-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 99999;
  background: #7C2D12; color: #FFFFFF; padding: 10px 16px; font: 14px/1.4 Inter, sans-serif;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.session-expiry-btn {
  background: #FFFFFF; color: #7C2D12; border: none; border-radius: 4px;
  padding: 4px 12px; cursor: pointer; font-weight: 600;
}
.session-expiry-btn:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 2px; }

/* ── B1972: shared "More options" menu for live-page toolbars ──────────────
   Everyday controls stay in the toolbar; the rest sits in this <details>
   (keyboard-native: Tab to the summary, Enter/Space opens it). Tokens only. */
.mb-more { position: relative; display: inline-block; }
.mb-more > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; font-size: .82rem; font-weight: 600; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; user-select: none;
}
.mb-more > summary::-webkit-details-marker { display: none; }
.mb-more > summary::after { content: "▾"; font-size: .7rem; color: var(--muted); }
.mb-more[open] > summary { border-color: var(--brand-orange); color: var(--text); }
.mb-more > summary:focus-visible { outline: 2px solid var(--brand-orange); outline-offset: 2px; }
.mb-more-count { font-size: .72rem; font-weight: 700; padding: 0 7px; border-radius: 10px;
  background: var(--badge-info-bg); color: var(--badge-info-fg); }
.mb-more-count:empty { display: none; }
.mb-more-panel {
  position: absolute; z-index: 50; top: calc(100% + 6px); left: 0; min-width: 260px; max-width: min(92vw, 420px);
  display: flex; flex-direction: column; gap: 10px; padding: 12px 14px;
  background: var(--card-bg); color: var(--text); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-md);
}
.mb-more--right .mb-more-panel { left: auto; right: 0; }   /* a menu at the end of a toolbar opens leftwards */
.mb-more-panel .mb-more-group { display: flex; flex-direction: column; gap: 6px; }
.mb-more-panel .mb-more-lbl { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.mb-more-panel .input-field { width: 100%; min-width: 0; }
.mb-more-panel .mb-more-text { font-size: .8rem; line-height: 1.45; color: var(--text-2); margin: 0; }
/* B2375: a menu inside a table row opens in place (an absolute panel would be
   clipped by .table-wrap's overflow); the row only grows while it is open. */
.mb-more--inline .mb-more-panel { position: static; margin-top: 6px; min-width: 0; box-shadow: none; }
.mb-more-panel .btn { justify-content: flex-start; }

/* B2375: compact KPI strip for pages whose table must start above the fold. */
.kpi-strip.kpi-compact { gap: 8px; margin-bottom: 10px; }
.kpi-strip.kpi-compact .kpi-tile { min-height: 0; padding: 8px 12px; gap: 2px; }
.kpi-strip.kpi-compact .kpi-val { font-size: 18px; }
.kpi-strip.kpi-compact .kpi-label { font-size: 10px; }
.action-bar.action-bar-compact { padding: 8px 12px; margin-bottom: 10px; align-items: center; }
/* B2375: admin user rows — role controls on one line */
.admin-role-ctl { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.admin-role-ctl .form-control { width: auto; min-width: 0; padding: 3px 6px; }
.admin-row-actions { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; }


/* B2312: Data Tables row viewer (drawer + full-screen modal) — classes instead of
   inline style="" attributes, which the CSP (no 'unsafe-inline' for style-src) drops. */
.dtv-head { display: flex; justify-content: space-between; align-items: center; }
.dtv-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; margin-top: 8px; }
.dtv-table-sm { font-size: 12px; }
.btn.dtv-del-btn { padding: 3px 7px; font-size: 11px; display: inline-flex; align-items: center; gap: 4px; }
.dtv-pager { display: flex; gap: 6px; margin-top: 10px; align-items: center; flex-wrap: wrap; }
.btn.dtv-page-active { background: var(--brand-orange); color: #fff; border-color: var(--brand-orange); }
.dtv-add { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.dtv-add-title { margin-bottom: 8px; }
.dtv-add-row { display: flex; gap: 8px; flex-wrap: wrap; }
.dtv-input-key { min-width: 120px; }
.dtv-input-col { min-width: 100px; }
.dtv-m-title { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.dtv-m-sub { font-size: 11px; color: var(--text-2); margin-top: 3px; }
.dtv-m-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.dtv-m-close { background: none; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 18px;
  color: var(--text-2); width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; }
.dtv-center { display: flex; align-items: center; justify-content: center; height: 100%; }
.dtv-pad { padding: 24px; }
.dtv-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-2);
  flex-direction: column; gap: 8px; }
.dtv-wide { min-width: 100%; }
.dtv-muted { color: var(--text-2); }

/* B2373: a filter changed but Run analysis not pressed yet (static/js/run_filters.js) */
.mb-run-changed { box-shadow: 0 0 0 2px var(--warning); }
.mb-run-note { font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 12px;
  background: var(--badge-warn-bg); color: var(--badge-warn-fg); align-self: center; }
.mb-run-note[hidden] { display: none; }
.mb-run-stale { opacity: .55; transition: opacity .15s; }

/* B2375: Queue Interaction Type -- the Breakdown column was cut off at 1366 px */
#qcp-table th, #qcp-table td { padding: 9px 10px; }
#qcp-table th { white-space: normal; }
