:root {
  --ink: #122033;
  --ink-soft: #33445b;
  --muted: #68778a;
  --line: #dfe6ee;
  --line-strong: #cbd6e2;
  --panel: #ffffff;
  --bg: #f3f6f9;
  --brand: #075f86;
  --brand-deep: #063c5b;
  --brand-bright: #0a8db8;
  --cyan-soft: #e9f7fb;
  --accent: #f5d400;
  --ok: #0d7b58;
  --ok-soft: #e9f8f1;
  --warn: #996000;
  --warn-soft: #fff8e8;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  --navy: #0b1727;
  --shadow-sm: 0 6px 20px rgba(15, 30, 50, .06);
  --shadow: 0 18px 54px rgba(15, 30, 50, .10);
  --radius: 16px;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }

.topbar {
  position: sticky; top: 0; z-index: 60;
  height: 68px; padding: 0 clamp(16px, 3vw, 42px);
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; min-width: 0; gap: 11px; }
.brand-mark {
  width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center;
  border-radius: 12px; background: linear-gradient(145deg, var(--brand-deep), var(--brand-bright));
  color: #fff; font-size: 12px; font-weight: 900; letter-spacing: -.02em;
  box-shadow: 0 9px 23px rgba(7,95,134,.24);
}
.brand-mark.large { width: 58px; height: 58px; font-size: 17px; border-radius: 18px; }
.brand-copy { min-width: 0; }
.brand-copy b { display: block; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.brand-copy small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; letter-spacing: .02em; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.topbar-actions form { margin: 0; }
.system-pill, .user-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  color: #4d5e73; font-size: 10px; white-space: nowrap;
}
.system-pill i { width: 7px; height: 7px; border-radius: 50%; background: #22a06b; box-shadow: 0 0 0 4px rgba(34,160,107,.10); }
.icon-button {
  display: inline-grid; place-items: center; border: 0; width: 34px; height: 34px;
  border-radius: 10px; background: #edf2f7; color: var(--ink); font-weight: 900;
}
.icon-button:hover { background: #e2eaf2; }
.signout { font-size: 17px; }

.page { width: min(1260px, calc(100% - 34px)); margin: 0 auto; padding: 28px 0 86px; }
.wide-page, .investigation-page { width: min(1480px, calc(100% - 34px)); }

.eyebrow {
  margin: 0 0 7px; color: #a8def1; text-transform: uppercase;
  letter-spacing: .13em; font-size: 10px; font-weight: 900;
}
.eyebrow.dark { color: var(--brand); }
.workspace-hero, .hero, .dashboard-hero {
  position: relative; overflow: hidden; border-radius: 22px;
  background: linear-gradient(125deg, #082d49 0%, #075f86 58%, #0788ad 100%);
  color: #fff; box-shadow: var(--shadow);
}
.workspace-hero::after, .hero::after {
  content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%;
  right: -150px; top: -260px; background: rgba(255,255,255,.09);
}
.workspace-hero { min-height: 188px; padding: 30px 32px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.workspace-hero > * { position: relative; z-index: 1; }
.workspace-hero h1, .hero h1 { margin: 0 0 8px; font-size: clamp(28px, 4vw, 43px); line-height: 1.04; letter-spacing: -.04em; }
.workspace-hero p:not(.eyebrow), .hero p:not(.eyebrow) { max-width: 860px; margin: 0; color: #d8edf6; font-size: 13px; line-height: 1.58; }
.hero.compact { padding: 26px 30px; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.hero-actions, .action-row { display: flex; align-items: center; justify-content: flex-end; gap: 9px; flex-wrap: wrap; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 9px 14px; border: 1px solid transparent; border-radius: 10px;
  font-weight: 800; font-size: 12px; transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
  white-space: nowrap;
}
.button:hover { transform: translateY(-1px); }
.button.primary { background: linear-gradient(135deg, var(--brand), #087ea7); color: #fff; box-shadow: 0 8px 18px rgba(7,95,134,.20); }
.button.ghost { background: #fff; border-color: var(--line); color: var(--ink-soft); }
.workspace-hero .button.ghost, .hero .button.ghost { color: #fff; background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.28); }
.button.soft { background: #f0f5f8; border-color: #dbe6ee; color: #315069; }
.button.soft.dark { color: #d9e7f3; background: #182638; border-color: #33445a; }
.button.camera { background: var(--cyan-soft); border-color: #bfe5f1; color: var(--brand-deep); }
.button.camera span { font-size: 16px; }
.button.large { min-height: 48px; padding: 12px 19px; font-size: 13px; }
.button.small { min-height: 32px; padding: 6px 10px; font-size: 10px; }
.button.full { width: 100%; }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.connection-state {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.28); border-radius: 999px;
  background: rgba(255,255,255,.10); color: #fff; font-size: 10px; font-weight: 850;
}
.connection-state i { width: 7px; height: 7px; border-radius: 50%; background: #77e1b3; }
.connection-state.offline { background: #84231c; border-color: #f5a9a4; }
.connection-state.offline i { background: #ffd0cc; }

.alert { margin: 16px 0; padding: 13px 15px; border: 1px solid; border-radius: 12px; font-size: 12px; line-height: 1.5; }
.alert.error { color: #981b1b; background: var(--danger-soft); border-color: #f5c1bd; }
.alert.warning { color: #815000; background: var(--warn-soft); border-color: #efd28c; }
.alert.success { color: #096747; background: var(--ok-soft); border-color: #b8e7d3; }

.investigation-layout {
  display: grid; grid-template-columns: 278px minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 20px;
}
.workflow-sidebar { position: sticky; top: 88px; display: grid; gap: 13px; }
.sidebar-card, .section-nav {
  background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow-sm);
}
.sidebar-card { padding: 16px; }
.sidebar-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; }
.sidebar-title b { color: var(--brand); font-size: 18px; }
.progress-card progress, .capture-summary progress, .processing-stage progress {
  width: 100%; overflow: hidden; border: 0; border-radius: 999px; background: #e8eef3; accent-color: var(--brand-bright);
}
.progress-card progress { height: 8px; margin: 13px 0 8px; }
.progress-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.section-nav { padding: 8px; }
.section-nav > p { margin: 5px 8px 8px; color: var(--muted); font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; }
.section-nav a { display: grid; grid-template-columns: 28px 1fr; align-items: start; gap: 9px; padding: 10px 9px; border-radius: 10px; }
.section-nav a:hover { background: #f3f8fb; }
.section-nav a > span { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; background: #e9f3f7; color: var(--brand); font-size: 9px; font-weight: 900; }
.section-nav b { display: block; font-size: 11px; }
.section-nav small { display: block; margin-top: 2px; color: var(--muted); font-size: 8.5px; line-height: 1.35; }
.mini-label { color: var(--brand); font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; }
.capture-launcher { background: linear-gradient(160deg, #092b43, #075f86); color: #fff; border-color: transparent; }
.capture-launcher h3 { margin: 8px 0 5px; font-size: 16px; letter-spacing: -.02em; }
.capture-launcher p { margin: 0 0 13px; color: #cce5ef; font-size: 10px; line-height: 1.45; }
.capture-launcher small { display: block; margin-top: 9px; color: #acd6e7; font-size: 9px; }
.trust-card b { font-size: 11px; }
.trust-card ul { margin: 9px 0 0; padding-left: 17px; color: var(--muted); font-size: 9px; line-height: 1.7; }
.form-column { min-width: 0; }

.workflow-overview {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px;
  margin-bottom: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--line);
}
.workflow-overview article { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 13px 14px; background: #fff; }
.workflow-overview article > span { color: var(--brand); font-size: 9px; font-weight: 950; letter-spacing: .08em; }
.workflow-overview b { display: block; font-size: 11px; }
.workflow-overview small { display: block; margin-top: 2px; color: var(--muted); font-size: 8.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.panel { margin-bottom: 16px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: center; gap: 13px; padding: 17px 19px; border-bottom: 1px solid var(--line); background: linear-gradient(#fff, #fbfcfd); }
.panel-head > div:not(.section-number) { min-width: 0; }
.panel-head h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.panel-head p:not(.eyebrow) { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.section-number { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 11px; background: var(--cyan-soft); color: var(--brand); font-size: 11px; font-weight: 950; }
.provider-chip { margin-left: auto; padding: 7px 9px; border-radius: 999px; background: #edf5f8; color: #456174; font-size: 9px; font-weight: 800; white-space: nowrap; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; padding: 18px; }
.field { display: flex; flex-direction: column; min-width: 0; gap: 6px; }
.field.wide { grid-column: 1 / -1; }
.field > span:first-child { color: #314258; font-size: 10px; font-weight: 850; }
.field em, .capture-card em, .review-card em { color: var(--danger); font-style: normal; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 42px; padding: 10px 11px; outline: 0;
  border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; color: var(--ink);
  font-size: 12px; transition: border-color .15s, box-shadow .15s, background .15s;
}
.field textarea { min-height: 76px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #35a3c4; box-shadow: 0 0 0 3px rgba(53,163,196,.12); }
.field input:invalid:not(:placeholder-shown) { border-color: #e39791; }
.field-meta { min-height: 14px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.field-meta b { padding: 3px 6px; border-radius: 5px; background: var(--cyan-soft); color: var(--brand); font-size: 8px; }
.field-meta small { color: var(--muted); font-size: 8.5px; line-height: 1.35; }

.capture-section { overflow: visible; }
.capture-head { position: sticky; top: 68px; z-index: 22; }
.capture-summary { display: grid; grid-template-columns: auto minmax(160px, 1fr) auto; align-items: center; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--line); background: #f7fafc; }
.capture-summary > div { display: flex; align-items: baseline; gap: 5px; }
.capture-summary b { color: var(--brand); font-size: 22px; }
.capture-summary span, .capture-summary small { color: var(--muted); font-size: 9px; }
.capture-summary progress { height: 8px; }
.capture-category { padding: 18px; }
.capture-category + .capture-category { border-top: 1px solid var(--line); background: #fbfcfd; }
.capture-category-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 13px; }
.capture-category-head > div { display: flex; align-items: center; gap: 10px; }
.capture-category-head > span { padding: 5px 8px; border-radius: 999px; background: #edf3f6; color: var(--muted); font-size: 8px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.category-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #eaf6fa; color: var(--brand); font-weight: 900; }
.capture-category h3 { margin: 0; font-size: 14px; }
.capture-category-head p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.capture-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.evidence-grid-capture { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.capture-card {
  position: relative; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 13px;
  background: #fff; transition: border-color .18s, box-shadow .18s, transform .18s;
}
.capture-card:hover { border-color: #c8d8e3; box-shadow: 0 8px 24px rgba(15,30,50,.06); }
.capture-card.capture-ready { border-color: #8ed5bb; background: #f8fffb; box-shadow: inset 0 0 0 1px rgba(13,123,88,.08); }
.capture-card.capture-failed { border-color: #efaaa5; background: #fffafa; }
.capture-card.capture-attention { animation: captureAttention .65s ease 2; }
.capture-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.capture-card-title { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
.capture-type-icon { display: grid; place-items: center; width: 36px; height: 31px; flex: 0 0 36px; border-radius: 8px; background: #e9f6fa; color: var(--brand); font-size: 8px; font-weight: 950; letter-spacing: .05em; }
.capture-type-icon.evidence { background: #eef1f6; color: #53657b; }
.capture-card h3 { margin: 0; font-size: 12px; }
.capture-card p { margin: 3px 0 0; color: var(--muted); font-size: 8.5px; line-height: 1.4; }
.capture-count { display: grid; place-items: center; min-width: 38px; height: 27px; padding: 0 7px; border-radius: 999px; background: #edf2f6; color: #53657b; font-size: 9px; font-weight: 900; }
.capture-card.capture-ready .capture-count { background: #dff5ea; color: var(--ok); }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.capture-actions { display: flex; gap: 7px; margin-top: 12px; }
.capture-actions .button { flex: 1; min-width: 0; min-height: 36px; padding: 8px 9px; font-size: 10px; }
.preview-strip { display: flex; gap: 7px; overflow-x: auto; min-height: 0; margin-top: 10px; scrollbar-width: thin; }
.preview-strip:has(img) { min-height: 74px; }
.preview-strip figure { position: relative; flex: 0 0 83px; margin: 0; }
.preview-strip img { display: block; width: 83px; height: 70px; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; }
.preview-badge { position: absolute; left: 4px; right: 4px; bottom: 4px; padding: 3px 4px; border-radius: 5px; text-align: center; background: #5b6d81; color: #fff; font-size: 7px; font-weight: 900; }
.preview-badge.pass { background: var(--ok); }
.preview-badge.fail, .preview-badge.error { background: var(--danger); }
.preview-badge.server-check, .preview-badge.checking { background: var(--warn); }
.capture-feedback, .server-check { margin-top: 7px; color: var(--muted); font-size: 8.5px; line-height: 1.4; }
.capture-feedback.bad { color: var(--danger); }
.capture-help { margin-top: 8px; border-top: 1px dashed #dce4eb; padding-top: 7px; }
.capture-help summary { cursor: pointer; color: #53657b; font-size: 8.5px; font-weight: 800; }
.capture-card-checklist { margin: 8px 0 0; padding-left: 16px; color: var(--muted); font-size: 8px; line-height: 1.5; }

.submit-bar {
  position: sticky; bottom: 12px; z-index: 45; display: flex; align-items: center; justify-content: space-between; gap: 18px;
  width: min(1160px, calc(100% - 18px)); margin: 20px auto 0; padding: 12px 13px 12px 15px;
  border: 1px solid rgba(203,214,226,.9); border-radius: 15px; background: rgba(255,255,255,.94);
  box-shadow: 0 18px 55px rgba(15,30,50,.18); backdrop-filter: blur(16px);
}
.submit-state { display: flex; align-items: center; gap: 10px; min-width: 0; }
.submit-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 10px; background: #e8f6ef; color: var(--ok); font-weight: 900; }
.submit-state b { display: block; font-size: 11px; }
.submit-state span:not(.submit-icon) { display: block; margin-top: 2px; color: var(--muted); font-size: 8.5px; }

.camera-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 10px; background: rgba(3,10,20,.88); }
.camera-modal[hidden] { display: none; }
.camera-dialog { width: min(900px, 100%); max-height: calc(100dvh - 20px); overflow: auto; border: 1px solid #31435a; border-radius: 18px; background: #0b1727; color: #fff; box-shadow: 0 30px 100px rgba(0,0,0,.48); }
.camera-dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 16px; }
.camera-dialog header b { display: block; font-size: 15px; }
.camera-dialog header small { display: block; margin-top: 2px; color: #aebdce; font-size: 9px; }
.camera-dialog .eyebrow { margin-bottom: 3px; font-size: 8px; }
.camera-dialog .icon-button { color: #fff; background: #1c2c40; font-size: 20px; }
.camera-instructions { padding: 0 16px 10px; border-bottom: 1px solid #243348; }
.camera-instructions .capture-card-checklist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 20px; margin: 0; color: #bac7d6; }
.camera-stage { position: relative; overflow: hidden; min-height: 320px; aspect-ratio: 16 / 10; background: #000; }
.camera-stage video { width: 100%; height: 100%; object-fit: cover; }
.camera-guide { --guide-aspect: 2.35; position: absolute; left: 5%; top: 50%; width: 90%; aspect-ratio: var(--guide-aspect); transform: translateY(-50%); border: 3px solid var(--accent); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0,0,0,.24), 0 0 20px rgba(245,212,0,.25); display: grid; place-items: end center; }
.camera-guide[data-kind="evidence"] { width: auto; height: 82%; max-width: 92%; }
.camera-guide span { margin-bottom: 7px; padding: 4px 7px; border-radius: 5px; background: rgba(0,0,0,.68); font-size: 8px; font-weight: 900; letter-spacing: .08em; }
.camera-status { position: absolute; left: 50%; top: 12px; z-index: 4; transform: translateX(-50%); max-width: calc(100% - 24px); padding: 8px 12px; border-radius: 999px; background: #405168; color: #fff; text-align: center; font-size: 9px; font-weight: 850; }
.camera-status.good { background: var(--ok); }
.camera-status.bad { background: var(--danger); }
.quality-panel { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: #28394e; border-top: 1px solid #31435a; border-bottom: 1px solid #31435a; }
.quality-panel article { padding: 9px 6px; background: #101d2e; text-align: center; }
.quality-panel span { display: block; color: #8fa1b6; font-size: 7px; text-transform: uppercase; letter-spacing: .06em; }
.quality-panel b { display: block; margin-top: 3px; font-size: 13px; }
.quality-panel .quality-score { background: #13283d; }
.metric-good { color: #76e0b4; }
.metric-bad { color: #f9a29b; }
.camera-options { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; padding: 10px 14px 0; color: #c4d0dd; font-size: 9px; }
.camera-options label { display: flex; align-items: center; gap: 6px; }
.override-option { color: #f1ce61; }
.camera-controls { display: flex; align-items: center; justify-content: center; gap: 22px; padding: 12px 14px 15px; }
.shutter { display: grid; place-items: center; width: 66px; height: 66px; flex: 0 0 66px; border: 5px solid #fff; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(255,255,255,.18); }
.shutter span { width: 42px; height: 42px; border: 2px solid #0b1727; border-radius: 50%; }
.shutter:disabled { opacity: .32; cursor: not-allowed; }
.burst-progress { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 0 16px 14px; color: #d8e7f5; font-size: 9px; }
.burst-progress[hidden] { display: none; }
.burst-progress > span { width: 17px; height: 17px; border: 2px solid #62748a; border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }

/* Dashboard */
.dashboard-page { width: min(1320px, calc(100% - 34px)); }
.dashboard-hero { min-height: 330px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); align-items: stretch; margin-bottom: 18px; }
.dashboard-copy { padding: 42px; }
.dashboard-copy h1 { margin: 0 0 13px; font-size: clamp(38px, 5vw, 62px); line-height: .95; letter-spacing: -.055em; }
.dashboard-copy > p:not(.eyebrow) { max-width: 600px; margin: 0 0 22px; color: #d7ebf4; font-size: 13px; line-height: 1.55; }
.dashboard-visual { display: grid; place-items: center; min-height: 260px; background: radial-gradient(circle at center, rgba(36,184,220,.24), transparent 55%); }
.scan-window { position: relative; width: min(280px, 76%); aspect-ratio: 1.25; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.18); background: rgba(5,26,43,.38); }
.scan-window b { display: block; color: var(--accent); font-size: 34px; letter-spacing: .18em; }
.scan-window small { position: absolute; bottom: 20px; color: #c8e0eb; font-size: 9px; }
.scan-corner { position: absolute; width: 35px; height: 35px; border-color: var(--accent); }
.scan-corner.tl { left: -2px; top: -2px; border-left: 3px solid; border-top: 3px solid; }
.scan-corner.tr { right: -2px; top: -2px; border-right: 3px solid; border-top: 3px solid; }
.scan-corner.bl { left: -2px; bottom: -2px; border-left: 3px solid; border-bottom: 3px solid; }
.scan-corner.br { right: -2px; bottom: -2px; border-right: 3px solid; border-bottom: 3px solid; }
.scan-line { position: absolute; left: 8%; right: 8%; height: 2px; background: var(--accent); box-shadow: 0 0 18px rgba(245,212,0,.8); animation: scan 2.2s ease-in-out infinite; }
.dashboard-strip { grid-column: 1 / -1; display: flex; align-items: center; gap: 22px; padding: 12px 20px; background: rgba(2,22,36,.48); font-size: 9px; }
.dashboard-strip span { display: inline-flex; align-items: center; gap: 7px; }
.dashboard-strip i { width: 7px; height: 7px; border-radius: 50%; background: #62dfac; }
.dashboard-strip a { margin-left: auto; color: var(--accent); font-weight: 850; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 17px; }
.stats-grid article { padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
.stats-grid span { display: block; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.stats-grid strong { display: block; margin: 4px 0 2px; font-size: 28px; letter-spacing: -.04em; }
.stats-grid small { color: #8a98a8; font-size: 8.5px; }
.report-list-panel .panel-head { justify-content: space-between; }
.report-cards { display: grid; }
.report-card { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 145px 22px; align-items: center; gap: 12px; padding: 13px 17px; border-top: 1px solid #edf1f4; }
.report-card:first-child { border-top: 0; }
.report-card:hover { background: #f8fbfd; }
.report-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: #e9f5f8; color: var(--brand); font-weight: 900; }
.report-main { min-width: 0; }
.report-main b, .report-main span, .report-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-main b { font-size: 11px; }
.report-main span { margin-top: 2px; color: var(--muted); font-size: 8.5px; }
.report-main small { margin-top: 3px; color: #8795a5; font-size: 8px; }
.report-card time { color: var(--muted); font-size: 9px; }
.open-arrow { color: var(--brand); font-weight: 900; }
.status { display: inline-flex; align-items: center; justify-content: center; padding: 5px 8px; border-radius: 999px; background: #edf1f5; color: #53657b; font-size: 8px; font-weight: 900; letter-spacing: .05em; white-space: nowrap; }
.status.final { background: #e2f7ed; color: var(--ok); }
.status.ocr_review { background: #fff1c9; color: #7f5400; }
.status.processing { background: #e6f4fb; color: var(--brand); }
.status.draft { background: #edf1f5; color: #596a7e; }
.empty { padding: 52px 20px; text-align: center; }
.empty-icon { width: 48px; height: 48px; margin: 0 auto 10px; display: grid; place-items: center; border-radius: 15px; background: #ecf4f7; color: var(--brand); font-size: 20px; }
.empty h3 { margin: 0 0 6px; }
.empty p { margin: 0 auto 17px; max-width: 480px; color: var(--muted); font-size: 11px; }

/* Login */
.login-shell { min-height: 100vh; padding: 20px; display: grid; place-items: center; background: radial-gradient(circle at 18% 10%, #0b7296 0, transparent 32%), linear-gradient(140deg, #071624, #0b243a 66%, #0c5772); }
.login-stage { width: min(1120px, 100%); min-height: 600px; display: grid; grid-template-columns: 1.25fr .75fr; overflow: hidden; border: 1px solid rgba(255,255,255,.14); border-radius: 25px; background: rgba(255,255,255,.07); box-shadow: 0 30px 100px rgba(0,0,0,.32); backdrop-filter: blur(18px); }
.login-story { padding: 56px; color: #fff; display: flex; flex-direction: column; justify-content: center; }
.login-logo { display: flex; align-items: center; gap: 13px; margin-bottom: 42px; }
.login-logo b { font-size: 14px; }
.login-story h1 { margin: 0 0 17px; font-size: clamp(42px, 6vw, 68px); line-height: .94; letter-spacing: -.055em; }
.login-story > p:not(.eyebrow) { max-width: 620px; margin: 0; color: #c7deea; font-size: 13px; line-height: 1.65; }
.login-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 42px; }
.login-metrics span { padding-top: 11px; border-top: 1px solid rgba(255,255,255,.2); color: #a9c7d5; font-size: 9px; }
.login-metrics b { display: block; margin-bottom: 2px; color: #fff; font-size: 11px; }
.login-card { padding: 44px 38px; background: #fff; display: flex; flex-direction: column; justify-content: center; }
.login-card h2 { margin: 0; font-size: 30px; letter-spacing: -.04em; }
.muted { color: var(--muted); font-size: 11px; line-height: 1.5; }
.stack { display: grid; gap: 14px; margin-top: 18px; }
.security-note { margin-top: 18px; padding: 11px 12px; border-radius: 10px; background: #f2f6f8; color: var(--muted); font-size: 9px; line-height: 1.45; }

/* Review and final */
.review-page { width: min(1480px, calc(100% - 34px)); }
.review-hero { margin-bottom: 16px; }
.review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 16px; }
.review-card { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.review-card.wide { grid-column: 1 / -1; }
.review-card.needs-review { border-color: #ebc879; background: #fffdf7; }
.review-card.accepted { border-color: #aee0ca; }
.review-card.employee-checked { box-shadow: inset 3px 0 0 var(--ok); }
.review-card > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.review-card header > div { display: flex; align-items: center; gap: 7px; }
.review-card h3 { margin: 0; font-size: 11px; }
.confidence, .review-state { padding: 4px 6px; border-radius: 999px; font-size: 7.5px; font-weight: 850; }
.confidence { background: #edf2f6; color: #53657b; }
.review-state.warning { background: #fff0c5; color: #7f5400; }
.review-state.success { background: #e2f7ed; color: var(--ok); }
.review-state.neutral { background: #edf1f5; color: #607084; }
.source-image { display: grid; grid-template-columns: 92px minmax(0,1fr); align-items: center; gap: 9px; margin-bottom: 9px; padding: 7px; border-radius: 9px; background: #f4f8fa; color: var(--brand); font-size: 8.5px; }
.source-image img { width: 92px; height: 59px; object-fit: cover; border-radius: 6px; }
.ocr-touch-zone > small { display: block; margin-bottom: 6px; color: var(--muted); font-size: 8px; }
.ocr-choice-row { display: flex; gap: 6px; flex-wrap: wrap; }
.ocr-choice { border: 1px solid #d7e0e8; border-radius: 8px; padding: 7px 9px; background: #fff; color: #32465b; font-size: 9px; font-weight: 800; }
.ocr-choice small { color: var(--muted); font-size: 7px; }
.ocr-choice.primary-choice { border-color: #9dd3e4; background: #edf8fb; color: var(--brand); }
.ocr-choice.selected { color: #fff; background: var(--brand); border-color: var(--brand); }
.consensus-strip { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.consensus-strip span { padding: 4px 6px; border-radius: 999px; background: #edf3f6; color: #617285; font-size: 7.5px; }
.consensus-strip b { color: var(--brand); }
.final-value > span { display: flex; justify-content: space-between; }
.final-value > span b { color: var(--brand); font-size: 7px; text-transform: uppercase; }
.review-card details { margin-top: 8px; color: #53657b; font-size: 8px; }
.review-card summary { cursor: pointer; font-weight: 800; }
.ocr-detail { display: grid; grid-template-columns: 75px 1fr; gap: 5px 9px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.ocr-detail dt { font-weight: 850; }
.ocr-detail dd { margin: 0; min-width: 0; }
.ocr-detail pre { margin: 0; padding: 6px; white-space: pre-wrap; word-break: break-word; border-radius: 6px; background: #f3f6f8; }
.evidence-review { padding-bottom: 14px; }
.evidence-group { padding: 14px 18px; border-top: 1px solid #edf1f4; }
.evidence-group:first-of-type { border-top: 0; }
.evidence-group h3 { margin: 0 0 9px; font-size: 11px; }
.evidence-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 9px; }
.evidence-grid a { padding: 6px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.evidence-grid img { width: 100%; height: 100px; object-fit: cover; border-radius: 6px; }
.evidence-grid small, .evidence-grid span { display: block; margin-top: 4px; color: var(--muted); font-size: 7.5px; line-height: 1.3; }
.evidence-grid a.quality-pass { border-color: #a9dfc8; }
.evidence-grid a.quality-fail { border-color: #efaaa5; background: #fffafa; }
.evidence-grid a.quality-fail span { color: var(--danger); }
.review-submit { align-items: flex-end; }
.confirmations { display: grid; gap: 7px; }
.confirm-box { display: flex; align-items: flex-start; gap: 8px; color: #43546a; font-size: 9px; line-height: 1.35; }
.confirm-box input { margin-top: 2px; }
.quality-override { color: #8a5600; }
.summary-table { padding: 2px 18px 18px; }
.summary-section { padding: 16px 0 3px; }
.summary-section h3 { margin: 0 0 8px; font-size: 12px; }
.summary-section dl { display: grid; grid-template-columns: 210px minmax(0,1fr); margin: 0; border-top: 1px solid var(--line); }
.summary-section dt, .summary-section dd { margin: 0; padding: 8px 9px; border-bottom: 1px solid var(--line); font-size: 9px; }
.summary-section dt { color: var(--muted); background: #f8fafb; font-weight: 800; }
.timeline { padding: 13px 18px 18px; }
.timeline article { display: grid; grid-template-columns: 14px 1fr; gap: 9px; position: relative; padding: 7px 0; }
.timeline article > span { width: 9px; height: 9px; margin-top: 3px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px #e8f4f8; }
.timeline b { display: block; font-size: 9px; }
.timeline small { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; }

/* Processing */
.processing-page { display: grid; min-height: calc(100vh - 68px); place-items: center; }
.processing-shell { width: min(1040px, 100%); display: grid; grid-template-columns: 1fr 310px; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
.processing-stage { min-height: 520px; padding: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: radial-gradient(circle at center, #e8f7fb, #fff 58%); }
.processing-orbit { position: relative; width: 170px; height: 170px; margin-bottom: 28px; display: grid; place-items: center; border: 1px solid #b9dce7; border-radius: 50%; }
.processing-core { width: 74px; height: 74px; display: grid; place-items: center; border-radius: 24px; background: linear-gradient(145deg, var(--brand-deep), var(--brand-bright)); color: #fff; font-weight: 950; box-shadow: 0 14px 32px rgba(7,95,134,.25); }
.processing-orbit > span { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: orbit 2.4s linear infinite; }
.processing-orbit > span:nth-child(3) { animation-delay: -.8s; }
.processing-orbit > span:nth-child(4) { animation-delay: -1.6s; }
.processing-stage h1 { max-width: 640px; margin: 0 0 8px; font-size: 30px; letter-spacing: -.04em; }
.processing-stage > p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 10px; }
.processing-stage progress { max-width: 520px; height: 10px; margin: 24px 0 9px; }
.progress-readout { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 9px; }
.progress-readout b { color: var(--brand); font-size: 16px; }
.processing-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; width: min(610px, 100%); margin-top: 28px; }
.processing-steps span { padding: 7px 5px; border-radius: 8px; background: #edf2f6; color: #758497; font-size: 8px; font-weight: 800; }
.processing-steps span.active { background: #dff4fa; color: var(--brand); }
.processing-side { padding: 34px 27px; color: #d7e4ee; background: var(--navy); }
.processing-side b { font-size: 14px; }
.processing-side ul { margin: 18px 0 24px; padding-left: 18px; color: #aebdce; font-size: 10px; line-height: 2; }
.processing-side small { color: #8193a8; font-size: 9px; line-height: 1.55; }

/* Printable legacy report */
.print-page { padding: 16px; background: #dfe5ea; }
.print-toolbar { width: 1120px; max-width: 100%; margin: 0 auto 12px; display: flex; justify-content: flex-end; gap: 8px; }
.legacy-report { width: 1120px; max-width: 100%; margin: 0 auto; border: 3px solid #111; background: #fff; color: #000; font-family: "Times New Roman", serif; box-shadow: var(--shadow); }
.legacy-report > h1 { margin: 0; padding: 5px; border-bottom: 3px solid #000; background: #fffb00; text-align: center; font-size: 25px; }
.legacy-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.legacy-table th, .legacy-table td { padding: 4px 5px; border: 1px solid #000; text-align: left; vertical-align: top; font-size: 13px; }
.legacy-table th { width: 21%; font-weight: 800; }
.legacy-table td { width: 29%; }
.legacy-photo-section { min-height: 220px; border-top: 2px solid #000; }
.legacy-photo-section h2 { margin: 0; padding: 5px; border-bottom: 1px solid #000; font-size: 14px; }
.legacy-photos { min-height: 180px; padding: 6px; display: flex; align-items: flex-start; gap: 4px; flex-wrap: wrap; }
.legacy-photos img { height: 122px; max-width: 240px; object-fit: contain; border: 1px solid #bbb; }
.legacy-report footer { padding: 5px; border-top: 1px solid #000; text-align: right; font-size: 9px; }

.footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 18px clamp(16px, 3vw, 42px) 28px; color: #8492a2; font-size: 8px; }
.bottom-dock { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes scan { 0%,100% { top: 15%; } 50% { top: 82%; } }
@keyframes orbit { from { transform: rotate(0deg) translateX(85px) rotate(0deg); } to { transform: rotate(360deg) translateX(85px) rotate(-360deg); } }
@keyframes captureAttention { 50% { transform: translateY(-3px); box-shadow: 0 0 0 4px rgba(180,35,24,.15); } }

@media (max-width: 1120px) {
  .investigation-layout { grid-template-columns: 230px minmax(0,1fr); }
  .evidence-grid-capture { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-hero { grid-template-columns: 1fr 330px; }
  .report-card { grid-template-columns: 40px minmax(0,1fr) auto 100px 18px; }
}

@media (max-width: 900px) {
  .system-pill { display: none; }
  .investigation-layout { grid-template-columns: 1fr; }
  .workflow-sidebar { position: static; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .section-nav { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); }
  .section-nav > p { grid-column: 1 / -1; }
  .capture-launcher, .trust-card { display: none; }
  .workflow-overview { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .capture-grid { grid-template-columns: 1fr; }
  .evidence-grid-capture { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .dashboard-hero { grid-template-columns: 1fr; }
  .dashboard-visual { display: none; }
  .dashboard-strip { grid-column: auto; flex-wrap: wrap; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .processing-shell { grid-template-columns: 1fr; }
  .processing-side { display: none; }
  .review-grid { grid-template-columns: 1fr; }
  .review-card.wide { grid-column: auto; }
  .login-stage { grid-template-columns: 1fr; }
  .login-story { display: none; }
  .login-card { min-height: 560px; }
}

@media (max-width: 650px) {
  body { padding-bottom: 66px; }
  .topbar { height: 60px; padding: 0 12px; }
  .brand-mark { width: 34px; height: 34px; flex-basis: 34px; border-radius: 10px; }
  .brand-copy b { max-width: 190px; font-size: 12px; }
  .brand-copy small, .user-chip { display: none; }
  .page, .wide-page, .investigation-page, .dashboard-page, .review-page { width: calc(100% - 20px); padding-top: 12px; padding-bottom: 80px; }
  .workspace-hero { min-height: 0; padding: 20px 17px; border-radius: 16px; align-items: flex-start; flex-direction: column; }
  .workspace-hero h1 { font-size: 28px; }
  .workspace-hero p:not(.eyebrow) { font-size: 11px; }
  .hero-actions { width: 100%; justify-content: space-between; }
  .workflow-sidebar { grid-template-columns: 1fr; }
  .section-nav { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); overflow: visible; padding: 7px; }
  .section-nav > p { display: none; }
  .section-nav a { min-width: 0; padding: 9px; align-items: center; }
  .section-nav a:last-child { grid-column: 1 / -1; }
  .section-nav a small { display: none; }
  .progress-card { display: block; }
  .workflow-overview { display: none; }
  .panel { border-radius: 13px; margin-bottom: 12px; }
  .panel-head { padding: 14px; align-items: flex-start; }
  .panel-head h2 { font-size: 15px; }
  .provider-chip { display: none; }
  .form-grid { grid-template-columns: 1fr; gap: 12px; padding: 13px; }
  .field.wide { grid-column: auto; }
  .field input, .field select, .field textarea { min-height: 46px; font-size: 14px; }
  .field textarea { min-height: 88px; }
  .capture-head { top: 60px; }
  .capture-summary { grid-template-columns: auto 1fr; padding: 11px 13px; }
  .capture-summary small { grid-column: 1 / -1; }
  .capture-category { padding: 13px; }
  .capture-category-head { align-items: flex-start; }
  .capture-category-head > span { display: none; }
  .capture-card { padding: 13px; }
  .capture-actions { flex-direction: column; }
  .capture-actions .button { min-height: 43px; }
  .evidence-grid-capture { grid-template-columns: 1fr; }
  .submit-bar { bottom: 70px; width: calc(100% - 8px); padding: 9px; border-radius: 13px; flex-direction: column; align-items: stretch; gap: 9px; }
  .submit-state { display: none; }
  .submit-bar .button { width: 100%; }
  .camera-modal { padding: 0; }
  .camera-dialog { width: 100%; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
  .camera-dialog > header { position: sticky; top: 0; z-index: 8; background: #0b1727; }
  .camera-instructions .capture-card-checklist { grid-template-columns: 1fr; }
  .camera-stage { min-height: 54vh; aspect-ratio: 3 / 4; }
  .camera-guide { left: 3%; width: 94%; }
  .camera-guide[data-kind="evidence"] { width: 92%; height: auto; }
  .quality-panel { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .camera-controls { justify-content: space-between; gap: 8px; }
  .camera-controls .button { min-width: 0; padding: 8px; font-size: 9px; }
  .shutter { width: 62px; height: 62px; flex-basis: 62px; }
  .dashboard-copy { padding: 27px 20px; }
  .dashboard-copy h1 { font-size: 40px; }
  .dashboard-strip { padding: 11px 15px; gap: 12px; }
  .dashboard-strip b { display: none; }
  .report-card { grid-template-columns: 38px minmax(0,1fr) auto; gap: 9px; padding: 12px; }
  .report-card time, .report-card .open-arrow { display: none; }
  .stats-grid { gap: 8px; }
  .stats-grid article { padding: 13px; }
  .stats-grid strong { font-size: 24px; }
  .bottom-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; display: grid; grid-template-columns: repeat(4,1fr); padding: 7px max(8px, env(safe-area-inset-left)) calc(7px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(16px); }
  .dock-item { display: grid; place-items: center; gap: 2px; color: #66768a; font-size: 15px; }
  .dock-item b { font-size: 8px; }
  .dock-primary span { display: grid; place-items: center; width: 35px; height: 28px; border-radius: 9px; background: var(--brand); color: #fff; }
  .footer { display: none; }
  .summary-section dl { grid-template-columns: 1fr; }
  .summary-section dt { border-bottom: 0; padding-bottom: 2px; }
  .summary-section dd { padding-top: 3px; }
  .processing-page { min-height: calc(100vh - 126px); }
  .processing-stage { min-height: 500px; padding: 28px 17px; }
  .processing-steps { grid-template-columns: 1fr; }
  .processing-steps span { display: none; }
  .processing-steps span.active:last-of-type { display: block; }
  .login-shell { padding: 0; }
  .login-stage { min-height: 100vh; border: 0; border-radius: 0; }
  .login-card { min-height: 100vh; padding: 30px 22px; }
  .print-page { padding: 0; }
  .legacy-report { border-width: 1px; }
  .legacy-report > h1 { font-size: 17px; }
  .legacy-table th, .legacy-table td { padding: 2px; font-size: 9px; }
  .legacy-photos img { height: 85px; }
}

@media print {
  body { padding: 0; background: #fff; }
  .print-toolbar, .footer, .bottom-dock { display: none !important; }
  .print-page { padding: 0; }
  .legacy-report { width: 100%; max-width: none; border: 2px solid #000; box-shadow: none; }
  .legacy-photo-section { break-inside: avoid; }
  .legacy-photos img { max-height: 125px; }
  @page { size: A4 portrait; margin: 7mm; }
}
