﻿/* ==========================================================================
   AIR Theme — erNavigator AIR SPA Stylesheet

   DESIGN TOKENS (see :root below):
     --navy, --navy-light, --navy-hover  Primary dark palette
     --accent, --accent-light            Interactive blue
     --bg, --white                       Backgrounds
     --text, --muted, --light            Text hierarchy
     --success, --warning, --danger      Semantic states (+ -bg variants)
     --border                            Dividers and input borders
     --radius (12px)                     Standard border-radius
     --shadow, --shadow-md               Elevation levels

   ADDING NEW STYLES:
     - Always use existing tokens. Never hardcode hex values.
     - Reuse existing classes (.btn, .card, .fg, .g2, .g3, .alert, etc.)
     - New class names must use kebab-case with a semantic prefix.
     - See air-style-guide.md for full conventions.
   ========================================================================== */

/* 1. Google Fonts
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=DM+Serif+Display&family=Quicksand:wght@500;600;700&display=swap');

/* 2. Reset + Design Tokens
   ========================================================================== */
* {
  box-sizing:border-box;
  margin:0;
  padding:0
}
:root {
  --navy:#0f1f3d;
  --navy-light:#1a3460;
  --navy-hover:#243d6e;
  /* Menu (sidebar) palette — overridable per-client from System Admin.
     Defaults keep the original navy look. */
  --menu-bg:var(--navy);
  --menu-field-bg:transparent;
  --menu-field-hover:rgba(255,255,255,.07);
  --menu-field-text:rgba(255,255,255,.58);
  --menu-field-text-hover:#fff;
  --accent:#2563eb;
  --accent-light:#eff6ff;
  --accent-alt:#0d9488;   /* teal — a distinct SECOND accent (e.g. the specialist-cases total card) */
  --bg:#f4f6fa;
  --white:#fff;
  --border:#e2e8f0;
  --text:#1e293b;
  --muted:#64748b;
  --light:#94a3b8;
  --success:#16a34a;
  --success-bg:#f0fdf4;
  --warning:#d97706;
  --warning-bg:#fffbeb;
  --danger:#dc2626;
  --danger-bg:#fef2f2;
  /* Five-level risk palette (Risk Score panel + case-table risk field) */
  --risk-low:#16a34a;        /* green */
  --risk-medium:#eab308;     /* yellow */
  --risk-high:#f97316;       /* orange */
  --risk-veryhigh:#dc2626;   /* red */
  --risk-critical:#7f1d1d;   /* dark red */
  /* Soft (tinted background) variants — used by the Risk Manager cards/bands */
  --risk-low-soft:#dcfce7;
  --risk-medium-soft:#fef9c3;
  --risk-high-soft:#ffedd5;
  --risk-veryhigh-soft:#fee2e2;
  --risk-critical-soft:#fecaca;
  --radius:12px;
  --shadow:0 1px 3px rgba(0,0,0,.08),0 4px 16px rgba(0,0,0,.04);
  --shadow-md:0 4px 12px rgba(0,0,0,.1),0 8px 32px rgba(0,0,0,.06)
}
body {
  font-family:'DM Sans',sans-serif;
  background:var(--bg);
  color:var(--text);
  display:flex;
  min-height:100vh;
  font-size:14px
}
#sidebar {
  width:232px;
  min-width:232px;
  background:var(--menu-bg);
  display:flex;
  flex-direction:column;
  position:fixed;
  top:0;
  left:0;
  height:100vh;
  z-index:100
}
.sb-brand {
  padding:22px 20px 18px;
  border-bottom:1px solid rgba(255,255,255,.08)
}
.sb-brand h1 {
  font-family:'DM Serif Display',serif;
  color:#fff;
  font-size:19px;
  font-weight:400
}
.sb-brand p {
  color:rgba(255,255,255,.38);
  font-size:11px;
  margin-top:2px
}
.sb-client {
  padding:10px 14px;
  background:rgba(255,255,255,.07);
  margin:12px 12px 0;
  border-radius:8px;
  cursor:pointer
}
.sb-client label {
  color:rgba(255,255,255,.35);
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.8px
}
.sb-client-name {
  color:#fff;
  font-size:13px;
  font-weight:600;
  margin-top:2px
}
nav {
  padding:14px 10px;
  flex:1;
  overflow-y:auto
}
/* Sidebar menu scrollbar — follows the client's menu palette (--menu-scrollbar, set by
   applyMenuTheme when a custom theme is applied); with no theme it falls back to the brand accent. */
#sidebar nav { scrollbar-width:thin; scrollbar-color:var(--menu-scrollbar, var(--accent)) transparent; }
#sidebar nav::-webkit-scrollbar { width:8px; }
#sidebar nav::-webkit-scrollbar-track { background:transparent; }
#sidebar nav::-webkit-scrollbar-thumb { background:var(--menu-scrollbar, var(--accent)); border-radius:8px; }
#sidebar nav::-webkit-scrollbar-thumb:hover { background:var(--menu-scrollbar, var(--accent-hover, var(--accent))); }
.nav-label {
  color:rgba(255,255,255,.22);
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.9px;
  padding:4px 10px 6px;
  margin-top:6px
}
.nav-item {
  display:flex;
  align-items:center;
  gap:9px;
  padding:8px 10px;
  border-radius:8px;
  color:var(--menu-field-text);
  cursor:pointer;
  font-size:13px;
  font-weight:500;
  transition:all .14s;
  margin-bottom:1px;
  background:var(--menu-field-bg)
}
.nav-item:hover {
  background:var(--menu-field-hover);
  color:var(--menu-field-text-hover)
}
.nav-item.active {
  background:#fff;
  color:var(--navy);
  font-weight:700
}
.nav-item .ni {
  width:16px;
  text-align:center;
  font-size:13px
}
.nav-item .nbadge {
  margin-left:auto;
  background:var(--danger);
  color:#fff;
  border-radius:10px;
  padding:1px 7px;
  font-size:10px;
  font-weight:700
}
.nav-item.active .nbadge {
  background:var(--navy)
}
.sb-footer {
  padding:14px 16px;
  border-top:1px solid rgba(255,255,255,.08)
}
.sb-user {
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-bottom:10px
}
.sb-user-top {
  display:flex;
  align-items:center;
  gap:9px
}
.sb-user-top .sb-user-name {
  flex:1;
  min-width:0
}
.sb-user-bottom {
  display:flex;
  align-items:center;
  gap:9px
}
.sb-user-bottom .sb-user-role {
  flex:1;
  min-width:0
}
.avatar {
  width:30px;
  height:30px;
  border-radius:50%;
  background:var(--accent);
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  font-size:11px;
  font-weight:700;
  flex-shrink:0
}
.sb-user-name {
  color:#fff;
  font-size:12px;
  font-weight:600;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis
}
.sb-user-role {
  color:rgba(255,255,255,.62);
  font-size:11px;
  white-space:normal;
  overflow:visible;
  word-break:break-word
}
/* User availability indicator (sidebar) */
.sb-avail {
  display:flex;
  align-items:center;
  gap:5px;
  flex-shrink:0;
  cursor:pointer;
  font-size:9px;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
  color:rgba(255,255,255,.5);
  padding:3px 7px;
  border-radius:11px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.08);
  transition:background .15s, color .15s
}
.sb-avail:hover {
  background:rgba(255,255,255,.13);
  color:rgba(255,255,255,.8)
}
.sb-avail-dot {
  width:8px;
  height:8px;
  border-radius:50%;
  flex-shrink:0;
  background:var(--success);
  box-shadow:0 0 0 2px rgba(22,163,74,.25)
}
.sb-avail.is-away {
  color:var(--warning)
}
.sb-avail.is-away .sb-avail-dot {
  background:var(--warning);
  box-shadow:0 0 0 2px rgba(217,118,6,.3)
}
.perm-box {
  background:rgba(255,255,255,.06);
  border-radius:7px;
  padding:9px 11px
}
.perm-box strong {
  color:rgba(255,255,255,.38);
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.7px;
  display:block;
  margin-bottom:3px
}
.perm-box p {
  color:rgba(255,255,255,.36);
  font-size:11px;
  line-height:1.5
}
#main {
  margin-left:232px;
  flex:1;
  display:flex;
  flex-direction:column;
  min-height:100vh
}
.topbar {
  background:var(--white);
  border-bottom:1px solid var(--border);
  padding:0 28px;
  height:58px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  position:sticky;
  top:0;
  z-index:50
}
.topbar-left h2 {
  font-size:20px;
  font-weight:700
}
.topbar-left p {
  font-size:11px;
  color:var(--muted);
  margin-top:1px
}
.topbar-right {
  display:flex;
  gap:9px;
  align-items:center
}
.btn {
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:7px 15px;
  border-radius:8px;
  font-size:13px;
  font-weight:600;
  cursor:pointer;
  border:none;
  transition:all .14s;
  font-family:'DM Sans',sans-serif;
  line-height:1
}
.btn-primary {
  background:var(--navy);
  color:#fff
}
.btn-primary:hover {
  background:var(--navy-light)
}
.btn-secondary {
  background:var(--white);
  color:var(--text);
  border:1.5px solid var(--border)
}
.btn-secondary:hover {
  background:var(--bg)
}
.btn-accent {
  background:var(--accent);
  color:#fff
}
.btn-accent:hover {
  background:#1d4ed8
}
.btn-success {
  background:var(--success);
  color:#fff
}
.btn-danger {
  background:var(--danger);
  color:#fff
}
.btn-warning {
  background:var(--warning);
  color:#fff
}
.btn-warning:hover {
  background:#b45309
}
.btn-xs {
  padding:3px 8px;
  font-size:11px
}
#content {
  /* Generous bottom clearance so action buttons at the foot of a long page (e.g. the
     investigation choice, Complete Step) are never jammed against the viewport edge /
     the fixed chat button, and the page scrollbar always has room to reveal them. */
  padding:28px 28px 96px;
  flex:1
}
.card {
  background:var(--white);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:22px
}
.card-sm {
  padding:14px 18px
}
.stats-row {
  display:grid;
  /* Fit as many tiles across as the width allows (was a fixed 4 columns, so a 5th tile
     wrapped to a second line). auto-fit keeps them on one row when they fit. */
  grid-template-columns:repeat(auto-fit,minmax(178px,1fr));
  gap:14px;
  margin-bottom:22px
}
.stat-card {
  background:var(--white);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:18px 22px
}
/* Blue highlight on the report From/To date inputs when a custom range (not a side preset)
   is the active reporting period. */
.rpt-date-active {
  border-color:var(--accent) !important;
  background:var(--accent-light) !important;
  color:var(--accent) !important;
  font-weight:700
}
.stat-label {
  font-size:11px;
  color:var(--muted);
  font-weight:500;
  text-transform:uppercase;
  letter-spacing:.5px
}
.stat-value {
  font-size:34px;
  font-weight:700;
  color:var(--text);
  margin-top:5px;
  line-height:1
}
.stat-sub {
  font-size:11px;
  color:var(--muted);
  margin-top:5px
}
table {
  width:100%;
  border-collapse:collapse
}
th {
  font-size:11px;
  font-weight:600;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.5px;
  padding:9px 14px;
  text-align:left;
  border-bottom:1.5px solid var(--border)
}
td {
  padding:12px 14px;
  border-bottom:1px solid var(--border);
  font-size:13px
}
tr:last-child td {
  border-bottom:none
}
tr:hover td {
  background:#fafbfd
}
/* Sticky table headings on My Cases + Case View. Relying on the window as the scroll container
   proved unreliable in the deployed app, so the CARD itself becomes the scroll container (its
   own max-height + overflow) and the header sticks to the TOP OF THE CARD — which works
   regardless of the outer page layout. A solid background stops rows showing through; the
   box-shadow re-creates the header's bottom divider (a collapsed border drops while sticky). */
#page-mycases .card,
#page-casehistory .card {
  max-height:calc(100vh - 200px);
  overflow:auto;
  /* No TOP padding: overflow clips at the card border, so any top padding becomes a band
     above the sticky header where scrolled rows show through (tester). The header sticks
     flush to the card top instead; the th keeps its own padding for breathing room. */
  padding-top:0
}
#page-mycases .card table thead th,
#page-casehistory .card table thead th {
  position:sticky;
  top:0;
  z-index:3;
  background:var(--white);
  /* A little top padding INSIDE the sticky header restores the breathing room removed from
     the card, and moves with the header so nothing shows above it. */
  padding-top:14px;
  box-shadow:inset 0 -1.5px 0 var(--border)
}
/* Worklist pages (My Cases + Case View): the TABLE card is the ONLY scroll — the outer page
   scrollbar is removed so there are never two scrollbars. body.page-fixed is toggled in showPage()
   for these two pages only (every other page keeps the normal outer scroll); the outer scroll is
   switched off and mcFitFixedCard() sizes the card's max-height to exactly fill the viewport so
   nothing is clipped. The card keeps its max-height + overflow scroll (sticky header relies on it). */
body.page-fixed { overflow:hidden }
body.page-fixed #main { min-height:0; height:100vh }
body.page-fixed #content { overflow:hidden; padding-bottom:28px; display:flex; flex-direction:column }
/* The visible worklist page and its table card fill the remaining height via flex, so the card's
   OWN overflow scrolls and the bottom rows can never be clipped by #content's overflow:hidden.
   This replaces a fragile JS max-height measurement (mcFitFixedCard) that mis-sized at some screen
   resolutions and when the group entity-filter bar changed the card's offset — leaving the last
   cases cut off at the bottom of My Cases (recurring tester report). Pure CSS = no timing race. */
body.page-fixed #page-mycases,
body.page-fixed #page-casehistory { flex:1 1 auto; min-height:0; display:flex; flex-direction:column }
body.page-fixed #page-mycases .card:not(.card-sm),
body.page-fixed #page-casehistory .card:not(.card-sm) { flex:1 1 auto; min-height:0; max-height:none }
.case-link {
  font-weight:700;
  color:var(--accent);
  cursor:pointer
}
.case-link:hover {
  text-decoration:underline
}
.rbadge {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:72px;
  padding:2px 9px;
  border-radius:20px;
  font-size:11px;
  font-weight:600;
  text-align:center
}
.r-low {
  background:var(--risk-low);
  color:var(--white)
}
.r-medium {
  background:var(--risk-medium);
  color:var(--text)
}
.r-high {
  background:var(--risk-high);
  color:var(--white)
}
.r-veryhigh {
  background:var(--risk-veryhigh);
  color:var(--white)
}
.r-critical {
  background:var(--risk-critical);
  color:var(--white)
}
.r-na {
  background:var(--bg);
  color:var(--muted);
  border:1px solid var(--border)
}
/* AI confidence badge — standardised Low / Medium / High, white text reversed out on the colour
   (High = green, Medium = orange, Low = red) so every confidence reads the same everywhere. */
.conf-badge {
  display:inline-block;
  padding:2px 10px;
  border-radius:20px;
  font-size:11px;
  font-weight:700;
  color:var(--white)
}
.conf-high {
  background:var(--success)
}
.conf-med {
  background:var(--warning)
}
.conf-low {
  background:var(--danger)
}
.sbadge {
  display:inline-flex;
  padding:2px 9px;
  border-radius:20px;
  font-size:11px;
  font-weight:600
}
.s-active {
  background:#dbeafe;
  color:#1e40af
}
.s-closed {
  background:#f1f5f9;
  color:#475569
}
.s-pending {
  background:#fdf4ff;
  color:#7e22ce
}
.s-readonly {
  background:#f1f5f9;
  color:#475569
}
.s-noncomp {
  background:var(--danger);
  color:var(--white);
  font-weight:800;
  font-size:12px;
  padding:3px 12px;
  letter-spacing:.3px;
  box-shadow:0 1px 3px var(--danger-bg);
  animation:ncPulse 2.2s ease-in-out infinite;
}
@keyframes ncPulse{ 0%,100%{ opacity:1; } 50%{ opacity:.7; } }
@media (prefers-reduced-motion: reduce){ .s-noncomp{ animation:none; } }
.cc-flash{ animation:ccFlash 1.6s ease; }
@keyframes ccFlash{ 0%,100%{ box-shadow:none; } 20%,60%{ box-shadow:0 0 0 3px var(--danger); } }
.s-inactive {
  background:#fee2e2;
  color:#b91c1c
}
.s-expired {
  background:#fef3c7;
  color:#92400e
}
.s-done {
  background:#dcfce7;
  color:#166534
}
.g2 {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px
}
.g3 {
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:14px
}
.insight-card {
  background:var(--white);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:18px
}
.insight-card h4 {
  font-size:13px;
  font-weight:700;
  margin-bottom:6px
}
.insight-card p {
  font-size:12px;
  color:var(--muted);
  line-height:1.6
}
.intake-layout {
  display:grid;
  grid-template-columns:1fr 380px;
  gap:22px
}
.intake-panel {
  background:var(--white);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:26px
}
.intake-panel h3 {
  font-size:16px;
  font-weight:700;
  margin-bottom:18px
}
.assess-panel {
  background:var(--white);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:26px;
  position:sticky;
  top:70px
}
.assess-panel h3 {
  font-size:16px;
  font-weight:700;
  margin-bottom:18px
}
.assess-item {
  border:1.5px solid var(--border);
  border-radius:8px;
  padding:12px 14px;
  margin-bottom:10px
}
.assess-item .al {
  font-size:10px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.7px;
  color:var(--muted);
  margin-bottom:3px
}
.assess-item .av {
  font-size:13px;
  font-weight:600
}
.assess-item.hl {
  border-color:var(--accent);
  background:var(--accent-light)
}
.assess-item.hl .al {
  color:var(--accent)
}
.fg {
  margin-bottom:14px
}
.fg label {
  display:block;
  font-size:11px;
  font-weight:600;
  color:var(--muted);
  margin-bottom:5px;
  text-transform:uppercase;
  letter-spacing:.5px
}
/* User add/edit form — headings shown bold (heavier + darker than the default muted label).
   Excludes checkbox toggle labels (Can Proxy, Auto Case, …). */
.uf-form .fg > label:not(.checkbox-label) {
  font-weight:800;
  color:var(--text)
}
input[type=text],input[type=email],input[type=password],input[type=date],input[type=time],input[type=number],textarea,select {
  width:100%;
  padding:9px 13px;
  border:1.5px solid var(--border);
  border-radius:8px;
  font-size:13px;
  font-family:'DM Sans',sans-serif;
  color:var(--text);
  background:var(--bg);
  outline:none;
  transition:border .14s
}
input:focus,textarea:focus,select:focus {
  border-color:var(--accent);
  background:#fff
}
textarea {
  resize:vertical;
  min-height:100px
}
.case-layout {
  display:grid;
  grid-template-columns:1fr 320px;
  gap:22px;
  align-items:start
}
.case-right {
  position:sticky;
  top:70px;
  display:flex;
  flex-direction:column;
  gap:14px
}
.steps-bar {
  display:flex;
  align-items:center;
  overflow-x:auto;
  padding-bottom:4px
}
.step-node {
  display:flex;
  align-items:center;
  gap:6px;
  cursor:pointer;
  white-space:nowrap;
  padding:4px 6px;
  border-radius:7px;
  transition:background .13s
}
.step-node:hover {
  background:var(--bg)
}
.step-node.locked-other {
  cursor:not-allowed;
  opacity:.5
}
.step-circle {
  width:22px;
  height:22px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:10px;
  font-weight:700;
  flex-shrink:0
}
.step-done .step-circle {
  background:var(--success);
  color:#fff
}
.step-active .step-circle {
  background:var(--accent);
  color:#fff;
  box-shadow:0 0 0 3px rgba(37,99,235,.2)
}
.step-pending .step-circle {
  background:var(--border);
  color:var(--muted)
}
.step-node span {
  font-size:11px;
  font-weight:600
}
.step-done span {
  color:var(--success)
}
.step-active span {
  color:var(--accent)
}
.step-pending span {
  color:var(--muted)
}
.step-line {
  width:24px;
  height:2px;
  background:var(--border);
  flex-shrink:0
}
.step-line.done {
  background:var(--success)
}
.chat-box {
  border:1.5px solid var(--border);
  border-radius:10px;
  padding:14px;
  overflow-y:auto;
  display:flex;
  flex-direction:column;
  gap:13px;
  background:#fafbfd
}
.msg {
  display:flex;
  gap:9px;
  max-width:90%
}
.msg.user {
  align-self:flex-end;
  flex-direction:row-reverse
}
.msg-bub {
  padding:10px 14px;
  border-radius:10px;
  font-size:13px;
  line-height:1.6
}
.msg.ai .msg-bub {
  background:var(--white);
  border:1.5px solid var(--border);
  border-radius:4px 10px 10px 10px
}
.msg.user .msg-bub {
  background:var(--navy);
  color:#fff;
  border-radius:10px 4px 10px 10px
}
.msg-av {
  width:28px;
  height:28px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
  font-weight:700;
  flex-shrink:0;
  margin-top:2px
}
.msg.ai .msg-av {
  background:var(--accent-light);
  color:var(--accent);
  border:1.5px solid var(--accent)
}
.msg.user .msg-av {
  background:var(--navy-light);
  color:#fff
}
.ro-bubble {
  background:#f8fafc;
  border:1.5px solid var(--border);
  border-radius:10px;
  padding:14px;
  font-size:13px;
  line-height:1.7;
  color:var(--text)
}
.ctx-panel {
  background:var(--white);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:18px
}
.ctx-panel h4 {
  font-size:12px;
  font-weight:700;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.6px;
  margin-bottom:13px
}
/* Collapsible context panels */
.ctx-panel h4.ctx-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px
}
.ctx-toggle {
  flex:0 0 auto;
  text-transform:none;
  letter-spacing:0
}
.ctx-body.collapsed {
  display:none
}
.ctx-panel:has(.ctx-body.collapsed) .ctx-head {
  margin-bottom:0 !important
}
.ctx-row {
  margin-bottom:10px;
  padding-bottom:10px;
  border-bottom:1px solid var(--border)
}
.ctx-row:last-child {
  border-bottom:none;
  margin-bottom:0;
  padding-bottom:0
}
.ctx-lbl {
  font-size:10px;
  font-weight:700;
  color:var(--light);
  text-transform:uppercase;
  letter-spacing:.6px;
  margin-bottom:2px
}
.ctx-val {
  font-size:12px;
  font-weight:600;
  color:var(--text);
  line-height:1.5
}
.ctx-tag {
  display:inline-flex;
  padding:2px 7px;
  border-radius:5px;
  font-size:10px;
  font-weight:600;
  background:var(--accent-light);
  color:var(--accent);
  margin:1px
}
.ctx-person {
  display:flex;
  align-items:center;
  gap:7px;
  margin-bottom:5px;
  font-size:12px
}
.ctx-person .mini-av {
  width:22px;
  height:22px;
  border-radius:50%;
  background:linear-gradient(135deg,var(--accent),var(--navy));
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:9px;
  font-weight:700;
  flex-shrink:0
}
.doc-item {
  display:flex;
  align-items:center;
  gap:6px;
  font-size:11px;
  padding:4px 0;
  border-bottom:1px solid var(--border);
  color:var(--text)
}
.doc-item:last-child {
  border-bottom:none
}
.meeting-item {
  background:var(--bg);
  border-radius:7px;
  padding:8px 10px;
  margin-bottom:6px;
  font-size:11px
}
.meeting-item .mt {
  font-weight:700;
  font-size:12px;
  margin-bottom:2px
}
.meeting-item .ms {
  color:var(--muted)
}
.summary-box {
  background:#f8fafc;
  border-radius:8px;
  padding:12px;
  font-size:12px;
  line-height:1.7;
  color:var(--text)
}
.emp-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(270px,1fr));
  gap:14px
}
.emp-card {
  background:var(--white);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:18px;
  cursor:pointer;
  transition:box-shadow .14s,transform .14s
}
.emp-card:hover {
  box-shadow:var(--shadow-md);
  transform:translateY(-1px)
}
.emp-av {
  width:40px;
  height:40px;
  border-radius:50%;
  background:linear-gradient(135deg,var(--accent),var(--navy));
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  font-size:14px;
  font-weight:700
}
.emp-name {
  font-size:14px;
  font-weight:700
}
.emp-num {
  font-size:11px;
  color:var(--muted)
}
.emp-status {
  display:inline-flex;
  padding:2px 8px;
  border-radius:20px;
  font-size:10px;
  font-weight:700;
  text-transform:uppercase
}
.es-employed {
  background:#dcfce7;
  color:#15803d
}
.es-suspended {
  background:#fef3c7;
  color:#92400e
}
.es-dismissed {
  background:#fee2e2;
  color:#b91c1c
}
.es-resigned,.es-retired,.es-retrenched {
  background:#f1f5f9;
  color:#475569
}
.setup-tabs {
  display:flex;
  gap:3px;
  background:var(--bg);
  border-radius:8px;
  padding:4px;
  margin-bottom:20px
}
.setup-tab {
  padding:7px 14px;
  border-radius:6px;
  font-size:13px;
  font-weight:500;
  cursor:pointer;
  color:var(--muted);
  transition:all .13s
}
.setup-tab.active {
  background:var(--white);
  color:var(--text);
  font-weight:700;
  box-shadow:0 1px 3px rgba(0,0,0,.09)
}
/* Policy validation — a tab with unresolved (red) gaps, and its count badge */
.setup-tab.has-gap {
  color:var(--danger);
  box-shadow:inset 0 -2px 0 var(--danger)
}
.setup-tab.has-gap.active {
  box-shadow:0 1px 3px rgba(0,0,0,.09), inset 0 -2px 0 var(--danger)
}
/* JS-rendered policy tab buttons (grievance/incapacity) use .btn, not .setup-tab */
.btn.has-gap {
  box-shadow:0 0 0 1.5px var(--danger)
}
.tab-gap-badge {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:16px;
  height:16px;
  margin-left:6px;
  padding:0 5px;
  border-radius:8px;
  background:var(--danger);
  color:var(--white);
  font-size:10px;
  font-weight:700;
  line-height:1;
  vertical-align:middle
}
/* A policy item (offence/sanction/alt row, or a period field) with a gap to fix */
tr.pol-gap > td {
  background:var(--danger-bg);
  box-shadow:inset 3px 0 0 var(--danger)
}
.pol-gap {
  border:1.5px solid var(--danger) !important;
  background:var(--danger-bg) !important;
  border-radius:7px
}
.modal-overlay {
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.42);
  z-index:9999;
  display:flex;
  align-items:center;
  justify-content:center;
  backdrop-filter:blur(2px)
}
.modal {
  background:var(--white);
  border-radius:16px;
  width:540px;
  max-width:95vw;
  max-height:88vh;
  overflow-y:auto;
  box-shadow:0 20px 60px rgba(0,0,0,.2)
}
.modal-lg {
  width:780px
}
.modal-xl {
  width:960px
}
.modal-pricing {
  width:90vw
}
/* Pricing modal: darker helper text (redefining --muted scoped here darkens every inline var(--muted)),
   a bounded scroll pane so the horizontal scrollbar stays in view (no scrolling the whole modal to reach
   it), and a sticky table header. */
#pricing-body {
  --muted:#334155;
  --light:#475569
}
#pricing-body .pr-scroll {
  max-height:56vh;
  overflow:auto
}
#pricing-body thead th {
  position:sticky;
  top:0;
  background:var(--white);
  z-index:1
}
.modal-hd {
  padding:22px 26px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  /* Pin the dialog title (e.g. "Edit User — Name") to the top while a tall modal body scrolls
     — the whole .modal scrolls, so without this the header scrolls out of view (tester). */
  position:sticky;
  top:0;
  background:var(--white);
  border-radius:16px 16px 0 0;
  z-index:2
}
.modal-hd h3 {
  font-size:17px;
  font-weight:700
}
.modal-close {
  background:none;
  border:none;
  font-size:19px;
  cursor:pointer;
  color:var(--muted);
  padding:3px;
  border-radius:6px
}
.modal-close:hover {
  background:var(--bg)
}
.modal-bd {
  padding:22px 26px
}
.modal-ft {
  padding:0 26px 22px;
  display:flex;
  gap:9px;
  justify-content:flex-end
}
.upload-zone {
  border:2px dashed var(--border);
  border-radius:9px;
  padding:28px;
  text-align:center;
  cursor:pointer;
  transition:all .14s
}
.upload-zone:hover,.upload-zone.drag {
  border-color:var(--accent);
  background:var(--accent-light)
}
.upload-zone .ui {
  font-size:28px;
  margin-bottom:6px
}
.upload-zone p {
  font-size:13px;
  color:var(--muted)
}
.alert {
  padding:11px 14px;
  border-radius:8px;
  font-size:13px;
  margin-bottom:14px;
  display:flex;
  gap:9px;
  align-items:flex-start;
  line-height:1.5
}
.a-info {
  background:#eff6ff;
  border-left:3px solid var(--accent);
  color:#1e40af
}
.a-warn {
  background:#fffbeb;
  border-left:3px solid var(--warning);
  color:#92400e
}
.a-success {
  background:#f0fdf4;
  border-left:3px solid var(--success);
  color:#15803d
}
.a-danger {
  background:#fef2f2;
  border-left:3px solid var(--danger);
  color:#b91c1c
}
.chip-select {
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin-top:7px
}
.chip {
  padding:5px 13px;
  border-radius:20px;
  font-size:12px;
  font-weight:600;
  border:1.5px solid var(--border);
  cursor:pointer;
  transition:all .13s;
  background:var(--white)
}
/* Fill blue on hover — but NOT when the "What this means" pill inside is the thing
   being hovered (the pill sits inside the chip, so hovering it also triggers
   .chip:hover). :has() lets only the pill react in that case. */
.chip:hover:not(:has(.chip-info:hover)) {
  border-color:var(--accent);
  background:var(--accent);
  color:#fff
}
.chip.selected {
  border-color:var(--accent);
  background:var(--accent);
  color:#fff
}
/* "What this means" info pill inside an intake chip. It has its OWN opaque background
   and fixed colour so it never changes when the surrounding chip is hovered/selected
   (the chip's blue must not show through) — it only turns blue on its OWN hover. */
.chip-info {
  display:inline-block;
  margin-left:6px;
  padding:1px 7px;
  border-radius:10px;
  font-size:10px;
  font-weight:700;
  cursor:pointer;
  background:var(--white);
  color:var(--muted);
  border:1px solid var(--border);
  transition:all .13s
}
.chip-info:hover {
  background:var(--accent);
  border-color:var(--accent);
  color:#fff
}
.divider {
  height:1px;
  background:var(--border);
  margin:16px 0
}
.section-hd {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:16px
}
.section-hd h3 {
  font-size:16px;
  font-weight:700
}
.empty-state {
  text-align:center;
  padding:50px 20px;
  color:var(--muted)
}
.empty-state .ei {
  font-size:42px;
  margin-bottom:10px
}
.loading-dots::after {
  content:'...';
  animation:dots 1.2s infinite
}
@keyframes dots {
  0%,20% {
  content:'.'
}
40% {
  content:'..'
}
60%,100% {
  content:'...'
}
}
.tag {
  display:inline-flex;
  padding:2px 7px;
  border-radius:5px;
  font-size:11px;
  font-weight:600;
  background:var(--accent-light);
  color:var(--accent);
  margin:1px
}
.hidden {
  display:none!important
}
.reports-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px
}
.report-card {
  background:var(--white);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:22px
}
.report-card h4 {
  font-size:14px;
  font-weight:700;
  margin-bottom:14px
}
.bar-row {
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:8px
}
.bar-lbl {
  width:130px;
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis
}
.bar-track {
  flex:1;
  height:18px;
  background:var(--bg);
  border-radius:4px;
  overflow:hidden;
  display:flex;          /* so a small bar's count can sit just to the right of the fill */
  align-items:center
}
.bar-fill {
  height:100%;
  border-radius:4px;
  display:flex;
  align-items:center;
  padding-left:7px;
  font-size:11px;
  font-weight:700;
  color:#fff;
  flex-shrink:0          /* keep the fill at its set width when the count sits outside it */
}
/* Count shown outside a short bar (dark text, readable on the light track). */
.bar-val-out {
  font-size:11px;
  font-weight:700;
  color:var(--text);
  padding-left:6px;
  white-space:nowrap
}
.checkbox-label {
  display:flex;
  align-items:center;
  gap:8px;
  cursor:pointer;
  font-size:13px;
  margin-bottom:7px
}
.checkbox-label input {
  width:15px;
  height:15px;
  accent-color:var(--accent)
}
.step-summary-box {
  background:#f0fdf4;
  border:1.5px solid var(--success);
  border-radius:10px;
  padding:16px;
  margin-bottom:14px;
  font-size:13px;
  line-height:1.7
}
.read-only-banner {
  background:var(--bg);
  border:1.5px solid var(--border);
  border-radius:8px;
  padding:10px 14px;
  font-size:13px;
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:16px
}


/* 3. Login Screen
   ========================================================================== */
    .login-box{background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.12);border-radius:16px;padding:40px;width:380px;max-width:94vw;}
    .login-box h2{font-family:'DM Serif Display',serif;color:#fff;font-size:28px;font-weight:400;margin-bottom:4px;}
    .login-box p{color:rgba(255,255,255,.45);font-size:13px;margin-bottom:28px;}
    .login-field{margin-bottom:16px;}
    .login-field label{display:block;font-size:11px;font-weight:600;color:rgba(255,255,255,.4);text-transform:uppercase;letter-spacing:.6px;margin-bottom:6px;}
    .login-field input{width:100%;padding:11px 14px;border:1.5px solid rgba(255,255,255,.15);border-radius:9px;background:rgba(255,255,255,.08);color:#fff;font-size:14px;font-family:'DM Sans',sans-serif;outline:none;transition:border .14s;box-sizing:border-box;}
    .login-field input:focus{border-color:rgba(255,255,255,.4);background:rgba(255,255,255,.12);}
    .login-field input::placeholder{color:rgba(255,255,255,.25);}
    .login-btn{width:100%;padding:12px;background:#fff;color:var(--navy);font-weight:700;font-size:14px;border:none;border-radius:9px;cursor:pointer;font-family:'DM Sans',sans-serif;margin-top:8px;transition:opacity .14s;}
    .login-btn:hover{opacity:.9;}
    .login-err{color:#fca5a5;font-size:12px;text-align:center;margin-top:10px;min-height:18px;}
    .login-ok{color:#86efac;font-size:12px;text-align:center;margin-top:10px;}
    .login-link{color:rgba(255,255,255,.45);font-size:12px;text-align:center;margin-top:14px;cursor:pointer;text-decoration:underline;}
    .login-link:hover{color:#fff;}
    #login-logo{text-align:center;margin-bottom:28px;}
    #login-logo span{font-family:'DM Serif Display',serif;font-size:42px;color:#fff;}
    #login-logo p{color:rgba(255,255,255,.35);font-size:12px;margin-top:2px;}

/* Brand — paper-plane logo lockups
   ========================================================================== */
.sb-brand svg{display:block;margin-bottom:8px;}
.sb-foot-brand{
  display:flex;align-items:center;gap:8px;
  margin-top:12px;padding-top:12px;
  border-top:1px solid rgba(255,255,255,.08);
}
.sb-foot-brand span{
  font-family:'DM Serif Display',serif;
  color:rgba(255,255,255,.6);
  font-size:13px;
}
.login-foot{
  position:absolute;
  bottom:26px;left:0;right:0;
  display:flex;align-items:center;justify-content:center;gap:9px;
}
.login-foot span{
  font-family:'DM Serif Display',serif;
  color:rgba(255,255,255,.7);
  font-size:16px;
}

/* Bulletin bar — scrolling announcement above the topbar
   ========================================================================== */
#bulletin-bar, #ez-bulletin-banner{
  display:flex;align-items:center;gap:12px;
  background:#fef3c7;color:var(--text);            /* light pastel yellow */
  border-bottom:1px solid #fde68a;
  padding:6px 14px;
  font-size:13px;font-weight:600;
  position:sticky;top:0;z-index:50;
}
#bulletin-bar .bulletin-icon, #ez-bulletin-banner .bulletin-icon{flex-shrink:0;font-size:16px;color:var(--warning);}
#bulletin-bar .bulletin-scroll, #ez-bulletin-banner .bulletin-scroll{flex:1;overflow:hidden;position:relative;mask-image:linear-gradient(to right,transparent 0,#000 24px,#000 calc(100% - 24px),transparent 100%);-webkit-mask-image:linear-gradient(to right,transparent 0,#000 24px,#000 calc(100% - 24px),transparent 100%);}
#bulletin-bar .bulletin-track, #ez-bulletin-banner .bulletin-track{display:inline-block;padding-left:100%;white-space:nowrap;animation:bulletin-scroll 30s linear infinite;}
#bulletin-bar:hover .bulletin-track, #ez-bulletin-banner:hover .bulletin-track{animation-play-state:paused;}
/* "Don't show again" button — readable on the light pastel-yellow bar. */
#bulletin-bar .btn.btn-secondary, #ez-bulletin-banner .btn.btn-secondary{
  background:rgba(0,0,0,.05);
  color:var(--text);
  border:1px solid #fde68a;
}
#bulletin-bar .btn.btn-secondary:hover, #ez-bulletin-banner .btn.btn-secondary:hover{
  background:rgba(0,0,0,.08);
  border-color:var(--warning);
}
@keyframes bulletin-scroll{
  from{transform:translateX(0);}
  to{transform:translateX(-100%);}
}

/* Sensitive-case marker
   ========================================================================== */
.sens-badge{
  display:inline-flex;align-items:center;gap:3px;
  padding:1px 7px;border-radius:5px;
  background:var(--danger-bg);color:var(--danger);
  font-size:10px;font-weight:700;letter-spacing:.4px;
  vertical-align:middle;
  border:1px solid var(--danger);
}
.shared-badge{
  display:inline-flex;align-items:center;gap:3px;
  padding:1px 7px;border-radius:5px;
  background:var(--accent-light);color:var(--accent);
  font-size:10px;font-weight:700;letter-spacing:.4px;
  vertical-align:middle;
  border:1px solid var(--accent);
}

/* Risk Manager
   ========================================================================== */
.rm-layout{ display:flex; gap:18px; align-items:flex-start; }
.rm-nav{
  width:228px; min-width:228px;
  background:var(--white); border:1px solid var(--border);
  border-radius:var(--radius); box-shadow:var(--shadow);
  padding:14px 10px; position:sticky; top:18px;
}
.rm-nav-brand{ display:flex; align-items:center; gap:10px; padding:4px 8px 14px; border-bottom:1px solid var(--border); margin-bottom:8px; }
.rm-nav-ico{ font-size:20px; }
.rm-nav-title{ font-size:14px; font-weight:700; color:var(--text); }
.rm-nav-sub{ font-size:11px; color:var(--muted); }
.rm-nav-group{ font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.6px; color:var(--light); padding:12px 10px 4px; }
.rm-nav-link{
  display:flex; align-items:center; gap:9px; width:100%; text-align:left;
  background:transparent; border:none; border-radius:8px; padding:8px 10px;
  font-size:12.5px; font-weight:600; color:var(--muted); cursor:pointer; font-family:inherit;
}
.rm-nav-link:hover{ background:var(--bg); color:var(--text); }
.rm-nav-link.active{ background:var(--accent-light); color:var(--accent); }
.rm-nav-link-ico{ width:18px; text-align:center; font-size:13px; flex:0 0 auto; }

.rm-main{ flex:1; min-width:0; }
.rm-head{ display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:16px; }
.rm-h2{ font-size:20px; font-weight:700; color:var(--text); }
.rm-greet{ font-size:12px; color:var(--muted); margin-top:2px; }
.rm-empty{ background:var(--white); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); padding:48px 22px; text-align:center; }
.rm-empty-ico{ font-size:34px; margin-bottom:12px; }
.rm-note{ background:var(--bg); border:1px solid var(--border); border-radius:10px; padding:12px 14px; font-size:12.5px; color:var(--muted); margin-bottom:14px; }
.rm-card-title{ font-size:12px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.5px; margin:14px 2px 8px; display:flex; justify-content:space-between; align-items:center; }
.rm-pin{ font-size:11px; font-weight:600; color:var(--accent); text-transform:none; letter-spacing:0; }

.rm-alert{ display:flex; gap:12px; align-items:center; background:var(--danger-bg); border:1px solid var(--risk-veryhigh-soft); border-radius:12px; padding:13px 15px; margin-bottom:14px; }
.rm-alert-ico{ font-size:20px; color:var(--danger); }
.rm-alert-title{ font-size:13px; font-weight:700; color:var(--text); }
.rm-alert-sub{ font-size:11px; color:var(--muted); margin-top:2px; }

.rm-hero{ background:linear-gradient(135deg,var(--navy) 0%,var(--navy-light) 100%); color:var(--white); border-radius:14px; padding:18px; margin-bottom:14px; cursor:pointer; }
.rm-hero-lbl{ font-size:11px; text-transform:uppercase; letter-spacing:.6px; opacity:.8; }
.rm-hero-row{ display:flex; justify-content:space-between; align-items:flex-end; margin:6px 0 12px; }
.rm-hero-v{ font-size:34px; font-weight:800; line-height:1; }
.rm-hero-sub{ font-size:10px; opacity:.8; }
.rm-hero-hi{ font-size:20px; font-weight:700; color:var(--risk-high); }
.rm-hero-stats{ display:flex; gap:8px; }
.rm-hero-stat{ flex:1; background:rgba(255,255,255,.08); border-radius:9px; padding:8px 6px; text-align:center; }
.rm-hero-stat-n{ font-size:18px; font-weight:800; }
.rm-hero-stat-l{ font-size:9px; opacity:.85; margin-top:2px; }

.rm-scorepair{ display:flex; gap:10px; margin-bottom:14px; }
.rm-score-card{ flex:1; background:var(--white); border:1px solid var(--border); border-radius:12px; box-shadow:var(--shadow); padding:14px; }
.rm-score-lbl{ font-size:10px; text-transform:uppercase; letter-spacing:.5px; color:var(--muted); font-weight:600; }
.rm-score-v{ font-size:30px; font-weight:800; color:var(--text); line-height:1.1; margin:4px 0 2px; }
.rm-score-v small{ font-size:13px; color:var(--muted); font-weight:600; }
.rm-score-sub{ font-size:10px; color:var(--muted); margin-bottom:8px; }

.rm-conc{ background:var(--white); border:1px solid var(--border); border-radius:12px; box-shadow:var(--shadow); padding:14px; margin-bottom:12px; }
.rm-conc-head{ display:flex; justify-content:space-between; align-items:center; font-size:12px; font-weight:700; color:var(--text); margin-bottom:10px; }
.rm-conc-hint{ color:var(--muted); font-weight:500; font-size:10px; }
.rm-conc-row{ display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.rm-conc-name{ width:130px; min-width:130px; font-size:11.5px; color:var(--text); font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rm-conc-bar-wrap{ flex:1; height:8px; background:var(--bg); border-radius:5px; overflow:hidden; }
.rm-conc-bar{ height:100%; border-radius:5px; background:var(--risk-veryhigh); }
.rm-conc-bar.med{ background:var(--risk-high); }
.rm-conc-bar.low{ background:var(--risk-medium); }
.rm-conc-pct{ width:52px; text-align:right; font-size:12px; font-weight:700; color:var(--text); }
.rm-conc-all{ font-size:11px; color:var(--accent); font-weight:600; margin-top:4px; }
.rm-conc-empty{ font-size:12px; color:var(--muted); }

.rm-conc-hero{ border-radius:14px; padding:16px; margin-bottom:14px; color:var(--white); background:linear-gradient(135deg,var(--risk-high),var(--risk-veryhigh)); }
.rm-conc-hero.lvl-low{ background:linear-gradient(135deg,var(--risk-low),var(--success)); }
.rm-conc-hero.lvl-high{ background:linear-gradient(135deg,var(--risk-high),var(--risk-veryhigh)); }
.rm-conc-hero.lvl-veryhigh{ background:linear-gradient(135deg,var(--risk-veryhigh),var(--risk-critical)); }
.rm-conc-hero-lbl{ font-size:11px; opacity:.9; text-transform:uppercase; letter-spacing:.5px; }
.rm-conc-hero-v{ font-size:26px; font-weight:800; margin:4px 0; }
.rm-conc-hero-sub{ font-size:12px; opacity:.92; }

/* AI response component — confidence indicator + thumbs vote/feedback */
.rm-conf{ display:inline-block; font-size:10px; font-weight:700; padding:2px 9px; border-radius:20px; white-space:nowrap; }
.rm-airesp{ border:1px solid var(--border); border-radius:12px; padding:12px 14px; margin-bottom:14px; background:var(--white); box-shadow:var(--shadow); }
.rm-airesp-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:12px; font-weight:700; color:var(--navy); margin-bottom:8px; }
.rm-airesp-body{ font-size:13px; color:var(--text); line-height:1.55; }
.rm-airesp-foot{ margin-top:10px; padding-top:8px; border-top:1px solid var(--border); }
.rm-vote{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.rm-vote-btn{ border:1px solid var(--border); background:var(--bg); border-radius:7px; padding:3px 11px; cursor:pointer; font-size:13px; line-height:1.2; }
.rm-vote-btn:hover{ border-color:var(--navy); }
.rm-vote-btn.up{ background:var(--success); border-color:var(--success); }
.rm-vote-btn.down{ background:var(--danger); border-color:var(--danger); }
.rm-vote-note{ font-size:11px; color:var(--muted); }

/* Top Risk Drivers — driver-frequency bars + driver pills */
.rm-driver-list{ display:flex; flex-direction:column; gap:9px; margin-bottom:6px; }
.rm-driver{ background:var(--white); border:1px solid var(--border); border-radius:10px; padding:9px 12px; }
.rm-driver-top{ display:flex; justify-content:space-between; align-items:center; font-size:12px; margin-bottom:6px; }
.rm-driver-name{ font-weight:700; color:var(--navy); }
.rm-driver-n{ font-weight:700; color:var(--muted); }
.rm-driver-bar{ height:7px; border-radius:5px; background:var(--bg); overflow:hidden; }
.rm-driver-fill{ height:100%; border-radius:5px; background:linear-gradient(90deg,var(--navy),var(--navy-light)); }
.rm-driver-pill{ font-size:10px; font-weight:700; color:var(--white); background:var(--navy-light); padding:2px 9px; border-radius:20px; white-space:nowrap; }

/* Delivered-alert inbox + nav unread badge */
.rm-pcard.rm-unread{ border-left:4px solid var(--accent); }
.rm-nav-badge{ margin-left:auto; background:var(--danger); color:var(--white); font-size:10px; font-weight:700; min-width:18px; height:18px; border-radius:9px; display:inline-flex; align-items:center; justify-content:center; padding:0 5px; }

/* Auto Case chat */
.auto-bubble{ max-width:88%; font-size:13px; line-height:1.55; padding:10px 13px; border-radius:12px; }
.auto-bubble.ai{ align-self:flex-start; background:var(--bg); border:1px solid var(--border); border-bottom-left-radius:3px; }
.auto-bubble.user{ align-self:flex-end; background:var(--navy); color:var(--white); border-bottom-right-radius:3px; }
.auto-bubble.user strong{ color:var(--white); }

.rm-wl{ display:flex; flex-direction:column; gap:9px; }
.rm-watch{ background:var(--white); border:1px solid var(--border); border-left:4px solid var(--risk-medium); border-radius:12px; box-shadow:var(--shadow); padding:13px 15px; }
.rm-watch-critical{ border-left-color:var(--risk-critical); }
.rm-watch-veryhigh{ border-left-color:var(--risk-veryhigh); }
.rm-watch-high{ border-left-color:var(--risk-high); }
.rm-watch-head{ display:flex; justify-content:space-between; gap:12px; }
.rm-watch-cid{ font-size:10px; color:var(--muted); font-weight:600; }
.rm-watch-title{ font-size:13px; font-weight:700; color:var(--text); margin:2px 0 4px; }
.rm-watch-meta{ display:flex; flex-wrap:wrap; gap:10px; font-size:10.5px; color:var(--muted); }
.rm-watch-score{ font-size:22px; font-weight:800; line-height:1; }
.rm-watch-actions{ display:flex; align-items:center; gap:8px; margin-top:10px; }
.rm-watch-note{ flex:1; font-size:10px; color:var(--muted); }

/* solid risk text colours (on white) */
.rm-c-critical{ color:var(--risk-critical); }
.rm-c-veryhigh{ color:var(--risk-veryhigh); }
.rm-c-high{ color:var(--risk-high); }
.rm-c-medium{ color:var(--risk-medium); }
.rm-c-low{ color:var(--risk-low); }

.rm-kpi-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:12px; }
.rm-kpi{ background:var(--white); border:1px solid var(--border); border-radius:12px; box-shadow:var(--shadow); padding:14px; }
.rm-kpi-cat{ font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--light); }
.rm-kpi-name{ font-size:12.5px; font-weight:700; color:var(--text); margin:2px 0 8px; min-height:34px; }
.rm-kpi-v{ font-size:30px; font-weight:800; line-height:1; }
.rm-kpi-ok{ color:var(--success); }
.rm-kpi-bad{ color:var(--danger); }
.rm-kpi-na{ color:var(--light); }
.rm-kpi-sub{ font-size:11px; color:var(--muted); margin-top:4px; }
.rm-kpi-tgt{ font-size:11px; color:var(--light); margin-top:6px; }

.rm-ainote{ font-size:11.5px; color:var(--muted); background:var(--bg); border:1px solid var(--border); border-radius:9px; padding:9px 12px; margin-bottom:14px; line-height:1.5; }
.rm-ainote.on{ background:var(--accent-light); border-color:var(--accent-light); color:var(--accent); }
.rm-list{ display:flex; flex-direction:column; gap:10px; }
.rm-pcard{ background:var(--white); border:1px solid var(--border); border-radius:12px; box-shadow:var(--shadow); padding:13px 15px; }
.rm-pcard-h{ display:flex; justify-content:space-between; align-items:center; gap:10px; }
.rm-pcard-name{ font-size:13px; font-weight:700; color:var(--text); }
.rm-pcard-desc{ font-size:11.5px; color:var(--muted); margin-top:4px; line-height:1.5; }
.rm-pcard-sig{ font-size:11.5px; font-weight:600; color:var(--text); margin-top:8px; }
.rm-pcard-rem{ font-size:11.5px; color:var(--success); margin-top:6px; }

.rm-vis-group{ font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:var(--light); margin:12px 0 4px; }
.rm-vis-row{ display:flex; justify-content:space-between; align-items:center; padding:8px 0; border-bottom:1px solid var(--border); font-size:13px; }
.rm-vis-row:last-child{ border-bottom:none; }

.rm-tiles{ display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:12px; }
.rm-tile{ text-align:left; background:var(--white); border:1px solid var(--border); border-radius:12px; box-shadow:var(--shadow); padding:16px; cursor:pointer; font-family:inherit; }
.rm-tile:hover{ border-color:var(--accent); }
.rm-tile-name{ font-size:14px; font-weight:700; color:var(--text); }
.rm-tile-sub{ font-size:11px; color:var(--muted); margin-top:3px; }

@media (max-width:900px){
  .rm-layout{ flex-direction:column; }
  .rm-nav{ width:100%; min-width:0; position:static; }
}

/* Employee Zone
   ========================================================================== */
#employeezone-screen{ font-family:'DM Sans',sans-serif; color:var(--text); }
.ez-topbar{ display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 28px; background:var(--menu-bg); color:var(--menu-field-text); box-shadow:var(--shadow); }
.ez-brand{ display:flex; align-items:center; gap:12px; color:var(--menu-field-text); }
.ez-top-right{ display:flex; align-items:center; gap:14px; }
.ez-welcome{ padding:24px 28px; background:var(--white); border-bottom:1px solid var(--border); }
.ez-welcome h2{ font-size:20px; font-weight:700; color:var(--text); margin:0 0 4px; }
.ez-welcome p{ font-size:13px; color:var(--muted); margin:0; }
.ez-body{ padding:26px 28px; max-width:1100px; margin:0 auto; width:100%; box-sizing:border-box; }
.ez-section{ margin-bottom:26px; }
.ez-section > h3{ font-size:16px; font-weight:700; margin:0 0 12px; color:var(--text); }
.ez-cards{ display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:14px; }

@media (max-width:700px){
  .ez-topbar{ padding:12px 16px; }
  .ez-body{ padding:18px 16px; }
}

/* Dashboard — case-volume chart
   ========================================================================== */
.dash-chart-wrap{ width:100%; }
.dash-bar{ fill:var(--accent); }
.dash-bar-now{ fill:var(--navy); }
.dash-bar-val{ fill:var(--text); font-size:14px; font-weight:700; font-family:'DM Sans',sans-serif; }
.dash-bar-lbl{ fill:var(--text); font-size:14px; font-weight:700; font-family:'DM Sans',sans-serif; }
@media (max-width:900px){
  .dash-mid{ grid-template-columns:1fr !important; }
  .dash-top{ grid-template-columns:repeat(2,1fr) !important; }
}
@media (max-width:560px){
  .dash-top{ grid-template-columns:1fr !important; }
}

/* Digital signature
   ========================================================================== */
.esig{ font-family:"Segoe Script","Brush Script MT","Lucida Handwriting",cursive; font-size:20px; line-height:1.1; color:var(--text); }

/* Alerts — bell + dropdown card
   ========================================================================== */
@keyframes alertCardIn{
  from{ opacity:0; transform:translateY(-14px) scale(.96); }
  to{ opacity:1; transform:translateY(0) scale(1); }
}
@keyframes alertBellPulse{
  0%{ box-shadow:0 0 0 0 rgba(220,38,38,.55); }
  70%{ box-shadow:0 0 0 9px rgba(220,38,38,0); }
  100%{ box-shadow:0 0 0 0 rgba(220,38,38,0); }
}
#alert-card{
  width:380px !important;
  border:1.5px solid var(--accent) !important;
  box-shadow:0 18px 44px rgba(15,31,61,.30) !important;
  animation:alertCardIn .22s cubic-bezier(.2,.8,.2,1);
  overflow:hidden;
}
#alert-bell.has-alerts{
  animation:alertBellPulse 1.8s ease-out infinite;
  border-color:var(--danger);
  background:var(--danger-bg);
}
/* Count badge tucked into the top-right corner of the bell */
#alert-count{
  position:absolute; top:1px; right:3px;
  min-width:15px; height:15px; padding:0 3px;
  box-sizing:border-box;
  background:var(--danger); color:var(--white);
  border:1.5px solid var(--white); border-radius:9px;
  font-size:9px; font-weight:800; line-height:12px; text-align:center;
}
.alert-card-head{
  position:sticky; top:0; z-index:1;
  background:var(--navy); color:var(--white);
  padding:12px 14px; display:flex; align-items:center; justify-content:space-between;
  font-size:13px; font-weight:700;
}
.alert-card-head .alert-pill{
  background:var(--danger); color:var(--white);
  border-radius:12px; font-size:11px; font-weight:700; padding:1px 9px; margin-left:8px;
}
.alert-card-head .alert-x{
  background:transparent; border:0; color:var(--white); cursor:pointer; font-size:17px; line-height:1; opacity:.8; padding:0 2px;
}
.alert-card-head .alert-x:hover{ opacity:1; }
.alert-tabs{ display:flex; border-bottom:1px solid var(--border); background:var(--bg); }
.alert-tab{ flex:1; background:transparent; border:0; padding:9px 8px; font-size:12px; font-weight:600; color:var(--muted); cursor:pointer; border-bottom:2px solid transparent; font-family:inherit; }
.alert-tab:hover{ color:var(--navy); }
.alert-tab.active{ color:var(--accent); border-bottom-color:var(--accent); }
/* In-case 🔔 Alerts button — flashes when a new risk alert/meeting arrived since the user last looked. */
.cw-alerts-flash{ animation:cwAlertsFlash 1.1s ease-in-out infinite; }
@keyframes cwAlertsFlash{ 0%,100%{ box-shadow:0 0 0 1px var(--accent); } 50%{ box-shadow:0 0 0 4px var(--accent); } }
@media (prefers-reduced-motion: reduce){ .cw-alerts-flash{ animation:none; } }
.alert-tab .alert-pill{ background:var(--danger); color:var(--white); border-radius:12px; font-size:10px; font-weight:700; padding:0 6px; margin-left:4px; }
/* Delayed case — banner + locked workspace */
.delay-banner{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; background:var(--warning-bg); border:1.5px solid var(--warning); color:var(--warning); border-radius:9px; padding:11px 16px; margin-bottom:16px; font-size:13px; font-weight:600; }
.delay-banner .db-msg{ flex:1; min-width:0; }
.case-locked{ pointer-events:none; opacity:.5; filter:grayscale(.15); user-select:none; }
.alert-row{ padding:11px 14px; border-bottom:1px solid var(--border); cursor:pointer; transition:background .12s; }
.alert-row:last-child{ border-bottom:0; }
.alert-row:hover{ background:var(--accent-light); }
.alert-row.alert-overdue{ border-left:3px solid var(--danger); }

/* Days / due-by inputs — consistent across all modules, matching Policy → Key Periods
   ========================================================================== */
.days-input{ width:80px; padding:7px 10px; border:1.5px solid var(--border); border-radius:7px; font-size:13px; background:var(--bg); }
.days-input:focus{ outline:none; border-color:var(--accent); }

/* Entity badge — multi-entity (group) clients: tags a case/employee with its entity
   ========================================================================== */
.entity-badge{ display:inline-flex; align-items:center; gap:3px; margin-left:6px; padding:2px 8px;
  border-radius:20px; font-size:10px; font-weight:700; background:var(--navy); color:var(--white); vertical-align:middle; }

/* Help & Chat widget
   ========================================================================== */
#chat-fab{ position:fixed; right:22px; bottom:22px; width:56px; height:56px; border:none; border-radius:50%;
  background:linear-gradient(135deg,var(--accent),var(--navy)); color:#fff; font-size:25px; cursor:pointer;
  align-items:center; justify-content:center; box-shadow:0 8px 24px rgba(37,99,235,.42); z-index:8800; }
#chat-fab:hover{ transform:translateY(-2px); box-shadow:0 12px 30px rgba(37,99,235,.5); }
/* Unread badge — a readable red count pill (was a tiny dot, so the number was hard to see). */
.chat-unread{ position:absolute; top:-5px; right:-5px; min-width:17px; height:17px; padding:0 4px; box-sizing:border-box;
  display:inline-flex; align-items:center; justify-content:center; border-radius:9px; background:var(--danger);
  color:#fff; font-size:10px; font-weight:800; line-height:1; border:2px solid var(--white); }
#chat-fab .chat-unread{ top:2px; right:2px; }
/* Top-bar chat button — same blue gradient CIRCLE as the floating chat FAB, sized for the top bar.
   No longer carries the .btn/.btn-secondary classes, so this rule is fully self-contained. */
#chat-topbtn{ display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; min-width:0; padding:0;
  border:none; border-radius:50%; font-size:16px; line-height:1; color:#fff; cursor:pointer;
  font-family:'DM Sans',sans-serif; transition:all .14s;
  background:linear-gradient(135deg,var(--accent),var(--navy)); box-shadow:0 3px 10px rgba(37,99,235,.35); }
#chat-topbtn:hover{ color:#fff; background:linear-gradient(135deg,var(--accent),var(--navy)); transform:translateY(-1px); box-shadow:0 5px 14px rgba(37,99,235,.45); }
/* Awareness: while there is unread chat (and the panel is closed), the launcher pulses a blue ring
   so a new conversation is hard to miss. A one-shot bounce fires the moment a new message lands. */
@keyframes chatPulseRing{ 0%{ box-shadow:0 0 0 0 rgba(37,99,235,.55); } 70%{ box-shadow:0 0 0 12px rgba(37,99,235,0); } 100%{ box-shadow:0 0 0 0 rgba(37,99,235,0); } }
#chat-fab.chat-alert, #chat-topbtn.chat-alert{ animation:chatPulseRing 1.6s ease-out infinite; }
@keyframes chatBounce{ 0%,100%{ transform:translateY(0); } 25%{ transform:translateY(-7px); } 55%{ transform:translateY(-3px); } }
#chat-fab.chat-bounce, #chat-topbtn.chat-bounce{ animation:chatBounce .6s ease; }
/* "Peek" toast that sticks out beside the floating bubble when a new message arrives while closed. */
#chat-peek{ position:fixed; right:86px; bottom:30px; z-index:8850; display:none; align-items:center; gap:6px;
  background:linear-gradient(135deg,var(--accent),var(--navy)); color:#fff; font-size:12px; font-weight:700;
  padding:9px 13px; border-radius:20px; box-shadow:0 8px 22px rgba(37,99,235,.42); cursor:pointer;
  animation:chatPeekIn .3s ease; white-space:nowrap; }
#chat-peek::after{ content:''; position:absolute; right:-6px; bottom:12px; width:0; height:0;
  border-top:6px solid transparent; border-bottom:6px solid transparent; border-left:7px solid var(--navy); }
@keyframes chatPeekIn{ from{ opacity:0; transform:translateX(10px); } to{ opacity:1; transform:translateX(0); } }

.chat-panel{ position:fixed; right:22px; bottom:22px; width:340px; max-width:calc(100vw - 30px); max-height:74vh;
  background:var(--white); border:1px solid var(--border); border-radius:16px; overflow:hidden; display:flex; flex-direction:column;
  box-shadow:0 20px 50px rgba(15,31,61,.30); z-index:8900; }
.chat-head{ background:linear-gradient(135deg,var(--navy),var(--navy-light)); color:#fff; padding:13px 15px; display:flex; align-items:center; gap:10px; flex-shrink:0; }
.chat-head .chat-av{ width:32px; height:32px; border-radius:50%; background:var(--accent); display:flex; align-items:center; justify-content:center; font-size:17px; }
.chat-back{ background:rgba(255,255,255,.14); border:none; color:#fff; width:28px; height:28px; border-radius:8px; cursor:pointer; font-size:15px; }
.chat-back:hover{ background:rgba(255,255,255,.24); }
.chat-head-tt{ flex:1; min-width:0; }
.chat-ti{ font-size:13.5px; font-weight:700; }
.chat-su{ font-size:10.5px; opacity:.72; }
.chat-x{ background:none; border:none; color:#fff; opacity:.7; cursor:pointer; font-size:15px; }
.chat-x:hover{ opacity:1; }
.chat-body{ padding:15px; background:var(--bg); overflow-y:auto; }
.chat-greet{ font-size:14px; font-weight:700; color:var(--navy); margin-bottom:3px; }
.chat-greet-sub{ font-size:11.5px; color:var(--muted); margin-bottom:13px; }
.chat-opt{ display:flex; align-items:center; gap:11px; background:var(--white); border:1px solid var(--border); border-radius:11px;
  padding:11px 13px; margin-bottom:9px; cursor:pointer; transition:.12s; }
.chat-opt:hover{ border-color:var(--accent); box-shadow:0 3px 10px rgba(37,99,235,.12); }
.chat-opt-ic{ width:36px; height:36px; border-radius:9px; display:flex; align-items:center; justify-content:center; font-size:18px; flex-shrink:0; }
.chat-opt-ic.ai{ background:var(--accent-light); } .chat-opt-ic.exp{ background:var(--success-bg); } .chat-opt-ic.sup{ background:var(--warning-bg); }
.chat-opt-tx{ flex:1; min-width:0; }
.chat-opt-tt{ font-size:12.5px; font-weight:700; color:var(--navy); }
.chat-opt-ds{ font-size:10.7px; color:var(--muted); margin-top:1px; line-height:1.35; }
.chat-opt-ar{ color:var(--light); font-size:15px; }
.chat-foot{ padding:8px 14px; border-top:1px solid var(--border); font-size:10px; color:var(--light); text-align:center; flex-shrink:0; }
.chat-info-card{ background:var(--white); border:1px solid var(--border); border-radius:11px; padding:18px 16px; text-align:center; }

/* AI conversation */
.chat-scroll{ flex:1; overflow-y:auto; padding:15px; background:var(--bg); display:flex; flex-direction:column; gap:9px; min-height:220px; }
.chat-msg{ max-width:82%; font-size:12.5px; line-height:1.5; padding:9px 12px; border-radius:13px; word-wrap:break-word; }
.chat-msg.ai{ align-self:flex-start; background:var(--white); border:1px solid var(--border); color:var(--text); border-bottom-left-radius:4px; }
.chat-msg.me{ align-self:flex-end; background:var(--accent); color:#fff; border-bottom-right-radius:4px; }
.chat-typing{ display:inline-flex; gap:4px; }
.chat-typing span{ width:6px; height:6px; border-radius:50%; background:var(--light); animation:chatBlink 1.2s infinite; }
.chat-typing span:nth-child(2){ animation-delay:.2s; } .chat-typing span:nth-child(3){ animation-delay:.4s; }
@keyframes chatBlink{ 0%,60%,100%{ opacity:.3; } 30%{ opacity:1; } }
.chat-input-row{ display:flex; gap:8px; padding:10px 12px; border-top:1px solid var(--border); background:var(--white); flex-shrink:0; }
.chat-input-row input{ flex:1; border:1.5px solid var(--border); border-radius:20px; padding:8px 14px; font-size:13px; background:var(--bg); }
.chat-input-row input:focus{ outline:none; border-color:var(--accent); }
.chat-send{ width:36px; height:36px; border:none; border-radius:50%; background:var(--accent); color:#fff; cursor:pointer; font-size:14px; flex-shrink:0; }
.chat-send:disabled{ opacity:.5; cursor:default; }
.chat-wait{ font-size:11px; color:var(--muted); background:var(--accent-light); border:1px solid var(--border); border-radius:8px; padding:8px 11px; text-align:center; }
.chat-chips{ display:flex; gap:6px; overflow-x:auto; padding:8px 10px; background:var(--white); border-bottom:1px solid var(--border); flex-shrink:0; }
.chat-chip{ border:1px solid var(--border); background:var(--bg); color:var(--text); font-size:11px; font-weight:600; padding:5px 10px; border-radius:16px; white-space:nowrap; cursor:pointer; }
.chat-chip.active{ background:var(--navy); color:#fff; border-color:var(--navy); }
.chat-chip.new{ border-color:var(--warning); color:var(--warning); background:var(--warning-bg); }
.chat-chip.new.active{ background:var(--warning); color:#fff; }
.chat-endrow{ display:flex; justify-content:flex-end; padding:5px 12px 0; background:var(--white); flex-shrink:0; }
.chat-end{ background:none; border:none; color:var(--danger); font-size:11px; font-weight:600; cursor:pointer; padding:2px 4px; }
.chat-end:hover{ text-decoration:underline; }

/* Guided tour
   ========================================================================== */
#tour-ov{ position:fixed; inset:0; z-index:9400; }
#tour-ov.hidden{ display:none; }
#tour-spot{ position:fixed; border-radius:9px; border:2px solid var(--accent); box-shadow:0 0 0 9999px rgba(15,31,61,.45); transition:top .22s ease,left .22s ease,width .22s ease,height .22s ease; pointer-events:none; }
#tour-pop{ position:fixed; width:300px; max-width:calc(100vw - 24px); background:var(--white); border-radius:13px; box-shadow:0 18px 46px rgba(15,31,61,.34); padding:16px 17px 16px; z-index:9460; }
.tour-x{ position:absolute; top:8px; right:9px; width:24px; height:24px; border:none; background:none; color:var(--light); font-size:14px; cursor:pointer; border-radius:6px; line-height:1; }
.tour-x:hover{ background:var(--bg); color:var(--muted); }
.tour-step{ font-size:10px; font-weight:700; letter-spacing:.6px; color:var(--accent); text-transform:uppercase; }
.tour-title{ font-size:15.5px; font-weight:800; color:var(--navy); margin:3px 0 6px; }
.tour-body{ font-size:12.5px; color:var(--muted); line-height:1.55; margin-bottom:14px; }
.tour-actions{ display:flex; align-items:center; gap:8px; }
.tour-skip{ background:none; border:none; color:var(--light); font-size:12px; cursor:pointer; padding:4px; }
.tour-skip:hover{ color:var(--muted); }

/* First-login Onboarding
   ========================================================================== */
.onb-wrap{ max-width:860px; margin:0 auto; width:100%; padding:36px 28px 60px; }
/* Host for the relocated Setup grid during the in-wizard "review & lock" step */
.onb-cfg-host{ margin:20px 0 8px; text-align:left; }
.onb-hero{ margin-bottom:24px; }
.onb-badge{ display:inline-block; font-size:11px; font-weight:700; letter-spacing:.4px; text-transform:uppercase; color:var(--accent); background:var(--accent-light); padding:4px 10px; border-radius:20px; margin-bottom:12px; }
.onb-hero h1{ font-size:26px; font-weight:800; color:var(--navy); margin:0 0 8px; }
.onb-lead{ font-size:14px; color:var(--muted); line-height:1.6; max-width:680px; }
.onb-summary{ font-size:13px; color:var(--text); line-height:1.55; margin-top:6px; font-style:italic; }
.onb-choices{ display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.onb-choice{ background:var(--white); border:1px solid var(--border); border-radius:var(--radius); padding:24px; box-shadow:var(--shadow); display:flex; flex-direction:column; }
.onb-choice-ic{ font-size:30px; margin-bottom:10px; }
.onb-choice h3{ font-size:16px; font-weight:700; color:var(--navy); margin:0 0 8px; }
.onb-choice p{ font-size:13px; color:var(--muted); line-height:1.55; margin:0 0 18px; flex:1; }
.onb-actions{ display:flex; gap:12px; justify-content:flex-end; margin-top:26px; }
.onb-uploads{ display:flex; flex-direction:column; gap:12px; }
.onb-up{ background:var(--white); border:1px solid var(--border); border-radius:var(--radius); padding:16px 18px; }
.onb-up-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.onb-up-title{ font-size:14px; font-weight:700; color:var(--navy); }
.onb-up-sub{ font-size:12px; color:var(--muted); margin-top:2px; }
.onb-up-btn{ flex-shrink:0; cursor:pointer; }
.onb-up-status{ margin-top:10px; font-size:12px; }
.onb-file-ok{ color:var(--success); font-weight:600; }
.onb-file-none{ color:var(--light); }
.onb-found{ background:var(--white); border:1px solid var(--border); border-radius:var(--radius); padding:18px 20px; margin-bottom:14px; box-shadow:var(--shadow); }
.onb-found h3{ font-size:15px; font-weight:700; color:var(--navy); margin:0 0 4px; }
.onb-found p{ font-size:13px; color:var(--muted); margin:2px 0; }
.onb-tbl-wrap{ overflow-x:auto; margin-top:10px; border:1px solid var(--border); border-radius:8px; }
.onb-tbl{ width:100%; border-collapse:collapse; font-size:12px; }
.onb-tbl th{ background:var(--bg); color:var(--muted); text-align:left; padding:7px 10px; font-weight:600; border-bottom:1px solid var(--border); }
.onb-tbl td{ padding:7px 10px; border-bottom:1px solid var(--border); color:var(--text); vertical-align:top; }
.onb-tbl tr:last-child td{ border-bottom:none; }
.onb-more{ font-size:12px; color:var(--light); margin-top:8px; }
.onb-checks{ display:flex; flex-direction:column; gap:10px; }
.onb-check{ display:flex; align-items:center; gap:12px; background:var(--white); border:1px solid var(--border); border-radius:var(--radius); padding:14px 16px; }
.onb-check.gap{ border-color:var(--warning); background:var(--warning-bg); }
.onb-check.ok{ border-color:var(--border); }
.onb-check-ic{ font-size:18px; flex-shrink:0; }
.onb-check-body{ flex:1; }
.onb-check-label{ font-size:13px; font-weight:700; color:var(--navy); }
.onb-check-detail{ font-size:12px; color:var(--muted); margin-top:2px; }
@media (max-width:720px){ .onb-choices{ grid-template-columns:1fr; } }

/* Ask a Question (AI analysis)
   ========================================================================== */
.ask-hist-item{ display:flex;align-items:center;gap:6px;padding:8px 10px;border-radius:8px;cursor:pointer;margin-bottom:4px;font-size:12.5px;color:var(--text); }
.ask-hist-item:hover{ background:var(--bg); }
.ask-hist-item.active{ background:var(--accent-light); color:var(--accent); font-weight:600; }
.ask-hist-title{ flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.ask-hist-del{ border:none;background:none;color:var(--light);cursor:pointer;font-size:12px;padding:2px 4px;border-radius:4px;flex-shrink:0; }
.ask-hist-del:hover{ color:var(--danger);background:var(--danger-bg); }
.ask-msg{ display:flex;margin-bottom:14px; }
.ask-msg.user{ justify-content:flex-end; }
.ask-msg .ask-bub{ max-width:760px;padding:12px 15px;border-radius:12px;font-size:13.5px;line-height:1.6; }
.ask-msg.user .ask-bub{ background:var(--navy);color:#fff;border-bottom-right-radius:4px; }
.ask-msg.ai .ask-bub{ background:var(--white);border:1px solid var(--border);color:var(--text);border-bottom-left-radius:4px;box-shadow:var(--shadow); }
.ask-foot{ display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-top:10px;padding-top:8px;border-top:1px solid var(--border);font-size:11.5px;color:var(--muted); }
.ask-fb{ display:flex;align-items:center;gap:6px;margin-top:8px; }
.ask-thumb{ border:1px solid var(--border);background:var(--white);border-radius:7px;cursor:pointer;font-size:13px;padding:2px 8px;line-height:1.4; }
.ask-thumb:hover{ background:var(--bg); }
.ask-thumb.on{ background:var(--accent-light);border-color:var(--accent); }
/* A selected thumbs-DOWN always highlights red (consistent across chat + AI analysis). */
.ask-thumb.on.down{ background:var(--danger);border-color:var(--danger); }

/* My Cases — awaiting-approval row highlight
   ========================================================================== */
/* A case out for approval is tinted amber with a left accent bar so it stands out
   in the worklist (tester 5-Aug: "waiting for approval must be a different colour"). */
tr.mc-awaiting > td{ background:var(--warning-bg); }
tr.mc-awaiting > td:first-child{ box-shadow:inset 3px 0 0 var(--warning); }

/* FAIS / REDS indicators in the case header — coloured badges so they stand out next to the name
   ========================================================================== */
.hdr-ind{ display:inline-flex; align-items:center; padding:1px 8px; border-radius:20px; font-size:11px; font-weight:800; letter-spacing:.3px; vertical-align:middle; margin:0 2px; }
.hdr-fais{ background:var(--warning-bg); color:var(--warning); border:1px solid var(--warning); }
.hdr-reds{ background:var(--danger-bg); color:var(--danger); border:1px solid var(--danger); }

/* Engagements
   ========================================================================== */
.eng-secnav-wrap{ display:flex; flex-direction:column; gap:4px; }
.eng-secnav{ padding:9px 12px; border-radius:7px; font-size:13px; font-weight:600; color:var(--text); cursor:pointer; border:1px solid transparent; }
.eng-secnav:hover{ background:var(--bg); }
.eng-secnav.active{ background:var(--accent-light); color:var(--accent); border-color:var(--accent); }

/* Engagements report — keep the Case Type selector AND the date range (filter by period),
   but hide the filters that don't apply to engagements (date basis / access / field / entity). */
#rpt-filter-card.rpt-eng-active #rpt-datebasis-fg,
#rpt-filter-card.rpt-eng-active #rpt-access-fg,
#rpt-filter-card.rpt-eng-active #rpt-field-filters,
#rpt-filter-card.rpt-eng-active #rpt-entity-fg { display:none !important; }

/* Control Centre (Dashboard)
   ========================================================================== */
.cc-header{ display:flex; align-items:center; justify-content:space-between; gap:16px 20px; flex-wrap:wrap;
  background:linear-gradient(120deg,var(--navy),var(--navy-light)); color:var(--white);
  padding:18px 22px; border-radius:var(--radius); margin-bottom:16px; box-shadow:var(--shadow); }
.cc-hello-group{ display:flex; align-items:center; gap:18px; flex-wrap:wrap; min-width:0; }
.cc-hello h2{ font-family:'DM Serif Display',serif; font-weight:400; font-size:22px; color:var(--white); }
.cc-hello p{ font-size:12px; color:rgba(255,255,255,.6); margin-top:2px; }
.cc-hello-sum{ font-size:13px; color:rgba(255,255,255,.9); padding-left:18px; border-left:1px solid rgba(255,255,255,.22); max-width:420px; }
.cc-hello-sum strong{ color:var(--white); }
.cc-header-entity{ flex-shrink:0; }
.cc-header-entity .card{ margin:0 !important; }

.cc-cards{ display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:14px; margin-bottom:16px; }
.cc-card{ background:var(--white); border:1px solid var(--border); border-radius:var(--radius); padding:16px 18px;
  cursor:pointer; transition:box-shadow .15s,transform .15s,border-color .15s; box-shadow:var(--shadow); }
.cc-card:hover{ box-shadow:var(--shadow-md); transform:translateY(-2px); border-color:var(--accent); }
.cc-card-total{ background:linear-gradient(135deg,var(--accent),var(--navy)); border-color:transparent; color:var(--white); }
/* The specialist-cases total uses a distinct (teal) gradient so it reads apart from the blue my-profile total. */
.cc-card-total.cc-card-break{ background:linear-gradient(135deg,var(--accent-alt),var(--navy)); }
.cc-card-lbl{ font-size:12px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.4px; }
.cc-card-total .cc-card-lbl{ color:rgba(255,255,255,.82); }
.cc-card-v{ font-size:34px; font-weight:800; color:var(--navy); line-height:1.1; margin:6px 0 2px;
  font-variant-numeric:tabular-nums; }
.cc-card-total .cc-card-v{ color:var(--white); }
.cc-card-sub{ font-size:11px; color:var(--light); }
.cc-card-total .cc-card-sub{ color:rgba(255,255,255,.72); }
.cc-card-splits{ display:flex; flex-wrap:wrap; gap:5px 10px; margin-top:8px; }
.cc-split{ font-size:11px; color:var(--muted); }
.cc-split em{ font-style:normal; font-weight:800; color:var(--navy); }
.cc-card-od{ display:inline-block; margin-left:8px; padding:1px 7px; border-radius:999px; background:var(--danger-bg); color:var(--danger); font-weight:700; font-size:10px; }
.cc-card-total .cc-card-od{ background:rgba(255,255,255,.22); color:var(--white); }
.cc-card-break{ grid-column-start:1; }

.cc-section-lbl{ font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.6px;
  color:var(--muted); margin:6px 2px 10px; }

.cc-risk{ margin-bottom:16px; }
.cc-tabs{ display:flex; gap:6px; border-bottom:1px solid var(--border); margin:6px 0 14px; }
.cc-tab{ background:none; border:0; border-bottom:2px solid transparent; padding:8px 14px; font-size:13px; font-weight:700; color:var(--muted); cursor:pointer; }
.cc-tab:hover{ color:var(--navy); }
.cc-tab.active{ color:var(--accent); border-bottom-color:var(--accent); }
.cc-riskbar{ display:flex; height:14px; border-radius:8px; overflow:hidden; background:var(--border); margin:6px 0 10px; }
.cc-riskseg{ height:100%; }
.cc-risk-legend{ display:flex; flex-wrap:wrap; gap:6px 16px; margin-bottom:14px; }
.cc-risk-key{ font-size:12px; color:var(--muted); display:inline-flex; align-items:center; gap:6px; }
.cc-risk-key em{ font-style:normal; font-weight:800; color:var(--text); }
.cc-dot{ width:10px; height:10px; border-radius:50%; display:inline-block; }
.cc-risk-stats{ display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:14px; }
.cc-risk-stat{ background:var(--bg); border-radius:9px; padding:12px 14px; }
.cc-risk-stat-v{ font-size:24px; font-weight:800; color:var(--navy); font-variant-numeric:tabular-nums; }
.cc-risk-stat-v small{ font-size:12px; color:var(--muted); font-weight:600; }
.cc-risk-stat-l{ font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.4px; margin-top:2px; }
.cc-risk-drivers .cc-drv{ display:flex; flex-wrap:wrap; gap:5px; margin-top:6px; }
.cc-riskline{ border-top:1px solid var(--border); padding-top:12px; margin-top:12px; }
.cc-riskline:first-of-type{ border-top:0; padding-top:0; margin-top:6px; }
.cc-riskline-hd{ font-size:13px; font-weight:800; color:var(--navy); margin-bottom:10px; }
.cc-riskline-hd span{ font-size:11px; color:var(--muted); font-weight:500; }
.cc-risk-drv-row{ display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:12px; }
.cc-risk-drv-row .cc-risk-drivers{ background:var(--bg); border-radius:9px; padding:12px 14px; }
.cc-drv-none{ font-size:12px; color:var(--muted); margin-top:4px; }
@media (max-width:640px){ .cc-risk-drv-row{ grid-template-columns:1fr; } }

.cc-trends{ display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:14px; margin-bottom:18px; align-items:stretch; }
.cc-trend-wide{ grid-column:span 1; }
.cc-trend-note{ font-weight:500; text-transform:none; letter-spacing:0; color:var(--light); }
.cc-modlist{ margin-top:10px; display:flex; flex-direction:column; gap:7px; }
.cc-modrow{ display:flex; justify-content:space-between; align-items:baseline; gap:10px; font-size:13px; border-bottom:1px dashed var(--border); padding-bottom:6px; }
.cc-modrow:last-child{ border-bottom:0; padding-bottom:0; }
.cc-modrow-nm{ color:var(--muted); }
.cc-modrow-v{ font-weight:800; color:var(--navy); font-variant-numeric:tabular-nums; text-align:right; }
.cc-trend{ background:var(--white); border:1px solid var(--border); border-radius:var(--radius); padding:16px 18px; box-shadow:var(--shadow); display:flex; flex-direction:column; justify-content:space-between; }
.cc-trend-lbl{ font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.4px; color:var(--muted); }
.cc-trend-v{ font-size:34px; font-weight:800; color:var(--navy); margin:10px 0 4px; display:flex; align-items:center; gap:8px; line-height:1.05; font-variant-numeric:tabular-nums; }
.cc-trend-sub{ font-size:12px; color:var(--muted); }
.cc-trend-pie{ justify-content:flex-start; }
.cc-arw{ font-size:22px; }
.cc-arw.good{ color:var(--success); }
.cc-arw.bad{ color:var(--danger); }
.cc-arw.flat{ color:var(--light); }

.cc-mid{ display:grid; grid-template-columns:2fr 1fr; gap:16px; margin-bottom:18px; }
/* Category pie sits in the wide (2fr) first column of the Trends grid */
.cc-pie-wrap{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; margin-top:8px; }
.cc-pie-legend{ display:flex; flex-direction:column; gap:5px; flex:1; min-width:150px; }
.cc-pie-key{ display:flex; align-items:center; gap:7px; font-size:11px; }
.cc-pie-nm{ flex:1; color:var(--text); line-height:1.2; }
.cc-pie-ct{ color:var(--muted); font-weight:700; font-variant-numeric:tabular-nums; white-space:nowrap; }
.cc-act{ display:flex; gap:10px; align-items:flex-start; padding:8px 0; border-bottom:1px solid var(--border); cursor:pointer; }
.cc-act:hover .cc-act-t{ color:var(--accent); }
.cc-act-dot{ width:8px; height:8px; border-radius:50%; background:var(--accent); margin-top:5px; flex-shrink:0; }
.cc-act-t{ font-size:12px; font-weight:600; color:var(--text); }
.cc-act-s{ font-size:11px; color:var(--muted); margin-top:1px; }

.cc-watch{ margin-bottom:18px; }
.cc-watch-instr{ font-size:12px; color:var(--muted); margin:-4px 0 12px; }
.cc-watch-row{ display:flex; gap:16px; align-items:flex-start; margin-bottom:14px; flex-wrap:wrap; }
.cc-watch-actions{ display:flex; flex-direction:column; gap:8px; flex-shrink:0; }
.cc-watch-filters{ flex:1; min-width:260px; display:flex; flex-direction:column; gap:12px;
  background:var(--bg); border-radius:10px; padding:14px 16px; }
.cc-wgrp-lbl{ font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.4px; color:var(--muted); margin-bottom:6px; }
.cc-req{ color:var(--accent); font-weight:700; letter-spacing:0; text-transform:none; }
.cc-wgrp-body{ display:flex; flex-wrap:wrap; gap:8px 16px; }
.cc-chk{ font-size:13px; color:var(--text); display:inline-flex; align-items:center; gap:6px; cursor:pointer; }
.cc-chk-lg{ font-weight:600; }
.cc-wsubs{ display:flex; flex-direction:column; gap:10px; width:100%; }
.cc-wsub{ background:var(--white); border:1px solid var(--border); border-radius:8px; padding:10px 12px; }
.cc-wsub-hd{ font-size:12px; font-weight:700; color:var(--text); margin-bottom:7px; }
.cc-wsub-hd span{ font-weight:500; color:var(--light); }
.cc-wsub-list{ display:flex; flex-wrap:wrap; gap:6px 14px; max-height:150px; overflow-y:auto; }
.cc-watch-summary{ flex:1; min-width:260px; display:flex; flex-direction:column; gap:8px; }
.cc-wsum{ display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.cc-wsum-lbl{ font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.4px; color:var(--muted); min-width:150px; }
.cc-wchip{ font-size:12px; font-weight:600; background:var(--accent-light); color:var(--accent); border-radius:20px; padding:2px 10px; }
.cc-wchip-all{ background:var(--bg); color:var(--muted); }

@media (max-width:1024px){
  .cc-trends{ grid-template-columns:1fr 1fr; }
  .cc-trend-pie{ grid-column:1 / -1; }
}
@media (max-width:860px){
  .cc-mid{ grid-template-columns:1fr; }
  .cc-hello-sum{ border-left:none; padding-left:0; }
}
@media (max-width:560px){
  .cc-trends{ grid-template-columns:1fr; }
}

/* Active worklist filters
   ========================================================================== */
/* A filter control (search box / select) that holds a non-default selection is highlighted so it's
   obvious at a glance that the list has been filtered. Applied by markActiveFilters() and inline on
   the JS-rendered Engagements / Restructuring status selects. */
select.filter-active,
input.filter-active{
  border-color:var(--accent);
  background:var(--accent-light);
  color:var(--accent);
  font-weight:600;
  box-shadow:0 0 0 1px var(--accent) inset;
}

/* Trainer — interactive "Training mode"
   ==========================================================================
   Non-blocking: the highlight ring is pointer-events:none and there is no
   full-screen backdrop, so the trainee can still click the real UI. rgba()
   literals below are shadows/glows only (same convention as #tour-spot). */
#trn-ring{
  position:fixed; z-index:9290; pointer-events:none; border-radius:9px;
  border:2px solid var(--accent); box-shadow:0 0 0 3px var(--accent-light);
  transition:top .18s ease,left .18s ease,width .18s ease,height .18s ease;
  animation:trnpulse 1.6s ease-in-out infinite;
}
@keyframes trnpulse{ 0%,100%{ box-shadow:0 0 0 3px var(--accent-light);} 50%{ box-shadow:0 0 0 6px var(--accent-light);} }

#trn-banner{
  position:fixed; top:58px; left:50%; transform:translateX(-50%); z-index:9300;
  display:flex; align-items:center; gap:10px;
  background:var(--navy); color:var(--white);
  padding:7px 10px 7px 14px; border-radius:999px;
  box-shadow:0 10px 30px rgba(15,31,61,.3); font-size:12px;
}
.trn-dot{ width:9px; height:9px; border-radius:50%; background:var(--success); animation:trndot 1.4s ease-out infinite; }
@keyframes trndot{ 0%{ box-shadow:0 0 0 0 rgba(22,163,74,.55);} 70%{ box-shadow:0 0 0 7px rgba(22,163,74,0);} 100%{ box-shadow:0 0 0 0 rgba(22,163,74,0);} }
.trn-bn-tx{ opacity:.95; }
.trn-bn-btn{ background:rgba(255,255,255,.14); color:var(--white); border:none; border-radius:999px; padding:5px 11px; font-size:11px; font-weight:600; cursor:pointer; }
.trn-bn-btn:hover{ background:rgba(255,255,255,.24); }
.trn-bn-exit{ background:var(--white); color:var(--navy); border:none; border-radius:999px; padding:5px 12px; font-size:11px; font-weight:700; cursor:pointer; }
.trn-bn-exit:hover{ background:var(--accent-light); }

#trn-panel{
  position:fixed; right:18px; bottom:18px; width:340px; max-width:calc(100vw - 32px); z-index:9305;
  background:var(--white); border:1px solid var(--border); border-radius:14px;
  box-shadow:0 18px 46px rgba(15,31,61,.34); padding:16px 17px;
}
.trn-x{ position:absolute; top:9px; right:10px; width:24px; height:24px; border:none; background:none; color:var(--light); font-size:14px; cursor:pointer; border-radius:6px; line-height:1; }
.trn-x:hover{ background:var(--bg); color:var(--muted); }
.trn-head{ display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.trn-h-ic{ width:34px; height:34px; border-radius:9px; background:var(--accent-light); display:flex; align-items:center; justify-content:center; font-size:18px; }
.trn-h-ti{ font-size:14px; font-weight:800; color:var(--navy); }
.trn-h-su{ font-size:11px; color:var(--muted); }
.trn-lead{ font-size:12px; color:var(--muted); margin-bottom:10px; }
.trn-lesson{ display:block; width:100%; text-align:left; background:var(--bg); border:1px solid var(--border); border-radius:10px; padding:10px 12px; margin-bottom:8px; cursor:pointer; }
.trn-lesson:hover{ border-color:var(--accent); background:var(--accent-light); }
.trn-l-ti{ font-size:13px; font-weight:700; color:var(--navy); }
.trn-l-ds{ font-size:11.5px; color:var(--muted); margin-top:2px; }
.trn-explore{ display:block; width:100%; text-align:center; background:none; border:none; color:var(--accent); font-size:12px; font-weight:600; cursor:pointer; padding:6px; margin-top:2px; }
.trn-step{ font-size:10px; font-weight:700; letter-spacing:.5px; color:var(--accent); text-transform:uppercase; }
.trn-title{ font-size:15px; font-weight:800; color:var(--navy); margin:3px 0 6px; }
.trn-text{ font-size:12.5px; color:var(--muted); line-height:1.55; }
.trn-status{ font-size:12px; font-weight:600; margin-top:10px; padding:7px 10px; border-radius:8px; }
.trn-status.wait{ background:var(--accent-light); color:var(--accent); }
.trn-status.ok{ background:var(--success-bg); color:var(--success); }
.trn-actions{ display:flex; align-items:center; gap:8px; margin-top:14px; }
.trn-link{ background:none; border:none; color:var(--accent); font-size:12px; font-weight:600; cursor:pointer; padding:4px; }
.trn-link:hover{ text-decoration:underline; }
.trn-actions .btn:disabled{ opacity:.45; cursor:not-allowed; }

/* Notice / form preview — real paragraph spacing (parity with the printed doc) */
.form-preview p{ margin:0 0 12px; }
.form-preview p:last-child{ margin-bottom:0; }

/* Case record side-panel buttons (Description / Investigation / Assessment) */
.cx-record-btn{ display:flex; width:100%; justify-content:flex-start; text-align:left; margin-bottom:6px; }
.cx-record-btn:last-child{ margin-bottom:0; }
