/* TSU-ORGDOCX — Storyboard theme (Figures 4–14)
   Dark navy + mint teal operational UI */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
  --bg: #0b1220;
  --bg-elevated: #121a2b;
  --bg-card: #162033;
  --bg-card-2: #1a2740;
  --sidebar: #0e1624;
  --ink: #f1f5f9;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, 0.18);
  --teal: #2dd4bf;
  --teal-dim: #14b8a6;
  --teal-soft: rgba(45, 212, 191, 0.14);
  --teal-glow: rgba(45, 212, 191, 0.35);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.15);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.15);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.15);
  --info: #60a5fa;
  --info-soft: rgba(96, 165, 250, 0.15);
  --purple: #a78bfa;
  --purple-soft: rgba(167, 139, 250, 0.18);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --sidebar-w: 250px;
  --font: "DM Sans", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

/* Thin dark scrollbar (storyboard) */
* {
  scrollbar-width: thin;
  scrollbar-color: #64748b transparent;
}
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: #64748b;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-corner {
  background: transparent;
}

.scroll-panel {
  max-height: 360px;
  overflow: auto;
  padding-right: 0.55rem;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

/* ─── Auth / Sign-in (Fig 4) ───────────────────────────────────────────── */

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(900px 500px at 20% 10%, rgba(45, 212, 191, 0.12), transparent 55%),
    radial-gradient(700px 400px at 90% 80%, rgba(37, 99, 235, 0.18), transparent 50%),
    linear-gradient(160deg, #07101d 0%, #0b1730 45%, #0a1222 100%);
}

.auth-stage {
  width: min(460px, 100%);
  display: grid;
  justify-items: stretch;
  gap: 1.15rem;
}

.auth-card {
  width: 100%;
  padding: 2.15rem 1.85rem 1.9rem;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(12, 20, 36, 0.62);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  text-align: center;
}

.tsu-seal {
  width: 88px;
  height: 88px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #0b1220;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.2), 0 8px 24px rgba(0,0,0,0.4);
}
.tsu-seal img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.tsu-seal span {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #0b1220;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fbbf24;
}

.auth-card h1 {
  margin: 0 0 0.25rem;
  font-size: 1.42rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.auth-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
}
.auth-kicker {
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: rgba(241, 245, 249, 0.88);
}
.auth-card .sub {
  margin: 0 0 1.45rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}
.auth-footer {
  margin: 0;
  padding: 0 0.35rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem 0.35rem;
  color: rgba(148, 163, 184, 0.78);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-align: center;
  line-height: 1.45;
}
.auth-footer-sep { opacity: 0.65; }

.auth-error {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fecaca;
  font-size: 0.86rem;
  text-align: left;
}

.role-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.35rem;
}
.role-chip {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 12px;
  padding: 0.85rem 0.4rem;
  color: var(--ink);
  display: grid;
  gap: 0.45rem;
  justify-items: center;
  transition: 0.15s ease;
}
.role-chip svg { width: 22px; height: 22px; opacity: 0.9; }
.role-chip span { font-size: 0.72rem; font-weight: 500; }
.role-chip:hover { border-color: rgba(255,255,255,0.45); }
.role-chip.active {
  background: #fff;
  color: #0b1220;
  border-color: #fff;
}

.field { text-align: left; margin-bottom: 0.9rem; }
.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: rgba(255,255,255,0.88);
}
.password-wrap {
  position: relative;
}
.password-wrap input {
  padding-right: 2.85rem;
}
.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.28rem;
  transform: translateY(-50%);
  width: 2.15rem;
  height: 2.15rem;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0;
}
.password-toggle:hover:not(:disabled) {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
}
.password-toggle:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}
.password-toggle:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.field input, .field select, .field textarea,
.input, .select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.04);
  outline: none;
  color: var(--ink);
}
.field select,
.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.6rem;
  color-scheme: dark;
  background-color: rgba(255, 255, 255, 0.04);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%94a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1rem;
  cursor: pointer;
}
.field select option,
.select option {
  background-color: #0f172a;
  color: #e2e8f0;
}
.field select option:checked,
.select option:checked {
  background-color: #1d4ed8;
  color: #fff;
}
.field input:focus, .field select:focus, .input:focus, .select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.7rem 1.25rem;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.92rem;
  transition: 0.15s ease;
}
.btn-primary {
  background: var(--teal);
  color: #042f2e;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn:disabled,
.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}
.btn-ghost {
  background: transparent;
  border-color: rgba(255,255,255,0.28);
  color: var(--ink);
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.5); }
.btn-microsoft {
  background: #fff;
  color: #1b1b1b;
  border-color: #fff;
  font-weight: 600;
}
.btn-microsoft:hover:not(:disabled) { filter: brightness(0.96); }
.btn-microsoft .ms-logo {
  display: inline-flex;
  width: 18px;
  height: 18px;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.15rem 0 1rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.16);
}
.auth-divider span { white-space: nowrap; }
.btn-outline-teal {
  background: transparent;
  border-color: var(--teal);
  color: var(--teal);
}
.btn-block { width: 100%; }
.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.82rem; border-radius: 999px; }

.auth-actions { margin-top: 1.1rem; }

/* ─── Portal shell ─────────────────────────────────────────────────────── */

.portal {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  background: var(--bg);
  transition: grid-template-columns 0.28s ease;
}
.portal.sidebar-collapsed {
  --sidebar-w: 84px;
}

.sidebar {
  --sidebar-pad: 1rem;
  background:
    linear-gradient(180deg, rgba(45, 212, 191, 0.04) 0%, transparent 28%),
    var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 1.15rem var(--sidebar-pad) 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  transition: padding 0.28s ease;
}
.portal.sidebar-collapsed .sidebar {
  --sidebar-pad: 0.65rem;
  align-items: center;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.2rem 0 0.95rem;
  margin-bottom: 0.15rem;
  width: 100%;
  min-height: 3.25rem;
  position: relative;
  border-bottom: none;
}
/* Full-bleed divider (edge to edge of sidebar) */
.sidebar-brand::after {
  content: "";
  position: absolute;
  left: calc(-1 * var(--sidebar-pad));
  right: calc(-1 * var(--sidebar-pad));
  bottom: 0;
  height: 1px;
  background: rgba(148, 163, 184, 0.2);
}
.sidebar-brand-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  border-radius: 10px;
  position: relative;
  z-index: 2;
}
.sidebar-brand-main:hover .brand-text {
  color: var(--teal);
}
.sidebar-brand .mini-seal {
  width: 36px; height: 36px; border-radius: 50%;
  background: conic-gradient(from 210deg, #b91c1c, #fbbf24, #1d4ed8, #b91c1c);
  flex-shrink: 0;
}
.sidebar-brand .brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
  background: #0a1220;
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.25);
  transition: width 0.28s ease, height 0.28s ease;
  pointer-events: none;
}
.sidebar-brand .brand-text {
  min-width: 0;
  font-size: 0.8rem;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: opacity 0.2s ease, max-width 0.28s ease, margin 0.28s ease;
  max-width: 9.5rem;
  overflow: hidden;
  pointer-events: none;
}
.sidebar-brand strong {
  font-size: 0.8rem;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.sidebar-toggle {
  appearance: none;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.65);
  color: #94a3b8;
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  z-index: 2;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.sidebar-toggle:hover {
  color: #5eead4;
  border-color: rgba(45, 212, 191, 0.45);
  background: rgba(45, 212, 191, 0.12);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.1);
}
.sidebar-toggle:active {
  transform: scale(0.96);
}
.sidebar-toggle:focus-visible {
  outline: 2px solid rgba(45, 212, 191, 0.55);
  outline-offset: 2px;
}
.portal.sidebar-collapsed .sidebar-brand {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.7rem;
  padding-bottom: 0.95rem;
}
.portal.sidebar-collapsed .sidebar-brand-main {
  justify-content: center;
  flex: 0;
}
.portal.sidebar-collapsed .sidebar-brand .brand-logo {
  width: 40px;
  height: 40px;
}
.portal.sidebar-collapsed .sidebar-brand .brand-text {
  opacity: 0;
  max-width: 0;
  margin: 0;
  pointer-events: none;
  position: absolute;
}
.portal.sidebar-collapsed .sidebar-toggle {
  width: 30px;
  height: 30px;
}

.user-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.7rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(148, 163, 184, 0.12);
}
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(145deg, #1e3a4c, #152033);
  border: 2px solid rgba(45, 212, 191, 0.35);
  display: grid; place-items: center;
  font-weight: 700; font-size: 0.85rem; color: var(--teal);
  flex-shrink: 0;
}
.user-block .name { font-weight: 600; font-size: 0.88rem; }
.user-block .meta { color: var(--muted); font-size: 0.72rem; line-height: 1.35; margin-top: 0.1rem; }
.role-pill {
  display: inline-block;
  margin-top: 0.3rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.65rem;
  font-weight: 600;
}

/* Centered sidebar profile (storyboard) */
.sidebar-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.45rem;
  padding: 1.05rem 0.75rem 1.15rem;
  margin: 0.15rem 0 0.35rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(148, 163, 184, 0.12);
}
.sidebar-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--teal);
  background:
    radial-gradient(circle at 30% 25%, rgba(45, 212, 191, 0.22), transparent 55%),
    linear-gradient(160deg, #1e3a4c 0%, #122033 100%);
  border: 3px solid rgba(45, 212, 191, 0.45);
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.08);
  margin-bottom: 0.35rem;
  overflow: hidden;
  text-decoration: none;
  flex-shrink: 0;
}
.sidebar-avatar:hover {
  border-color: rgba(45, 212, 191, 0.75);
}
.sidebar-profile-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.25;
  max-width: 100%;
  word-break: break-word;
}
.sidebar-profile-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  color: rgba(226, 232, 240, 0.78);
  font-size: 0.78rem;
  line-height: 1.4;
  margin-bottom: 0.25rem;
}
.sidebar-org-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  max-width: 100%;
}
.sidebar-college-line {
  color: rgba(148, 163, 184, 0.95);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-top: 0.1rem;
}
.sidebar-org-logo {
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.28);
}
.sidebar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sidebar-role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.2rem;
  padding: 0.35rem 0.95rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
}
.sidebar-role-badge:hover {
  filter: brightness(1.12);
}
.sidebar-role-badge.role-sou {
  background: rgba(124, 58, 237, 0.22);
  border: 1px solid rgba(167, 139, 250, 0.55);
  color: #ddd6fe;
}
.sidebar-role-badge.role-reviewer {
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(147, 197, 253, 0.45);
  color: #bfdbfe;
}
.sidebar-role-badge.role-officer {
  background: rgba(45, 212, 191, 0.14);
  border: 1px solid rgba(45, 212, 191, 0.45);
  color: #99f6e4;
}

.portal.sidebar-collapsed .sidebar-profile {
  padding: 0.55rem 0.25rem;
  gap: 0;
  border-color: transparent;
  background: transparent;
  width: 100%;
}
.portal.sidebar-collapsed .sidebar-avatar {
  width: 44px;
  height: 44px;
  font-size: 0.9rem;
  margin-bottom: 0;
  border-width: 2px;
  box-shadow: none;
}
.portal.sidebar-collapsed .sidebar-profile-name,
.portal.sidebar-collapsed .sidebar-profile-meta,
.portal.sidebar-collapsed .sidebar-role-badge {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 0;
  pointer-events: none;
}

.nav-list {
  display: grid;
  gap: 0.3rem;
  flex: 1;
  padding: 0.35rem 0;
  align-content: start;
  width: 100%;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.72rem 0.85rem;
  border-radius: 12px;
  color: var(--muted);
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, padding 0.28s ease;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
}
.nav-item.active {
  color: var(--teal);
  background: rgba(45, 212, 191, 0.12);
  border-color: rgba(45, 212, 191, 0.22);
  font-weight: 600;
  box-shadow: none;
}
.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}
.nav-item.active svg { opacity: 1; }
.nav-label {
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.18s ease, max-width 0.28s ease;
  max-width: 12rem;
}
.portal.sidebar-collapsed .nav-item,
.portal.sidebar-collapsed .nav-signout {
  justify-content: center;
  padding-left: 0.7rem;
  padding-right: 0.7rem;
  gap: 0;
}
.portal.sidebar-collapsed .nav-label {
  opacity: 0;
  max-width: 0;
  pointer-events: none;
}

.nav-signout {
  margin-top: auto;
  appearance: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  padding: 0.75rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: 0.15s ease;
}
.nav-signout svg { flex-shrink: 0; opacity: 0.85; }
.nav-signout:hover {
  color: #fca5a5;
  background: var(--danger-soft);
  border-color: rgba(248, 113, 113, 0.2);
}

.portal-main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.85rem;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 18, 32, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar .portal-label { font-weight: 700; font-size: 0.95rem; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  display: grid; place-items: center;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover, .icon-btn.active {
  color: var(--ink);
  border-color: rgba(45, 212, 191, 0.35);
  background: var(--teal-soft);
}

.account-menu { position: relative; }
.topbar-avatar-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  padding: 0;
  overflow: hidden;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--teal);
  background: var(--teal-soft);
}
.topbar-avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.account-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  width: 260px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0.45rem;
  z-index: 50;
  color: var(--ink);
  color-scheme: dark;
}
.account-dropdown-head {
  display: block;
  width: 100%;
  margin: 0 0 0.35rem;
  padding: 0.65rem 0.75rem 0.75rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  text-decoration: none;
  cursor: pointer;
}
.account-dropdown-head:hover {
  background: var(--teal-soft);
}
.account-dropdown-head:hover .account-dropdown-role {
  text-decoration: underline;
}
.account-dropdown-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.account-dropdown-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--teal);
  background: var(--teal-soft);
  border: 1px solid rgba(45, 212, 191, 0.35);
}
.account-dropdown-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.account-dropdown-name {
  font-weight: 650;
  font-size: 0.9rem;
}
.account-dropdown-email {
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 0.15rem;
  word-break: break-all;
}
.account-dropdown-role {
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 650;
  margin-top: 0.2rem;
}
.account-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  font: inherit;
  font-size: 0.88rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.account-dropdown-item:hover {
  background: var(--teal-soft);
}
.account-dropdown-item.danger { color: var(--danger); }
.account-dropdown-item.danger:hover { background: var(--danger-soft); }

.sidebar-avatar img,
.account-avatar-preview img,
.topbar-avatar-btn img,
.account-dropdown-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.account-page {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}
.account-panel { max-width: none; width: 100%; }
.account-section-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}
.account-avatar-block {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.account-avatar-preview {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 700;
  font-size: 1.35rem;
  overflow: hidden;
  border: 2px solid rgba(45, 212, 191, 0.35);
  flex-shrink: 0;
}
.account-avatar-actions .hint { margin: 0.45rem 0 0; }
.account-avatar-actions .btn.is-busy {
  opacity: 0.7;
  pointer-events: none;
  cursor: wait;
}
.account-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.account-logo-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.75rem 0.45rem 0.45rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.28);
}
.account-logo-chip img {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  object-fit: cover;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.28);
  flex-shrink: 0;
}
.account-logo-chip span {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
  align-items: center;
}
.form-success {
  color: var(--success);
  background: var(--success-soft);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin: 0 0 1rem;
}
.content {
  padding: 1.35rem 1.5rem 2.5rem;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
}

/* ─── Shared surface ───────────────────────────────────────────────────── */

.page-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
}
.page-head h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
}
.back-btn {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.25);
  background: transparent;
  color: var(--ink);
  border-radius: 10px;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.welcome {
  background: linear-gradient(120deg, #1e3a5f 0%, #16324f 100%);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.15rem;
  border: 1px solid rgba(96, 165, 250, 0.2);
}
.welcome h2 { margin: 0 0 0.35rem; font-size: 1.35rem; }
.welcome p { margin: 0; color: #cbd5e1; font-size: 0.92rem; }
.welcome-meta {
  margin-top: 0.55rem !important;
  font-size: 0.82rem !important;
  color: var(--muted) !important;
}
.welcome-meta strong { color: var(--teal); font-weight: 600; }

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.15rem;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 0.9rem;
}

.stat-card, .panel, .folder-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.stat-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.stat-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--teal-soft);
  color: var(--teal);
}
.stat-card .label { color: var(--muted); font-size: 0.78rem; }
.stat-card .value { font-size: 1.35rem; font-weight: 700; line-height: 1.1; }
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}
.panel-title h3 { margin: 0; font-size: 1rem; }
.panel-title-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Section header outside the file list card (Adviser dashboard) */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 1.15rem 0 0.65rem;
}
.section-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}
.section-head + .panel {
  margin-top: 0;
}

.empty-state {
  margin: 0;
  padding: 1.35rem 0.25rem;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 0.2rem;
  border-bottom: 1px solid var(--line);
}
.list-row:last-child { border-bottom: 0; }
.doc-ico {
  width: 36px; height: 36px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--teal-soft);
  color: var(--teal);
  flex-shrink: 0;
}
.doc-ico.warn { background: var(--warn-soft); color: var(--warn); }
.doc-ico.danger { background: var(--danger-soft); color: var(--danger); }
.doc-ico.info { background: var(--info-soft); color: var(--info); }
.doc-ico.purple { background: var(--purple-soft); color: var(--purple); }
.list-row .title { font-weight: 600; font-size: 0.92rem; }
.list-row .meta { color: var(--muted); font-size: 0.75rem; margin-top: 0.15rem; }
.list-row .right { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; }
.list-row-btn {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
  border-radius: 10px;
  transition: background 0.15s ease;
}
.list-row-btn:hover { background: rgba(255, 255, 255, 0.04); }
.list-row-btn:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-review { background: var(--warn-soft); color: var(--warn); }
.badge-approved { background: var(--success-soft); color: var(--success); }
.badge-returned { background: var(--danger-soft); color: var(--danger); }
.badge-submitted { background: var(--info-soft); color: var(--info); }
.badge-flagged { background: var(--purple-soft); color: var(--purple); }
/* Figure 26 org health — Flagged uses danger (distinct from CALSV purple Flagged). */
.badge-org-flagged { background: var(--danger-soft); color: var(--danger); }
.badge-inactive { background: rgba(148, 163, 184, 0.16); color: #94a3b8; }
.badge-dean { background: rgba(251, 191, 36, 0.18); color: #fcd34d; }
.badge-adviser { background: var(--info-soft); color: #93c5fd; }
.score { color: var(--teal); font-size: 0.82rem; font-weight: 600; white-space: nowrap; }

/* Stepper */
.stepper {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
  margin-bottom: 1.15rem;
}
.step {
  text-align: center;
  padding: 0.55rem 0.35rem;
  border-radius: 10px;
  background: #1a2233;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.step.done {
  background: rgba(20, 184, 166, 0.22);
  color: var(--teal);
}
.step.active {
  background: var(--teal);
  color: #042f2e;
}

.wizard-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.35rem 1.4rem 1.25rem;
}
.wizard-card h2 { margin: 0 0 0.3rem; font-size: 1.25rem; }
.wizard-card .hint { margin: 0 0 1.1rem; color: var(--muted); font-size: 0.9rem; }

.draft-banner {
  margin: 0 0 1.15rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(45, 212, 191, 0.28);
  background: rgba(13, 148, 136, 0.12);
  border-radius: 12px;
}
.draft-banner-title {
  margin: 0;
  font-weight: 650;
  font-size: 0.92rem;
  color: #99f6e4;
}
.draft-banner-hint {
  margin: 0.2rem 0 0.7rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.draft-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.draft-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  background: rgba(15, 23, 42, 0.45);
  border-radius: 10px;
}
.draft-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.draft-delete {
  color: var(--danger) !important;
  border-color: rgba(248, 113, 113, 0.35) !important;
}
.draft-delete:hover:not(:disabled) {
  background: var(--danger-soft) !important;
}
.draft-title { font-weight: 600; font-size: 0.9rem; }
.draft-meta { color: var(--muted); font-size: 0.78rem; margin-top: 0.1rem; }

.checklist { list-style: none; padding: 0; margin: 0.85rem 0 1.25rem; }
.checklist-block { margin-top: 0.35rem; }
.checklist-title {
  margin: 0.75rem 0 0.35rem;
  font-weight: 650;
  font-size: 0.95rem;
  color: #e2e8f0;
}
.checklist li {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.4rem 0; color: #cbd5e1; font-size: 0.9rem;
}
.checklist li.conditional { color: #94a3b8; }
.checklist li.conditional em { font-style: normal; font-size: 0.78rem; color: var(--warn); }
.checklist li.optional { color: #94a3b8; }
.checklist li.optional em { font-style: normal; font-size: 0.78rem; color: #64748b; }
.checklist .ok {
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(34, 197, 94, 0.18); color: #4ade80;
  display: grid; place-items: center; font-size: 0.72rem; font-weight: 700;
  flex-shrink: 0;
}
.checklist .opt {
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(148, 163, 184, 0.18); color: #94a3b8;
  display: grid; place-items: center; font-size: 0.72rem; font-weight: 700;
  flex-shrink: 0;
}
.checklist .warn {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--warn-soft); color: var(--warn);
  display: grid; place-items: center; font-size: 0.7rem; font-weight: 700;
  flex-shrink: 0;
}
.field-hint {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}
.fig6-select .wizard-actions .btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.form-error {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.1);
  color: #fecaca;
  font-size: 0.88rem;
}

.wizard-actions {
  display: flex; gap: 0.65rem; align-items: center; margin-top: 1.1rem;
}

/* Figure 7 — Upload Required Documents */
.upload-grid-fig7 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.1rem;
  width: 100%;
  align-items: start;
  box-sizing: border-box;
}
.upload-grid-fig7 > .ucard {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
}
.upload-grid-fig7 .ucard-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: #f1f5f9;
  line-height: 1.35;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.4rem;
}
.upload-grid-fig7 .ucard-title-text {
  min-width: 0;
  flex: 1 1 100%;
}
.upload-grid-fig7 .ucard-req {
  color: #fb7185;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1;
  margin-left: 0.15em;
  white-space: nowrap;
}
.upload-grid-fig7 .ucard-tag {
  color: #94a3b8;
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: lowercase;
  flex: 0 0 auto;
}
.upload-grid-fig7 .ucard-zone.empty.missing {
  border-color: #fb7185;
  background: rgba(251, 113, 133, 0.08);
}
.upload-count-hint .ucard-req {
  color: #fb7185;
  font-weight: 800;
}
.upload-missing-msg {
  margin: 0.35rem 0 0.85rem;
  color: #fda4af;
  font-size: 0.88rem;
  font-weight: 600;
}
.upload-grid-fig7 .ucard-zone {
  position: relative;
  min-height: 168px;
  border-radius: 14px;
  border: 1.5px dashed rgba(148, 163, 184, 0.42);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.upload-grid-fig7 .ucard-zone.empty {
  justify-content: center;
  align-items: center;
  text-align: center;
}
.upload-grid-fig7 .ucard-zone.uploading {
  justify-content: flex-end;
  gap: 0.45rem;
}
.upload-grid-fig7 .ucard-zone.done {
  border-style: solid;
  border-color: #2dd4bf;
  background: rgba(45, 212, 191, 0.12);
  justify-content: space-between;
  align-items: stretch;
  padding-top: 1.35rem;
  padding-bottom: 0.85rem;
}
.upload-grid-fig7 .ucard-remove {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 4;
  width: 1.55rem;
  height: 1.55rem;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #e2e8f0;
  font: inherit;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}
.upload-grid-fig7 .ucard-remove:hover:not(:disabled) {
  background: #b91c1c;
  color: #fff;
}
.upload-grid-fig7 .ucard-remove:disabled {
  opacity: 0.55;
  cursor: wait;
}
.upload-grid-fig7 .ucard-file-host {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}
.upload-grid-fig7 .ucard-zone input[type=file] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.upload-grid-fig7 .ucard-add-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  border: none;
  background: transparent;
  color: #e2e8f0;
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.35rem 0.5rem;
}
.upload-grid-fig7 .ucard-add-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1.5px dashed rgba(148, 163, 184, 0.55);
  color: #2dd4bf;
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 500;
}
.upload-grid-fig7 .ucard-add-btn:hover .ucard-add-icon {
  border-color: #2dd4bf;
  background: rgba(45, 212, 191, 0.1);
}
.upload-grid-fig7 .ucard-source-menu {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: min(100%, 11.5rem);
  padding: 0.35rem;
  border-radius: 12px;
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  z-index: 3;
}
.upload-grid-fig7 .ucard-source-item {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #f1f5f9;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 550;
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  text-align: left;
}
.upload-grid-fig7 .ucard-source-item:hover {
  background: rgba(45, 212, 191, 0.12);
  color: #2dd4bf;
}
.upload-grid-fig7 .ucard-source-item svg {
  flex-shrink: 0;
  opacity: 0.9;
}
.upload-grid-fig7 .ucard-replace-btn {
  align-self: center;
  margin-top: 0.15rem;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: transparent;
  color: #94a3b8;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.28rem 0.75rem;
  cursor: pointer;
}
.upload-grid-fig7 .ucard-replace-btn:hover {
  border-color: #2dd4bf;
  color: #2dd4bf;
}
.upload-grid-fig7 .ucard-file {
  font-size: 0.82rem;
  color: #cbd5e1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-grid-fig7 .ucard-zone.done .ucard-file {
  text-align: center;
  font-size: 0.88rem;
  margin-top: auto;
  margin-bottom: auto;
}
.upload-grid-fig7 .ucard-badge {
  color: #2dd4bf;
  font-weight: 700;
  font-size: 0.82rem;
  text-align: center;
  margin-top: auto;
}
.upload-grid-fig7 .ucard-placeholder {
  margin: 0.45rem 0 0;
  color: #94a3b8;
  font-size: 0.78rem;
  line-height: 1.4;
  max-width: 11.5rem;
  pointer-events: none;
}
.upload-grid-fig7 .ucard-progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
  overflow: hidden;
}
.upload-grid-fig7 .ucard-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #14b8a6, #2dd4bf);
  transition: width 0.12s ease;
}
.upload-grid-fig7 .ucard-progress-label {
  font-size: 0.78rem;
  font-weight: 650;
  color: #2dd4bf;
  text-align: right;
}
.upload-count-hint {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}
}

/* Fig 7 — three-column upload cards (storyboard) */
.upload-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 1.1rem;
  width: 100%;
  margin: 0.35rem 0 0.25rem;
  align-items: start;
}

.upload-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
}

.upload-card-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 1.3;
}

.upload-card-zone {
  position: relative;
  min-height: 168px;
  border-radius: 14px;
  border: 1.5px dashed rgba(148, 163, 184, 0.42);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.upload-card-zone.is-empty {
  justify-content: center;
  align-items: center;
  text-align: center;
}

.upload-card-zone.is-uploading {
  justify-content: flex-end;
}

.upload-card:hover .upload-card-zone {
  border-color: rgba(45, 212, 191, 0.5);
  background: rgba(45, 212, 191, 0.05);
}

.upload-card.is-done .upload-card-zone,
.upload-card-zone.is-done {
  border-style: solid;
  border-color: var(--teal);
  background: rgba(45, 212, 191, 0.12);
  justify-content: space-between;
  padding-top: 1.35rem;
  padding-bottom: 0.85rem;
}

.upload-card-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
}

.upload-card-placeholder {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
  max-width: 11.5rem;
  pointer-events: none;
}

.upload-card-footer {
  pointer-events: none;
  display: grid;
  gap: 0.4rem;
  z-index: 1;
}

.upload-card-file {
  font-size: 0.82rem;
  color: #cbd5e1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-card-zone.is-done .upload-card-file {
  text-align: center;
  font-size: 0.88rem;
  margin: auto 0;
}

.upload-card-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin: 0.45rem 0 0.35rem;
}

.upload-card-bar > span {
  display: block;
  height: 100%;
  background: var(--teal);
  border-radius: 999px;
}

.upload-card-pct {
  font-size: 0.75rem;
  color: var(--muted);
}

.upload-card-badge {
  color: var(--teal);
  font-weight: 700;
  font-size: 0.82rem;
  text-align: center;
  margin-top: auto;
}

.upload-count {
  margin-top: 1rem !important;
}

@media (max-width: 760px) {
  .upload-grid {
    grid-template-columns: 1fr !important;
  }
  .upload-card-zone { min-height: 140px; }
}

.ocr-grid, .val-grid {
  display: grid;
  grid-template-columns: 0.92fr 1.18fr;
  gap: 1.25rem 1.5rem;
  align-items: start;
}
.fig9-val .val-class-line {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
}
.fig9-val .val-muted {
  color: var(--muted, #94a3b8);
  font-weight: 500;
  margin-left: 0.25rem;
}
.fig9-val .val-group {
  margin-bottom: 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}
.fig9-val .val-group:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}
.fig9-val .val-group-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #94a3b8);
  margin-bottom: 0.35rem;
}
.fig9-val .val-check-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 0.88rem;
}
.fig9-val .val-check-row:last-child { border-bottom: 0; }
.fig9-val .val-check-name {
  font-weight: 600;
  color: var(--text, #f1f5f9);
  display: block;
}
.fig9-val .val-check-detail {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.76rem;
  color: var(--muted, #94a3b8);
}
.fig9-val .val-insight-title {
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--text, #f1f5f9);
}
.fig9-val .val-insight-body {
  margin-top: 0.2rem;
  font-size: 0.82rem;
  color: var(--muted, #94a3b8);
  line-height: 1.4;
}
.fig9-val .val-insight-note {
  margin: 0.85rem 0 0;
  font-size: 0.8rem;
  color: var(--muted, #94a3b8);
  font-style: italic;
}
.fig9-val .val-status-line {
  margin: 1rem 0 0.25rem;
  font-weight: 600;
  color: var(--text, #e2e8f0);
}
.fig8-ocr .ocr-side {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}

/* Step 3 — live scanning theater (busy only; results UI unchanged) */
.fig8-ocr .ocr-scan-stage {
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
}
.fig8-ocr .ocr-scan-viewport {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.65rem 1.2rem 1.35rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(560px 240px at 50% -10%, rgba(45, 212, 191, 0.14), transparent 58%),
    var(--bg-elevated);
}
.fig8-ocr .ocr-scan-frame {
  position: relative;
  width: min(100%, 228px);
  height: 276px;
  margin-bottom: 1.05rem;
}
.fig8-ocr .ocr-scan-page {
  position: absolute;
  border-radius: 12px;
  background: #101a2c;
  border: 1px solid rgba(45, 212, 191, 0.22);
}
.fig8-ocr .ocr-scan-page--back {
  inset: 28px 28px 18px;
  transform: translate(12px, -10px) rotate(5deg);
  opacity: 0.38;
}
.fig8-ocr .ocr-scan-page--mid {
  inset: 22px 24px 12px;
  transform: translate(-10px, -6px) rotate(-4deg);
  opacity: 0.55;
}
.fig8-ocr .ocr-scan-page--front {
  inset: 10px 16px 0;
  overflow: hidden;
  background: linear-gradient(180deg, #1b2c44 0%, #122033 100%);
  border-color: rgba(45, 212, 191, 0.42);
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(45, 212, 191, 0.16);
  animation: ocr-scan-frame-pulse 2.4s ease-in-out infinite;
}
.fig8-ocr .ocr-scan-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
  z-index: 3;
}
.fig8-ocr .ocr-scan-corner--tl { top: 8px; left: 8px; border-left: 2px solid var(--teal); border-top: 2px solid var(--teal); }
.fig8-ocr .ocr-scan-corner--tr { top: 8px; right: 8px; border-right: 2px solid var(--teal); border-top: 2px solid var(--teal); }
.fig8-ocr .ocr-scan-corner--bl { bottom: 8px; left: 8px; border-left: 2px solid var(--teal); border-bottom: 2px solid var(--teal); }
.fig8-ocr .ocr-scan-corner--br { bottom: 8px; right: 8px; border-right: 2px solid var(--teal); border-bottom: 2px solid var(--teal); }
.fig8-ocr .ocr-scan-sheet {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 1.15rem 1rem 1rem;
}
.fig8-ocr .ocr-scan-sheet-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.2rem;
  min-width: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #e2e8f0;
  text-align: left;
}
.fig8-ocr .ocr-scan-sheet-head span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fig8-ocr .ocr-scan-sheet-mark {
  flex-shrink: 0;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  color: #042f2e;
  background: var(--teal);
  border-radius: 4px;
  padding: 0.12rem 0.32rem;
}
.fig8-ocr .ocr-scan-line {
  display: block;
  height: 6px;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.2);
  animation: ocr-scan-line-read 2.4s ease-in-out infinite;
}
.fig8-ocr .ocr-scan-line:nth-child(2) { animation-delay: 0.12s; }
.fig8-ocr .ocr-scan-line:nth-child(3) { animation-delay: 0.28s; }
.fig8-ocr .ocr-scan-line:nth-child(4) { animation-delay: 0.44s; }
.fig8-ocr .ocr-scan-line:nth-child(5) { animation-delay: 0.6s; }
.fig8-ocr .ocr-scan-line:nth-child(6) { animation-delay: 0.76s; }
.fig8-ocr .ocr-scan-line:nth-child(7) { animation-delay: 0.92s; }
.fig8-ocr .ocr-scan-line:nth-child(8) { animation-delay: 1.08s; }
.fig8-ocr .ocr-scan-line:nth-child(9) { animation-delay: 1.24s; }
.fig8-ocr .ocr-scan-line:nth-child(10) { animation-delay: 1.4s; }
.fig8-ocr .ocr-scan-line--box {
  width: 100%;
  height: 22px;
  border-radius: 6px;
  background: rgba(45, 212, 191, 0.08);
  border: 1px dashed rgba(45, 212, 191, 0.28);
}
.fig8-ocr .ocr-scan-beam {
  position: absolute;
  left: 8%;
  right: 8%;
  top: -8%;
  height: 46px;
  border-radius: 999px;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(45, 212, 191, 0.12) 32%,
    rgba(45, 212, 191, 0.82) 50%,
    rgba(45, 212, 191, 0.12) 68%,
    transparent 100%
  );
  box-shadow: 0 0 18px rgba(45, 212, 191, 0.45);
  animation: ocr-scan-beam 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.fig8-ocr .ocr-scan-heading {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.fig8-ocr .ocr-scan-stage-label {
  margin: 0.4rem 0 0;
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--teal);
}
.fig8-ocr .ocr-scan-hint {
  margin: 0.45rem 0 0;
  max-width: 34rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted);
}
.fig8-ocr .ocr-scan-progress {
  margin-top: 0.95rem;
  width: min(100%, 16rem);
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.16);
}
.fig8-ocr .ocr-scan-progress-bar {
  width: 42%;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--teal-dim), var(--teal));
  animation: ocr-scan-progress 1.8s ease-in-out infinite;
}
.fig8-ocr .ocr-scan-now {
  margin: 0.7rem 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #99f6e4;
}
.fig8-ocr .ocr-scan-files {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-elevated);
  padding: 0.85rem 0.95rem 0.4rem;
}
.fig8-ocr .ocr-scan-files-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}
.fig8-ocr .ocr-scan-files-head h4 {
  margin: 0;
  font-size: 0.88rem;
}
.fig8-ocr .ocr-scan-files-head span {
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--teal);
}
.fig8-ocr .ocr-scan-file {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.68rem 0.4rem;
  margin: 0 -0.25rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 10px;
  animation: ocr-scan-file-in 0.45s ease-out both;
  animation-delay: calc(var(--i, 0) * 70ms);
}
.fig8-ocr .ocr-scan-file:last-child {
  border-bottom: 0;
}
.fig8-ocr .ocr-scan-file.is-active {
  background: rgba(45, 212, 191, 0.1);
  box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.28);
}
.fig8-ocr .ocr-scan-file-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  color: var(--teal);
  background: var(--teal-soft);
  border: 1px solid rgba(45, 212, 191, 0.22);
}
.fig8-ocr .ocr-scan-file-copy {
  min-width: 0;
}
.fig8-ocr .ocr-scan-pill {
  white-space: nowrap;
  animation: ocr-scan-pill-pulse 1.6s ease-in-out infinite;
}
.fig8-ocr .ocr-scan-file.is-active .ocr-scan-file-icon {
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.28);
}

@keyframes ocr-scan-beam {
  0% { top: -10%; opacity: 0; }
  12% { opacity: 0.95; }
  88% { opacity: 0.95; }
  100% { top: 88%; opacity: 0; }
}
@keyframes ocr-scan-frame-pulse {
  0%, 100% { box-shadow: 0 16px 36px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(45, 212, 191, 0.16), 0 0 16px rgba(45, 212, 191, 0.18); }
  50% { box-shadow: 0 16px 36px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(45, 212, 191, 0.42), 0 0 26px rgba(45, 212, 191, 0.38); }
}
@keyframes ocr-scan-line-read {
  0%, 100% { background: rgba(148, 163, 184, 0.18); }
  42% { background: rgba(45, 212, 191, 0.55); box-shadow: 0 0 8px rgba(45, 212, 191, 0.32); }
}
@keyframes ocr-scan-progress {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}
@keyframes ocr-scan-file-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes ocr-scan-pill-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@media (max-width: 640px) {
  .fig8-ocr .ocr-scan-frame {
    height: 248px;
  }
  .fig8-ocr .ocr-scan-file {
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: start;
  }
  .fig8-ocr .ocr-scan-pill {
    grid-column: 2;
    justify-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fig8-ocr .ocr-scan-beam,
  .fig8-ocr .ocr-scan-page--front,
  .fig8-ocr .ocr-scan-progress-bar,
  .fig8-ocr .ocr-scan-line,
  .fig8-ocr .ocr-scan-file,
  .fig8-ocr .ocr-scan-pill {
    animation: none !important;
  }
  .fig8-ocr .ocr-scan-beam {
    top: 42%;
    opacity: 0.75;
    transform: none;
  }
  .fig8-ocr .ocr-scan-progress-bar {
    width: 46%;
    transform: none;
  }
}
.fig8-ocr .ocr-file-grid {
  margin-top: 1.15rem;
}
.fig8-ocr .ocr-extract-panel,
.fig8-ocr .ocr-extract-card {
  min-width: 0;
  max-height: min(64vh, 640px);
  overflow: auto;
}
.fig8-ocr .ocr-extract-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}
.fig8-ocr .ocr-extract-card-head > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.fig8-ocr .ocr-extract-card-head h4 {
  margin: 0;
  overflow-wrap: anywhere;
}
.fig8-ocr .ocr-slot-pill {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal);
  background: var(--teal-soft);
  border: 1px solid rgba(45, 212, 191, 0.28);
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  white-space: nowrap;
}
.fig8-ocr .ocr-extract-card-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  max-width: 100%;
}
.fig8-ocr .ocr-edit-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  display: grid;
  place-items: center;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}
.fig8-ocr .ocr-edit-btn:hover,
.fig8-ocr .ocr-edit-btn.is-editing {
  color: var(--ink);
  border-color: rgba(45, 212, 191, 0.35);
  background: var(--teal-soft);
}
.fig8-ocr .ocr-officer-acc {
  margin-top: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-elevated);
}
.fig8-ocr .ocr-officer-acc-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0.75rem 0.9rem;
  text-align: left;
  font: inherit;
  font-weight: 700;
}
.fig8-ocr .ocr-officer-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  margin-left: 0.4rem;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  font-size: 0.72rem;
  color: var(--teal);
  background: var(--teal-soft);
  border: 1px solid rgba(45, 212, 191, 0.28);
}
.fig8-ocr .ocr-chev {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.18s ease;
}
.fig8-ocr .ocr-officer-acc.is-collapsed .ocr-chev,
.fig8-ocr .ocr-officer-row.is-collapsed .ocr-chev {
  transform: rotate(-90deg);
}
.fig8-ocr .ocr-officer-acc-body {
  border-top: 1px solid var(--line);
  padding: 0.35rem 0.55rem 0.55rem;
}
.fig8-ocr .ocr-officer-row {
  border-radius: 10px;
  margin-top: 0.35rem;
  background: var(--panel, transparent);
  border: 1px solid var(--line);
}
.fig8-ocr .ocr-officer-row-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.45rem 0.35rem 0.2rem;
}
.fig8-ocr .ocr-officer-name-btn {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  text-align: left;
  font: inherit;
  padding: 0.3rem 0.2rem;
}
.fig8-ocr .ocr-officer-name-btn span {
  min-width: 0;
  overflow: hidden;
}
.fig8-ocr .ocr-officer-name-btn b {
  display: block;
  font-weight: 700;
}
.fig8-ocr .ocr-officer-row.is-collapsed .ocr-officer-name-btn b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fig8-ocr .ocr-officer-row.is-collapsed .ocr-officer-details {
  display: none;
}
.fig8-ocr .ocr-officer-pos {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}
.fig8-ocr .ocr-view-photo-btn {
  flex-shrink: 0;
  border: 1px solid rgba(45, 212, 191, 0.35);
  background: var(--teal-soft);
  color: var(--teal);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}
.fig8-ocr .ocr-doc-gallery {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.35rem;
}
.fig8-ocr .ocr-doc-page {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(8, 18, 28, 0.35);
}
.fig8-ocr .ocr-doc-thumb {
  width: 52px;
  height: 64px;
  border-radius: 8px;
  border: 1px solid rgba(45, 212, 191, 0.35);
  background: linear-gradient(180deg, rgba(45, 212, 191, 0.16), rgba(8, 18, 28, 0.2));
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--teal);
  font-weight: 800;
  font-size: 0.95rem;
}
.fig8-ocr .ocr-doc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.fig8-ocr .ocr-doc-caption {
  font-weight: 400;
  line-height: 1.4;
  color: #c5d4e0;
  font-size: 0.84rem;
}
.ocr-doc-modal-title {
  font-weight: 400;
  font-size: 0.92rem;
  line-height: 1.4;
  color: #c5d4e0;
}
.fig8-ocr .ocr-member-phone {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--teal);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--teal-soft);
  border: 1px solid rgba(45, 212, 191, 0.28);
  font-variant-numeric: tabular-nums;
}
.fig8-ocr .ocr-gpoa-amount {
  max-width: 6.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fig8-ocr .ocr-gpoa-head-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
  max-width: min(100%, 18rem);
}
.fig8-ocr .ocr-gpoa-class-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #9fe8dc;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  background: rgba(45, 212, 191, 0.12);
  border: 1px solid rgba(45, 212, 191, 0.32);
  white-space: nowrap;
}
.fig8-ocr .ocr-gpoa-class-chip::before {
  content: "✓";
  font-size: 0.62rem;
  opacity: 0.9;
}
.fig8-ocr .ocr-gpoa-class-chip.is-missing {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.35);
}
.fig8-ocr .ocr-gpoa-class-chip.is-missing::before {
  content: "?";
}
.fig8-ocr .ocr-officer-details {
  margin: 0;
  padding: 0.15rem 0.7rem 0.7rem 1.85rem;
  display: grid;
  gap: 0.35rem;
}
.fig8-ocr .ocr-officer-details div {
  display: grid;
  grid-template-columns: minmax(7.5rem, 32%) 1fr;
  gap: 0.55rem;
  font-size: 0.82rem;
}
.fig8-ocr .ocr-officer-details dt {
  color: var(--muted);
  font-weight: 600;
}
.fig8-ocr .ocr-officer-details dd {
  margin: 0;
  color: var(--ink);
}
.fig8-ocr .ocr-photo-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(6, 12, 20, 0.62);
  display: grid;
  place-items: center;
  padding: 1.2rem;
}
.fig8-ocr .ocr-photo-modal-card {
  width: min(420px, 100%);
  background: var(--bg-elevated, #11212f);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem;
}
.fig8-ocr .ocr-photo-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}
.fig8-ocr .ocr-photo-modal-card img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 10px;
  background: #0a141f;
}
.fig8-ocr .ocr-photo-modal-close {
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  border-radius: 8px;
  padding: 0.28rem 0.65rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.ocr-photo-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(6, 12, 20, 0.62);
  display: grid;
  place-items: center;
  padding: 1.2rem;
}
.ocr-photo-modal-card {
  width: min(420px, 100%);
  background: var(--bg-elevated, #11212f);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem;
}
.ocr-photo-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}
.ocr-photo-modal-card img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 10px;
  background: #0a141f;
}
.ocr-doc-modal-card {
  width: min(860px, 100%);
}
.ocr-doc-frame {
  width: 100%;
  height: min(70vh, 720px);
  border: 0;
  border-radius: 10px;
  background: #0a141f;
}
.ocr-photo-modal-close {
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  border-radius: 8px;
  padding: 0.28rem 0.65rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.fig8-ocr .ocr-field-input {
  width: 100%;
  margin: 0;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.45;
  resize: vertical;
}
.fig8-ocr textarea.ocr-field-input {
  min-height: 2.4rem;
}
.fig8-ocr .ocr-excerpt-input {
  min-height: 8rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
}
.fig8-ocr .ocr-excerpt {
  max-height: 180px;
}
.fig8-ocr .ocr-file-title {
  font-weight: 600;
  color: var(--text, #f1f5f9);
}
.fig8-ocr .ocr-file-name {
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--muted, #94a3b8);
  word-break: break-all;
}
.fig8-ocr .ocr-status-line {
  margin: 0.85rem 0 0.35rem;
  font-weight: 600;
  color: var(--text, #e2e8f0);
}
.fig8-ocr .ocr-preview {
  margin: 0.65rem 0 0;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #cbd5e1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.fig8-ocr .ocr-group-title {
  margin: 0.85rem 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #94a3b8);
}
.fig8-ocr .ocr-group-title:first-child { margin-top: 0; }
.fig8-ocr .ocr-field-row {
  padding: 0.58rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}
.fig8-ocr .ocr-field-row:last-of-type { border-bottom: 0; }
.fig8-ocr .ocr-field-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted, #94a3b8);
  margin-bottom: 0.18rem;
}
.fig8-ocr .ocr-field-value {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text, #f1f5f9);
  word-break: break-word;
}
.fig8-ocr .ocr-activity-block {
  margin-top: 0.85rem;
  padding-top: 0.15rem;
}
.fig8-ocr .ocr-activity-heading {
  margin: 0.15rem 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #94a3b8);
}
.fig8-ocr .ocr-printed-name {
  display: block;
  margin-top: 0.28rem;
  font-size: 0.92rem;
  color: var(--text, #f1f5f9);
  font-weight: 600;
}
.fig8-ocr .ocr-sig-role {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.78rem;
  color: var(--muted, #94a3b8);
  font-weight: 500;
}
.fig8-ocr .ocr-sig-name-input {
  display: block;
  margin-top: 0.35rem;
  max-width: 22rem;
}
.fig8-ocr .ocr-sig-preview {
  display: block;
  margin-top: 0.55rem;
  max-width: 100%;
  max-height: 130px;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 6px;
  background: #fff;
}
.fig8-ocr .ocr-sig-note {
  margin: 0.7rem 0 0;
  font-size: 0.76rem;
  color: var(--muted, #94a3b8);
  line-height: 1.4;
}
.fig8-ocr .ocr-sig-attach {
  display: inline-flex;
  align-items: center;
  margin-top: 0.5rem;
  padding: 0.28rem 0.7rem;
  border: 1px solid rgba(45, 212, 191, 0.45);
  border-radius: 999px;
  color: var(--teal, #2dd4bf);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}
.fig8-ocr .ocr-sig-attach.is-busy,
.fig8-ocr .ocr-sig-attach:has(input:disabled) {
  opacity: 0.6;
  cursor: wait;
}
.fig8-ocr .ocr-sig-attach-hint {
  display: block;
  margin-top: 0.22rem;
  font-size: 0.7rem;
  color: var(--muted, #94a3b8);
}
.fig8-ocr .ocr-raw-toggle {
  background: none;
  border: 0;
  padding: 0;
  color: var(--teal, #2dd4bf);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}
.fig8-ocr .kv .v.teal,
.fig8-ocr .teal {
  color: var(--teal, #2dd4bf);
  font-weight: 700;
}
.fig8-ocr .ocr-flag-list {
  margin-top: 0.75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  padding-top: 0.25rem;
}
.subcard {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  padding: 0.95rem 1.05rem 1rem;
  margin-bottom: 0.85rem;
}
.subcard h4 {
  margin: 0 0 0.7rem;
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 600;
}
.kv { display: grid; gap: 0.48rem; font-size: 0.86rem; }
.kv > div {
  display: grid;
  grid-template-columns: minmax(6.5rem, 38%) 1fr;
  gap: 0.75rem;
  align-items: baseline;
}
.kv .k { color: var(--muted); font-weight: 500; letter-spacing: 0.03em; }
.kv > div > span:last-child { text-align: right; justify-self: end; font-weight: 500; }
.file-status {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.72rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 0.9rem;
}
.file-status > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.file-status > span {
  flex: 0 0 auto;
}
.file-status:last-child { border-bottom: 0; }
.tag-pass {
  color: var(--teal);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.tag-flag {
  color: var(--warn);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.flag-item {
  display: flex; gap: 0.55rem; padding: 0.65rem 0;
  border-bottom: 1px solid var(--line); font-size: 0.85rem;
}
.flag-item:last-child { border-bottom: 0; }
.flag-item.blocking .flag-dot {
  background: var(--danger);
}
.flag-item.blocking .val-insight-title {
  color: #fca5a5;
}

.confirm-grid,
.meta-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1.1rem 0;
  background: transparent;
  border: 0;
  overflow: visible;
  padding: 0;
}
.confirm-grid > div,
.meta-cell {
  padding: 1.05rem 1.15rem;
  min-width: 0;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
}
.confirm-grid .k,
.meta-cell .k {
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}
.confirm-grid .v,
.meta-cell .v {
  color: #cbd5e1;
  font-weight: 400;
  font-size: 0.9rem;
  line-height: 1.35;
}

.fig10-confirm .confirm-subtitle {
  margin: 0 0 0.35rem;
  font-weight: 600;
  color: var(--ink);
}
.fig10-confirm .hash-line {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  word-break: break-all;
}
.fig10-confirm .hash-line code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #94a3b8;
  font-size: 0.74rem;
}
.fig10-confirm .confirm-files {
  margin: 0 0 0.35rem;
  padding: 1.05rem 1.15rem;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
}
.fig10-confirm .confirm-files-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}
.fig10-confirm .confirm-files-head .k {
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
}
.fig10-confirm .confirm-files-head .v {
  color: var(--teal);
  font-weight: 700;
  font-size: 0.82rem;
}
.fig10-confirm .confirm-file-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.72rem 0;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}
.fig10-confirm .confirm-file-role {
  font-weight: 650;
  color: var(--ink);
  font-size: 0.88rem;
}
.fig10-confirm .confirm-file-name {
  margin-top: 0.18rem;
  font-size: 0.8rem;
  color: var(--muted);
  word-break: break-all;
}
.fig10-confirm .confirm-file-tag {
  flex-shrink: 0;
  margin-top: 0.15rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal);
  background: var(--teal-soft);
  border: 1px solid rgba(45, 212, 191, 0.28);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

/* Tracker */
.tabs {
  display: flex; flex-wrap: wrap; gap: 0.35rem 1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
  align-items: center;
}
.tab {
  appearance: none; background: none; border: 0;
  color: var(--muted); padding: 0.65rem 0.1rem; font-weight: 600; font-size: 0.88rem;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab.active { color: var(--teal); border-bottom-color: var(--teal); }
.tabs .spacer { margin-left: auto; color: var(--muted); font-size: 0.82rem; }

.tracker-card {
  display: flex; align-items: center; gap: 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.95rem 1.05rem;
  margin-bottom: 0.7rem;
  transition: 0.15s ease;
}
.tracker-card:hover { border-color: rgba(45, 212, 191, 0.35); }

.tracker-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.tracker-doc-link {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.tracker-doc-link:focus-visible .timeline-card {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* Vertical document timeline cards (tracker UI) */
.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.15rem 1.25rem 0.85rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.tracker-doc-link:hover .timeline-card {
  border-color: rgba(45, 212, 191, 0.4);
  background: var(--bg-card-2);
}
.timeline-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}
.timeline-card-titles { min-width: 0; }
.timeline-card-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: 0.01em;
}
.timeline-card-sub {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.doc-timeline {
  list-style: none;
  margin: 0;
  padding: 0.15rem 0 0.35rem;
  position: relative;
}
/* Continuous vertical rail behind all step markers */
.doc-timeline::before {
  content: "";
  position: absolute;
  left: 17px; /* center of 36px rail column */
  top: 15px;  /* first marker center */
  bottom: calc(0.35rem + 15px); /* last marker center */
  width: 2px;
  transform: translateX(-50%);
  background: rgba(148, 163, 184, 0.35);
  z-index: 0;
  border-radius: 999px;
}
.doc-timeline-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 0.75rem;
  position: relative;
  padding-bottom: 1.15rem;
  z-index: 1;
}
.doc-timeline-item:last-child { padding-bottom: 0.35rem; }
.doc-timeline-rail {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.doc-timeline-item:not(:last-child) .doc-timeline-rail::after {
  display: none; /* replaced by continuous .doc-timeline::before */
}
.doc-timeline-item.done:not(:last-child) .doc-timeline-rail::after {
  display: none;
}
.doc-timeline-marker {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  z-index: 1;
  border: 2px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.98);
  color: #94a3b8;
  box-shadow: 0 0 0 3px var(--bg-card);
}
.doc-timeline-item.done .doc-timeline-marker {
  background: var(--teal);
  border-color: var(--teal);
  color: #042f2e;
  box-shadow: 0 0 0 3px var(--bg-card);
}
.doc-timeline-item.current .doc-timeline-marker {
  background: rgba(45, 212, 191, 0.18);
  border-color: var(--teal);
  color: var(--teal);
  box-shadow: 0 0 0 3px var(--bg-card);
}
.doc-timeline-content { min-width: 0; padding-top: 0.15rem; }
.doc-timeline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}
.doc-timeline-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #e2e8f0;
}
.doc-timeline-item.upcoming .doc-timeline-title { color: #94a3b8; }
.doc-timeline-date {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.timeline-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.32rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.timeline-pill.done {
  background: var(--teal);
  color: #042f2e;
}
.timeline-pill.progress {
  background: rgba(45, 212, 191, 0.22);
  color: #5eead4;
  border: 1px solid rgba(45, 212, 191, 0.45);
}
.timeline-pill.upcoming {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.tracker-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 1rem;
  align-items: start;
}
.tracker-side-panel .kv { margin-top: 0.25rem; }
.id-banner-sep { margin: 0 0.35rem; color: #64748b; }

@media (max-width: 900px) {
  .tracker-detail-grid { grid-template-columns: 1fr; }
  .doc-timeline-row { flex-wrap: wrap; }
}

.id-banner {
  background: #1a2233;
  border-radius: 12px;
  padding: 0.7rem 1rem;
  margin-bottom: 1rem;
  color: #cbd5e1;
  font-size: 0.9rem;
}

.milestones {
  display: flex;
  justify-content: space-between;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem 0.75rem 1.15rem;
  margin-bottom: 1rem;
  position: relative;
}
.milestone {
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 1;
  padding: 0 0.25rem;
}
/* Timeline track segments between dots */
.milestone:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 8px;
  left: calc(50% + 11px);
  width: calc(100% - 22px);
  height: 3px;
  border-radius: 999px;
  background: #334155;
  z-index: 0;
  pointer-events: none;
}
.milestone.done:not(:last-child)::after {
  background: var(--teal);
}
.milestone .dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  margin: 0 auto 0.5rem;
  border: 2px solid #475569;
  background: var(--bg-card);
  position: relative;
  z-index: 2;
  box-sizing: border-box;
}
.milestone.done .dot {
  background: var(--teal);
  border-color: var(--teal);
}
.milestone.current .dot {
  background: var(--info);
  border-color: var(--info);
  box-shadow: 0 0 0 4px var(--info-soft);
}
.milestone .label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}
.milestone .sub {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.2rem;
}
.milestone:not(.done):not(.current) .label {
  color: #64748b;
}
.milestone:not(.done):not(.current) .sub {
  color: #475569;
}

.audit-item {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 0.75rem;
  padding-bottom: 0.95rem;
  position: relative;
}
.audit-item::before {
  content: "";
  position: absolute;
  left: 6px; top: 14px; bottom: 0;
  width: 2px; background: var(--line);
}
.audit-item:last-child::before { display: none; }
.audit-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--teal); margin-top: 0.2rem;
}
.audit-dot.blue { background: var(--info); }
.audit-item .when { color: var(--muted); font-size: 0.75rem; }
.audit-item .what { font-size: 0.88rem; margin-top: 0.15rem; }

/* Audit Log — card list (adviser / review) */
.audit-toolbar { margin-bottom: 1rem; }
.audit-search { margin-bottom: 0.85rem; }
.audit-search .input { max-width: 520px; }
.audit-range-tabs { margin-bottom: 0; }
.audit-list { display: flex; flex-direction: column; gap: 0.65rem; }
.audit-card {
  display: grid;
  grid-template-columns: minmax(160px, 200px) 1fr auto;
  gap: 1rem;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.95rem 1.1rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.audit-card:hover {
  border-color: rgba(45, 212, 191, 0.35);
  background: var(--bg-card-2);
}
.audit-card-actor {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}
.audit-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.72rem; font-weight: 700;
  flex-shrink: 0;
  background: var(--teal-soft); color: var(--teal);
}
.audit-avatar.blue { background: var(--info-soft); color: var(--info); }
.audit-avatar.warn { background: var(--warn-soft); color: var(--warn); }
.audit-avatar.danger { background: var(--danger-soft); color: var(--danger); }
.audit-avatar.purple { background: var(--purple-soft); color: var(--purple); }
.audit-avatar.info { background: var(--info-soft); color: #93c5fd; }
.audit-actor-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.audit-actor-role { color: var(--muted); font-size: 0.74rem; margin-top: 0.1rem; }
.audit-card-body { min-width: 0; }
.audit-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.55rem;
}
.audit-action {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--teal);
}
.audit-action.blue { color: var(--info); }
.audit-action.warn { color: var(--warn); }
.audit-action.danger { color: var(--danger); }
.audit-action.purple { color: var(--purple); }
.audit-action.info { color: #93c5fd; }
.audit-entity {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: #cbd5e1;
}
.audit-type {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
}
.audit-detail {
  color: #94a3b8;
  font-size: 0.8rem;
  margin-top: 0.3rem;
}
.audit-card-time {
  text-align: right;
  white-space: nowrap;
  flex-shrink: 0;
}
.audit-date { font-size: 0.82rem; font-weight: 600; color: #e2e8f0; }
.audit-clock { font-size: 0.75rem; color: var(--muted); margin-top: 0.15rem; }
.audit-empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
}
.audit-empty p { margin: 0; }
.audit-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 1.1rem;
  padding: 0.35rem 0.15rem;
}
.audit-pager-count { color: var(--muted); font-size: 0.82rem; }
.audit-pager-nav {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
  margin-right: auto;
}
.audit-page-label { color: var(--muted); font-size: 0.82rem; font-weight: 600; }
.audit-pager .back-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.audit-page-size {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
  margin-left: auto;
}
.audit-page-size .select {
  width: auto;
  min-width: 4.5rem;
  padding: 0.4rem 0.55rem;
  font-size: 0.82rem;
}
@media (max-width: 860px) {
  .audit-card {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .audit-card-time { text-align: left; }
  .audit-pager-nav { margin: 0; width: 100%; justify-content: center; }
  .audit-page-size { margin-left: 0; }
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 0.5rem;
}
.folder-card {
  min-height: 140px;
  display: grid;
  place-items: center;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  transition: 0.15s ease;
}
.folder-card:hover { transform: translateY(-2px); }
.folder-card.purple { color: #c4b5fd; box-shadow: inset 0 0 40px rgba(167,139,250,0.12); border-color: rgba(167,139,250,0.35); }
.folder-card.red { color: #fca5a5; box-shadow: inset 0 0 40px rgba(248,113,113,0.12); border-color: rgba(248,113,113,0.35); }
.folder-card.green { color: #86efac; box-shadow: inset 0 0 40px rgba(52,211,153,0.12); border-color: rgba(52,211,153,0.35); }
.folder-card.teal { color: #5eead4; box-shadow: inset 0 0 40px rgba(45,212,191,0.12); border-color: rgba(45,212,191,0.35); }

.metric-big .value { font-size: 2rem; font-weight: 700; }
.metric-big .label { color: var(--muted); font-size: 0.85rem; }
.metric-big .metric-hint {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.review-btn {
  border: 1px solid #fb923c;
  color: #fb923c;
  background: transparent;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
}

/* Responsive (content grids — portal shell handled in responsive.css) */
@media (max-width: 980px) {
  .grid-4, .grid-3, .confirm-grid { grid-template-columns: 1fr 1fr; }
  .ocr-grid, .val-grid, .grid-2, .folder-grid { grid-template-columns: 1fr; }
  /* keep .upload-grid as 3 columns until phone breakpoint */
  .role-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid-4, .grid-3, .confirm-grid { grid-template-columns: 1fr; }
  .content { padding: 1rem; }
  .stepper { font-size: 0.7rem; }
}

/* DMA — Organization Documents archive */
.archive-lead {
  margin: -0.35rem 0 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.hint {
  color: var(--muted);
  font-size: 0.88rem;
}
.archive-filters { margin-bottom: 1rem; }
.archive-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}
.archive-filter-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.archive-filter-grid select,
.archive-filter-grid input[type="search"] {
  appearance: none;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #121a29;
  color: var(--text);
  padding: 0.55rem 0.7rem;
  font-size: 0.88rem;
}
.archive-search-row {
  display: flex;
  gap: 0.45rem;
}
.archive-search-row input { flex: 1; min-width: 0; }
.archive-row .right { flex-wrap: wrap; justify-content: flex-end; }

@media (max-width: 980px) {
  .archive-filter-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .archive-filter-grid { grid-template-columns: 1fr; }
  .archive-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .archive-row .right {
    width: 100%;
    margin-left: 0;
    padding-left: 2.85rem;
  }
}

/* Figure 13 — repository type folders */
.repo-folders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.repo-folder {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.45);
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.repo-folder:hover { border-color: rgba(45, 212, 191, 0.4); }
.repo-folder.active {
  border-color: var(--teal);
  background: rgba(45, 212, 191, 0.08);
}
.repo-folder-ico { color: var(--teal); display: grid; place-items: center; }
.repo-folder-ico.blue { color: #60a5fa; }
.repo-folder-ico.purple { color: #c084fc; }
.repo-folder-ico.amber { color: #fbbf24; }
.repo-folder-ico.green { color: #4ade80; }
.repo-folder-ico.teal { color: var(--teal); }
.repo-folder-name { font-weight: 650; font-size: 0.86rem; line-height: 1.25; }
.repo-folder-count { font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.archive-row-block + .archive-row-block {
  border-top: 1px solid var(--line);
  margin-top: 0.35rem;
  padding-top: 0.35rem;
}
.repo-versions {
  margin: 0.15rem 0 0.55rem 3rem;
  padding: 0.55rem 0.75rem;
  border-left: 2px solid rgba(45, 212, 191, 0.35);
}
.repo-version-row {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  font-size: 0.82rem;
  padding: 0.25rem 0;
}
.repo-files {
  margin: 0.15rem 0 0.2rem 3rem;
  padding: 0.15rem 0 0.2rem;
}
.repo-file-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
}
.repo-file-row:last-child { border-bottom: 0; }
.repo-file-row > div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.repo-file-row > div span:first-child {
  font-weight: 700;
  color: var(--teal);
}
@media (max-width: 640px) {
  .repo-files { margin-left: 0; padding-left: 2.85rem; }
}
.repo-version-row span:first-child {
  font-weight: 700;
  color: var(--teal);
  min-width: 2rem;
}

/* ── Notification Bell ──────────────────────────────────────────────────── */
.notif-wrap { position: relative; }
.notif-bell { position: relative; }
.notif-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: #f43f5e;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  pointer-events: none;
}
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-height: min(70vh, 420px);
  overflow: auto;
  background: var(--bg-card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.45);
  z-index: 50;
}
.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg-card-2);
}
.notif-read-all {
  font-size: 0.75rem;
  color: var(--teal);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.notif-read-all:hover { text-decoration: underline; }
.notif-empty {
  padding: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}
.notif-item {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--line);
}
.notif-item:last-child { border-bottom: none; }
.notif-title {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.notif-title:hover { color: var(--teal); }
.notif-body {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0.2rem 0 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-time {
  font-size: 0.72rem;
  color: var(--muted);
}

/* ── Review Queue table ─────────────────────────────────────────────────── */
.queue-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.queue-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--line);
}
.queue-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.queue-table tr:last-child td { border-bottom: none; }
.queue-table tr:hover td { background: rgba(255,255,255,.02); }
.val-muted { color: var(--muted); font-size: 0.8rem; }
.tag-pass {
  display: inline-block;
  background: rgba(45,212,191,.15);
  color: #2dd4bf;
  border-radius: 6px;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
}
.tag-flag {
  display: inline-block;
  background: rgba(251,191,36,.12);
  color: #fbbf24;
  border-radius: 6px;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
}
.tag-fail {
  display: inline-block;
  background: rgba(244,63,94,.12);
  color: #f43f5e;
  border-radius: 6px;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
}
.tag-neutral {
  display: inline-block;
  background: rgba(148,163,184,.12);
  color: #94a3b8;
  border-radius: 6px;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
}
.tag-optional {
  display: inline-block;
  background: rgba(148,163,184,.12);
  color: #94a3b8;
  border-radius: 6px;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ── CALSV Layer-3 validation taxonomy badges ──────────────────────────── */
/* Green — field identified, content complete & legible (PRESENT / SIGNED)  */
.tag-present {
  display: inline-block;
  background: rgba(45,212,191,.16);
  color: #2dd4bf;
  border-radius: 6px;
  padding: 0.15rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.tag-signed {
  display: inline-block;
  background: rgba(52,211,153,.15);
  color: #34d399;
  border-radius: 6px;
  padding: 0.15rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
/* Red — required field/attachment absent (MISSING) → routes to FLAGGED      */
.tag-missing {
  display: inline-block;
  background: rgba(244,63,94,.14);
  color: #f43f5e;
  border-radius: 6px;
  padding: 0.15rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
/* Amber-red — signature zone found but empty (UNSIGNED) → always FLAGGED    */
.tag-unsigned {
  display: inline-block;
  background: rgba(251,113,133,.13);
  color: #fb7185;
  border-radius: 6px;
  padding: 0.15rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
/* Amber — field present but low-confidence OCR (ILLEGIBLE) → human review   */
.tag-illegible {
  display: inline-block;
  background: rgba(251,191,36,.13);
  color: #fbbf24;
  border-radius: 6px;
  padding: 0.15rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ── CALSV 7-sub-check scoring breakdown (spec §3) ────────────────────── */

/* Header row: DocumentClass + weighted score % */
.val-score-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}
.val-score-right { display: flex; align-items: center; gap: 0.5rem; }
.val-score-pct   { font-size: 1.2rem; font-weight: 760; }
.val-score-pct.score-pass { color: #2dd4bf; }
.val-score-pct.score-flag { color: #fbbf24; }
.val-score-pct.score-warn { color: #fb7185; }
.val-score-pct.score-fail { color: #f43f5e; }

/* Classification label badge (PASSED / CONDITIONALLY_PASSED / INCOMPLETE / REJECTED) */
.val-class-badge {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.45rem;
  border-radius: 5px;
  text-transform: uppercase;
  margin-left: 0.4rem;
}
.clf-passed     { background: rgba(45,212,191,.15); color: #2dd4bf; }
.clf-flagged    { background: rgba(251,191,36,.14); color: #fbbf24; }
.clf-incomplete { background: rgba(251,113,133,.13); color: #fb7185; }
.clf-rejected   { background: rgba(244,63,94,.14); color: #f43f5e; }

/* Org role inference badge */
.val-role-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.val-role-label { font-size: 0.75rem; color: var(--muted); }
.val-role-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.role-organizer   { background: rgba(52,211,153,.15); color: #34d399; }
.role-participant { background: rgba(139,92,246,.15); color: #a78bfa; }
.role-co-organizer{ background: rgba(251,191,36,.14); color: #fbbf24; }
.role-unknown     { background: rgba(148,163,184,.10); color: var(--muted); }

/* Sub-layer panel container */
.val-sublayer-panel {
  background: rgba(15,23,42,.45);
  border: 1px solid rgba(148,163,184,.08);
  border-radius: 0.6rem;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.75rem;
}
.val-sublayer-title {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
}
.val-sublayer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.3rem;
}
.val-sublayer-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}
.val-sublayer-code {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--teal);
  flex-shrink: 0;
}
.val-sublayer-name {
  font-size: 0.75rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.val-sublayer-right {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.val-sublayer-weight {
  font-size: 0.65rem;
  color: var(--muted);
}
.val-sub-tag {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0.08rem 0.4rem;
  border-radius: 4px;
  letter-spacing: 0.03em;
}
/* Progress bar */
.val-sublayer-bar-track {
  height: 3px;
  background: rgba(148,163,184,.1);
  border-radius: 2px;
  overflow: hidden;
  margin: 0.15rem 0 0.1rem;
}
.val-sublayer-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}
/* Reuse tag colours for bars */
.val-sublayer-bar-fill.tag-present { background: #2dd4bf; }
.val-sublayer-bar-fill.tag-signed  { background: #34d399; }
.val-sublayer-bar-fill.tag-missing { background: #f43f5e; }
.val-sublayer-bar-fill.tag-flag    { background: #fbbf24; }
.val-sublayer-bar-fill.tag-unsigned{ background: #fb7185; }
.val-sublayer-bar-fill.tag-optional{ background: rgba(148,163,184,.3); }

/* ── CALSV Validation redesign (hero + category cards) ───────────────── */
.calsv-val { max-width: 980px; }
.calsv-val-hero {
  background: linear-gradient(180deg, #11212f 0%, #17293a 100%);
  border: 1px solid #223b4f;
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}
.calsv-val-hero-left { flex: 1 1 260px; min-width: 220px; }
.calsv-val-eyebrow {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.calsv-val-title-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.calsv-val-title {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.calsv-val-verdict {
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}
.calsv-val-verdict.pass {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(52, 211, 153, 0.35);
}
.calsv-val-verdict.warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: rgba(251, 191, 36, 0.35);
}
.calsv-val-verdict.flagged {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.35);
}
.calsv-val-desc {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  max-width: 52ch;
  margin: 0;
}
.calsv-val-role {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.calsv-val-score-wrap { flex: 0 0 auto; text-align: right; }
.calsv-val-score {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1;
}
.calsv-val-score.pass { color: var(--teal); }
.calsv-val-score.warn { color: var(--warn); }
.calsv-val-score.flagged { color: var(--danger); }
.calsv-val-score-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 0.25rem;
  letter-spacing: 0.04em;
}
.calsv-val-dims {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.85rem;
  flex: 1 1 100%;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.calsv-val-dim { display: flex; flex-direction: column; gap: 0.35rem; }
.calsv-val-dim-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  gap: 0.5rem;
}
.calsv-val-dim-top b { color: var(--ink); font-weight: 700; }
.calsv-val-dim-track {
  height: 6px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
}
.calsv-val-dim-fill { height: 100%; border-radius: 4px; }
.calsv-val-dim-fill.pass { background: var(--teal); }
.calsv-val-dim-fill.warn { background: var(--warn); }
.calsv-val-dim-fill.flagged { background: var(--danger); }
.calsv-val-dim-fill.na { background: rgba(148, 163, 184, 0.35); }

.calsv-val-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--warn-soft);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}
.calsv-val-banner b { color: var(--warn); }
.calsv-val-banner-icon {
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: rgba(251, 191, 36, 0.2);
  color: var(--warn);
  font-size: 0.8rem;
}

.calsv-val-file-section + .calsv-val-file-section {
  margin-top: 1.45rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
}
.calsv-val-section-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0.5rem 0 0.7rem 0.15rem;
}
.calsv-val-section-file {
  margin: -0.45rem 0 0.65rem 0.15rem;
  font-size: 0.8rem;
  color: var(--muted);
  word-break: break-all;
}
.calsv-val-cat-list { display: flex; flex-direction: column; gap: 0.7rem; }
.calsv-val-cat {
  background: #11212f;
  border: 1px solid #223b4f;
  border-radius: var(--radius);
  overflow: hidden;
}
.calsv-val-cat.is-flagged { border-color: rgba(248, 113, 113, 0.45); }
.calsv-val-cat.is-warn { border-color: rgba(251, 191, 36, 0.4); }
.calsv-val-cat.is-pass { border-color: var(--line); }
.calsv-val-cat.is-na { border-color: rgba(148, 163, 184, 0.12); opacity: 0.92; }

.calsv-val-cat-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.95rem 1.05rem;
  text-align: left;
  color: inherit;
  font: inherit;
}
.calsv-val-cat-name { font-size: 0.98rem; font-weight: 700; color: var(--ink); }
.calsv-val-cat-sub { font-size: 0.78rem; color: var(--muted); margin-top: 0.15rem; }
.calsv-val-cat-head-right {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.calsv-val-cat-weight {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.calsv-val-cat-score { font-size: 0.92rem; font-weight: 760; }
.calsv-val-cat-score.tone-pass { color: var(--teal); }
.calsv-val-cat-score.tone-warn { color: var(--warn); }
.calsv-val-cat-score.tone-flagged { color: var(--danger); }
.calsv-val-cat-score.tone-na { color: var(--muted); }
.calsv-val-status-pill {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 750;
  white-space: nowrap;
}
.calsv-val-status-pill.pass {
  background: var(--success-soft);
  color: var(--success);
}
.calsv-val-status-pill.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.calsv-val-status-pill.flagged {
  background: var(--danger-soft);
  color: var(--danger);
}
.calsv-val-status-pill.na {
  background: rgba(148, 163, 184, 0.14);
  color: var(--muted);
}
.calsv-val-chev {
  color: var(--muted);
  transition: transform 0.18s ease;
  font-size: 0.85rem;
}
.calsv-val-chev.open { transform: rotate(180deg); }

.calsv-val-cat-body { padding: 0 1.05rem 1rem; }
.calsv-val-na-note {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(109, 130, 153, 0.12);
  border: 1px dashed #223b4f;
}
.calsv-val-pass-banner {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-sm);
  background: rgba(51, 214, 192, 0.13);
  border: 1px solid rgba(51, 214, 192, 0.35);
  color: var(--ink);
  font-size: 0.86rem;
  margin-bottom: 0.55rem;
}
.calsv-val-pass-banner b { color: var(--teal); }
.calsv-val-flag {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 93, 114, 0.12);
  border: 1px solid rgba(255, 93, 114, 0.4);
  margin-bottom: 0.45rem;
  font-size: 0.86rem;
}
.calsv-val-flag.warn {
  background: rgba(255, 182, 72, 0.12);
  border-color: rgba(255, 182, 72, 0.4);
}
.calsv-val-flag.pass {
  background: rgba(51, 214, 192, 0.13);
  border-color: rgba(51, 214, 192, 0.35);
}
.calsv-val-flag.pending {
  background: rgba(255, 182, 72, 0.12);
  border-color: rgba(255, 182, 72, 0.4);
}
.calsv-val-flag.blocking {
  background: rgba(255, 93, 114, 0.12);
  border-color: rgba(255, 93, 114, 0.4);
}
.calsv-val-mark {
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.75rem;
  background: rgba(248, 113, 113, 0.2);
  color: var(--danger);
}
.calsv-val-mark.pass {
  background: var(--teal-soft);
  color: var(--teal);
}
.calsv-val-flag.warn .calsv-val-mark {
  background: rgba(251, 191, 36, 0.2);
  color: var(--warn);
}
.calsv-val-flag-field { font-weight: 700; color: var(--ink); }
.calsv-val-flag-reason { color: var(--muted); margin-top: 0.2rem; line-height: 1.45; }
.calsv-val-flag-source {
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 0.3rem;
}
.calsv-val-flag-source b { color: var(--ink); font-weight: 650; }
.calsv-val-sig-preview {
  display: block;
  max-height: 56px;
  max-width: 220px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin-top: 0.45rem;
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 0.25rem;
}
.calsv-val-sig-attach {
  display: inline-flex;
  align-items: center;
  margin-top: 0.5rem;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--teal) 45%, transparent);
  background: color-mix(in srgb, var(--teal) 12%, transparent);
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.calsv-val-sig-attach.is-busy,
.calsv-val-sig-attach:has(input:disabled) {
  opacity: 0.65;
  cursor: wait;
}
.calsv-val-sig-attach-hint {
  margin-top: 0.25rem;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}
.calsv-val-sub-label {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  margin: 0.85rem 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
}
.calsv-val-sub-meta {
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  font-size: 0.74rem;
}
.calsv-val-act-sub {
  margin: -0.15rem 0 0.45rem;
  color: var(--muted);
  font-size: 0.78rem;
}
.calsv-val-rule-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--panel-2, color-mix(in srgb, var(--ink) 6%, transparent));
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
}
.calsv-val-rule-row.has-mid {
  grid-template-columns: 1.05fr 1fr 1fr 1fr auto;
}
.calsv-val-rule-row.is-fail {
  outline: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
}
.calsv-val-rule-row.is-warn {
  outline: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
}
.calsv-val-rname { font-weight: 700; color: var(--ink); }
.calsv-val-rval { color: var(--ink); min-width: 0; }
.calsv-val-rval span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.1rem;
}
.calsv-val-rule-chip {
  justify-self: end;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}
.calsv-val-rule-chip.fail { background: var(--danger-soft); color: var(--danger); }
.calsv-val-rule-chip.pass { background: var(--success-soft); color: var(--teal); }
.calsv-val-rule-chip.warn { background: var(--warn-soft); color: var(--warn); }
.calsv-val-rule-chip.note { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--muted); }
.calsv-ccs-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 0.82rem;
}
.calsv-ccs-summary b { color: var(--ink); }
.calsv-ccs-wrap { overflow-x: auto; }
.calsv-ccs {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.calsv-ccs th, .calsv-ccs td {
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  padding: 0.55rem 0.4rem;
  vertical-align: top;
  text-align: left;
}
.calsv-ccs th {
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 750;
}
.calsv-ccs th small {
  display: block;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 650;
}
.calsv-ccs-name { font-weight: 750; color: var(--ink); }
.calsv-ccs-sub { color: var(--muted); font-size: 0.7rem; margin-top: 0.15rem; }
.calsv-ccs-cell {
  border-radius: 8px;
  padding: 0.35rem 0.45rem;
  line-height: 1.35;
}
.calsv-ccs-cell.ok { background: var(--success-soft); color: var(--ink); }
.calsv-ccs-cell.bad { background: var(--danger-soft); color: var(--ink); }
.calsv-ccs-cell.warn { background: var(--warn-soft); color: var(--ink); }
.calsv-ccs-cell.na {
  background: transparent;
  color: var(--muted);
  border: 1px dashed color-mix(in srgb, var(--ink) 18%, transparent);
}
.calsv-ccs tfoot td { font-size: 0.72rem; color: var(--muted); }
.calsv-ccs-pct { display: block; font-weight: 800; color: var(--ink); }
.calsv-ccs-foot { display: block; }
.calsv-ccs-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.72rem;
}
.calsv-ccs-legend span::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  margin-right: 0.35rem;
}
.calsv-ccs-legend .ok::before { background: var(--teal); }
.calsv-ccs-legend .warn::before { background: var(--warn); }
.calsv-ccs-legend .bad::before { background: var(--danger); }
.calsv-ccs-legend .na::before {
  background: transparent;
  border: 1px dashed color-mix(in srgb, var(--ink) 35%, transparent);
}
.calsv-val-rule-note {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
  margin: -0.15rem 0 0.55rem 0.15rem;
}
@media (max-width: 640px) {
  .calsv-val-rule-row {
    grid-template-columns: 1fr;
    row-gap: 0.25rem;
  }
  .calsv-val-rule-chip { justify-self: start; }
}
.calsv-val-tag-req {
  margin-left: 0.35rem;
  font-size: 0.65rem;
  font-weight: 750;
  color: var(--danger);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.calsv-val-tag-pending {
  margin-left: 0.35rem;
  font-size: 0.65rem;
  font-weight: 750;
  color: #d97706;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.calsv-val-tag-attached {
  margin-left: 0.35rem;
  font-size: 0.65rem;
  font-weight: 750;
  color: #059669;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.calsv-val-mark.pending {
  background: rgba(251,191,36,.22);
  color: #d97706;
}
.tag-pending {
  display: inline-block;
  background: rgba(251,191,36,.16);
  color: #d97706;
  border-radius: 6px;
  padding: 0.15rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.tag-attached {
  display: inline-block;
  background: rgba(52,211,153,.15);
  color: #34d399;
  border-radius: 6px;
  padding: 0.15rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.calsv-val-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.5rem 0.1rem;
  margin-top: 0.15rem;
  font-family: inherit;
}
.calsv-val-present-list {
  margin-top: 0.25rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
}
.calsv-val-present-item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.4rem 0.15rem;
  font-size: 0.84rem;
  color: var(--muted);
}
.calsv-val-check {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 5px;
  background: var(--teal-soft);
  color: var(--teal);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 800;
  border: 1px solid rgba(45, 212, 191, 0.35);
  margin-top: 0.1rem;
}
.calsv-val-present-item b { color: var(--ink); font-weight: 600; }
.calsv-val-present-val { color: var(--muted); }
.calsv-val-status-line {
  margin: 1.1rem 0 0.4rem;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ── Accomplishment Report · Section 10 per-activity table (spec §8.4) ───── */

.ar-section10 {
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.ar-section10-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}
.ar-section10-desc {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}
.ar-section10-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.ar-section10-table thead th {
  text-align: left;
  padding: 0.5rem 0.6rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.ar-section10-table td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

/* Activity summary row */
.ar-act-row > td { color: var(--ink); }
.ar-act-row.ar-act-hardgate {
  background: var(--danger-soft);
}
.ar-act-no {
  font-weight: 700;
  color: var(--muted);
  width: 2.5rem;
}
.ar-act-name { font-weight: 600; min-width: 12rem; }
.ar-act-score { font-weight: 800; white-space: nowrap; }
.ar-act-score.pass { color: var(--teal); }
.ar-act-score.warn { color: var(--warn); }
.ar-act-score.flagged { color: var(--danger); }
.ar-act-issues { color: var(--muted); font-size: 0.8rem; }

.ar-hardgate-badge {
  display: inline-block;
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  font-size: 0.74rem;
  font-weight: 700;
}
.ar-no-issues { color: var(--teal); font-weight: 600; }

/* Indented defect detail rows */
.ar-defect-row > td {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  background: rgba(148, 163, 184, 0.04);
  font-size: 0.79rem;
}
.ar-defect-zone { color: var(--muted); padding-left: 1rem !important; }
.ar-defect-ref { color: var(--muted); }
.ar-defect-remarks { color: var(--muted); line-height: 1.45; }
.ar-defect-status {
  display: inline-block;
  border-radius: 5px;
  padding: 0.1rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.ar-defect-status.ar-defect-missing,
.ar-defect-status.ar-defect-unsigned {
  background: var(--danger-soft);
  color: var(--danger);
}
.ar-defect-status.ar-defect-mismatch,
.ar-defect-status.ar-defect-illegible {
  background: var(--warn-soft);
  color: var(--warn);
}

/* Hero mini activity summary tones */
.tone-pass { color: var(--teal); }
.tone-warn { color: var(--warn); }
.tone-flagged { color: var(--danger); }

/* Reviewer-side status pills used alongside the existing .tag-pass */
.tag-warn,
.tag-flagged {
  display: inline-block;
  border-radius: 6px;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.tag-warn { background: var(--warn-soft); color: var(--warn); }
.tag-flagged { background: var(--danger-soft); color: var(--danger); }

@media (max-width: 720px) {
  .calsv-val-score { font-size: 2.2rem; }
  .calsv-val-cat-header { flex-direction: column; align-items: flex-start; }
  .calsv-val-cat-head-right { justify-content: flex-start; }

  /* Section 10 scrolls horizontally instead of squashing columns */
  .ar-section10 { overflow-x: auto; }
  .ar-section10-table { min-width: 34rem; }
}

/* Camera scan UI lives inside each upload card (.ucard-source-menu). */

.pagination {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  justify-content: flex-end;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ── Review Decide page ─────────────────────────────────────────────────── */
.decide-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.25rem;
  align-items: start;
}
.decide-panel { display: flex; flex-direction: column; gap: 0.85rem; }
.decide-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.decide-confirm {
  background: rgba(251,191,36,.06);
  border: 1px solid rgba(251,191,36,.25);
  border-radius: 10px;
  padding: 0.85rem 1rem;
}
.kv { display: flex; flex-direction: column; gap: 0.45rem; }
.kv > div {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.84rem;
}
.kv .k {
  color: var(--muted);
  min-width: 120px;
  font-size: 0.78rem;
}
.file-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.83rem;
}
.file-status:last-child { border-bottom: none; }
.btn-warn {
  background: rgba(251,191,36,.15);
  color: #fbbf24;
  border: 1px solid rgba(251,191,36,.35);
  border-radius: 10px;
  padding: 0.55rem 1.1rem;
  font-size: 0.87rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-warn:hover:not(:disabled) { background: rgba(251,191,36,.25); }
.btn-danger {
  background: rgba(244,63,94,.12);
  color: #f43f5e;
  border: 1px solid rgba(244,63,94,.3);
  border-radius: 10px;
  padding: 0.55rem 1.1rem;
  font-size: 0.87rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-danger:hover:not(:disabled) { background: rgba(244,63,94,.22); }

/* ── Shared confirmation dialog ─────────────────────────────────────────── */
.confirm-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(2, 6, 23, 0.72);
  display: grid;
  place-items: center;
  padding: 1rem;
}
.confirm-dialog {
  width: min(100%, 420px);
  background: #111827;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  padding: 1.15rem 1.2rem 1.1rem;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}
.confirm-dialog h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
}
.confirm-dialog p {
  margin: 0 0 1.1rem;
  color: #94a3b8;
  font-size: 0.9rem;
  line-height: 1.45;
}
.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.teal { color: var(--teal); }

/* ─── SOU Admin (Figures 21–25) ─────────────────────────────────────────── */

/* Figure 21: charts row */
.sou-charts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 1rem;
  margin-top: 1rem;
}
@media (max-width: 900px) {
  .sou-charts { grid-template-columns: 1fr; }
}

.type-chart {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  height: 150px;
  padding: 0.5rem 0.25rem 0;
}
.type-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 0.35rem;
  min-width: 0;
}
.type-bar-count {
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--muted);
}
.type-bar { width: 100%; border-radius: 6px 6px 0 0; }
.type-bar.teal   { background: #2dd4bf; }
.type-bar.blue   { background: #60a5fa; }
.type-bar.purple { background: #c084fc; }
.type-bar.amber  { background: #fbbf24; }
.type-bar.green  { background: #4ade80; }
.type-bar-label {
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.status-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 0.5rem 0;
}
.status-breakdown-row {
  display: grid;
  grid-template-columns: 110px 1fr 48px;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.85rem;
}
.status-breakdown-label { color: var(--muted); }
.status-breakdown-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  overflow: hidden;
}
.status-breakdown-fill { display: block; height: 100%; border-radius: 999px; }
.status-breakdown-fill.ok     { background: #2dd4bf; }
.status-breakdown-fill.warn   { background: #fbbf24; }
.status-breakdown-fill.danger { background: #f43f5e; }
.status-breakdown-pct { text-align: right; font-weight: 700; font-size: 0.82rem; }
.status-breakdown-pct.ok     { color: #2dd4bf; }
.status-breakdown-pct.warn   { color: #fbbf24; }
.status-breakdown-pct.danger { color: #f43f5e; }

/* Org avatar circles (Figures 21 & 24) */
.org-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 0.78rem;
  flex-shrink: 0;
  color: #fff;
}
.org-avatar.sm { width: 28px; height: 28px; font-size: 0.65rem; }
.org-avatar.red    { background: #b91c1c; }
.org-avatar.purple { background: #7e22ce; }
.org-avatar.blue   { background: #1d4ed8; }
.org-avatar.green  { background: #15803d; }
.org-avatar.amber  { background: #b45309; }
.org-avatar.pink   { background: #be185d; }
.org-avatar.has-photo {
  padding: 0;
  overflow: hidden;
  background: #0b1220;
}
.org-avatar.has-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.compliance-score.ok strong     { color: #2dd4bf; }
.compliance-score.warn strong   { color: #fbbf24; }
.compliance-score.danger strong { color: #f43f5e; }

/* Figure 24: global tracker layout */
.sou-search {
  width: 100%;
  margin-bottom: 1rem;
  border-radius: 999px;
}
.sou-tracker-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
@media (max-width: 980px) {
  .sou-tracker-layout { grid-template-columns: 1fr; }
}
.sou-filter-panel { padding: 1rem; }
.sou-filter-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
}
.sou-clear-btn {
  appearance: none; border: 0; background: none;
  color: var(--teal); font-size: 0.75rem; font-weight: 600;
  cursor: pointer;
}
.sou-org-search {
  width: 100%;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
}
.sou-filter-label {
  margin: 0.9rem 0 0.45rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.college-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.college-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 0.3rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s ease;
}
.college-chip:hover { border-color: var(--teal); color: var(--teal); }
.college-chip.active {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal);
}
.compliance-filters { display: flex; flex-direction: column; gap: 0.4rem; }
.compliance-filter-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
}
.compliance-filter-row input { margin-left: auto; accent-color: var(--teal); }
.compliance-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: rgba(148, 163, 184, 0.5);
  flex-shrink: 0;
}
.compliance-dot.ok     { background: #2dd4bf; }
.compliance-dot.warn   { background: #fbbf24; }
.compliance-dot.danger { background: #f43f5e; }

.sou-org-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.sou-org-row {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.45rem;
  border-radius: 10px;
  cursor: pointer;
  color: var(--ink);
  text-align: left;
  transition: 0.15s ease;
}
.sou-org-row:hover { background: rgba(255, 255, 255, 0.04); }
.sou-org-row.active { border-color: var(--teal); background: var(--teal-soft); }
.sou-org-name {
  font-size: 0.78rem;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sou-org-name small { display: block; color: var(--muted); font-weight: 500; font-size: 0.65rem; }
.sou-org-pct { margin-left: auto; font-weight: 700; font-size: 0.78rem; }
.sou-org-pct.ok     { color: #2dd4bf; }
.sou-org-pct.warn   { color: #fbbf24; }
.sou-org-pct.danger { color: #f43f5e; }

.stage-count-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}
@media (max-width: 900px) {
  .stage-count-cards { grid-template-columns: repeat(2, 1fr); }
}
.stage-count-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.5rem;
  text-align: center;
  cursor: pointer;
  color: inherit;
  font: inherit;
  width: 100%;
}
.stage-count-card:hover { border-color: rgba(45, 212, 191, 0.35); }
.stage-count-card.active { border-color: var(--teal); background: var(--teal-soft); }
.stage-count-card .value { font-size: 1.25rem; font-weight: 700; }
.stage-count-card .label { font-size: 0.7rem; color: var(--muted); margin-top: 0.15rem; }
.stage-count-card .purple-text { color: #c084fc; }
.stage-count-card .amber-text  { color: #fbbf24; }
.stage-count-card .blue-text   { color: #60a5fa; }
.stage-count-card .green-text  { color: #4ade80; }

.sou-tracker-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.7rem;
  font-size: 0.82rem;
  font-weight: 600;
}

/* Document Tracker — stacked list cards (Figure 24) */
.tracker-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.tracker-doc-card {
  appearance: none;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-align: left;
  cursor: pointer;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg-card, rgba(15, 23, 42, 0.72));
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.tracker-doc-card:hover {
  border-color: rgba(45, 212, 191, 0.4);
  background: rgba(15, 23, 42, 0.95);
}
.tracker-doc-card:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
.tracker-doc-card-main {
  min-width: 0;
  flex: 1;
}
.tracker-doc-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: baseline;
}
.tracker-doc-card-title .sep { color: var(--muted); font-weight: 500; }
.tracker-doc-card-meta {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.35rem;
  align-items: center;
}
.tracker-doc-card-meta .dot { opacity: 0.55; }
.tracker-doc-card-status {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border-radius: 999px;
  padding: 0.38rem 0.75rem;
  border: 1px solid transparent;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}
.tracker-doc-card-status .status-pct {
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  font-weight: 800;
}
.tracker-doc-card-status.status-submitted {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.28);
}
.tracker-doc-card-status.status-ai {
  color: #c084fc;
  background: rgba(192, 132, 252, 0.12);
  border-color: rgba(192, 132, 252, 0.28);
}
.tracker-doc-card-status.status-adviser {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.28);
}
.tracker-doc-card-status.status-dean {
  color: #22d3ee;
  background: rgba(34, 211, 238, 0.12);
  border-color: rgba(34, 211, 238, 0.28);
}
.tracker-doc-card-status.status-sou,
.tracker-doc-card-status.status-default {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.22);
}
.tracker-doc-card-status.status-flagged {
  color: #c084fc;
  background: rgba(192, 132, 252, 0.14);
  border-color: rgba(192, 132, 252, 0.3);
}
.tracker-doc-card-status.status-returned {
  color: #f87171;
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.28);
}
.tracker-doc-card-status.status-approved {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.28);
}
.tracker-doc-card-status.ok .status-pct { color: #2dd4bf; }
.tracker-doc-card-status.warn .status-pct { color: #fbbf24; }
.tracker-doc-card-status.danger .status-pct { color: #f43f5e; }
.tracker-doc-card-status.pending .status-pct { color: #94a3b8; }

@media (max-width: 720px) {
  .tracker-doc-card {
    flex-wrap: wrap;
  }
  .tracker-doc-card-status {
    margin-left: auto;
  }
}

/* Make org compliance % stand out more in the filter list */
.sou-org-pct {
  min-width: 2.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ─── SOU Admin management (Figures 26–29) ──────────────────────────────── */

/* Figure 26: organization cards */
.org-cards {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.org-card { padding: 1rem 1.2rem; text-align: left; }
.org-card-btn {
  width: 100%;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.org-card-btn:hover {
  border-color: rgba(45, 212, 191, 0.35);
  background: rgba(15, 23, 42, 0.55);
}
.org-card-btn:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
.org-card-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.org-card-identity { min-width: 0; flex: 1; }
.org-card-head .title {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.org-card-head .meta {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.org-card-head .badge { margin-left: auto; flex-shrink: 0; }
.org-card-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-top: 0.9rem;
}
@media (max-width: 700px) {
  .org-card-stats { grid-template-columns: repeat(2, 1fr); }
}
.org-stat {
  background: rgba(30, 58, 95, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 10px;
  padding: 0.65rem 0.5rem;
  text-align: center;
}
.org-stat .value { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.org-stat .label { font-size: 0.68rem; color: var(--muted); margin-top: 0.15rem; }

.green-text  { color: #4ade80; }
.amber-text  { color: #fbbf24; }
.danger-text { color: #f43f5e; }
.purple-text { color: #c084fc; }
.blue-text   { color: #60a5fa; }

/* Figure 27: processing time + export cards */
.proc-times {
  display: flex;
  flex-direction: column;
  padding: 0.25rem 0;
}
.proc-time-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}
.proc-time-row:last-child { border-bottom: 0; }
.proc-time-row .label { color: var(--muted); }
.proc-time-row .value { font-weight: 700; font-size: 0.82rem; }

.export-heading {
  margin: 1.4rem 0 0.7rem;
  font-size: 0.95rem;
  font-weight: 700;
}
.export-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
}
@media (max-width: 800px) {
  .export-cards { grid-template-columns: 1fr; }
}
.export-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.3rem 1.2rem;
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  transition: 0.15s ease;
}
.export-card:hover { border-color: var(--teal); }
.export-card:disabled { opacity: 0.6; cursor: wait; }
.export-card .title { font-weight: 700; font-size: 0.95rem; }
.export-card .meta { color: var(--muted); font-size: 0.76rem; margin-top: 0.2rem; }
.export-ico {
  color: var(--teal);
  opacity: 0.85;
  flex-shrink: 0;
}
.reports-kpi { margin-bottom: 1rem; }

/* Figure 28: audit "Submitted" tint */
.audit-action-label.info { color: #60a5fa; }

/* Figure 29: settings */
.settings-group-title {
  margin: 1.2rem 0 0.5rem;
  font-size: 0.92rem;
  font-weight: 700;
}
.settings-group-title:first-of-type { margin-top: 0.4rem; }
.settings-panel { padding: 0.4rem 1.2rem 0.9rem; }
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.87rem;
  cursor: pointer;
}
.setting-row:last-child { border-bottom: 0; }

input.toggle {
  appearance: none;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.3);
  position: relative;
  cursor: pointer;
  transition: background 0.18s ease;
  flex-shrink: 0;
}
input.toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
}
input.toggle:checked { background: #2dd4bf; }
input.toggle:checked::after { transform: translateX(18px); }

.settings-panel .form-field { margin: 0.8rem 0; }
.settings-panel .form-field label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.form-success {
  color: #4ade80;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Document Tracker sort dropdown (Figure 17) */
.tracker-sort .select {
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  border-radius: 999px;
}

/* Horizontal milestone progress bar (Figure 18) */
.milestone-panel { margin-bottom: 1rem; }
.milestone-bar {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  position: relative;
}
.milestone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  position: relative;
  text-align: center;
}
/* Connector line between milestone dots */
.milestone:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 14px;
  left: calc(50% + 18px);
  width: calc(100% - 36px);
  height: 3px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.3);
}
.milestone.completed:not(:last-child)::after { background: var(--teal); }
.milestone-dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: #334155;
  border: 3px solid rgba(148, 163, 184, 0.35);
  z-index: 1;
}
.milestone.completed .milestone-dot {
  background: var(--teal);
  border-color: var(--teal);
}
.milestone.progress .milestone-dot {
  background: #2563eb;
  border-color: #3b82f6;
}
.milestone-label { font-weight: 600; font-size: 0.82rem; color: var(--ink); }
.milestone-state { font-size: 0.68rem; color: var(--muted); }
.milestone.completed .milestone-state { color: var(--teal); }

/* Real-time audit trail (Figure 18) */
.audit-trail {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.audit-trail li {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
}
.audit-trail-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--teal);
  margin-top: 0.25rem;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
}
.audit-trail-dot.ok {
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
}
.audit-trail li:first-child .audit-trail-dot,
.audit-trail-dot.current {
  background: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.audit-trail-time { font-size: 0.75rem; color: var(--muted); }
.audit-trail-title { font-size: 0.88rem; font-weight: 700; color: var(--ink); margin-top: 0.08rem; }
.audit-trail-msg { font-size: 0.82rem; color: #94a3b8; margin-top: 0.12rem; line-height: 1.4; }

/* Tracker detail — CALSV ML score (left→right fill, full value column) */
.kv-score-row {
  display: flex !important;
  align-items: center !important;
  gap: 0.75rem !important;
  width: 100%;
  grid-template-columns: none !important;
}
.kv-score-row > .k {
  flex: 0 0 auto;
  min-width: 7.5rem;
}
.kv-score-row > .calsv-score,
.kv-score-row > .val-muted {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left !important;
  justify-self: stretch !important;
}
.kv .calsv-score {
  display: flex !important;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  min-width: 0;
  grid-template-columns: none !important;
}
.kv .calsv-score-track {
  display: block !important;
  flex: 1 1 auto;
  min-width: 72px;
  height: 10px;
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.18);
  overflow: hidden;
  grid-template-columns: none !important;
}
.kv .calsv-score-meta {
  display: flex !important;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
  color: #2dd4bf;
  white-space: nowrap;
  grid-template-columns: none !important;
}
.kv .calsv-score-meta strong {
  font-size: 0.9rem;
  font-weight: 750;
}
.kv .calsv-score-meta span {
  font-size: 0.68rem;
  font-weight: 600;
  opacity: 0.9;
}
.kv .calsv-score-meta.warn { color: #fbbf24; }
.kv .calsv-score-meta.danger { color: #fb7185; }
.kv .calsv-score-meta.ok { color: #2dd4bf; }

/* Audit log table (Figure 20) */
.audit-table .audit-row { cursor: pointer; }
.audit-action-label { font-weight: 700; font-size: 0.82rem; }
.audit-action-label.pass { color: #4ade80; }
.audit-action-label.fail { color: #f43f5e; }
.audit-action-label.info { color: #60a5fa; }
.audit-panel .table-scroll { overflow-x: auto; }
.audit-table th,
.audit-table td { vertical-align: middle; }
.audit-table .audit-time {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #cbd5e1;
  white-space: nowrap;
}
.audit-by-role {
  font-size: 0.72rem;
  margin-top: 0.1rem;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
.pager-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

/* Review queue rows (Figure 15) — right-aligned AI compliance figure */
.compliance-score {
  text-align: right;
  line-height: 1.15;
}
.compliance-score strong { font-size: 1.08rem; font-weight: 700; }
.compliance-score small {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}

/* Document evaluation card (Figure 16) */
.review-eval { max-width: 880px; }
.review-eval-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding-bottom: 0.95rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.review-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: #7f1d1d;
  color: #fecaca;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.review-eval-titles .title { font-weight: 700; font-size: 1rem; }
.review-eval-titles .meta { color: var(--muted); font-size: 0.82rem; margin-top: 0.15rem; }
.review-eval-ref {
  margin-left: auto;
  text-align: right;
  font-size: 0.82rem;
  color: var(--ink);
}
.review-eval-ref small { display: block; color: var(--muted); margin-top: 0.15rem; }

.review-section-label {
  margin: 1.25rem 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.ocr-box {
  background: #11212f;
  border: 1px solid #223b4f;
  border-radius: 14px;
  padding: 0.95rem 1.05rem;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #eef5fa;
  max-height: 320px;
  overflow-y: auto;
}

.ocr-file-grid {
  display: grid;
  gap: 0.9rem;
  align-items: stretch;
}
.ocr-file-card {
  background: #11212f;
  border: 1px solid #223b4f;
  border-radius: 14px;
  padding: 0.9rem 1rem 1rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  max-height: min(64vh, 640px);
  overflow: auto;
}
.fig8-ocr .ocr-file-grid .subcard {
  background: #11212f;
  border: 1px solid #223b4f;
}
.ocr-file-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid #1b2f40;
}
.ocr-file-card-head h4 {
  margin: 0.12rem 0 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #eef5fa;
  line-height: 1.3;
}
.ocr-file-card-code {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal, #33d6c0);
}
.ocr-file-card .ocr-file-name,
.ocr-file-grid .ocr-file-name {
  margin-top: 0.18rem;
  font-size: 0.75rem;
  color: #93aabd;
  word-break: break-all;
}
.ocr-file-card .ocr-slot-pill,
.ocr-file-grid .ocr-slot-pill {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal, #33d6c0);
  background: rgba(51, 214, 192, 0.13);
  border: 1px solid rgba(51, 214, 192, 0.35);
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  white-space: nowrap;
}
.ocr-file-card-head > div:first-child,
.ocr-extract-card-head > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
.ocr-file-cols {
  display: grid;
  grid-template-columns: 0.9fr 1.35fr 0.7fr;
  gap: 0.75rem;
  padding: 0 0.85rem 0.45rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #93aabd;
}
.ocr-file-rows {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ocr-extract-row {
  display: grid;
  grid-template-columns: 0.9fr 1.35fr 0.7fr;
  gap: 0.75rem;
  align-items: start;
  padding: 0.72rem 0.85rem;
  border-radius: 10px;
  background: #17293a;
  border: 1px solid #223b4f;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #93aabd;
}
.ocr-extract-row.is-ok {
  background: rgba(51, 214, 192, 0.13);
  border-color: rgba(51, 214, 192, 0.35);
}
.ocr-extract-row.is-warn {
  background: rgba(255, 182, 72, 0.12);
  border-color: rgba(255, 182, 72, 0.4);
}
.ocr-extract-row.is-muted {
  background: rgba(109, 130, 153, 0.12);
  border-color: #223b4f;
}
.ocr-extract-row-field {
  font-weight: 700;
  color: #eef5fa;
}
.ocr-extract-row-value {
  color: #c5d4e0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.ocr-extract-row-status {
  justify-self: end;
  text-align: right;
  white-space: nowrap;
}
.ocr-file-table-wrap {
  overflow-x: auto;
}
.ocr-file-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.5rem;
  font-size: 0.84rem;
  line-height: 1.45;
}
.ocr-file-table thead th {
  text-align: left;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #93aabd;
  background: transparent;
  padding: 0 0.85rem 0.2rem;
  border: 0;
}
.ocr-file-table tbody td {
  padding: 0.72rem 0.85rem;
  vertical-align: top;
  color: #c5d4e0;
  background: rgba(51, 214, 192, 0.13);
  border-top: 1px solid rgba(51, 214, 192, 0.35);
  border-bottom: 1px solid rgba(51, 214, 192, 0.35);
}
.ocr-file-table tbody td:first-child {
  font-weight: 700;
  color: #eef5fa;
  width: 22%;
  max-width: 11rem;
  border-left: 1px solid rgba(51, 214, 192, 0.35);
  border-radius: 10px 0 0 10px;
}
.ocr-file-table tbody td:last-child {
  width: 12%;
  white-space: nowrap;
  border-right: 1px solid rgba(51, 214, 192, 0.35);
  border-radius: 0 10px 10px 0;
}
.ocr-file-table tbody td.ocr-extracted-text {
  font-weight: 400;
  white-space: pre-wrap;
  word-break: normal;
  overflow-wrap: break-word;
  text-align: left;
  min-width: 16rem;
}
.ocr-file-status.is-ok { color: #33d6c0; font-weight: 700; }
.ocr-file-status.is-warn { color: #ffb648; font-weight: 700; }
.ocr-file-status.is-muted { color: #93aabd; font-weight: 650; }

@media (max-width: 860px) {
  .ocr-file-grid {
    grid-template-columns: 1fr !important;
  }
  .ocr-file-cols,
  .ocr-extract-row {
    grid-template-columns: 1fr;
  }
  .ocr-extract-row-status,
  .ocr-file-table tbody td:last-child {
    justify-self: start;
    text-align: left;
    white-space: normal;
  }
}
.ocr-caption {
  margin: 0 0 0.85rem;
  color: #e2e8f0;
  font-size: 0.9rem;
  line-height: 1.55;
}
.ocr-caption-line {
  color: #cbd5e1;
  padding: 0.08rem 0;
}
.ocr-caption-line span {
  color: #94a3b8;
  font-weight: 650;
}
.ocr-scanned {
  margin: 0.85rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  color: #94a3b8;
  font-size: 0.8rem;
  line-height: 1.5;
  font-style: italic;
}
.compliance-head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: 1.25rem;
  font-weight: 600;
  font-size: 0.92rem;
}
.compliance-head strong { font-size: 1.25rem; }
.compliance-checklist {
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.compliance-checklist li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.88rem;
  font-weight: 500;
}
.compliance-checklist li.pass { color: var(--success, #4ade80); }
.compliance-checklist li.flag { color: var(--warn, #fbbf24); }
.compliance-checklist .check-ico {
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1.5px solid currentColor;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}
.integrity-box {
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.78rem;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.integrity-box code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
  color: #cbd5e1;
}
.review-comment { width: 100%; resize: vertical; min-height: 110px; }

.reviewer-sig-note {
  margin: 0.9rem 0 0.15rem;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(45, 212, 191, 0.28);
  background: rgba(45, 212, 191, 0.08);
  color: #99f6e4;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.45;
}
.reviewer-sig-panel {
  margin-top: 0.35rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.35);
}
.reviewer-sig-slots {
  list-style: none;
  margin: 0.7rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}
.reviewer-sig-slots li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.86rem;
}
.reviewer-sig-preview {
  display: block;
  margin: 0.75rem 0 0.15rem;
  max-height: 88px;
  max-width: 280px;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.28);
}
.reviewer-sig-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.85rem;
}
.reviewer-sig-actions .btn input[type="file"] { display: none; }
.reviewer-sig-actions .btn.is-busy { opacity: 0.65; pointer-events: none; }

.decide-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.15rem;
}
.decide-actions-row .btn {
  min-width: 140px;
}
.warn-text { color: #fbbf24; }
.danger-text { color: #f43f5e; }

@media (max-width: 900px) {
  .decide-grid { grid-template-columns: 1fr; }
  .decide-actions-row .btn { flex: 1 1 100%; }
}

/* ── SOU Accounts ───────────────────────────────────────────────────────── */
.user-filters {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 0.85rem;
  align-items: end;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
}
.user-filters label span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.user-row { cursor: pointer; }
.membership-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto auto;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 0.75rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.membership-row .field { margin-bottom: 0; }
.membership-primary {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  padding-bottom: 0.7rem;
  white-space: nowrap;
}
@media (max-width: 800px) {
  .user-filters { grid-template-columns: 1fr; }
  .membership-row { grid-template-columns: 1fr; }
  .membership-primary { padding-bottom: 0; }
}

/* ── Camera scan modal ──────────────────────────────────────────────────── */

.camera-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.85);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.camera-modal {
  background: var(--card-bg, #111827);
  border: 1px solid var(--border, #1e293b);
  border-radius: 0.75rem;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.camera-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border, #1e293b);
}

.camera-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.camera-modal-sub {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--muted-fg, #94a3b8);
  max-width: 36rem;
  line-height: 1.4;
}

.camera-modal-body {
  padding: 1rem 1.25rem;
}

.camera-viewfinder-container {
  position: relative;
  width: 100%;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #000;
  aspect-ratio: 4 / 3;
}

.camera-viewfinder {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.camera-guide-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.camera-guide-border {
  width: 80%;
  height: 75%;
  border: 2px dashed rgba(255, 255, 255, 0.4);
  border-radius: 0.5rem;
}

.camera-guide-text {
  position: absolute;
  bottom: 0.75rem;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

.camera-preview-container {
  width: 100%;
  text-align: center;
}

.camera-preview-img {
  max-width: 100%;
  max-height: 50vh;
  border-radius: 0.5rem;
  object-fit: contain;
}

.camera-quality-badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.camera-quality-badge.checking {
  background: var(--muted, #334155);
  color: var(--muted-fg, #94a3b8);
}

.camera-quality-badge.good {
  background: #065f46;
  color: #6ee7b7;
}

.camera-quality-badge.okay {
  background: #78350f;
  color: #fbbf24;
}

.camera-quality-badge.bad {
  background: #7f1d1d;
  color: #fca5a5;
}

.camera-quality-issues {
  list-style: disc;
  padding-left: 1.25rem;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--muted-fg, #94a3b8);
}

.camera-modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: 1rem 0 0.5rem;
}

.camera-modal-actions-inline {
  padding-top: 0.5rem;
}

.camera-checking-veil {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
  color: #e2e8f0;
  font-size: 0.9rem;
  font-weight: 600;
}

.camera-quality-panel {
  margin-top: 0.75rem;
  text-align: center;
}

.camera-page-strip {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.85rem 0.15rem 0.15rem;
  scrollbar-width: thin;
}

.camera-page-thumb {
  position: relative;
  width: 72px;
  height: 96px;
  flex-shrink: 0;
  border-radius: 0.4rem;
  overflow: hidden;
  border: 2px solid rgba(45, 212, 191, 0.45);
  background: #0b1220;
}

.camera-page-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.camera-page-num {
  position: absolute;
  left: 4px;
  bottom: 3px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px #000;
}

.camera-page-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 1.15rem;
  height: 1.15rem;
  border: 0;
  border-radius: 999px;
  background: rgba(127, 29, 29, 0.92);
  color: #fecaca;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}

.camera-page-remove:hover {
  background: #991b1b;
}

@media (max-width: 480px) {
  .camera-modal {
    max-width: 100%;
    border-radius: 0;
    max-height: 100vh;
  }
  .camera-viewfinder-container {
    aspect-ratio: auto;
    height: 50vh;
  }
}

.app-toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 80;
  max-width: min(28rem, calc(100vw - 2rem));
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  font-size: 0.9rem;
  line-height: 1.4;
}
.app-toast-error {
  background: #3f1d1d;
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #fecaca;
}
.app-toast-success {
  background: #0f3d38;
  border: 1px solid rgba(45, 212, 191, 0.4);
  color: #99f6e4;
}
.app-toast-close {
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  opacity: 0.7;
  padding: 0;
}
.app-toast-close:hover { opacity: 1; }

