/* ZeniX AI Vigilance — clean UI layer (CC-2026-003 UI change)
 * Loaded after app.css. Quiet white surfaces, hairline borders, one ink primary,
 * colour reserved for status. Source Sans 3 throughout (tokens.css).
 */

:root, body {
  --surface-1: #FFFFFF;
  --canvas: #FFFFFF;
  --line: #E8EBF0;
  --line-2: #DCE1E8;
  --ink: #16202E;
  --ink-2: #5A6577;
  --ink-3: #8B94A5;
  --accent: #2457D6;
  --accent-hover: #1C47B5;
  --accent-soft: #EEF3FD;
  --soft: #F5F7FA;
  --ok-soft: #E9F6EF;
  --warn-soft: #FDF3E4;
  --bad-soft: #FCECEC;
  --radius: 8px;
  --r-card: 10px;
  --shadow-pop: 0 8px 24px rgba(16, 24, 40, .10), 0 1px 3px rgba(16, 24, 40, .06);
}
body.dark {
  --surface-0: #141922; --surface-1: #0F131A; --surface-2: #1C2230; --canvas: #0F131A;
  --line: #232A37; --line-2: #2C3443; --ink: #E7EAF0; --ink-2: #A9B1C1; --ink-3: #7C8597;
  --soft: #1A202B; --accent: #6E95F2; --accent-soft: #1C2742;
  --ok-soft: #12291D; --warn-soft: #2E2312; --bad-soft: #321718;
}

body { background: var(--canvas); color: var(--ink); -webkit-font-smoothing: antialiased; }

/* ── Sidebar ─────────────────────────────────────────────────────────── */
.sidebar { background: var(--surface-0); border-right: 1px solid var(--line); box-shadow: none; }
body.dark .sidebar { background: var(--surface-0); }
.sidebar-logo { padding: 18px 18px 14px; border-bottom: 0; gap: 10px; }
.sidebar-logo .logo-text h2 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.ws-switch { margin: 0 14px 10px; padding: 3px; background: var(--soft); border: 0; border-radius: 8px; gap: 2px; }
.ws-switch button { border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); font-weight: 600;
  font-size: 13px; padding: 6px 8px; box-shadow: none; }
.ws-switch button[aria-pressed="true"] { background: var(--surface-0); color: var(--ink);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .08); }
.sidebar-nav { padding: 4px 10px 12px; }
.nav-section-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--ink-3);
  padding: 16px 10px 6px; text-transform: uppercase; }
.nav-item { padding: 7px 10px; margin: 1px 0; border-radius: 7px; color: var(--ink-2); font-size: 14px;
  border: 0; border-left: 0; gap: 11px; }
.nav-item:hover { background: var(--soft); color: var(--ink); }
.nav-item.active { background: var(--soft); color: var(--ink); font-weight: 600; border-left: 0; box-shadow: none; }
.nav-item .nav-icon { width: 16px; color: var(--ink-3); font-size: 13px; }
.nav-item.active .nav-icon, .nav-item:hover .nav-icon { color: var(--ink); }
.sidebar-footer { border-top: 1px solid var(--line); padding: 10px; }
.collapse-btn { border: 0; background: transparent; color: var(--ink-3); border-radius: 7px; }
.collapse-btn:hover { background: var(--soft); color: var(--ink); }

/* ── Top bar ─────────────────────────────────────────────────────────── */
.topbar { height: 56px; min-height: 56px; background: var(--surface-0); border-bottom: 1px solid var(--line);
  padding: 0 28px; box-shadow: none; }
.crumbs { display: flex; align-items: baseline; gap: 8px; font-size: 14px; min-width: 0; }
.crumb-ws { color: var(--ink-3); white-space: nowrap; }
.crumb-sep { color: var(--line-2); }
.topbar .topbar-title { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.topbar .topbar-sub { display: none; }
.topbar-right { gap: 10px; }
.icon-btn { position: relative; width: 34px; height: 34px; display: inline-grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; font-size: 15px; }
.icon-btn:hover { background: var(--soft); color: var(--ink); }
.notif-wrap { position: relative; }
#notif-count { position: absolute; top: 3px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px;
  text-align: center; }
.user-menu { position: relative; display: flex; align-items: center; }
.user-chip { display: flex; align-items: center; gap: 9px; border: 0; background: transparent; padding: 4px 8px 4px 4px;
  border-radius: 999px; cursor: pointer; font-family: inherit; color: var(--ink); }
.user-chip:hover { background: var(--soft); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #E4E9F2; color: var(--ink); display: inline-grid;
  place-items: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
body.dark .avatar { background: #2A3242; }
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.user-chip-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.user-chip .u-name { font-size: 13px; font-weight: 600; }
.u-role-label { font-size: 11px; color: var(--ink-3); }
.user-chip-caret { font-size: 10px; color: var(--ink-3); }
.user-pop { position: absolute; right: 0; top: 44px; width: 248px; background: var(--surface-0); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-pop); padding: 6px; z-index: 1100; }
.user-pop[hidden] { display: none; }
.user-pop-head { padding: 10px 10px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex;
  flex-direction: column; gap: 2px; }
.user-pop-head b { font-size: 14px; }
.user-pop-head span { font-size: 12px; color: var(--ink-3); }
.pop-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px;
  background: transparent; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.pop-item i { width: 14px; color: var(--ink-3); font-size: 13px; text-align: center; }
.pop-item:hover { background: var(--soft); }
.pop-static { cursor: default; color: var(--ink-2); }
.pop-static:hover { background: transparent; }
.pop-static #ws-dot { font-size: 7px; }
.pop-danger { color: var(--danger); }
.pop-danger i { color: var(--danger); }
.pop-meta { font-size: 11px; color: var(--ink-3); padding: 6px 10px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.session-warn { border-radius: 999px; }

/* ── Content + page heads ─────────────────────────────────────────────── */
.content { background: var(--canvas); padding: 28px 32px 40px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-title, .dash-head h1 { font-size: 26px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); margin: 0; }
.page-sub, .page-head .text-muted { color: var(--ink-2); font-size: 14px; margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-shrink: 0; }
.section-title { font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--ink-3); text-transform: uppercase; }
.text-meta { color: var(--ink-3); font-size: 12px; }

/* ── Cards ───────────────────────────────────────────────────────────── */
.card, .stat-card, .pillar-card, .result-card { background: var(--surface-0); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: none; }
.card { padding: 18px 20px; }
.card:hover, .stat-card:hover, .pillar-card:hover { border-color: var(--line); box-shadow: none; transform: none; }
.card-header { border-bottom: 0; padding-bottom: 6px; }
.card-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.card-sub { color: var(--ink-3); font-size: 12px; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px;
  border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 15px; font-weight: 600; margin: 0; }
.link-btn { border: 0; background: transparent; color: var(--accent); font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.stat-icon, .pillar-icon { border-radius: 8px; }

/* ── Buttons: one ink primary, one outline secondary, semantic only where it matters ── */
.btn { border-radius: 8px; font-weight: 600; font-size: 13px; padding: 7px 13px; gap: 7px; box-shadow: none;
  border: 1px solid transparent; transition: background .12s, border-color .12s, color .12s; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn-primary, .btn-blue, .btn-green, .btn-teal, .btn-purple { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover:not(:disabled), .btn-blue:hover:not(:disabled), .btn-green:hover:not(:disabled),
.btn-teal:hover:not(:disabled), .btn-purple:hover:not(:disabled) { background: #2B3647; border-color: #2B3647; opacity: 1; }
body.dark .btn-primary, body.dark .btn-blue, body.dark .btn-green, body.dark .btn-teal, body.dark .btn-purple {
  background: #E7EAF0; color: #0F131A; border-color: #E7EAF0; }
.btn-ghost { background: var(--surface-0); color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover:not(:disabled) { background: var(--soft); color: var(--ink); border-color: var(--line-2); }
.btn-amber { background: var(--surface-0); color: var(--warn); border-color: #F0D9B5; }
.btn-amber:hover:not(:disabled) { background: var(--warn-soft); opacity: 1; }
.btn-danger { background: var(--surface-0); color: var(--danger); border-color: #F1C9C9; }
.btn-danger:hover:not(:disabled) { background: var(--bad-soft); opacity: 1; }
.btn:disabled { opacity: .45; }

/* ── Badges → soft pills ─────────────────────────────────────────────── */
.badge { border-radius: 999px; font-weight: 600; font-size: 12px; padding: 2px 9px; border: 0; }
.badge-gray { background: var(--soft); color: var(--ink-2); }
.badge-blue { background: var(--accent-soft); color: var(--accent); }
.badge-green { background: var(--ok-soft); color: var(--ok); }
.badge-amber { background: var(--warn-soft); color: var(--warn); }
.badge-red { background: var(--bad-soft); color: var(--danger); }
.badge-purple { background: #F3EEFC; color: #6B46C1; }
.badge-teal { background: #E8F5F5; color: #0E6E73; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; border-radius: 999px;
  padding: 2px 9px; background: var(--soft); color: var(--ink-2); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-s1 { color: #3B5BB5; background: #EEF2FC; }
.pill-s2 { color: #6B46C1; background: #F3EEFC; }
.pill-s3 { color: #0E6E73; background: #E8F5F5; }
.pill-ok { color: var(--ok); background: var(--ok-soft); }
.pill-warn { color: var(--warn); background: var(--warn-soft); }
.pill-info { color: var(--accent); background: var(--accent-soft); }
body.dark .pill-s1, body.dark .pill-s2, body.dark .pill-s3 { background: var(--soft); }
.prog { display: inline-flex; gap: 3px; margin-left: 9px; vertical-align: middle; }
.prog i { width: 14px; height: 4px; border-radius: 2px; background: var(--line-2); }
.prog i.f { background: var(--ink); }
.tag { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--ink-2); white-space: nowrap; }

/* ── Tables ──────────────────────────────────────────────────────────── */
.table-wrap { border: 0; border-radius: 0; }
.card > .table-wrap { margin: -2px -4px; }
table { font-size: 14px; }
th { background: transparent; color: var(--ink-3); font-size: 12px; font-weight: 600; text-transform: none;
  letter-spacing: 0; padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 16px; border-bottom: 1px solid var(--line); color: var(--ink); vertical-align: middle; }
tr:hover td { background: #FAFBFC; }
body.dark tr:hover td { background: var(--soft); }
.th-action, .td-action { text-align: right; }
.case-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.case-link:hover { text-decoration: underline; }
.who { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.dl { font-variant-numeric: tabular-nums; }
.dl-bad { color: var(--danger); font-weight: 600; }
.dl-warn { color: var(--warn); font-weight: 600; }

/* Row actions: one primary + "⋯" menu (details/summary — no script needed to open) */
.row-actions { display: inline-flex; align-items: center; gap: 4px; justify-content: flex-end; }
.row-menu { position: relative; }
.row-menu > summary { list-style: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px;
  color: var(--ink-3); cursor: pointer; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu > summary:hover, .row-menu[open] > summary { background: var(--soft); color: var(--ink); }
.row-menu .menu { position: absolute; right: 0; top: 34px; min-width: 190px; background: var(--surface-0);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-pop); padding: 5px; z-index: 50; text-align: left; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; font: inherit;
  font-size: 13px; color: var(--ink); padding: 7px 10px; border-radius: 6px; cursor: pointer; text-align: left; }
.menu-item i { width: 14px; text-align: center; color: var(--ink-3); }
.menu-item:hover { background: var(--soft); }
.menu-warn, .menu-warn i { color: var(--warn); }
.menu-danger, .menu-danger i { color: var(--danger); }
.row-menu-spacer { display: inline-block; width: 30px; }

/* ── Review tabs (wf-step elements restyled as underline tabs) ─────────── */
.wf-tabs { display: flex; align-items: center; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 16px;
  overflow-x: auto; }
.wf-tabs .wf-arrow { display: none; }
.wf-step { background: transparent !important; color: var(--ink-2) !important; padding: 10px 0 !important; border: 0;
  border-radius: 0; font-weight: 600; font-size: 14px; opacity: 1 !important; white-space: nowrap; flex: 0 0 auto; }
.wf-step i { display: none; }
.wf-step span { color: inherit !important; }
.wf-step:hover { color: var(--ink) !important; }
.wf-step.active { color: var(--ink) !important; box-shadow: inset 0 -2px 0 var(--ink); }
.tab-count { color: var(--ink-3); font-weight: 400; margin-left: 6px; }
#review-filter-label { display: none; }

/* role banner → quiet note */
#review-role-banner .card { background: var(--soft); border: 0; border-radius: 8px; padding: 10px 14px !important;
  font-size: 13px !important; color: var(--ink-2); }

/* ── Dashboard: status checks + work ─────────────────────────────────── */
.checks { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line);
  border-radius: var(--r-card); margin-bottom: 24px; background: var(--surface-0); }
.check { padding: 14px 16px; border-right: 1px solid var(--line); cursor: pointer; }
.check:last-child { border-right: 0; }
.check:hover { background: #FAFBFC; }
body.dark .check:hover { background: var(--soft); }
.check-head { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 14px; }
.check-value { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.check-sub { color: var(--ink-3); font-size: 12px; margin-top: 1px; }
.check-dot { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 10px;
  background: var(--soft); color: var(--ink-3); }
.check-dot.ok { background: var(--ok-soft); color: var(--ok); }
.check-dot.warn { background: var(--warn-soft); color: var(--warn); }
.check-dot.bad { background: var(--bad-soft); color: var(--danger); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.dl-list { list-style: none; margin: 0; padding: 0; }
.dl-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 18px;
  border-bottom: 1px solid var(--line); font-size: 14px; }
.dl-list li:last-child { border-bottom: 0; }
@media (max-width: 1200px) {
  .checks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .check:nth-child(3) { border-right: 0; }
  .check:nth-child(n+4) { border-top: 1px solid var(--line); }
  .dash-grid { grid-template-columns: 1fr; }
}

/* ── Forms ───────────────────────────────────────────────────────────── */
.form-input, .form-select, .form-textarea { border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface-0);
  font-size: 14px; padding: 8px 11px; box-shadow: none; }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft); outline: 0; }
.form-label { font-size: 13px; font-weight: 600; color: var(--ink); }

/* ── Tabs used across views ──────────────────────────────────────────── */
.cf-tabs { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0; gap: 20px; }
.cf-tab { background: transparent; border-radius: 0; padding: 10px 0; color: var(--ink-2); font-weight: 600; }
.cf-tab:hover { background: transparent; color: var(--ink); }
.cf-tab.active { background: transparent; color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.cu-tab.active, .priv-tab-active { color: var(--ink) !important; border-bottom-color: var(--ink) !important; }
.mdb-type.active, .mdb-level.active { background: var(--ink); color: #fff; }

/* ── Modals ──────────────────────────────────────────────────────────── */
.modal-overlay { background: rgba(15, 20, 30, .35); backdrop-filter: blur(2px); }
.modal { border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-title { font-size: 16px; font-weight: 600; }

/* ── Misc ────────────────────────────────────────────────────────────── */
.empty-state { color: var(--ink-3); }
.empty-state i { color: var(--ok); opacity: .9; font-size: 24px; }
.toast { border-radius: 10px; box-shadow: var(--shadow-pop); border: 1px solid var(--line); }
#chat-fab, .chat-fab { box-shadow: var(--shadow-pop); }

/* A card that only holds a table sits flush, like Ketryx lists */
.card:has(> .table-wrap:only-child) { padding: 0; overflow: visible; }
.card:has(> .table-wrap:only-child) > .table-wrap { margin: 0; }
.card:has(> .table-wrap:only-child) th:first-child, .card:has(> .table-wrap:only-child) td:first-child { padding-left: 20px; }
.card:has(> .table-wrap:only-child) th:last-child, .card:has(> .table-wrap:only-child) td:last-child { padding-right: 16px; }
#view-review .table-wrap, #view-cases .table-wrap, .dash-pv .table-wrap { overflow: visible; }

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #B8BFCC; margin: 0 3px; flex-shrink: 0; }

/* Legacy buttons coloured inline (PADER orange, RMP purple, bright-blue Refresh) → standard styles */
.content .btn:not(.btn-ghost):not(.btn-danger):not(.btn-amber)[style*="background"] {
  background: var(--ink) !important; border-color: var(--ink) !important; color: #fff !important; }
.content .btn.btn-ghost[style*="background"] { background: var(--surface-0) !important; color: var(--ink) !important; }
/* Page titles carry no decorative icons (Ketryx-style plain headings) */
.view h2 > i:first-child, .view .page-title > i:first-child { display: none; }
.view h2 { letter-spacing: -.015em; }

/* Case review panel: light header, quiet section actions */
.rp-head { padding: 16px 20px; background: var(--surface-0); border-bottom: 1px solid var(--line); display: flex;
  align-items: center; justify-content: space-between; flex-shrink: 0; }
.rp-title { font-size: 18px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.rp-sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
#review-preview-modal > div { border-radius: 12px !important; border-color: var(--line) !important; }
#rp-body .btn-primary, #rp-body .btn-blue { background: var(--surface-0); color: var(--ink); border-color: var(--line-2); }
#rp-body .btn-primary:hover, #rp-body .btn-blue:hover { background: var(--soft); border-color: var(--line-2); }
#rp-body .rp-sec { border-radius: 10px !important; border-color: var(--line) !important; background: var(--surface-0) !important; }
#rp-body .rp-sec > div:first-child { background: var(--surface-0) !important; border-color: var(--line) !important; padding: 12px 16px !important; }
#rp-body .rp-sec > div:first-child > div { text-transform: none !important; letter-spacing: 0 !important; font-size: 14px !important; font-weight: 600 !important; }
#rp-body .rp-sec > div:first-child > div > i { color: var(--ink-3) !important; }
#rp-body .rp-sec > div:first-child > button { background: var(--surface-0) !important; color: var(--ink) !important;
  border: 1px solid var(--line-2) !important; border-radius: 8px !important; padding: 5px 11px !important; }
#rp-body .rp-sec > div:first-child > button:hover { background: var(--soft) !important; }

/* ── Group 2: calendar, periodic reports, signals ── */
.checks.checks-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.checks-3 .check { cursor: default; }
.checks-3 .check:hover { background: transparent; }
.page-actions .form-select { width: auto; min-width: 150px; padding: 6px 10px; font-size: 13px; }
.empty-row { padding: 26px 8px; text-align: center; color: var(--ink-3); font-size: 14px; }
.empty-row i { color: var(--ok); margin-right: 6px; }
.empty-card { text-align: center; color: var(--ink-3); font-size: 13px; padding: 22px; }
.er-tabs { margin-bottom: 16px; }
.er-tabs .cf-tab { border: 0; font: inherit; font-size: 14px; cursor: pointer; }
.section-heading { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 14px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid-2 .span-2 { grid-column: 1 / -1; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 6px; }
.opt { color: var(--ink-3); font-weight: 400; }
#psur-result:not(:empty) { margin-top: 16px; }
#view-reports > .card + #psur-result + .card, #view-reports > .card { margin-bottom: 16px; }
@media (max-width: 900px) { .form-grid-2 { grid-template-columns: 1fr; } .checks.checks-3 { grid-template-columns: 1fr; } }
.er-tabs { display: flex; justify-content: flex-start; width: auto; }
.er-tabs .cf-tab { flex: 0 0 auto; width: auto; padding: 10px 2px; background: transparent; color: var(--ink-2); }
.er-tabs .cf-tab.active { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }

/* ── Group 3: Master DB ── */
.seg-row { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--soft); border-radius: 8px; }
.seg button { border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 600;
  padding: 6px 12px; border-radius: 6px; cursor: pointer; }
.seg button:hover { color: var(--ink); }
.seg .mdb-type.active, .seg .mdb-level.active { background: var(--surface-0); color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .08); }
.mdb-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 2px 0 12px; font-size: 13px; color: var(--ink-2); }
.mdb-summary b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.mdb-summary .sep { font-style: normal; color: var(--line-2); }
#view-master-db .form-input, #view-master-db .form-select { font-size: 13px !important; }
.mdb-table { font-size: 13px; }
.mdb-table th, .mdb-table td { white-space: nowrap; }
.mdb-table td { padding: 9px 14px; vertical-align: middle; }
.mdb-table th { padding: 10px 14px; position: sticky; top: 0; z-index: 2; background: var(--surface-0); }
.mdb-table th.sortable { cursor: pointer; user-select: none; }
.mdb-table th.sortable:hover, .mdb-table th.sorted { color: var(--ink); }
.mdb-table th i { font-size: 10px; margin-left: 3px; }
.mdb-table th:first-child, .mdb-table td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface-0);
  box-shadow: inset -1px 0 0 var(--line); }
.mdb-table th:first-child { z-index: 3; }
.mdb-table tr:hover td:first-child { background: #FAFBFC; }
body.dark .mdb-table tr:hover td:first-child { background: var(--soft); }

/* Page header: text shrinks, actions stay on the right */
.page-head { flex-wrap: nowrap; }
.page-head > div:first-child { flex: 1 1 auto; min-width: 0; }
.page-head > .btn, .page-head > .page-actions, .page-head > div:last-child:not(:first-child) { flex: 0 0 auto; }
@media (max-width: 760px) { .page-head { flex-wrap: wrap; } }
.seg button.active { background: var(--surface-0); color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .08); }
.seg button i { margin-right: 5px; color: var(--ink-3); }

/* ── Group 4: oversight dashboards, signal lifecycle, literature, users ── */
.checks-static .check { cursor: default; }
.checks-static .check:hover { background: transparent; }
.checks.checks-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1200px) { .checks.checks-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kpi-num { font-size: 24px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.form-select-sm { width: auto; padding: 4px 8px; font-size: 13px; }
.view .section-heading > i, .view .card-title > i { color: var(--ink-3) !important; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; background: var(--soft); border-radius: 8px;
  margin-bottom: 16px; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.note > i { color: var(--ink-3); margin-top: 3px; }
.note strong { color: var(--ink); }
.src-label { font-weight: 600; font-size: 13px; color: var(--ink); }
.users-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.users-table th { text-align: left; }
.users-table td { vertical-align: middle; }
.u-cell-name { font-weight: 600; }
.u-warn { font-size: 12px; color: var(--warn); margin-top: 2px; }
.u-warn i { margin-right: 4px; }
#admin-users-table { overflow: visible; }
.note { display: block; }
.note > i { margin: 0 8px 0 0; }
.users-table th.th-action { text-align: right; }

/* ── Workflow: team card, assignee, out of office, automatic checks, change history ── */
.team-card { margin-top: 24px; }
.unassigned-strip { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 18px; background: var(--warn-soft); color: var(--warn); font-size: 13px; border-bottom: 1px solid var(--line); }
.unassigned-strip .ua-cases { display: flex; gap: 12px; flex-wrap: wrap; }
.ooo-form .form-group { margin-bottom: 14px; }
.ooo-toggle { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 16px; cursor: pointer; }
.ooo-toggle input { width: 16px; height: 16px; }
.rp-wf { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; background: var(--surface-0); }
.rp-wf-grid { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 12px; align-items: end; padding-bottom: 12px;
  border-bottom: 1px solid var(--line); margin-bottom: 12px; font-size: 14px; }
.rp-wf-grid .text-meta { display: block; margin-bottom: 2px; }
.ac-title { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); margin: 2px 0 8px; }
.ac-title .text-meta { text-transform: none; letter-spacing: 0; font-weight: 400; }
.ac-row { padding: 8px 0; border-top: 1px solid var(--line); }
.ac-row:first-of-type { border-top: 0; }
.ac-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; }
.ac-note { font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.ac-list { margin: 6px 0 0 18px; padding: 0; font-size: 13px; color: var(--ink-2); }
.ac-list li { margin: 3px 0; }
.rp-hist { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 6px; margin-top: 4px; background: var(--surface-0); }
.rp-hist > .ac-title { margin-bottom: 10px; }
.h-list { list-style: none; margin: 0; padding: 0; }
.h-list li { position: relative; padding: 0 0 16px 22px; margin-left: 5px; border-left: 1px solid var(--line); }
.h-list li:last-child { border-left-color: transparent; padding-bottom: 6px; }
.h-list li::before { content: ""; position: absolute; left: -5px; top: 5px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--surface-0); border: 2px solid var(--line-2); box-sizing: border-box; }
.h-list li.h-ok::before { border-color: #1F8A4C; background: #1F8A4C; }
.h-list li.h-warn::before { border-color: #B26B00; background: #B26B00; }
.h-list li.h-bad::before { border-color: #C53030; background: #C53030; }
.h-list li.h-accent::before { border-color: var(--accent); }
.h-head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 14px; line-height: 1.35; }
.h-by { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.h-chip { font-size: 11px; color: var(--ink-3); background: var(--soft); border: 1px solid var(--line); padding: 0 6px; border-radius: 4px; }
.h-note { font-size: 13px; color: var(--ink-2); margin-top: 6px; line-height: 1.5; }
.h-muted { color: var(--ink-3); }
.h-reason { margin-top: 6px; font-size: 13px; color: var(--ink-2); line-height: 1.5; padding: 6px 10px; background: var(--soft); border-radius: 6px; }
.h-reason > span { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); margin-right: 8px; }
.h-checks { list-style: none; margin: 6px 0 0; padding: 0; font-size: 13px; }
.h-checks li { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 5px 0; border-top: 1px solid var(--line); margin: 0; border-left: 0; }
.h-checks li::before { display: none; }
.h-checks li:first-child { border-top: 0; }
.h-checks b { font-weight: 600; color: var(--ink); }
.h-checks span { color: var(--ink-2); line-height: 1.45; }
.h-diff { width: 100%; margin-top: 8px; font-size: 13px; border-collapse: collapse; table-layout: fixed; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.h-diff col.c-f { width: 32%; }
.h-diff th, .h-diff td { padding: 6px 10px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.h-diff thead th { border-top: 0; background: var(--soft); color: var(--ink-3); font-size: 11.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.h-diff td:first-child { color: var(--ink); font-weight: 500; }
.h-diff td.h-old { color: var(--ink-3); }
.h-kv { display: grid; grid-template-columns: max-content 1fr; gap: 1px 8px; margin: 0; }
.h-kv dt { color: var(--ink-3); }
.h-kv dd { margin: 0; }
@media (max-width: 640px) { .h-checks li { grid-template-columns: 1fr; gap: 2px; } }
.ac-title-row { display: flex; align-items: center; justify-content: space-between; }
.ac-title-row .btn { text-transform: none; letter-spacing: 0; }

/* Review panel: reviewer edits with justification */
.rp-sec-act { display: inline-flex; align-items: center; gap: 8px; }
.rp-edit { display: flex; flex-direction: column; gap: 12px; }
.rp-edit-item { padding: 10px 12px; background: var(--bg); border-radius: var(--r-s); border: 1px solid var(--border); }
.rp-edit-item-h { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.rp-edit-rm { display: inline-flex; gap: 4px; align-items: center; color: var(--red); font-weight: 500; cursor: pointer; }
.rp-edit-why { padding-top: 10px; border-top: 1px dashed var(--border); }
.rp-edit-why .req { color: var(--red); }
.rp-edit-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; }
.rp-edit-btns { display: inline-flex; gap: 8px; }

/* Review panel: information needed (core/required_fields.py) */
.rp-open { margin-bottom: 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.rp-open.has-req { border-left: 3px solid var(--red); }
.of-xml { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; margin: 6px 0 8px; }
.of-errs { font-size: 12px; margin-bottom: 8px; }
.of-errs summary { cursor: pointer; color: var(--text2); }
.of-errs ul { margin: 6px 0 0 18px; padding: 0; }
.of-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.of-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-s); font-size: 13px; }
.of-list li.of-required { background: rgba(220, 38, 38, .05); border-left: 3px solid var(--red); }
.of-list li.of-recommended { background: rgba(217, 119, 6, .05); border-left: 3px solid var(--amber); }
.of-tag { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 999px; }
.of-tag.of-required { color: var(--red); background: rgba(220, 38, 38, .08); }
.of-tag.of-recommended { color: var(--amber); background: rgba(217, 119, 6, .08); }
.is-required-open { border-color: var(--red) !important; box-shadow: 0 0 0 2px rgba(220, 38, 38, .12); }
.is-recommended-open { border-color: var(--amber) !important; }
.pill-bad { color: var(--red); background: rgba(220, 38, 38, .08); }
.dl-ok { color: var(--ok); }

/* Review panel: case versions */
.rp-vers { margin: 0 0 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.v-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.v-list li { padding: 10px 12px; border-radius: var(--r-s); background: var(--bg); border-left: 3px solid var(--border); }
.v-list li.v-current { border-left-color: var(--accent); }
.v-tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 4px 0 6px; font-size: 12px; }

/* Review panel: test results + clinical documents */
.lab-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.lab-table th { text-align: left; color: var(--text3); font-weight: 600; padding: 4px 6px; border-bottom: 1px solid var(--border); }
.lab-table td { padding: 5px 6px; border-bottom: 1px solid var(--border); }
.cd-upload { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 6px 0 10px; }
.cd-upload .form-select, .cd-upload .form-input { width: auto; padding: 6px 8px; font-size: 12px; }
.cd-sum { font-size: 13px; margin: 4px 0; }
.cd-warn { font-size: 12px; color: var(--amber); margin: 4px 0; }
.cd-pre { white-space: pre-wrap; font-size: 11px; max-height: 220px; overflow: auto; background: var(--surface); padding: 8px; border-radius: var(--r-s); }
.cd-props { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.cd-props li { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 12px; padding: 6px 8px; border-radius: var(--r-s); background: var(--surface); }
.cd-props label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; min-width: 0; }
.cd-props li.cd-p-accepted, .cd-props li.cd-p-rejected { opacity: .7; }
.cd-actions { display: flex; flex-direction: column; gap: 6px; }
.cd-actions .rp-edit-btns { justify-content: flex-end; }

/* Access per user */
.acc-seg { display: flex; flex-wrap: wrap; gap: 4px; }
.seg-opt { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; }
.seg-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.seg-opt.is-off { opacity: .4; cursor: not-allowed; }
.acc-editor td { vertical-align: top; }
.acc-ceiling td.acc-l { text-align: center; font-size: 12px; }
.acc-ceiling .acc-none { color: var(--text3); }
.acc-ceiling .acc-full { font-weight: 600; }

/* Reporter contact for follow-up (masked by default) */
.rc-box { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); font-size: 13px; }
.rc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.rc-head > i { color: var(--ink-3); }
.rc-head .rc-hide { margin-left: auto; }
.rc-masked { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ink-2); }
.rc-masked i { color: var(--ink-3); margin-right: 4px; }
.rc-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.rc-form .form-select { flex: 1 1 220px; max-width: 360px; }
.rc-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 3px 0; }
.rc-row span { color: var(--ink-3); }
.rc-row b { font-weight: 600; overflow-wrap: anywhere; }
.rc-legal { margin-top: 8px; font-size: 12px; color: var(--ink-3); line-height: 1.45; }
