:root {
  --paper: #f4f5f7;
  --surface: #ffffff;
  --ink: #111827;
  --muted: #4b5563;
  --line: #e5e7eb;
  --accent: #0e5700;          /* Chesapeake green */
  --accent-dark: #0a4200;
  --accent-soft: #ecfdf5;
  --gold: #d97706;            /* Chesapeake gold (accents/text — readable) */
  --gold-soft: #fffbeb;
  --gold-bright: #edd200;     /* logo globe yellow (decorative only) */
  --danger: #ef4444;
  --amber: #b45309;
  --radius: 8px;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Public Sans", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: "Spectral", Georgia, serif; font-weight: 600; line-height: 1.2; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 22px; background: var(--accent);
  border: 3px solid #edd200; border-radius: 14px; margin: 10px 12px 0;
}
.topbar .brand { display: flex; align-items: baseline; gap: 12px; }
.topbar .brand h1 { font-size: 20px; margin: 0; }
.topbar .brand .tag {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.topbar nav { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.topbar .user { color: var(--muted); font-size: 13px; }
.topbar nav .icon-btn { background: transparent; border: 0; color: #fff; cursor: pointer;
  padding: 7px; border-radius: 9px; display: inline-flex; align-items: center; opacity: .9; }
.topbar nav .icon-btn:hover { background: rgba(255,255,255,.16); opacity: 1; }
.topclock { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.1;
  color: #f4f1e6; margin-right: 4px; font-variant-numeric: tabular-nums; }
.topclock .tc-time { font-weight: 700; font-size: 14px; }
.topclock .tc-date { font-size: 11px; color: rgba(244,241,230,.78); }
@media (max-width: 700px) { .topclock .tc-date { display: none; } }
@media (max-width: 520px) { .topclock { display: none; } }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: #d9b44a; color: #3a2c00;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
  letter-spacing: .4px; border: 0; }
.profile-menu > summary { display: inline-flex; outline: none; }
.profile-menu > summary:hover { box-shadow: 0 0 0 3px rgba(255,255,255,.22); border-radius: 50%; }
.profile-menu .panel { min-width: 236px; padding-bottom: 4px; }
.profile-menu .profile-head { display: flex; gap: 11px; align-items: center; padding: 13px 14px;
  border-bottom: 1px solid var(--line); }
.profile-menu .avatar.lg { width: 42px; height: 42px; font-size: 15px; flex: 0 0 auto; }
.profile-menu .pf-id { display: flex; flex-direction: column; min-width: 0; }
.profile-menu .pf-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.profile-menu .pf-mail { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.profile-menu .panel a { font-size: 14px; }
.profile-menu .pf-signout { border-top: 1px solid var(--line); margin-top: 4px; }
.profile-menu .pf-signout button { width: 100%; text-align: left; background: transparent; border: 0;
  padding: 10px 14px; cursor: pointer; color: var(--ink); font: inherit; }
.profile-menu .pf-signout button:hover { background: var(--accent-soft); }

.wrap { max-width: 1040px; margin: 0 auto; padding: 28px; }

.flash {
  padding: 11px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px;
  border: 1px solid var(--line); background: var(--surface);
}
.flash.success { background: var(--accent-soft); border-color: #bcd6c9; }
.flash.error { background: #f6e7e3; border-color: #e3c4bc; color: #5e261b; }

/* Toolbar / search */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 22px; }
.toolbar form { display: flex; gap: 8px; flex: 1 1 auto; flex-wrap: wrap; }
input[type="text"], input[type="search"], input[type="number"], input[type="date"],
select, textarea {
  font: inherit; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); color: var(--ink);
}
input[type="search"] { flex: 1 1 240px; }
textarea { width: 100%; }

.btn {
  font: inherit; cursor: pointer; border: 1px solid var(--accent-dark);
  background: var(--accent); color: #fff; padding: 9px 16px; border-radius: var(--radius);
}
.btn:hover { background: var(--accent-dark); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--accent-dark); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger { background: transparent; color: var(--danger); border-color: #d7b3aa; }

.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu .panel {
  position: absolute; right: 0; margin-top: 6px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); min-width: 200px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08); z-index: 5; overflow: hidden;
}
.menu .panel a { display: block; padding: 10px 14px; color: var(--ink); }
.menu .panel a:hover { background: var(--accent-soft); text-decoration: none; }

/* Listing */
table { width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #faf8f2; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px;
  border: 1px solid var(--line); color: var(--muted); }
.pill.draft { background: #f0eee7; }
.pill.in_review { background: #f6efdd; color: var(--amber); border-color: #e6d6ab; }
.pill.approved { background: var(--accent-soft); color: var(--accent-dark); border-color: #bcd6c9; }
.pill.archived { background: #ece9e3; color: var(--muted); }
.review-alert { display:flex; gap:10px; align-items:center; border-radius:10px; padding:12px 16px;
  margin-bottom:16px; font-size:14px; }
.review-alert.overdue { background:#fdecec; color:#8a1c10; border:1px solid #f3c7c7; }
.review-alert.soon { background:#fff6e0; color:#7a5600; border:1px solid #e6d6ab; }

.empty { padding: 48px; text-align: center; color: var(--muted); }

/* Detail layout */
.detail { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 18px; }
.card h3 { margin: 0 0 12px; font-size: 16px; }
.viewer { width: 100%; height: 560px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; }
.meta-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0;
  border-bottom: 1px dotted var(--line); font-size: 14px; }
.meta-row:last-child { border-bottom: none; }
.meta-row .k { color: var(--muted); }
.audit { font-size: 13px; }
.audit li { padding: 7px 0; border-bottom: 1px dotted var(--line); list-style: none; }
.audit ul { margin: 0; padding: 0; }
.audit .when { color: var(--muted); font-family: var(--mono); font-size: 12px; }

/* Forms */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.field input, .field select, .field textarea { width: 100%; }
.field .req { color: var(--danger); }
.errorlist { color: var(--danger); font-size: 13px; list-style: none; padding: 0; margin: 4px 0 0; }

/* Login */
.login-card { max-width: 380px; margin: 80px auto; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 40px 32px; }
.login-card h1 { font-size: 26px; margin: 0 0 6px; }
.login-card p { color: var(--muted); margin: 0 0 28px; }
.ms-btn { display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: var(--radius); font-weight: 500; }
.ms-btn:hover { background: var(--paper); text-decoration: none; }
.ms-logo { width: 18px; height: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.ms-logo span { display: block; }
.ms-logo span:nth-child(1) { background: #f25022; }
.ms-logo span:nth-child(2) { background: #7fba00; }
.ms-logo span:nth-child(3) { background: #00a4ef; }
.ms-logo span:nth-child(4) { background: #ffb900; }

@media (max-width: 820px) {
  .detail { grid-template-columns: 1fr; }
}

/* ============ v2: sidebar layout, branding, admin ============ */
.topbar .brand { gap: 12px; }
.logo {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff; border-radius: 9px; font-family: "Spectral", serif; font-weight: 600;
  font-size: 15px; letter-spacing: 0.02em;
}
.logo.big { width: 54px; height: 54px; font-size: 22px; margin-bottom: 14px; }
.topbar .brand h1 { font-size: 17px; }
.btn.sm { padding: 6px 12px; font-size: 13px; }

.layout { display: grid; grid-template-columns: 248px 1fr; align-items: start; min-height: calc(100vh - 64px); }
.sidebar { border-right: 1px solid var(--line); background: var(--surface); padding: 18px 0; min-height: 100%; }
.side-section { padding: 6px 0 14px; }
.side-head { font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); padding: 6px 20px; }
.side-link { display: block; padding: 8px 20px; color: var(--ink); font-size: 14px; border-left: 3px solid transparent; }
.side-link:hover { background: var(--paper); text-decoration: none; }
.side-link.active { border-left-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.side-link.sub { font-size: 13px; color: var(--muted); padding-left: 24px; }
.side-empty { padding: 6px 20px; color: var(--muted); font-size: 13px; }
.main { padding: 28px 32px; max-width: 1100px; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head h2 { margin: 0; font-size: 22px; }

.searchbar { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.searchbar input[type="search"], .searchbar input[type="text"] { flex: 1 1 260px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { display: flex; flex-direction: column; align-items: flex-start; text-decoration: none; color: var(--ink); }
.stat:hover { text-decoration: none; border-color: var(--accent); }
.stat .num { font-family: "Spectral", serif; font-size: 30px; line-height: 1; }
.stat .lbl { color: var(--muted); font-size: 13px; margin-top: 6px; }

.tagchip { display: inline-block; background: var(--accent-soft); color: var(--accent-dark); border: 1px solid #bcd6c9; border-radius: 999px; padding: 2px 9px; font-size: 12px; margin: 2px 4px 2px 0; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 5px 0; }
.plain.spaced li { padding: 8px 0; border-bottom: 1px dotted var(--line); }
.field.check label { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.field.check input { width: auto; }
.ocrbox { max-height: 220px; overflow: auto; white-space: pre-wrap; font-size: 13px; color: var(--muted); }

table.inner { border: none; margin-bottom: 12px; }
table.inner td { border-bottom: 1px dotted var(--line); padding: 8px 0; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; }
.btn.ghost.sm.danger { color: var(--danger); border-color: #d7b3aa; }

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--line); min-height: 0; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .main { padding: 20px; }
}

/* PDF.js viewer */
#pdf-viewer { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.pdf-toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--paper); border-bottom: 1px solid var(--line); }
.pdf-toolbar .pdf-spacer { flex: 1; }
#pdf-page-info { font-size: 13px; color: var(--muted); min-width: 60px; text-align: center; }
.pdf-canvas-wrap { max-height: 620px; overflow: auto; background: #525659; padding: 16px; text-align: center; }
#pdf-canvas { box-shadow: 0 2px 12px rgba(0,0,0,0.4); background: #fff; }
.viewer-img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); display: block; }

/* Chesapeake branding — green header bar, gold frame, white logo panel */
.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo-wrap { background: #fff; border-radius: 9px; padding: 5px 12px; display: inline-flex; align-items: center; }
.brand-logo { height: 38px; width: auto; display: block; }
.brand-divider { width: 1px; align-self: center; height: 28px; background: rgba(255,255,255,.4); }
.brand-sub { font-family: "Spectral", serif; font-size: 22px; font-weight: 600; color: #edd200; line-height: 1; }
.login-logo { width: 300px; max-width: 78%; height: auto; display: block; margin: 0 auto 20px; }
.login-card h1 { font-size: 20px; }
@media (max-width: 600px) { .brand-divider, .brand-sub { display: none; } .brand-logo { height: 32px; } }

/* CAPA + Audit additions */
.pill.open { background: var(--gold-soft); color: var(--amber); border-color: #e6d6ab; }
.pill.rejected { background: #fdecec; color: var(--danger); border-color: #f3c7c7; }
.pill.closed { background: #ece9e3; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.capa-form h3 { margin: 20px 0 8px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--accent); }
.capa-form h3:first-of-type { border-top: none; padding-top: 0; }
.capa-form .field { margin-bottom: 10px; }
.capa-form input[type=text], .capa-form input[type=date], .capa-form select, .capa-form textarea { width: 100%; }
.banner-readonly { background: var(--gold-soft); border: 1px solid #e6d6ab; color: var(--amber);
  padding: 8px 14px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; }
@media (max-width: 700px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* Native PDF/preview frame (no external worker dependency) */
.doc-frame { width: 100%; height: 78vh; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.frame-note { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.lib-picker select { min-width: 280px; }

/* Purchase request statuses + line-item editor */
.pill.submitted, .pill.manager_approved, .pill.operations_approved,
.pill.director_approved, .pill.cfo_approved { background: var(--gold-soft); color: var(--amber); border-color: #e6d6ab; }
.pill.ordered { background: var(--accent-soft); color: var(--accent-dark); border-color: #bcd6c9; }
.li-table { margin-bottom: 8px; }
.li-table td { padding: 4px; }
.li-table input { width: 100%; }

/* Required-field highlighting: reddish hint, strong red once left empty/invalid */
.req-field { border-color: #f0b6b6 !important; }
.req-field:user-invalid { border-color: var(--danger) !important; box-shadow: 0 0 0 2px rgba(239,68,68,.18); }
.req-field:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 2px rgba(14,87,0,.15); }
.errorlist { color: var(--danger); font-size: 12px; list-style: none; padding: 0; margin: 4px 0 0; }
.req-legend { font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.req-legend .req { color: var(--danger); }

/* Universal page-image viewer (PDF rendered server-side to PNG) */
.doc-pages { max-height: 80vh; overflow: auto; background: var(--paper); padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); }
.doc-page-wrap { width: var(--page-w, 100%); margin: 0 auto 12px; }
.doc-page-wrap:last-child { margin-bottom: 0; }
.doc-page { display: block; width: 100%; margin: 0; border: 1px solid var(--line); border-radius: 4px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.doc-page:last-child { margin-bottom: 0; }
.zoom-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.zoom-bar #zoom-level { min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; color: var(--muted); }

/* Landing dashboard */
.dash-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff; border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px; }
.dash-hero h2 { margin: 0 0 4px; color: #fff; font-size: 22px; }
.dash-hero p { margin: 0; color: rgba(255,255,255,.85); }
.dash-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; flex: 1 1 360px; }
.dash-hero-actions .btn.ghost { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.5); color: #fff; }
.dash-hero-actions .btn.ghost:hover { background: rgba(255,255,255,.24); }

/* Premium editorial home greeting (replaces the green hero on the landing) */
.home-greet { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
  flex-wrap: wrap; margin: 4px 0 20px; }
.greet-title { font-family: "Spectral", Georgia, serif; font-weight: 600; font-size: 30px;
  line-height: 1.1; color: var(--ink); margin: 0 0 4px; letter-spacing: -.01em; }
.greet-sub { margin: 0; color: var(--muted); font-size: 15px; }
.home-greet .dash-hero-actions .btn.ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.home-greet .dash-hero-actions .btn.ghost:hover { background: var(--accent-soft); }

/* Worklist card promoted to the top of the home page */
.wl-card { margin-bottom: 18px; }
.wl-card .worklist li { padding: 13px 0; }
.wl-title a { font-weight: 600; color: var(--ink); text-decoration: none; }
.wl-title a:hover { color: var(--accent); }
.wl-detail { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.wl-due { flex: 0 0 auto; align-self: center; font-size: 12.5px; color: var(--gold-dark, #9a6700); font-weight: 600; }
.wl-chip { flex: 0 0 auto; align-self: center; font-size: 12px; font-weight: 700; color: var(--accent-dark, #0e5700);
  background: var(--accent-soft); border-radius: 999px; padding: 4px 12px; text-decoration: none; }
.wl-chip:hover { background: var(--accent); color: #fff; }
.wl-empty { color: var(--muted); margin: 4px 0 0; }
.persona-pill { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--accent-dark, #0e5700); background: var(--accent-soft); border-radius: 999px; padding: 3px 11px; }

/* Compact readiness gauge tile that sits in the KPI status row */
.gauge.sm { width: 74px; height: 74px; }
.gauge.sm::after { inset: 8px; }
.gauge.sm .gauge-num { font-size: 22px; }
.readiness-tile { display: flex; align-items: center; gap: 14px; }
.readiness-tile .q-kpi-lbl { margin-bottom: 2px; }
.stat.link { text-decoration: none; transition: box-shadow .15s, transform .15s; }
.stat.link:hover { box-shadow: 0 4px 14px rgba(0,0,0,.10); transform: translateY(-1px); }
.dash-cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .dash-cols { grid-template-columns: 1fr; } }
.search-bar { display: flex; gap: 8px; align-items: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 18px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.search-bar-icon { font-size: 15px; opacity: .55; padding-left: 4px; }
.search-bar-input { flex: 1; border: none; outline: none; background: transparent; font-size: 15px;
  color: var(--ink); padding: 6px 4px; min-width: 120px; }
.search-bar-select { border: 1px solid var(--line); border-radius: 6px; background: var(--paper);
  color: var(--ink); font-size: 13px; padding: 7px 8px; }
@media (max-width: 700px) { .search-bar { flex-wrap: wrap; } .search-bar-input { flex-basis: 100%; order: -1; } }
.card-head { display: flex; justify-content: space-between; align-items: baseline; }
.card-link { font-size: 13px; color: var(--accent); text-decoration: none; }
.card-link:hover { text-decoration: underline; }
.lib-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
@media (max-width: 600px) { .lib-grid { grid-template-columns: 1fr; } }
.lib-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 10px; text-decoration: none; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.lib-tile:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.lib-name { font-weight: 600; color: var(--ink); }
.lib-count { font-size: 12px; color: var(--muted); }

/* Directory typeahead dropdown */
.ac-box { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; background: #fff;
  border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.12);
  max-height: 240px; overflow: auto; margin-top: 2px; }
.ac-item { padding: 8px 12px; cursor: pointer; font-size: 14px; }
.ac-item:hover { background: var(--accent-soft); }
.ac-item span { color: var(--muted); font-size: 12px; }
.ac-msg { padding: 8px 12px; font-size: 13px; color: var(--muted); }

/* Audit dashboard: toolbar, sections, print, fullscreen */
.audit-bar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; }
.audit-tools { display: flex; gap: 10px; align-items: center; }
.audit-tools #audit-search { min-width: 280px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; }
.audit-section h3 { display: flex; align-items: center; gap: 10px; }
.sec-count { font-size: 12px; font-weight: 600; color: var(--accent-dark); background: var(--accent-soft); border-radius: 999px; padding: 2px 10px; }
.print-title { display: none; }

/* Full screen (TV display): larger type, scrollable, clean white */
.audit-fullscreen { background: var(--paper); overflow: auto; padding: 28px 40px; }
.audit-fullscreen .audit-section h3 { font-size: 22px; }
.audit-fullscreen table { font-size: 18px; }
.audit-fullscreen td, .audit-fullscreen th { padding: 10px 12px; }

/* Print: hide chrome, show only the audit binder */
@media print {
  .topbar, .sidebar, .no-print, .audit-tools { display: none !important; }
  .layout { display: block !important; }
  .main, .wrap { display: block !important; margin: 0 !important; max-width: none !important; width: 100% !important; padding: 0 !important; }
  .print-title { display: block !important; margin: 0 0 12px; }
  .card { box-shadow: none !important; border: 1px solid #ccc; break-inside: avoid; }
  .audit-section { page-break-inside: avoid; }
  a { color: #000 !important; text-decoration: none !important; }
  body { background: #fff !important; }
}

/* PDF markup editor */
.mk-toolbar { display:flex; justify-content:space-between; align-items:center; gap:12px;
  flex-wrap:wrap; position:sticky; top:0; z-index:20; background:var(--paper);
  border:1px solid var(--line); border-radius:10px; padding:10px 12px; margin-bottom:8px; }
.mk-tools, .mk-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.mk-tool.active { background:var(--accent); color:#fff; border-color:var(--accent); }
.mk-sep { width:1px; height:22px; background:var(--line); margin:0 4px; }
.mk-hint { margin:0 0 14px; }
#mk-doc { max-width:900px; margin:0 auto; }
.mk-page { position:relative; margin:0 auto 16px; box-shadow:0 1px 6px rgba(0,0,0,.12); }
.mk-page img { display:block; width:100%; }
.mk-layer { position:absolute; inset:0; cursor:crosshair; }
.mk-hl { position:absolute; opacity:.32; cursor:pointer; }
.mk-temp { position:absolute; background:#ffd400; opacity:.32; }
.mk-cm { position:absolute; transform:translate(-50%,-50%); width:22px; height:22px;
  border-radius:50%; color:#fff; font-size:12px; font-weight:700; line-height:22px;
  text-align:center; cursor:pointer; box-shadow:0 1px 3px rgba(0,0,0,.3); }
.mk-ptr { position:absolute; inset:0; width:100%; height:100%; overflow:visible; pointer-events:none; }
.mk-ptr line { pointer-events:stroke; }

/* Dollar-amount inputs */
.money { display:inline-flex; align-items:center; gap:6px; }
.money input { display:inline-block; }

/* Order Request Form statuses + key/value tables */
.pill.in_progress { background: var(--gold-soft); color: var(--amber); border-color: #e6d6ab; }
.pill.complete { background: var(--accent-soft); color: var(--accent-dark); border-color: #bcd6c9; }
.kv { width: 100%; border-collapse: collapse; font-size: 14px; }
.kv td { padding: 3px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.kv td:first-child { width: 45%; }

/* Document preview: full screen view + print only the document pages */
.doc-fullscreen { position: fixed; inset: 0; z-index: 9999; background: #fff;
  overflow: auto; padding: 24px 32px; border-radius: 0; }
.doc-fullscreen .zoom-bar { position: sticky; top: 0; background: #fff; z-index: 2; }
@media print {
  body.print-pages * { visibility: hidden !important; }
  body.print-pages #doc-pages, body.print-pages #doc-pages * { visibility: visible !important; }
  body.print-pages #doc-pages { position: absolute; left: 0; top: 0; width: 100% !important;
    --page-w: 100% !important; }
}

/* Internal audit statuses + finding severities */
.pill.planned { background: #eef1f4; color: #475569; border-color: #d7dee6; }
.pill.completed { background: var(--accent-soft); color: var(--accent-dark); border-color: #bcd6c9; }
.pill.observation { background: #eef1f4; color: #475569; border-color: #d7dee6; }
.pill.minor { background: var(--gold-soft); color: var(--amber); border-color: #e6d6ab; }
.pill.major { background: #fbe8d3; color: #9a5b16; border-color: #f0cfa6; }
.pill.critical { background: #fdecec; color: var(--danger); border-color: #f3c7c7; }

/* ---- Order Request Form: DocuSign-style inline document ---- */
.orf-jump {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--gold-soft); border: 1px solid #e6d6ab; color: var(--amber);
  border-radius: 10px; padding: 10px 14px; margin-bottom: 14px;
}
.orf-doc { display: flex; flex-direction: column; gap: 14px; }
.orf-section {
  background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 16px 18px;
}
.orf-section.orf-current { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.orf-section.orf-pending { opacity: 0.72; }
.orf-section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.orf-section-head h3 { margin: 0; color: var(--accent-dark, var(--accent)); font-size: 16px; }

.orf-row {
  display: flex; gap: 16px; padding: 6px 0; border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.orf-row:last-child { border-bottom: none; }
.orf-label { flex: 0 0 42%; color: var(--muted); }
.orf-value { flex: 1; }
.orf-empty { color: #c2c8cf; }

/* Fillable field for the current signer — highlighted like a form field to complete */
.orf-fill {
  background: var(--gold-soft); border: 1px solid #e6d6ab;
  border-radius: 8px; padding: 8px 12px; margin: 8px 0;
}
.orf-fill .field { margin: 0; }
.orf-fill .field label { color: var(--amber); font-weight: 600; }

.orf-sign-line { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; font-style: italic; }

/* Sticky sign-off bar so Approve/Reject is always reachable while scrolling */
.orf-signbar {
  position: sticky; bottom: 0; z-index: 5; margin-top: 14px;
  display: flex; gap: 10px; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}
.orf-comment { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }

/* Attachment viewer */
.att-item { padding: 6px 0; border-bottom: 1px solid var(--line); }
.att-open {
  background: none; border: none; color: var(--accent); cursor: pointer;
  padding: 0; font: inherit; text-align: left; text-decoration: underline;
}
.att-open.active { font-weight: 700; }
.att-dl { margin-left: 8px; color: var(--muted); text-decoration: none; }
.att-viewer {
  display: none; width: 100%; height: 520px; margin-top: 12px;
  border: 1px solid var(--line); border-radius: 8px;
}

/* Progress checklist */
.orf-steps { list-style: none; margin: 0; padding: 0; }
.orf-steps li { padding: 4px 0 4px 22px; position: relative; color: var(--muted); font-size: 13px; }
.orf-steps li::before {
  content: "○"; position: absolute; left: 0; color: #c2c8cf;
}
.orf-steps li.done { color: var(--ink, #1a1a1a); }
.orf-steps li.done::before { content: "✓"; color: var(--accent); }
.orf-steps li.current { color: var(--amber); font-weight: 600; }
.orf-steps li.current::before { content: "●"; color: var(--gold); }

/* Per-section attachments */
.orf-atts { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.orf-att {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-soft); border: 1px solid #cfe8db;
  border-radius: 999px; padding: 3px 10px; font-size: 13px;
}
.orf-att .att-open { text-decoration: none; color: var(--accent-dark); }
.orf-att .att-open.active { font-weight: 700; }
.orf-att .att-dl { text-decoration: none; color: var(--muted); }
.orf-section-head .att-add { white-space: nowrap; }

/* Document panel buttons */
.doc-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* Document panel: rendered form pages (PDF as images, like a viewer) */
.doc-links { margin: 0 0 10px; font-size: 14px; }
.orf-pdf {
  max-height: 75vh; overflow: auto;
  border: 1px solid var(--line); border-radius: 8px;
  background: #525659; padding: 12px;
}
.orf-pdf-page {
  display: block; width: 100%; margin: 0 auto 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.4); border-radius: 2px; background: #fff;
}
.orf-pdf-page:last-child { margin-bottom: 0; }
.orf-att-link { text-decoration: none; color: var(--accent-dark); }
.orf-att-link:hover { text-decoration: underline; }

/* Large PDF view for completed forms */
.orf-pdf.big { max-height: 85vh; }

/* DocuSign-style attachment preview cards */
.doc-cards { display: flex; flex-direction: column; gap: 14px; }
.doc-card {
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: #fff; transition: box-shadow .15s, transform .05s;
}
.doc-card.can-preview { cursor: pointer; }
.doc-card.can-preview:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.doc-card.can-preview:active { transform: translateY(1px); }
.doc-card-thumb {
  height: 168px; background: #eef0f3; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.doc-card-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.doc-card-icon { font-size: 44px; color: var(--muted); }
.doc-card-name { padding: 10px 12px 2px; font-weight: 600; font-size: 13px; word-break: break-word; }
.doc-card-meta { padding: 0 12px 12px; color: var(--muted); font-size: 12px; }
.doc-card-meta a { color: var(--accent-dark); }

/* Attachment lightbox */
.att-modal { position: fixed; inset: 0; z-index: 1000; background: rgba(17,24,39,0.78);
  display: flex; flex-direction: column; }
.att-modal[hidden] { display: none; }
.att-modal-bar { display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 18px; color: #fff; }
.att-modal-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-modal-actions { display: flex; align-items: center; gap: 18px; flex: none; }
.att-modal-actions a { color: #fff; text-decoration: none; font-size: 14px; }
.att-modal-actions a:hover { text-decoration: underline; }
.att-modal-close { background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; line-height: 1; }
.att-modal-body { flex: 1; overflow: auto; padding: 18px; display: flex;
  flex-direction: column; align-items: center; gap: 14px; }
.att-modal-img, .att-modal-page {
  max-width: 920px; width: 100%; background: #fff; border-radius: 2px;
  box-shadow: 0 2px 14px rgba(0,0,0,0.45);
}

/* CSC Forms dashboard tiles */
.form-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.form-tile { display: flex; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.form-tile:hover { border-color: var(--accent); box-shadow: 0 4px 14px rgba(0,0,0,.06); transform: translateY(-2px); text-decoration: none; }
.form-tile-icon { font-size: 30px; line-height: 1; }
.form-tile-title { font-weight: 600; font-size: 16px; }
.form-tile-code { color: var(--muted); font-weight: normal; font-size: 12px; margin-left: 4px; }
.form-tile-desc { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.form-tile-secondary { display: inline-block; margin-top: 10px; font-size: 13px; color: var(--accent-dark); font-weight: 600; }
.form-tile-secondary:hover { text-decoration: underline; }
.qmod-head { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 6px 0 12px; }
.qmod-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.qmod-tile { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  border-top: 3px solid var(--accent); padding: 16px 18px; text-decoration: none; color: var(--ink); display: block;
  transition: transform .15s ease, box-shadow .15s ease; }
.qmod-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.08); text-decoration: none; }
.qmod-tile .ic { font-size: 22px; }
.qmod-tile .ti { font-weight: 700; font-size: 15px; margin: 8px 0 2px; }
.qmod-tile .de { font-size: 12px; color: var(--muted); line-height: 1.35; }
.qmod-tile .go { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--accent-dark, #0e5700); font-weight: 600; }

/* Admin dashboard tile sections */
.admin-section { margin: 24px 0; }
.admin-section-title { margin: 0 0 2px; font-size: 15px; }
.admin-section-desc { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.tile-badge { display: inline-block; margin-left: 8px; padding: 1px 9px; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--line); color: var(--muted);
  font-size: 12px; font-weight: 600; vertical-align: middle; }

/* Workflow viewer / editor */
.wf-flow { display: flex; flex-direction: column; gap: 0; margin-top: 4px; }
.wf-stage { display: flex; gap: 14px; padding: 14px 0; position: relative; }
.wf-stage:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 46px; bottom: -2px;
  width: 2px; background: var(--line); }
.wf-stage-num { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--accent);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; z-index: 1; }
.wf-stage-body { flex: 1; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: #fff; }
.wf-stage-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wf-stage-label { font-weight: 600; font-size: 15px; }
.wf-stage-role { color: var(--muted); font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.wf-pill { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px;
  font-size: 12px; color: var(--accent-dark); font-weight: 600; }
.wf-group-row { display: flex; align-items: center; gap: 10px; margin: 10px 0 6px; flex-wrap: wrap; }
.wf-select { padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; min-width: 240px; }
.wf-muted { color: var(--muted); font-size: 12px; }
.wf-edges { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; }
.wf-edge { font-size: 13px; color: var(--ink); display: flex; align-items: baseline; gap: 7px; }
.wf-arrow { color: var(--accent); font-weight: 700; }
.wf-cond { color: var(--muted); }
.wf-cond::after { content: ":"; }
.wf-target { font-weight: 600; }

/* ===========================================================================
   Quality Dashboard — command-center styling
   =========================================================================== */
.q-hero {
  position: relative; overflow: hidden;
  border-radius: 16px; padding: 26px 30px; margin-bottom: 22px;
  background:
    radial-gradient(120% 140% at 12% -10%, rgba(237,210,0,0.22), transparent 46%),
    radial-gradient(90% 120% at 108% 120%, rgba(255,255,255,0.16), transparent 50%),
    linear-gradient(135deg, var(--accent-dark) 0%, var(--accent) 70%);
  color: #fff;
  display: flex; flex-wrap: wrap; gap: 22px; align-items: center; justify-content: space-between;
  box-shadow: 0 18px 40px -22px rgba(10,66,0,0.7);
}
.q-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,0.10) 1px, transparent 1.4px);
  background-size: 18px 18px; opacity: .5; mask-image: linear-gradient(90deg, #000, transparent 70%);
}
.q-hero-text { position: relative; z-index: 1; max-width: 540px; }
.q-eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: 11px; font-weight: 700; color: var(--gold-bright); }
.q-hero h1 { font-size: 34px; margin: 6px 0 8px; color: #fff; }
.q-hero p { margin: 0; color: rgba(255,255,255,0.82); font-size: 14px; line-height: 1.5; }
.q-hero-meta { margin-top: 14px; display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: rgba(255,255,255,0.8); }
.q-hero-meta b { color: #fff; font-weight: 700; }

/* Health gauge */
.q-gauge { position: relative; z-index: 1; display: flex; align-items: center; gap: 18px; }
.q-gauge-svg { display: block; }
.q-gauge-num { font-family: "Spectral", Georgia, serif; font-weight: 700; }
.q-gauge-side { max-width: 220px; }
.q-gauge-band { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: rgba(255,255,255,0.16); color: #fff; border: 1px solid rgba(255,255,255,0.35); }
.q-gauge-factors { margin: 10px 0 0; padding: 0; list-style: none; font-size: 12px; color: rgba(255,255,255,0.85); }
.q-gauge-factors li { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.q-gauge-factors .hit { color: #fecaca; font-weight: 700; }
.q-gauge-clean { font-size: 13px; color: #d1fae5; font-weight: 600; }

/* KPI tiles */
.q-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 14px; margin-bottom: 22px; }
.q-kpi {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 18px 15px; text-decoration: none; color: var(--ink);
  border-top: 3px solid var(--accent); transition: transform .15s ease, box-shadow .15s ease;
  animation: qrise .5s ease both;
}
.q-kpi:hover { transform: translateY(-4px); box-shadow: 0 16px 30px -18px rgba(0,0,0,.4); text-decoration: none; }
.q-kpi-top { display: flex; align-items: center; justify-content: space-between; }
.q-kpi-icon { font-size: 20px; opacity: .9; }
.q-kpi-num { font-family: "Spectral", Georgia, serif; font-weight: 700; font-size: 42px; line-height: 1; margin: 8px 0 2px; }
.q-kpi-lbl { font-size: 13px; font-weight: 600; color: var(--ink); }
.q-kpi-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.q-kpi.is-danger { border-top-color: #b91c1c; } .q-kpi.is-danger .q-kpi-num { color: #b91c1c; }
.q-kpi.is-warn   { border-top-color: #ea580c; } .q-kpi.is-warn .q-kpi-num   { color: #c2410c; }
.q-kpi.is-gold   { border-top-color: var(--gold); } .q-kpi.is-gold .q-kpi-num { color: var(--gold); }
.q-kpi.is-ok     { border-top-color: #16a34a; } .q-kpi.is-ok .q-kpi-num     { color: #15803d; }
.q-kpi.is-sky    { border-top-color: #0ea5e9; } .q-kpi.is-sky .q-kpi-num    { color: #0284c7; }
.q-kpi:nth-child(1){animation-delay:.02s}.q-kpi:nth-child(2){animation-delay:.06s}
.q-kpi:nth-child(3){animation-delay:.10s}.q-kpi:nth-child(4){animation-delay:.14s}
.q-kpi:nth-child(5){animation-delay:.18s}.q-kpi:nth-child(6){animation-delay:.22s}
.q-kpi:nth-child(7){animation-delay:.26s}
@keyframes qrise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* Panels grid */
.q-cols { display: grid; grid-template-columns: 1.45fr 1fr; gap: 18px; align-items: start; margin-bottom: 22px; }
.q-stack { display: flex; flex-direction: column; gap: 18px; }
.q-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.q-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.q-panel-head h3 { margin: 0; font-size: 17px; }
.q-panel-head a { font-size: 12.5px; font-weight: 600; }

/* Donut + legend */
.q-donut-wrap { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.q-donut { position: relative; flex: none; }
.q-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.q-donut-center .n { font-family: "Spectral", Georgia, serif; font-weight: 700; font-size: 30px; line-height: 1; }
.q-donut-center .t { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.q-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 150px; }
.q-legend li { display: flex; align-items: center; gap: 9px; padding: 4px 0; font-size: 13px; }
.q-legend .dot { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.q-legend .ln { flex: 1; } .q-legend .lc { font-weight: 700; }

/* Severity bars */
.q-bars { margin: 4px 0 0; }
.q-bar-row { display: grid; grid-template-columns: 80px 1fr 34px; align-items: center; gap: 10px; margin: 9px 0; font-size: 13px; }
.q-bar-track { background: var(--paper); border-radius: 999px; height: 12px; overflow: hidden; }
.q-bar-fill { height: 100%; border-radius: 999px; transition: width .6s ease; min-width: 2px; }
.q-bar-row .c { text-align: right; font-weight: 700; }

/* Severity chips */
.q-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.q-chip { display: flex; flex-direction: column; align-items: center; min-width: 78px; padding: 10px 8px; border-radius: 12px;
  background: var(--paper); border: 1px solid var(--line); }
.q-chip .n { font-family: "Spectral", Georgia, serif; font-weight: 700; font-size: 24px; line-height: 1; }
.q-chip .l { font-size: 11px; color: var(--muted); margin-top: 2px; text-transform: uppercase; letter-spacing: .04em; }

/* Mini lists with severity/status stripe */
.q-list { list-style: none; margin: 0; padding: 0; }
.q-list li { display: flex; gap: 11px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); }
.q-list li:last-child { border-bottom: 0; }
.q-list .stripe { width: 4px; align-self: stretch; border-radius: 3px; flex: none; }
.q-list .body { flex: 1; min-width: 0; }
.q-list .ttl { font-size: 13.5px; font-weight: 600; }
.q-list .ttl a { color: var(--ink); } .q-list .ttl a:hover { color: var(--accent); }
.q-list .meta { font-size: 12px; color: var(--muted); margin-top: 1px; }
.q-tag { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px; color: #fff; }
.q-tag.late { background: #b91c1c; }

/* Audit status mini-counts */
.q-mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.q-mini div { text-align: center; padding: 9px 4px; border-radius: 10px; background: var(--paper); }
.q-mini .n { font-family: "Spectral", Georgia, serif; font-weight: 700; font-size: 22px; }
.q-mini .l { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }

/* Quick-action tiles */
.q-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; margin-bottom: 22px; }
.q-act { display: flex; align-items: center; gap: 11px; padding: 14px 16px; border-radius: 12px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); transition: border-color .15s, transform .15s; }
.q-act:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.q-act .ic { font-size: 18px; } .q-act .tx { font-size: 13.5px; font-weight: 600; }
.q-section-title { font-family: "Spectral", Georgia, serif; font-size: 15px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .1em; margin: 0 0 12px; }
@media (max-width: 900px){ .q-cols { grid-template-columns: 1fr; } }

/* ===========================================================================
   Shared dashboard polish — audit-mode hero tools + premium category tiles
   =========================================================================== */
.q-hero .audit-tools { position: relative; z-index: 1; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.q-hero .audit-tools input { min-width: 230px; padding: 9px 13px; border-radius: 9px; font: inherit;
  border: 1px solid rgba(255,255,255,0.42); background: rgba(255,255,255,0.14); color: #fff; }
.q-hero .audit-tools input::placeholder { color: rgba(255,255,255,0.72); }
.q-hero .audit-tools .btn { background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.5); color: #fff; }
.q-hero .audit-tools .btn:hover { background: rgba(255,255,255,0.26); }

.q-cat-head { font-family: "Spectral", Georgia, serif; font-size: 18px; margin: 24px 0 12px; }
.q-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); gap: 14px; }
.q-cat { position: relative; display: flex; flex-direction: column; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 18px 15px;
  border-left: 4px solid var(--accent); transition: transform .15s ease, box-shadow .15s ease; animation: qrise .45s ease both; }
.q-cat:hover { transform: translateY(-4px); box-shadow: 0 16px 30px -18px rgba(0,0,0,.35); text-decoration: none; }
.q-cat-count { font-family: "Spectral", Georgia, serif; font-weight: 700; font-size: 38px; line-height: 1; color: var(--accent-dark); }
.q-cat-label { font-size: 13.5px; font-weight: 600; margin-top: 7px; line-height: 1.25; }
.q-cat-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.q-cat.empty { opacity: .6; border-left-color: var(--line); }
.q-cat.empty .q-cat-count { color: var(--muted); }
.q-cat-go { position: absolute; top: 14px; right: 15px; color: var(--accent); opacity: 0; transition: opacity .15s; font-size: 16px; }
.q-cat:hover .q-cat-go { opacity: 1; }
@media print { .q-hero, .q-kpis { display: none !important; } }

/* Purchase-approvals hero money focal + age tag */
.q-money { position: relative; z-index: 1; text-align: right; min-width: 220px; }
.q-money .cap { font-size: 11px; color: var(--gold-bright); text-transform: uppercase; letter-spacing: .14em; font-weight: 700; }
.q-money .big { font-family: "Spectral", Georgia, serif; font-weight: 700; font-size: 42px; line-height: 1.05; color: #fff; }
.q-money .sub { font-size: 13px; color: rgba(255,255,255,0.85); margin-top: 8px; }
.q-money .sub b { color: #fff; }
.q-age { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--paper); color: var(--muted); }
.q-age.warn { background: #fbe8d3; color: #9a5b16; }
.q-age.late { background: #fdecec; color: #b91c1c; }
.q-amt { font-family: "Spectral", Georgia, serif; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Home: cross-workflow tasks + submission progress */
.q-prog { height: 7px; background: var(--paper); border-radius: 999px; overflow: hidden; margin-top: 7px; }
.q-prog > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .6s ease; }
.q-prog.done > span { background: #16a34a; }
.q-prog.rej > span { background: var(--danger); }
.q-track-list { display: flex; flex-direction: column; gap: 10px; }
.q-track { display: block; text-decoration: none; color: var(--ink); padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 11px; transition: border-color .15s, transform .15s; }
.q-track:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.q-track-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.q-track-name { font-size: 13.5px; }
.q-track-stage { font-size: 12px; color: var(--muted); margin: 3px 0 0; }
.q-attention { border-left: 4px solid var(--gold); margin-bottom: 18px; }

/* ============================================================
   Polished sign-in
   ============================================================ */
.login-shell { min-height: 80vh; display: grid; place-items: center; padding: 24px 8px; }
.login-box { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden; box-shadow: 0 18px 50px rgba(7,40,18,.16); }
.login-box__head { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  padding: 34px 32px 28px; text-align: center; position: relative; }
.login-box__head::after { content:""; position:absolute; left:0; right:0; bottom:0; height:46px;
  background: radial-gradient(120% 120% at 50% 0, rgba(237,210,0,.20), transparent 70%); pointer-events:none; }
.login-chip { width: 86px; height: 86px; margin: 0 auto 14px; background:#fff; border-radius: 20px;
  display:grid; place-items:center; box-shadow: 0 8px 22px rgba(0,0,0,.20); }
.login-chip img { width: 62px; height:auto; }
.login-box__head h1 { color:#fff; font-family:"Spectral",Georgia,serif; font-size: 23px; margin: 0; font-weight: 600; }
.login-box__head .sub { color: rgba(255,255,255,.85); font-size: 13px; margin: 5px 0 0; }
.login-box__body { padding: 26px 32px 28px; }
.login-welcome { font-size: 15px; color: var(--ink); margin: 0 0 18px; text-align:center; }
.login-feats { list-style:none; margin: 0 0 22px; padding: 0; display: grid; gap: 11px; }
.login-feats li { display:flex; gap:10px; align-items:flex-start; font-size: 13.5px; color: var(--muted); }
.login-feats .tick { flex:none; width:18px; height:18px; margin-top:1px; border-radius:50%;
  background: var(--accent-soft); color: var(--accent); display:grid; place-items:center; font-size:11px; font-weight:700; }
.ms-btn.full { display:flex; width:100%; justify-content:center; padding: 13px; font-size: 15px; font-weight:600; }
.login-foot { text-align:center; color: var(--muted); font-size: 12px; margin: 18px 0 0; }

/* ============================================================
   Command palette (Ctrl/Cmd-K)
   ============================================================ */
.cmdk-trigger { display:flex; align-items:center; gap:8px; width:100%; margin: 0 0 14px;
  padding: 8px 11px; border:1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  color: var(--muted); font: inherit; font-size: 13px; cursor:pointer; text-align:left; }
.cmdk-trigger:hover { border-color: var(--accent); color: var(--ink); }
.cmdk-trigger .kbd { margin-left:auto; font-size: 11px; color: var(--muted); border:1px solid var(--line);
  border-radius: 5px; padding: 1px 6px; background: var(--surface); }
#cmdk[hidden]{ display:none !important; }
#cmdk { position: fixed; inset: 0; z-index: 300; display:flex; align-items:flex-start; justify-content:center;
  background: rgba(15,23,20,.42); padding: 12vh 16px 16px; }
.cmdk-panel { width:100%; max-width: 560px; background: var(--surface); border:1px solid var(--line);
  border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.30); overflow: hidden; }
.cmdk-input { width:100%; box-sizing:border-box; border:0; border-bottom:1px solid var(--line);
  padding: 16px 18px; font: inherit; font-size: 16px; color: var(--ink); outline: none; background:var(--surface); }
.cmdk-list { list-style:none; margin:0; padding: 6px; max-height: 52vh; overflow:auto; }
.cmdk-item { display:flex; align-items:center; gap:10px; padding: 10px 12px; border-radius: 8px;
  color: var(--ink); font-size: 14px; cursor:pointer; }
.cmdk-item .sec { margin-left:auto; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing:.05em; }
.cmdk-item.active, .cmdk-item:hover { background: var(--accent-soft); text-decoration: none; }
.cmdk-empty { padding: 18px; text-align:center; color: var(--muted); font-size: 14px; }

#hsearch[hidden]{ display:none !important; }
#hsearch { position: fixed; inset: 0; z-index: 300; display:flex; align-items:flex-start; justify-content:center;
  background: rgba(15,23,20,.42); padding: 12vh 16px 16px; }
.hsearch-panel { padding: 16px; }
.hsearch-form { display:flex; align-items:center; gap:10px; }
.hsearch-ico { color: var(--muted); display:inline-flex; flex:0 0 auto; }
.hsearch-input { flex:1; min-width:0; border:1px solid var(--line); border-radius:10px; padding:12px 13px;
  font: inherit; font-size:16px; outline:none; }
.hsearch-input:focus { border-color: var(--accent); }
.hsearch-go { white-space:nowrap; flex:0 0 auto; }
.hsearch-ai { display:flex; align-items:center; gap:8px; margin-top:13px; font-size:13.5px; color:var(--ink); cursor:pointer; }
.hsearch-ai em { color: var(--muted); font-style:normal; }
.hsearch-eg { margin-top:8px; font-size:12.5px; color: var(--muted); background: var(--accent-soft);
  border:1px solid #d3e3d6; border-radius:8px; padding:8px 11px; }
.hsearch-foot { margin-top:13px; font-size:12.5px; color: var(--muted); }

/* ============================================================
   Draft recovery / reuse-last
   ============================================================ */
.draft-bar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin: 0 0 14px;
  padding: 10px 14px; border:1px solid #cfe6d8; background: var(--accent-soft); border-radius: var(--radius);
  font-size: 13.5px; color: var(--ink); }
.draft-bar.reuse { border-color:#f0e2bd; background: var(--gold-soft); }
.draft-bar .spacer{ flex:1 }
.draft-btn { font: inherit; font-size: 13px; cursor:pointer; border:1px solid var(--accent-dark);
  background: var(--accent); color:#fff; padding: 6px 12px; border-radius: 6px; }
.draft-btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }

/* ============================================================
   Spiced sign-in — warm canvas + scattered spice illustrations
   ============================================================ */
body:has(.login-spiced) {
  background:
    radial-gradient(1100px 720px at 50% -12%, #fff6e6 0%, #f7efe0 46%, #f2ece0 100%);
}
.login-shell.login-spiced {
  position: relative;
  min-height: 86vh;
  overflow: hidden;
  background: radial-gradient(820px 560px at 50% 2%, #fff7e8 0%, transparent 72%);
}
.login-spices { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.spice { position: absolute; opacity: .92; filter: drop-shadow(0 8px 12px rgba(90,45,10,.10)); }
.spice svg { width: 100%; height: 100%; display: block; }

.spice--anise1    { width: 124px; height: 124px; top: 7%;  left: 6%;   transform: rotate(-12deg); }
.spice--anise2    { width: 72px;  height: 72px;  bottom: 7%; right: 30%; opacity: .7; transform: rotate(22deg); }
.spice--chili1    { width: 94px;  height: 94px;  top: 16%; right: 9%;  transform: rotate(18deg); }
.spice--cinn1     { width: 132px; height: 132px; bottom: 9%; left: 8%;  transform: rotate(6deg); }
.spice--pepper1   { width: 86px;  height: 86px;  bottom: 15%; right: 11%; }
.spice--pepper2   { width: 58px;  height: 58px;  top: 9%;  left: 37%;  opacity: .7; }
.spice--bay1      { width: 84px;  height: 84px;  top: 45%; left: 2.5%; transform: rotate(-18deg); }
.spice--saffron1  { width: 96px;  height: 96px;  top: 58%; right: 4%;  transform: rotate(8deg); }
.spice--cardamom1 { width: 70px;  height: 70px;  top: 13%; left: 16%;  opacity: .8; }

/* keep the card breathing room and above the spices */
.login-spiced .login-box { position: relative; z-index: 1; }
.login-spiced .login-box__head { background: linear-gradient(135deg, #0e5700 0%, #0a4200 100%); }

@media (max-width: 720px) {
  .spice { display: none; }
  .login-shell.login-spiced { min-height: 78vh; }
}

/* ============================================================
   Spiced sign-in hero (full-bleed backdrop behind the card)
   ============================================================ */
.login-spiced {
  position: relative;
  width: 100vw; left: 50%; right: 50%; margin-left: -50vw; margin-right: -50vw;
  margin-top: -28px; margin-bottom: -28px;     /* cancel the .wrap padding */
  min-height: calc(100vh - 64px);
  display: grid; place-items: center;
  padding: 48px 16px; overflow: hidden;
  background: radial-gradient(120% 120% at 50% 0%, #26332c 0%, #11160f 78%);
}
.login-bg {
  position: absolute; inset: 0; z-index: 0; background-size: cover; background-position: center;
  background-repeat: no-repeat;
}
.login-scrim {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(60% 70% at 50% 50%, rgba(10,14,10,.30), rgba(8,12,8,.62));
}
.login-spiced .login-box {
  position: relative; z-index: 3;
  box-shadow: 0 26px 70px rgba(0,0,0,.45); border-color: rgba(255,255,255,.12);
}
@media (max-width: 680px) {
  .login-spiced { min-height: calc(100vh - 56px); padding: 28px 12px; }
}

/* Custom-property editor (document edit form) */
.prop-table { width: 100%; border-collapse: collapse; }
.prop-table td { padding: 3px 4px 3px 0; vertical-align: top; }
.prop-table td:first-child { width: 40%; }
.prop-table input { width: 100%; box-sizing: border-box; }

/* ===== Quality dashboard: hero actions, Part 11 strip, definitions, print ===== */
.q-hero-actions { position: relative; z-index: 1; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.q-hero-actions .btn { background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.5); color: #fff; }
.q-hero-actions .btn:hover { background: rgba(255,255,255,0.28); }

/* 21 CFR Part 11 readiness strip */
.q-ready { background: linear-gradient(135deg, var(--accent-soft) 0%, #fff 62%);
  border: 1px solid #bcd6c9; border-left: 5px solid var(--accent);
  border-radius: 14px; padding: 18px 22px; margin: 0 0 22px; }
.q-ready-head { display: flex; align-items: flex-start; gap: 14px; }
.q-ready-badge { flex: none; background: var(--accent); color: #fff; font-family: "Spectral", Georgia, serif;
  font-weight: 700; font-size: 12px; letter-spacing: .04em; padding: 5px 11px; border-radius: 999px; white-space: nowrap; }
.q-ready-ttl { font-family: "Spectral", Georgia, serif; font-weight: 700; font-size: 18px; color: var(--accent-dark); }
.q-ready-desc { color: var(--muted); font-size: 13px; margin-top: 2px; }
.q-ready-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 16px 0 4px; }
.q-ready-item { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.q-ready-item .n { display: block; font-family: "Spectral", Georgia, serif; font-weight: 700;
  font-size: 30px; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.q-ready-item .l { display: block; color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.q-ready-controls { list-style: none; padding: 0; margin: 12px 0 0; display: flex; gap: 8px 22px;
  flex-wrap: wrap; font-size: 13px; color: var(--accent-dark); font-weight: 600; }

/* Metric definitions */
.q-defs h3 { margin-top: 0; }
.q-deflist { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2px 28px; margin: 0; }
.q-deflist dt { font-weight: 700; color: var(--accent-dark); margin-top: 8px; }
.q-deflist dd { margin: 2px 0 6px; color: var(--muted); font-size: 13px; line-height: 1.45; }

/* Print handout header (hidden on screen via .print-title) */
.q-print-head { border-bottom: 2px solid var(--accent); padding-bottom: 10px; }
.q-print-org { font-family: "Spectral", Georgia, serif; font-weight: 700; color: var(--accent); font-size: 14px; }
.q-print-ttl { font-family: "Spectral", Georgia, serif; font-weight: 700; font-size: 24px; }
.q-print-sub { color: #444; font-size: 13px; }

/* Print: keep the numbers (in colour) on the auditor handout; drop the dark hero */
@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .q-hero { display: none !important; }
  .q-kpis { display: grid !important; grid-template-columns: repeat(3, 1fr) !important; }
  .q-cols { display: block !important; }
  .q-actions, .q-hero-actions { display: none !important; }
  .q-ready, .q-panel, .q-defs, .card, .q-kpi { break-inside: avoid; }
}

/* Auto-generated, read-only fields (e.g. document number) */
input.auto-id { background: var(--paper); color: var(--muted); font-family: var(--mono); cursor: not-allowed; }

/* ===== Bulk upload: drag-and-drop ===== */
.bulk-drop { display: block; text-align: center; cursor: pointer;
  border: 2px dashed #bcd0c6; border-radius: 14px; padding: 38px 20px;
  background: var(--accent-soft); transition: border-color .15s ease, background .15s ease; }
.bulk-drop:hover { border-color: var(--accent); }
.bulk-drop.is-over { border-color: var(--accent); background: #e3f5ea; }
.bulk-drop-ic { font-size: 34px; color: var(--accent); line-height: 1; }
.bulk-drop-main { font-family: "Spectral", Georgia, serif; font-weight: 700; font-size: 19px; margin-top: 8px; }
.bulk-drop-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.bulk-link { color: var(--accent-dark); text-decoration: underline; }
.bulk-list-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.bulk-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.bulk-list li { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-top: 1px solid var(--line); }
.bulk-list li:first-child { border-top: 0; }
.bulk-list .bn { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk-list .bs { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.bulk-list .brm { border: 0; background: transparent; color: var(--muted); font-size: 20px;
  line-height: 1; cursor: pointer; padding: 0 4px; }
.bulk-list .brm:hover { color: var(--danger); }
.bulk-note { color: var(--muted); font-size: 12.5px; margin-top: 14px; }

/* Inline command block (admin pages) */
.codeblock { background: #0f1c14; color: #d7eadd; font-family: var(--mono);
  font-size: 13px; padding: 10px 12px; border-radius: 8px; overflow-x: auto; margin: 0; white-space: pre-wrap; }

/* Multi-select checkbox groups (ORF / NIA / NC / FC forms): tidy aligned grid */
.orf-multi { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 9px 20px; margin-top: 5px; }
.orf-multi label { display: flex; align-items: flex-start; gap: 8px; font-weight: normal;
  font-size: 14px; line-height: 1.3; cursor: pointer; }
.orf-multi input[type="checkbox"] { margin: 2px 0 0; flex: none; width: 16px; height: 16px; }

/* In-document comment pins (positional comment threads over the page preview) */
.doc-page-wrap { position: relative; }
.pin-layer { position: absolute; inset: 0; pointer-events: none; }
.pin { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; z-index: 5; }
.pin-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--gold, #b8860b);
  color: #fff; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); cursor: pointer;
  font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  padding: 0; line-height: 1; }
.pin.resolved .pin-dot { background: var(--accent, #0e5700); }
.pin-pop { display: none; position: absolute; left: 18px; top: -6px; width: 260px; background: #fff;
  border: 1px solid var(--line, #ddd); border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.18);
  padding: 10px; z-index: 20; text-align: left; font-size: 13px; white-space: normal; }
.pin.open .pin-pop { display: block; }
.pin-pop-head { font-weight: 600; margin-bottom: 6px; }
.pin-c { border-top: 1px solid var(--line, #eee); padding: 5px 0; }
.pin-c-meta { font-size: 11px; color: var(--muted); }
.pin-reply { margin-top: 6px; display: flex; gap: 6px; align-items: flex-start; }
.pin-reply textarea { flex: 1; }
.pin-actions { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.pin-actions form { margin: 0; }
.pin-composer { position: absolute; display: block; z-index: 30; }
.pin-drag { cursor: grab; user-select: none; }

/* ===== Forward-looking layer: worklist, readiness gauge, risk board ===== */
.fwd-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; margin: 18px 0; }
@media (max-width: 900px) { .fwd-grid { grid-template-columns: 1fr; } }

/* Personalized worklist */
.worklist { list-style: none; margin: 0; padding: 0; }
.worklist li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line); }
.worklist li:last-child { border-bottom: 0; }
.wl-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; background: var(--muted); }
.wl-dot.urgent { background: var(--danger); }
.wl-dot.approve { background: var(--accent); }
.wl-body { flex: 1 1 auto; min-width: 0; }
.wl-title { font-weight: 600; color: var(--ink); font-size: 14px; }
.wl-title a { color: inherit; text-decoration: none; }
.wl-title a:hover { color: var(--accent); }
.wl-detail { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.wl-due { flex: 0 0 auto; font-size: 12px; color: var(--amber); white-space: nowrap; }
.wl-empty { color: var(--muted); font-size: 14px; padding: 8px 0; }
.persona-pill { display: inline-block; font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent-dark); background: var(--accent-soft); border-radius: 999px; padding: 2px 10px; }

/* Readiness gauge */
.gauge-wrap { display: flex; align-items: center; gap: 18px; }
.gauge { --v: 100; --c: #137333; flex: 0 0 auto; width: 116px; height: 116px; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--v) * 1%), var(--line) 0);
  display: grid; place-items: center; position: relative; }
.gauge::after { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--surface); }
.gauge-num { position: relative; z-index: 1; font-size: 30px; font-weight: 700; color: var(--ink); line-height: 1; }
.gauge-num small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 3px; }
.gauge-meta { flex: 1 1 auto; }
.gauge-band { font-weight: 700; font-size: 15px; }
.gauge-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* Domain rollup bars */
.dom-row { display: grid; grid-template-columns: 120px 1fr 42px; gap: 10px; align-items: center; margin: 8px 0; font-size: 13px; }
.dom-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.dom-bar > span { display: block; height: 100%; border-radius: 999px; }
.dom-count { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Risk / predictive signals */
.risk { border-left: 4px solid var(--muted); background: var(--surface); border-radius: 6px;
  border: 1px solid var(--line); padding: 12px 14px; margin: 10px 0; }
.risk.high { border-left-color: #b00020; }
.risk.medium { border-left-color: #b54708; }
.risk.low { border-left-color: #9a6700; }
.risk-title { font-weight: 700; font-size: 14.5px; color: var(--ink); }
.risk-detail { font-size: 13px; color: var(--muted); margin: 4px 0 8px; }
.risk-evidence { display: flex; flex-wrap: wrap; gap: 6px; }
.risk-chip { font-size: 11.5px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  padding: 2px 9px; color: var(--muted); }
.sev-tag { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 1px 7px; border-radius: 4px; color: #fff; }
.sev-tag.high { background: #b00020; } .sev-tag.medium { background: #b54708; } .sev-tag.low { background: #9a6700; }
.ai-brief { background: var(--accent-soft); border: 1px solid #bfe6c0; border-radius: 6px; padding: 12px 14px;
  font-size: 13.5px; color: var(--ink); margin: 6px 0 14px; }
.ai-brief .ai-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-dark);
  font-weight: 700; display: block; margin-bottom: 4px; }

.main.main-wide { max-width: none; }
@media (max-width: 820px){ .main.main-wide { padding: 20px; } }
