/* ==========================================================================
   SEA Tender Go/No-Go — app.css
   Design tokens + component styles. No external fonts, no build step.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens, reset, base
   -------------------------------------------------------------------------- */

:root {
  --ink: #172033;
  --muted: #64748b;
  --line: #dce4ec;
  --line-strong: #c7d2de;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --navy: #08355f;
  --navy-2: #0a4a7a;
  --teal: #087d9c;
  --teal-soft: #e6f4f8;
  --green: #15803d;
  --green-soft: #dcfce7;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --red: #b91c1c;
  --red-soft: #fee2e2;
  --blue: #1d4ed8;
  --blue-soft: #dbeafe;
  --violet: #6d28d9;
  --violet-soft: #ede9fe;
  --gray-soft: #eef2f6;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 10px rgba(8, 53, 95, 0.06);
  --shadow-lg: 0 18px 50px rgba(8, 53, 95, 0.18);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sidebar-w: 236px;
  --focus: 0 0 0 3px rgba(8, 125, 156, 0.25);
  --header-h: 58px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

::selection { background: rgba(8, 125, 156, 0.2); }

/* Utility ------------------------------------------------------------------ */

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.dot-sep { color: var(--muted); margin: 0 3px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-form { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; text-decoration: none; }
body[data-screen="auth"] .skip-link { display: none; }

.boot-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding: 24px;
  background: linear-gradient(135deg, #08355f 0%, #0a4a7a 45%, #087d9c 100%);
}
.boot-logo { width: 200px; height: auto; background: #fff; padding: 12px 18px; border-radius: 12px; }
.boot-loading { display: flex; align-items: center; gap: 10px; color: #e2eef4; font-weight: 500; }
.boot-error { max-width: 440px; padding: 28px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.boot-error h1 { font-size: 18px; }
.boot-error p { color: var(--muted); font-size: 13.5px; }
.boot-error-icon { color: var(--red); }

/* --------------------------------------------------------------------------
   2. Buttons, forms, chips, avatars, progress
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 650;
  font-size: 13.5px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, color 0.12s ease;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn .icon { flex: 0 0 auto; }
.btn-icon { display: inline-flex; }

.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--navy-2); }

.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover:not(:disabled) { background: #f7fafc; border-color: var(--muted); }

.btn-ghost { background: transparent; color: var(--teal); border-color: transparent; padding: 0 8px; }
.btn-ghost:hover:not(:disabled) { background: var(--teal-soft); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #991b1b; }
.btn-danger-ghost { background: transparent; color: var(--red); border-color: var(--line-strong); }
.btn-danger-ghost:hover:not(:disabled) { background: var(--red-soft); border-color: var(--red); }

.btn-sm { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn[aria-busy="true"] { cursor: progress; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
}
.icon-btn:hover { background: var(--gray-soft); color: var(--ink); }

.link-btn {
  border: 0; background: none; padding: 0;
  color: var(--teal); font-weight: 600; text-decoration: underline;
}
.link-more { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; }

/* Forms -------------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label { font-size: 12.5px; font-weight: 650; color: #2b3a4d; }
.field-optional, .field-hint { font-size: 11.5px; font-weight: 400; color: var(--muted); }
.field-hint { margin: 0; }
.req { color: var(--red); }
.field-invalid .input { border-color: var(--red); box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.12); }
.field-error { color: var(--red); font-size: 11.5px; margin: 2px 0 0; }

.input {
  min-height: 36px;
  width: 100%;
  padding: 7px 10px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--ink);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.input:hover:not(:disabled) { border-color: #a9b7c7; }
.input:focus { outline: none; border-color: var(--teal); box-shadow: var(--focus); }
.input::placeholder { color: #94a3b8; }
.input:disabled { background: #f1f5f9; color: var(--muted); cursor: not-allowed; }
textarea.input { resize: vertical; min-height: 66px; line-height: 1.45; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
.input-sm { min-height: 32px; font-size: 12.5px; padding: 5px 8px; }
.input-number { max-width: 110px; }
.input-wrap { position: relative; }
.input-password { padding-right: 40px; }
.input-icon-btn {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--muted);
}
.input-icon-btn:hover { background: var(--gray-soft); color: var(--ink); }

.input-search { padding-left: 32px; min-width: 260px; }
.search-field { position: relative; display: flex; align-items: center; }
.search-field > .icon { position: absolute; left: 10px; color: var(--muted); pointer-events: none; }

.checkbox-field { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.checkbox-field input { width: 16px; height: 16px; accent-color: var(--teal); }
.inline-field { display: inline-flex; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-span-2 { grid-column: 1 / -1; }
.form-divider { border: 0; border-top: 1px solid var(--line); margin: 2px 0; }
.form-note { display: flex; align-items: flex-start; gap: 7px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-note .icon { flex: 0 0 auto; margin-top: 1px; }
.form-error {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px; margin-bottom: 12px;
  background: var(--red-soft); color: var(--red);
  border: 1px solid rgba(185, 28, 28, 0.25); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
}
.form-error .icon { flex: 0 0 auto; margin-top: 1px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.form-loading { padding: 20px; display: flex; justify-content: center; }
.modal-text { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.help-footer { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 4px 2px; }

/* Chips -------------------------------------------------------------------- */

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.6;
  white-space: nowrap;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.stage-chip { border: 1px solid transparent; }
.stage-scoring { background: var(--amber-soft); color: var(--amber); }
.stage-in-review { background: var(--blue-soft); color: var(--blue); }
.stage-returned { background: var(--red-soft); color: var(--red); }
.stage-final-review { background: var(--violet-soft); color: var(--violet); }
.stage-decided { background: var(--green-soft); color: var(--green); }

.status-chip { background: var(--gray-soft); color: #475569; }
.status-todo { background: #eef2f6; color: #475569; }
.status-in-progress { background: var(--amber-soft); color: var(--amber); }
.status-submitted { background: var(--blue-soft); color: var(--blue); }
.status-approved { background: var(--green-soft); color: var(--green); }
.status-returned { background: var(--red-soft); color: var(--red); }

.role-chip { text-transform: uppercase; font-size: 10.5px; }
.role-responsible { background: var(--teal-soft); color: var(--teal); }
.role-accountable { background: var(--blue-soft); color: var(--blue); }
.role-final { background: var(--violet-soft); color: var(--violet); }

.recommendation-chip { font-size: 11.5px; padding: 3px 10px; }
.rec-not-ready { background: #eef2f6; color: #475569; }
.rec-go { background: var(--green-soft); color: var(--green); }
.rec-conditional { background: var(--amber-soft); color: var(--amber); }
.rec-no-go { background: var(--red-soft); color: var(--red); }

.count-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 22px; padding: 0 7px;
  border-radius: 999px; background: var(--teal-soft); color: var(--teal);
  font-size: 12px; font-weight: 700;
}

/* Avatar ------------------------------------------------------------------- */

.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.person { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.person-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-line { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.person-line .icon { color: var(--muted); flex: 0 0 auto; }

/* Progress ----------------------------------------------------------------- */

.progress {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e5ebf2;
  overflow: hidden;
}
.progress-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--teal);
  transition: width 0.3s ease;
}
.progress-cell { display: flex; flex-direction: column; gap: 4px; min-width: 92px; }
.progress-label { font-size: 11px; color: var(--muted); }

/* Spinner ------------------------------------------------------------------ */

.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(8, 125, 156, 0.2);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-sm { width: 13px; height: 13px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-block {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 56px 20px; color: var(--muted); font-size: 13px;
}
.loading-text { font-weight: 500; }

/* Skeleton ----------------------------------------------------------------- */

.skeleton-table { display: flex; flex-direction: column; gap: 10px; padding: 6px 2px; }
.skeleton-row { display: flex; gap: 16px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.skeleton-cell { height: 12px; border-radius: 6px; background: linear-gradient(90deg, #eef2f6 25%, #f6f9fc 50%, #eef2f6 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* --------------------------------------------------------------------------
   3. Cards, page scaffolding, tables
   -------------------------------------------------------------------------- */

.page { max-width: 1320px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin-bottom: 14px;
}
.card-title { font-size: 18px; font-weight: 650; line-height: 1.3; }
.card-subtitle { font-size: 12.5px; color: var(--muted); margin-top: 3px; max-width: 70ch; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.page-title { font-size: 24px; font-weight: 650; line-height: 1.2; letter-spacing: -0.01em; }
.page-subtitle { color: var(--muted); font-size: 13px; margin-top: 4px; }
.page-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.back-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  margin-bottom: 6px;
}
.back-link:hover { color: var(--teal); text-decoration: none; }

.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table caption { text-align: left; }
.data-table th {
  text-align: left;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background 0.12s ease; }
.data-table tbody tr:hover { background: #f8fbfd; }
.data-table tr[data-href] { cursor: pointer; }
.data-table tr[data-href]:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.ref { font-weight: 700; font-family: var(--mono); font-size: 12.5px; color: var(--navy); white-space: nowrap; }
.opp-name { display: block; font-weight: 600; color: var(--ink); max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opp-customer { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.row-open { display: inline-flex; color: var(--muted); }
.assessment-row:hover .row-open { color: var(--teal); }
.score-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.due { display: inline-flex; flex-direction: column; gap: 2px; white-space: nowrap; }
.due.overdue { color: var(--red); font-weight: 600; }
.due-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.days-pending { font-variant-numeric: tabular-nums; font-weight: 600; }

.inline-error {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px;
  background: #fff7f7;
  border: 1px solid rgba(185, 28, 28, 0.25);
  border-radius: var(--radius-sm);
  color: var(--ink);
}
.inline-error > .icon { color: var(--red); flex: 0 0 auto; margin-top: 2px; }
.inline-error strong { display: block; margin-bottom: 2px; }
.inline-error p { color: var(--muted); font-size: 12.5px; margin: 0; }
.inline-error > .btn { margin-left: auto; flex: 0 0 auto; }

.empty-state, .error-state {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 44px 24px; gap: 8px;
}
.empty-icon, .error-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; margin-bottom: 6px;
  border-radius: 50%;
  background: var(--teal-soft); color: var(--teal);
}
.error-icon { background: var(--red-soft); color: var(--red); }
.empty-title, .error-title { font-size: 17px; font-weight: 650; }
.empty-body, .error-message { color: var(--muted); font-size: 13px; max-width: 52ch; }
.empty-action, .error-actions { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }

.section-readonly-note { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; padding: 10px 2px 2px; }
.evidence-static { display: flex; flex-direction: column; gap: 10px; }
.evidence-static p { white-space: pre-wrap; word-break: break-word; font-size: 12.5px; color: var(--ink); margin-top: 2px; }
.static-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }

/* --------------------------------------------------------------------------
   4. Auth screens
   -------------------------------------------------------------------------- */

.auth {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #062c50 0%, #0a4a7a 48%, #087d9c 100%);
}
.auth-brandbar {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 26px;
}
.auth-logo { width: 128px; height: auto; background: #fff; padding: 6px 10px; border-radius: 8px; }
.auth-brandname { color: #e6f4f8; font-weight: 650; font-size: 14px; letter-spacing: 0.01em; }
.auth-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px 20px 40px; }
.auth-card {
  width: 100%; max-width: 430px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(2, 20, 40, 0.35);
  padding: 30px 30px 26px;
}
.auth-heading { margin-bottom: 20px; }
.auth-eyebrow {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--teal); margin-bottom: 8px;
}
.auth-title { font-size: 23px; font-weight: 650; line-height: 1.2; letter-spacing: -0.01em; }
.auth-subtitle { color: var(--muted); font-size: 13px; margin-top: 6px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .btn-block { margin-top: 4px; }
.auth-form .btn-block + .btn-block { margin-top: 0; }
.auth-note { font-size: 12px; color: var(--muted); margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.auth-footer { text-align: center; color: rgba(255, 255, 255, 0.75); font-size: 11.5px; padding: 18px; }
.setup-note {
  display: flex; gap: 9px; align-items: flex-start;
  background: var(--teal-soft); color: #0b4a5c;
  border-radius: var(--radius-sm);
  padding: 11px 12px; margin-bottom: 18px;
  font-size: 12.5px; line-height: 1.45;
}
.setup-note .icon { flex: 0 0 auto; margin-top: 1px; color: var(--teal); }

/* --------------------------------------------------------------------------
   5. Shell, sidebar, user menu
   -------------------------------------------------------------------------- */

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  gap: 22px;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-logo { width: 102px; height: auto; flex: 0 0 auto; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 700; font-size: 13.5px; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-sub { font-size: 10.5px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: #334155;
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
}
.nav-item:hover { background: #f5f9fc; color: var(--navy); text-decoration: none; }
.nav-item.is-active { background: var(--teal-soft); color: var(--navy); }
.nav-item.is-active .nav-icon { color: var(--teal); }
.nav-icon { display: inline-flex; color: #5b6b7d; }
.nav-label { white-space: nowrap; }

.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.user-area { position: relative; }
.user-button {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 7px 8px; border: 0; border-radius: var(--radius-sm);
  background: transparent; text-align: left;
}
.user-button:hover { background: #f5f9fc; }
.user-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.user-name { font-size: 13px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 10.5px; color: var(--muted); }
.user-chevron { color: var(--muted); display: inline-flex; }
.user-menu {
  position: absolute;
  left: 0; right: 0; bottom: calc(100% + 6px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 60;
}
.user-menu-head { display: flex; flex-direction: column; padding: 9px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.user-menu-name { font-weight: 650; font-size: 13px; }
.user-menu-username { font-size: 11.5px; color: var(--muted); }
.user-menu-role { font-size: 10.5px; color: var(--teal); font-weight: 600; margin-top: 2px; }
.user-menu-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 6px;
  background: transparent; text-align: left; font-size: 13px; font-weight: 500;
}
.user-menu-item:hover { background: #f5f9fc; }

.view {
  margin-left: var(--sidebar-w);
  padding: 24px 28px 90px;
  min-height: 100vh;
  outline: none;
}

/* --------------------------------------------------------------------------
   6. My Work
   -------------------------------------------------------------------------- */

.work-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.work-greeting { font-size: 26px; font-weight: 650; letter-spacing: -0.015em; line-height: 1.2; }
.work-date { color: var(--muted); font-size: 13px; margin-top: 4px; }

.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi-row-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.kpi {
  display: flex; align-items: center; gap: 11px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}
.kpi-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--gray-soft); color: #475569;
  flex: 0 0 auto;
}
.kpi-text { display: flex; flex-direction: column; min-width: 0; }
.kpi-value { font-size: 21px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-label { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.kpi-overdue .kpi-icon { background: var(--red-soft); color: var(--red); }
.kpi-overdue .kpi-value { color: var(--red); }
.kpi-score .kpi-icon { background: var(--amber-soft); color: var(--amber); }
.kpi-approve .kpi-icon { background: var(--blue-soft); color: var(--blue); }
.kpi-final .kpi-icon { background: var(--violet-soft); color: var(--violet); }
.kpi-decided .kpi-icon { background: var(--green-soft); color: var(--green); }
.kpi-total .kpi-icon { background: var(--teal-soft); color: var(--teal); }

.work-actions { padding-bottom: 8px; }
.action-list { display: flex; flex-direction: column; }
.action-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.2fr) auto;
  align-items: center;
  gap: 18px;
  padding: 16px 4px;
  border-top: 1px solid var(--line);
}
.action-list .action-row:first-child { border-top: 0; }
.action-main { min-width: 0; }
.action-ref { font-family: var(--mono); font-size: 11.5px; font-weight: 700; color: var(--muted); }
.action-title { font-size: 15px; font-weight: 650; line-height: 1.3; margin-top: 1px; }
.action-opp { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 12px; font-size: 12px; }
.action-wait { color: var(--muted); }
.action-due { color: var(--ink); font-weight: 500; }
.action-due.overdue { color: var(--red); }
.action-due.overdue strong { font-weight: 700; }
.action-detail { color: var(--muted); }
.action-cta { display: flex; justify-content: flex-end; }
.action-cta .btn { min-width: 150px; }

.work-assessments .card-head { align-items: center; }
.mini-table th, .mini-table td { padding: 9px 8px; }
.mini-empty { padding: 8px 2px; }
.mini-table .progress-cell { min-width: 120px; }

/* --------------------------------------------------------------------------
   7. Filters, chips, segmented control
   -------------------------------------------------------------------------- */

.filters-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.filter-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 32px; padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 12.5px;
  font-weight: 600;
}
.filter-chip:hover { border-color: var(--teal); color: var(--teal); }
.filter-chip.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip-count { font-size: 11px; font-weight: 700; padding: 0 5px; border-radius: 999px; background: rgba(8, 53, 95, 0.08); color: inherit; }
.filter-chip.is-active .chip-count { background: rgba(255, 255, 255, 0.22); }

.filters-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.segmented { display: inline-flex; background: var(--gray-soft); border-radius: 999px; padding: 3px; }
.segmented-btn {
  border: 0; background: transparent; border-radius: 999px;
  min-height: 28px; padding: 0 12px;
  font-size: 12px; font-weight: 650; color: var(--muted);
}
.segmented-btn.is-active { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(8, 53, 95, 0.15); }

.pending-with { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.pending-text { display: flex; flex-direction: column; min-width: 0; }
.pending-name { font-weight: 600; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 16ch; }
.pending-role { font-size: 10.5px; color: var(--muted); }
.pending-sections { font-size: 10.5px; color: var(--muted); background: var(--gray-soft); border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.stage-days { font-size: 10.5px; color: var(--muted); }

/* --------------------------------------------------------------------------
   8. Assessment page
   -------------------------------------------------------------------------- */

.page-assessment { padding-bottom: 120px; gap: 16px; }

.assess-bar {
  position: sticky;
  top: 10px;
  z-index: 30;
  padding: 16px 18px 14px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(6px);
}
.assess-bar-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.assess-identity { min-width: 0; flex: 1 1 420px; }
.assess-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 21px; font-weight: 650; line-height: 1.25; letter-spacing: -0.01em; }
.assess-ref { font-family: var(--mono); font-size: 15px; color: var(--navy); letter-spacing: -0.02em; }
.assess-opportunity { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.assess-meta { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; margin-top: 8px; }
.meta-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.meta-chip .icon { color: #7b8a9b; }
.meta-chip.is-overdue, .meta-chip.is-overdue strong { color: var(--red); }
.assess-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.assess-progress { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.assess-progress .progress { flex: 1; height: 7px; }
.progress-caption { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.progress-caption strong { color: var(--ink); }

.save-pill {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 28px; padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 650;
  background: var(--gray-soft); color: var(--muted);
  cursor: default;
}
.save-pill.is-saved { background: var(--green-soft); color: var(--green); border-color: rgba(21, 128, 61, 0.18); }
.save-pill.is-saving { background: var(--amber-soft); color: var(--amber); }
.save-pill.is-dirty { background: var(--amber-soft); color: var(--amber); }
.save-pill.is-error { background: var(--red-soft); color: var(--red); border-color: rgba(185, 28, 28, 0.2); }
.save-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.save-pill.is-saving .save-dot { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }

.decided-banner {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow);
}
.decided-banner.rec-go { background: linear-gradient(180deg, #f2fdf5, #fff); border-color: #b7e7c6; }
.decided-banner.rec-conditional { background: linear-gradient(180deg, #fffaf0, #fff); border-color: #f3dfae; }
.decided-banner.rec-no-go { background: linear-gradient(180deg, #fff7f7, #fff); border-color: #f3c6c6; }
.decided-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--gray-soft); color: var(--ink); flex: 0 0 auto; }
.decided-banner.rec-go .decided-icon { background: var(--green-soft); color: var(--green); }
.decided-banner.rec-conditional .decided-icon { background: var(--amber-soft); color: var(--amber); }
.decided-banner.rec-no-go .decided-icon { background: var(--red-soft); color: var(--red); }
.decided-text { display: flex; flex-direction: column; gap: 3px; }
.decided-label { font-size: 14.5px; font-weight: 650; }
.decided-comment { font-size: 12.5px; color: #334155; white-space: pre-wrap; }
.decided-meta { font-size: 11.5px; color: var(--muted); }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card {
  display: flex; flex-direction: column; gap: 3px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 15px 16px;
}
.stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; min-height: 36px; }
.stat-value .recommendation-chip { font-size: 12.5px; }
.stat-unit { font-size: 13px; font-weight: 600; color: var(--muted); }
.stat-note { font-size: 11px; color: var(--muted); }
.rec-explain { display: flex; align-items: flex-start; gap: 6px; font-size: 11.5px; color: var(--muted); padding: 0 2px; }
.rec-explain .icon { flex: 0 0 auto; margin-top: 1px; }

/* Sections ----------------------------------------------------------------- */

.sections { display: flex; flex-direction: column; gap: 12px; }
.section-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.section-card.is-open { border-color: #b9cfdf; }
.section-card.is-returned { border-left: 3px solid var(--red); }
.section-head { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 4px; }
.section-toggle {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto auto auto auto 22px;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  padding: 10px 8px;
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: var(--radius-sm);
}
.section-toggle:hover { background: #f8fbfd; }
.section-number {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--teal-soft); color: var(--navy);
  font-weight: 700; font-size: 13px;
}
.section-title-wrap { display: flex; flex-direction: column; min-width: 0; }
.section-name { font-size: 14.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section-meta { font-size: 11px; color: var(--muted); margin-top: 1px; }
.section-score-wrap { display: flex; align-items: baseline; gap: 4px; }
.section-score { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.section-score-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.section-status { display: inline-flex; }
.section-people { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: var(--muted); min-width: 130px; }
.section-due { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.section-due.is-overdue { color: var(--red); font-weight: 600; }
.section-chevron { display: inline-flex; color: var(--muted); transition: transform 0.15s ease; }
.section-card.is-open .section-chevron { transform: rotate(180deg); }
.section-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.section-body { padding: 4px 18px 18px; }

.section-callout {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 13px; margin: 4px 0 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.45;
}
.section-callout > .icon { flex: 0 0 auto; margin-top: 1px; }
.section-callout p { margin: 2px 0 0; color: inherit; opacity: 0.9; }
.section-callout.returned { background: var(--red-soft); color: #7f1d1d; }
.section-callout.review { background: var(--blue-soft); color: #1e3a8a; }
.section-callout.approved { background: var(--green-soft); color: #14532d; }

.criteria { display: flex; flex-direction: column; }
.criterion {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 18px;
  padding: 14px 4px;
  border-top: 1px solid var(--line);
  border-radius: 6px;
  scroll-margin-top: 150px;
}
.criteria .criterion:first-child { border-top: 0; }
.criterion.is-editable { cursor: default; }
.criterion.is-editable:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; background: #fbfdff; }
.criterion.is-low { border-left: 3px solid var(--amber); padding-left: 11px; }
.criterion-main { display: flex; gap: 10px; min-width: 0; }
.criterion-index {
  flex: 0 0 auto;
  width: 22px; height: 22px; margin-top: 1px;
  border-radius: 6px; background: #f1f5f9;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--muted);
}
.criterion-text { min-width: 0; }
.criterion-name { font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.guide { margin-top: 3px; }
.guide-summary {
  display: inline-flex; align-items: center;
  list-style: none;
  font-size: 11.5px; font-weight: 600; color: var(--teal);
  cursor: pointer;
}
.guide-summary::-webkit-details-marker { display: none; }
.guide-summary::before { content: "▸"; margin-right: 4px; font-size: 10px; }
.guide[open] .guide-summary::before { content: "▾"; }
.guide-list { list-style: none; margin: 8px 0 0; display: flex; flex-direction: column; gap: 5px; max-width: 72ch; }
.guide-list li { display: flex; gap: 8px; font-size: 12px; color: #475569; line-height: 1.45; }
.guide-number {
  flex: 0 0 auto; width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #f1f5f9; color: var(--muted);
  font-size: 10.5px; font-weight: 700;
}
.guide-list li.is-current { color: var(--ink); font-weight: 500; }
.guide-list li.is-current .guide-number { background: var(--navy); color: #fff; }
.guide-list.compact li { font-size: 11.5px; }

.criterion-score { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.score-buttons { display: inline-flex; gap: 4px; }
.score-btn {
  width: 34px; height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-weight: 700;
  font-size: 13px;
  transition: all 0.1s ease;
}
.score-btn:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }
.score-btn.is-selected { background: var(--navy); border-color: var(--navy); color: #fff; }
.score-btn.is-low.is-selected { background: var(--red); border-color: var(--red); }
.score-btn:disabled { opacity: 0.5; }
.score-static { display: inline-flex; align-items: center; min-height: 34px; }
.score-static-value { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; background: var(--navy); color: #fff; font-weight: 700; }
.row-save { font-size: 10.5px; color: var(--muted); min-height: 14px; display: inline-flex; align-items: center; gap: 4px; }
.row-save.state-saving { color: var(--amber); }
.row-save.state-saved { color: var(--green); }
.row-save.state-error { color: var(--red); }
.row-save .spinner-sm { width: 11px; height: 11px; }

.criterion-extra { grid-column: 1 / -1; }
.criterion-fields { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; padding-top: 2px; }
.evidence-hint { grid-column: 1 / -1; display: flex; align-items: center; gap: 5px; color: var(--amber); font-size: 11.5px; }
.evidence-hint .icon { flex: 0 0 auto; }

/* Timeline ----------------------------------------------------------------- */

.timeline-card { padding: 0; }
.timeline-details { padding: 4px 18px; }
.timeline-summary {
  display: flex; align-items: center; gap: 9px;
  list-style: none; cursor: pointer;
  padding: 13px 0;
}
.timeline-summary::-webkit-details-marker { display: none; }
.timeline-title { display: inline-flex; align-items: center; gap: 7px; font-weight: 650; font-size: 14px; }
.timeline-count { font-size: 11.5px; color: var(--muted); }
.timeline-chevron { margin-left: auto; color: var(--muted); transition: transform 0.15s ease; display: inline-flex; }
.timeline-details[open] .timeline-chevron { transform: rotate(180deg); }
.timeline-empty { padding: 0 0 16px; }
.timeline-list { list-style: none; padding: 2px 0 16px; display: flex; flex-direction: column; gap: 0; }
.timeline-item { position: relative; display: flex; gap: 12px; padding: 0 0 14px 4px; }
.timeline-item::before { content: ""; position: absolute; left: 9px; top: 14px; bottom: -2px; width: 1px; background: var(--line); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { flex: 0 0 auto; width: 11px; height: 11px; margin-top: 5px; border-radius: 50%; background: var(--teal-soft); border: 2px solid var(--teal); z-index: 1; }
.timeline-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.timeline-action { font-size: 12.5px; font-weight: 600; }
.timeline-meta { font-size: 11px; color: var(--muted); }

/* Review bar --------------------------------------------------------------- */

.review-bar {
  position: fixed;
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  z-index: 35;
  background: #fff;
  border-top: 1px solid var(--line-strong);
  box-shadow: 0 -6px 30px rgba(8, 53, 95, 0.1);
  padding: 12px 28px;
  max-height: 55vh;
  overflow-y: auto;
}
.review-bar-inner { max-width: 1320px; margin: 0 auto; display: flex; align-items: flex-end; gap: 18px; }
.review-bar.is-waiting .review-bar-inner { align-items: center; }
.review-targets { flex: 1 1 300px; min-width: 0; }
.review-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 6px; }
.review-section-list { display: flex; flex-wrap: wrap; gap: 4px 12px; max-height: 84px; overflow-y: auto; }
.review-check { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: #334155; }
.review-check input { accent-color: var(--teal); }
.review-comment-field { flex: 1 1 320px; min-width: 0; }
.review-comment-field .textarea { min-height: 46px; }
.review-actions { display: flex; gap: 8px; flex: 0 0 auto; padding-bottom: 2px; }
.review-ready { display: flex; align-items: center; gap: 12px; flex: 1; }
.review-ready-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: var(--green-soft); color: var(--green); flex: 0 0 auto; }
.review-ready strong { display: block; font-size: 13.5px; }
.review-ready p { font-size: 12px; color: var(--muted); margin: 1px 0 0; }

/* Decision dialog ---------------------------------------------------------- */

.decision-options { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.decision-option {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.decision-option:hover { border-color: var(--teal); }
.decision-option input { margin-top: 2px; accent-color: var(--navy); width: 16px; height: 16px; }
.decision-option:has(input:checked) { border-color: var(--navy); background: #f7fbfd; box-shadow: inset 0 0 0 1px var(--navy); }
.decision-option-body { display: flex; flex-direction: column; gap: 2px; }
.decision-option-title { font-weight: 700; font-size: 13px; letter-spacing: 0.01em; }
.decision-option-desc { font-size: 12px; color: var(--muted); }

/* People & dates ----------------------------------------------------------- */

.people-table-wrap { overflow-x: auto; }
.people-table th, .people-table td { padding: 8px 8px; }
.people-section-name { font-weight: 600; font-size: 12.5px; }
.people-table select, .people-table input { min-width: 140px; }
.users-table .row-actions { white-space: nowrap; text-align: right; }
.user-cell { display: inline-flex; align-items: center; gap: 9px; }
.user-name { font-weight: 600; }
.avatar { text-transform: uppercase; }

/* --------------------------------------------------------------------------
   9. Tracker
   -------------------------------------------------------------------------- */

.tracker-filters { margin-top: 2px; }
.tracker-table .person-line { font-size: 12.5px; }
.section-count { font-size: 10.5px; color: var(--muted); background: var(--gray-soft); padding: 1px 6px; border-radius: 999px; }

/* --------------------------------------------------------------------------
   10. Admin
   -------------------------------------------------------------------------- */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 40px; padding: 0 14px;
  border: 0; border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted); font-weight: 600; font-size: 13px;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--teal); }
.tab .icon { color: currentColor; }
.tab-panel { min-height: 200px; }
.admin-tab { display: flex; flex-direction: column; gap: 18px; }
.model-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.weight-indicator { font-size: 12px; color: var(--muted); }
.weight-total { font-weight: 700; margin-left: 3px; color: var(--muted); }
.weight-total.is-valid { color: var(--green); }
.weight-total.is-invalid { color: var(--red); }
.model-table .input { min-width: 90px; }
.model-table .input[type="text"] { min-width: 200px; }
.model-id { font-weight: 700; color: var(--muted); }
.model-save-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: 12px; }
.criteria-library { display: flex; flex-direction: column; gap: 8px; }
.criteria-section { border: 1px solid var(--line); border-radius: var(--radius-sm); }
.criteria-section > summary {
  display: flex; align-items: center; gap: 10px;
  list-style: none; cursor: pointer;
  padding: 11px 14px;
}
.criteria-section > summary::-webkit-details-marker { display: none; }
.criteria-section-name { font-weight: 600; font-size: 13px; }
.criteria-section > summary .muted { margin-left: auto; font-size: 11.5px; }
.criteria-section[open] > summary .icon { transform: rotate(180deg); }
.criteria-section-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 12px; }
.library-criterion-name { font-weight: 600; font-size: 12.5px; display: block; margin-bottom: 4px; }
.settings-grid { grid-template-columns: 1.5fr 0.7fr; }
.settings-people-table select { min-width: 170px; }
.backup-actions { display: flex; flex-direction: column; gap: 0; }
.backup-action { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 2px; border-top: 1px solid var(--line); }
.backup-action:first-child { border-top: 0; }
.backup-action-text strong { font-size: 13.5px; }
.backup-action-text p { color: var(--muted); font-size: 12px; margin: 2px 0 0; max-width: 66ch; }
.restore-guide { margin-top: 14px; padding: 16px; background: #f8fbfd; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.restore-title { display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 650; margin-bottom: 8px; }
.restore-steps { margin: 0 0 10px 18px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: #334155; }
.audit-table .audit-summary { font-size: 12px; color: #334155; }
.audit-table .mono { font-size: 11.5px; }

/* --------------------------------------------------------------------------
   11. Modal + toast
   -------------------------------------------------------------------------- */

.modal-root { position: relative; z-index: 90; }
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10, 25, 45, 0.5);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 5vh 18px 40px;
  overflow-y: auto;
  z-index: 90;
  animation: fadeIn 0.12s ease;
}
.modal-overlay.modal-closing { opacity: 0; transition: opacity 0.12s ease; }
body.modal-open { overflow: hidden; }
.modal {
  width: 100%;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn 0.15s ease;
}
.modal-sm { max-width: 420px; }
.modal-md { max-width: 560px; }
.modal-lg { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.modal-title { font-size: 18px; font-weight: 650; line-height: 1.3; }
.modal-close { margin: -4px -6px 0 0; }
.modal-body { padding: 14px 20px 18px; }
.modal-body .stack > .field:first-child, .modal-body .stack-form > .field:first-child { margin-top: 2px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; background: #f8fafc; border-top: 1px solid var(--line); }
.confirm-message { font-size: 13.5px; color: #334155; }
.confirm-details { margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.modal .form-grid { gap: 12px; }
.modal .stat-grid { gap: 10px; }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(6px) scale(0.99); } }

.toasts {
  position: fixed;
  right: 18px; bottom: 18px;
  z-index: 120;
  display: flex; flex-direction: column; gap: 8px;
  max-width: min(380px, calc(100vw - 32px));
}
.toast {
  display: flex; align-items: flex-start; gap: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(8, 53, 95, 0.18);
  padding: 11px 12px;
  font-size: 12.5px;
  color: var(--ink);
  animation: toastIn 0.16s ease;
}
.toast.toast-out { opacity: 0; transform: translateY(4px); transition: all 0.18s ease; }
.toast-success { border-left-color: var(--green); }
.toast-error { border-left-color: var(--red); }
.toast-warning { border-left-color: var(--amber); }
.toast-error .toast-icon { color: var(--red); }
.toast-warning .toast-icon { color: var(--amber); }
.toast-success .toast-icon { color: var(--green); }
.toast-icon { flex: 0 0 auto; color: var(--teal); margin-top: 1px; }
.toast-message { flex: 1; min-width: 0; }
.toast-close { border: 0; background: transparent; color: var(--muted); padding: 0; flex: 0 0 auto; display: inline-flex; }
.toast-close:hover { color: var(--ink); }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } }

.noscript { padding: 40px; text-align: center; font-size: 15px; }

/* --------------------------------------------------------------------------
   12. Responsive — 1024 rail, 760 horizontal header
   -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .action-row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr) auto; gap: 14px; }
  .review-bar-inner { flex-wrap: wrap; align-items: flex-end; }
  .review-targets { flex-basis: 100%; }
}

@media (max-width: 1024px) {
  :root { --sidebar-w: 72px; }
  .sidebar { padding: 14px 10px; gap: 18px; align-items: stretch; }
  .brand { justify-content: center; padding: 2px 0; }
  .brand-logo { width: 40px; height: 40px; object-fit: contain; }
  .brand-text { display: none; }
  .nav { align-items: center; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nav-icon { display: inline-flex; }
  .sidebar-foot { padding-top: 10px; }
  .user-button { justify-content: center; padding: 7px 0; }
  .user-text, .user-chevron { display: none; }
  .user-menu { left: 54px; right: auto; bottom: 0; width: 240px; }
  .view { padding: 20px 20px 90px; }
  .review-bar { padding: 12px 20px; }
  .kpi-row-7 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat-grid, .stat-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-toggle { grid-template-columns: 30px minmax(0, 1fr) auto auto auto 22px; }
  .section-people { display: none; }
  .section-due { display: none; }
  .section-head { flex-wrap: wrap; }
  .section-actions { padding: 0 8px 8px; }
}

@media (max-width: 860px) {
  .action-row { grid-template-columns: minmax(0, 1fr) auto; }
  .action-meta { grid-column: 1 / -1; }
  .action-cta { grid-row: 1 / span 2; align-self: center; }
  .action-cta .btn { min-width: 0; }
}

@media (max-width: 760px) {
  :root { --sidebar-w: 0px; }
  .app-shell { display: block; }
  .sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }
  .brand { flex: 0 0 auto; padding: 0 2px; }
  .brand-logo { width: 52px; height: 22px; }
  .nav { flex: 1 1 auto; flex-direction: row; gap: 0; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { padding: 9px 7px; flex: 0 0 auto; gap: 4px; }
  .nav-item .icon { width: 16px; height: 16px; }
  .nav-label { position: static; width: auto; height: auto; clip: auto; overflow: visible; font-size: 11.5px; }
  .sidebar-foot { flex: 0 0 auto; margin: 0; padding: 0; border: 0; }
  .user-button { padding: 4px; }
  .user-menu { position: fixed; top: 58px; right: 10px; left: auto; bottom: auto; width: min(260px, calc(100vw - 20px)); }
  .view { padding: 16px 14px 96px; margin-left: 0; }
  .page { gap: 14px; }
  .page-title { font-size: 22px; }
  .page-head { align-items: flex-start; }
  .page-head-actions { width: 100%; }
  .page-head-actions .btn { flex: 1; }
  .work-greeting { font-size: 23px; }
  .work-head .btn { width: 100%; }
  .kpi-row, .kpi-row-7 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px; }
  .kpi-icon { width: 32px; height: 32px; }
  .kpi-value { font-size: 19px; }
  .card { padding: 16px; }
  .action-row { grid-template-columns: 1fr; gap: 10px; }
  .action-meta { grid-column: auto; }
  .action-cta { grid-row: auto; align-self: stretch; }
  .action-cta .btn { width: 100%; }
  .filters-bar { align-items: stretch; }
  .filter-chips { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; scrollbar-width: none; }
  .filter-chips::-webkit-scrollbar { display: none; }
  .filters-tools { width: 100%; }
  .search-field { flex: 1; }
  .input-search { min-width: 0; }
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 12px;
    margin-bottom: 10px;
    background: #fff;
    box-shadow: var(--shadow);
  }
  .data-table tbody tr:hover { background: #fff; }
  .data-table td { display: flex; align-items: baseline; gap: 12px; padding: 5px 0; border: 0; }
  .data-table td::before {
    content: attr(data-label);
    flex: 0 0 38%;
    font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted);
  }
  .data-table td.col-open { display: none; }
  .data-table td.row-actions { display: flex; flex-wrap: wrap; gap: 4px; }
  .data-table td.row-actions::before { flex-basis: 100%; }
  .data-table td:empty { display: none; }
  .assess-bar { position: sticky; top: 0; margin: -16px -14px 0; border-radius: 0; border-left: 0; border-right: 0; padding: 12px 14px; }
  .assess-bar-top { flex-direction: column; align-items: stretch; gap: 10px; }
  .assess-identity { flex: 0 0 auto; }
  .assess-actions { justify-content: flex-start; }
  .assess-actions .btn { flex: 1 1 auto; }
  .assess-title { font-size: 18px; }
  .assess-meta { gap: 6px 10px; }
  .stat-grid, .stat-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-value { font-size: 22px; }
  .section-toggle { grid-template-columns: 28px minmax(0, 1fr) auto 20px; row-gap: 4px; }
  .section-score-wrap { grid-column: 3; }
  .section-status { grid-column: 2; justify-self: start; }
  .section-due { display: none; }
  .section-chevron { grid-column: 4; grid-row: 1; }
  .section-actions { width: 100%; }
  .section-actions .btn { flex: 1; }
  .section-body { padding: 0 12px 14px; }
  .criterion { grid-template-columns: 1fr; }
  .criterion-score { flex-direction: row; align-items: center; justify-content: space-between; }
  .score-btn { width: 44px; height: 44px; font-size: 15px; }
  .score-static-value { width: 44px; height: 44px; }
  .criterion-fields { grid-template-columns: 1fr; }
  .review-bar { left: 0; padding: 10px 14px; max-height: 64vh; }
  .review-bar-inner { flex-direction: column; align-items: stretch; gap: 10px; }
  .review-actions .btn { flex: 1; min-height: 44px; }
  .btn { min-height: 40px; }
  .btn-sm { min-height: 36px; }
  .input { min-height: 42px; }
  .tab-panel { margin-top: 2px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-span-2 { grid-column: auto; }
  .modal-overlay { padding: 12px; align-items: flex-end; }
  .modal { max-height: 88vh; display: flex; flex-direction: column; }
  .modal-body { overflow-y: auto; }
  .modal-foot { flex-direction: column-reverse; }
  .modal-foot .btn { width: 100%; }
  .backup-action { flex-direction: column; align-items: stretch; gap: 10px; }
  .backup-action .btn { width: 100%; }
  .settings-grid { grid-template-columns: 1fr; }
  .toasts { right: 12px; left: 12px; bottom: 12px; max-width: none; }
  .timeline-item { padding-left: 0; }
  .people-table select, .people-table input { min-width: 120px; }
  .model-table .input[type="text"] { min-width: 150px; }
  .assess-progress { gap: 8px; }
  .progress-caption { white-space: normal; }
}

@media (max-width: 480px) {
  .stat-grid, .stat-grid-4 { grid-template-columns: 1fr; }
  .kpi-row, .kpi-row-7 { grid-template-columns: 1fr 1fr; }
  .assess-actions .save-pill { flex: 0 0 auto; }
  .section-toggle { grid-template-columns: 26px minmax(0, 1fr) auto; }
  .section-status { grid-column: 2; }
  .section-score-wrap { grid-column: 3; grid-row: 1; }
  .section-chevron { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}


/* ---- Roles / auto-assigned section owners (v1.0.2) ---- */
.role-chip{display:inline-block;padding:3px 9px;border-radius:999px;background:#eef2f7;color:#334155;font-size:11.5px;font-weight:650;white-space:nowrap}
.create-owners-head{margin-bottom:8px}
.create-owners-head .card-title{font-size:15px}
.create-owners-head .card-subtitle{margin-top:2px}
.role-pickers{display:grid;gap:10px;margin:8px 0 14px}
.role-choice-row{display:grid;grid-template-columns:1.1fr 1fr;gap:12px;align-items:center;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#f8fafc}
.role-choice-label{display:flex;flex-direction:column;gap:2px;font-size:13px}
.role-choice-label .muted{font-size:12px}
.notice-inline{display:flex;gap:8px;align-items:flex-start;font-size:12.5px;margin-bottom:4px}
.owners-table td{vertical-align:middle}
.owner-name{display:block;font-weight:600;font-size:13px}
.role-tag{display:inline-block;margin-top:2px;padding:1px 7px;border-radius:999px;background:#e6f4f8;color:#075985;font-size:10.5px;font-weight:700}
.warn-text{color:var(--amber);font-weight:600;font-size:12.5px}
.role-holders-line{margin-top:4px;font-size:11px;line-height:1.4}
.role-holders{color:var(--muted)}
.role-holders-empty{color:var(--amber);font-weight:650}
.role-holders-multi{color:var(--violet);font-weight:650}
@media(max-width:700px){.role-choice-row{grid-template-columns:1fr}}
