:root {
    --ink: #17211f;
    --muted: #66716d;
    --line: #d8dfdc;
    --bg: #f6f8f7;
    --panel: #ffffff;
    --accent: #166b68;
    --accent-2: #c05b3f;
    --amber: #af751b;
    --green: #2f7a4f;
    --red: #aa3b35;
    --nav: #f0f5f3;
    --nav-active: #dcebe7;
    --shadow: 0 14px 32px rgba(30, 49, 45, .07);
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    letter-spacing: 0;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 236px 1fr; }
.sidebar { background: #ffffff; border-right: 1px solid var(--line); padding: 18px 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; color: #123a38; }
.brand-mark { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: #123a38; color: #fff; font-weight: 900; letter-spacing: 0; }
.brand-title { font-weight: 850; font-size: 18px; line-height: 1.05; }
.brand-subtitle { font-size: 11px; color: var(--muted); margin-top: 2px; }
.nav { display: grid; gap: 6px; }
.nav a, .nav button {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--ink);
    text-align: left;
    padding: 10px 11px;
    border-radius: 8px;
    font: inherit;
    cursor: pointer;
}
.nav a:hover, .nav button:hover { background: var(--nav); text-decoration: none; }
.nav a.active { background: var(--nav-active); color: #123a38; font-weight: 800; }
.nav-dot { width: 8px; height: 8px; border-radius: 999px; background: #b7c4bf; flex: 0 0 auto; }
.nav a.active .nav-dot { background: var(--accent); }
.main { padding: 24px 28px 42px; min-width: 0; }
.auth-main { max-width: 520px; margin: 0 auto; }
.topbar, .page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.topbar.compact { margin-bottom: 10px; }
.topbar .actions, .page-header .actions { justify-content: flex-end; }
h1 { font-size: 28px; line-height: 1.15; margin: 0; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 14px; }
.grid.stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid.two { grid-template-columns: minmax(0, 1fr) minmax(360px, .72fr); align-items: start; }
.panel, .stat, .table-wrap {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    min-width: 0;
    max-width: 100%;
}
.panel { padding: 16px; }
.narrow-panel { max-width: 680px; }
.table-wrap { overflow-x: auto; }
.table-wrap table { min-width: 620px; }
.stat { padding: 16px; min-height: 96px; position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; inset: auto 14px 14px auto; width: 44px; height: 4px; border-radius: 999px; background: var(--accent); opacity: .36; }
.stat.review::after { background: var(--amber); }
.stat.quarantine::after { background: #7c6a55; }
.stat.alerts::after { background: var(--accent-2); }
.stat.duplicates::after { background: var(--red); }
.stat strong { display: block; font-size: 30px; line-height: 1; margin-top: 10px; }
.stat small { display: block; color: var(--muted); margin-top: 8px; line-height: 1.35; }
.status-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.kicker { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; margin-bottom: 6px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
th { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
input, select, textarea {
    width: 100%;
    border: 1px solid #cbd5d1;
    border-radius: 8px;
    padding: 9px 10px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}
textarea { min-height: 84px; resize: vertical; }
label { display: grid; gap: 6px; font-weight: 700; font-size: 12px; color: #3c4743; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.export-gate-form { display: grid; gap: 8px; align-items: start; }
.topbar .export-gate-form .actions { justify-content: flex-start; }
.readiness-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: #3c4743;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}
.checkbox-row input[type="checkbox"] {
    width: 16px;
    min-width: 16px;
    height: 16px;
    margin: 1px 0 0;
}
.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}
.checkbox-inline input[type="checkbox"] { width: auto; flex: 0 0 auto; }
.button {
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    padding: 9px 12px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    min-height: 38px;
}
.button.secondary { background: #fff; color: var(--accent); }
.button.ghost { background: #f8fbfa; color: var(--ink); border-color: var(--line); }
.button.warn { background: var(--accent-2); border-color: var(--accent-2); }
.button:disabled { opacity: .55; cursor: not-allowed; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 8px; font-size: 12px; font-weight: 700; background: #edf2f0; color: #34403c; }
.badge.high, .badge.critical { background: #f9e1dd; color: var(--red); }
.badge.medium { background: #f7ead3; color: var(--amber); }
.badge.low { background: #e6f1ea; color: var(--green); }
.notice { padding: 11px 12px; border-radius: 8px; background: #e6f1ea; color: #245a3c; border: 1px solid #bcd7c7; margin-bottom: 14px; }
.errors { padding: 11px 12px; border-radius: 8px; background: #f9e1dd; color: var(--red); border: 1px solid #e8b6af; margin-bottom: 14px; }
.document-layout { display: grid; grid-template-columns: minmax(0, .95fr) minmax(420px, 1fr); gap: 14px; align-items: start; }
.evidence-box { white-space: pre-wrap; max-height: 620px; overflow: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.55; background: #fbfcfc; border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.field-card { padding: 8px 0; border-bottom: 1px solid var(--line); }
.field-card:last-child { border-bottom: 0; }
.field-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 70px 88px; gap: 8px; align-items: center; }
.field-evidence {
    margin: 7px 0 0 170px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.document-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.summary-tile {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    display: grid;
    gap: 6px;
}
.summary-tile span { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.summary-tile strong { font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.blocker-summary { margin-bottom: 14px; }
.blocker-overview {
    display: grid;
    grid-template-columns: minmax(220px, .62fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}
.blocker-overview strong { display: block; font-size: 18px; line-height: 1.25; margin-bottom: 8px; }
.blocker-list { display: grid; gap: 10px; }
.blocker-row {
    padding: 0 0 10px;
    border-bottom: 1px solid var(--line);
    display: grid;
    gap: 7px;
}
.blocker-row:last-of-type { border-bottom: 0; padding-bottom: 0; }
.document-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.document-menu a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
    padding: 8px 10px;
    color: var(--ink);
    font-weight: 800;
}
.document-menu a:hover { background: var(--nav); text-decoration: none; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-heading h2 { margin-bottom: 0; }
.section-heading .muted { max-width: 560px; }
.field-group {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
    background: #fbfcfc;
    min-width: 0;
}
.field-group h3 { color: #2e3a36; margin-bottom: 4px; }
.finding-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #fff;
    display: grid;
    gap: 8px;
}
.finding-card + .finding-card { margin-top: 10px; }
.finding-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.safe-action {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #f7faf9;
    border: 1px solid var(--line);
    color: #34403c;
    font-weight: 700;
    overflow-wrap: anywhere;
}
.review-explainer {
    border: 1px solid #c9d9d5;
    border-radius: 8px;
    padding: 12px;
    background: #f8fbfa;
}
.explanation-list { display: grid; gap: 10px; }
.explanation-item {
    border-top: 1px solid var(--line);
    padding-top: 10px;
    display: grid;
    gap: 8px;
}
.explanation-item:first-child { border-top: 0; padding-top: 0; }
.explanation-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.explanation-grid p {
    margin: 5px 0 0;
    color: var(--muted);
    line-height: 1.45;
}
.source-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #fff;
    display: grid;
    gap: 6px;
}
.triage-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.triage-strip strong { margin-right: 4px; }
.triage-strip a:hover { text-decoration: none; }
.alert-summary {
    min-width: 220px;
    display: grid;
    gap: 6px;
}
.alert-rules {
    font-weight: 800;
    color: #2e3a36;
    overflow-wrap: anywhere;
}
.alert-compact {
    display: grid;
    gap: 6px;
}
.disclosure { padding: 0; overflow: hidden; }
.disclosure summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    font-weight: 800;
}
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::after { content: "+"; color: var(--accent); font-size: 18px; line-height: 1; }
.disclosure[open] summary { border-bottom: 1px solid var(--line); }
.disclosure[open] summary::after { content: "-"; }
.disclosure-body { padding: 14px 16px 16px; }
.technical-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pagination { margin-top: 14px; }
.footer-note { margin-top: 28px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.compact-list { display: grid; gap: 10px; }
.compact-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.compact-item:last-child { border-bottom: 0; }
.empty-state { padding: 22px; display: grid; gap: 10px; color: var(--muted); }
.empty-state strong { color: var(--ink); font-size: 16px; }
.workflow-band {
    margin: 16px 0 14px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}
.workflow-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.workflow-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.step-card {
    min-height: 116px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 13px;
    display: grid;
    gap: 8px;
    color: var(--ink);
}
.step-card:hover { text-decoration: none; border-color: #9db7af; box-shadow: 0 8px 18px rgba(30, 49, 45, .06); }
.step-card strong { font-size: 15px; }
.step-card span { color: var(--muted); }
.step-index { width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center; background: var(--nav-active); color: var(--accent); font-weight: 900; }
.section-gap { margin-top: 14px; }
.section-bottom { margin-bottom: 14px; }
.stack-tight { display: grid; gap: 8px; }
.export-panel { margin-top: 14px; }
.metric-strip { display: grid; grid-template-columns: repeat(5, minmax(110px, 1fr)); gap: 10px; }
.metric-card {
    min-height: 78px;
    display: grid;
    align-content: space-between;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbfa;
}
.metric-card span { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.metric-card strong { color: var(--ink); font-size: 28px; line-height: 1; }
a.metric-card { color: var(--ink); text-decoration: none; }
a.metric-card:hover { border-color: #9db7af; box-shadow: 0 8px 18px rgba(30, 49, 45, .06); }
.risk-summary .metric-strip { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
.search-filters summary .muted {
    font-size: 13px;
    font-weight: 600;
    text-transform: none;
}
.saved-views {
    border-top: 1px solid var(--line);
    padding-top: 12px;
    display: grid;
    gap: 10px;
}
.saved-view-list { display: flex; flex-wrap: wrap; gap: 8px; }
.saved-view-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.saved-view-chip a { font-weight: 800; }
.saved-view-chip button {
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    padding: 4px;
}
.saved-view-chip button:hover { color: var(--red); }
.saved-view-form {
    display: grid;
    grid-template-columns: minmax(180px, 320px) auto;
    gap: 8px;
    align-items: end;
}
.category-metrics { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-summary { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }
.feedback-list { display: grid; gap: 12px; }
.feedback-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    gap: 14px;
    align-items: start;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(33, 48, 44, .04);
}
.feedback-main { min-width: 0; display: grid; gap: 10px; }
.feedback-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; color: var(--muted); font-size: 12px; }
.feedback-title-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; }
.feedback-message { margin: 0; font-size: 15px; line-height: 1.55; }
.feedback-route {
    max-width: 100%;
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}
.feedback-triage {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbfa;
}
@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
    .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid.stats, .grid.two, .document-layout, .form-grid, .document-summary, .blocker-overview, .technical-grid, .readiness-grid, .explanation-grid, .metric-strip, .feedback-card { grid-template-columns: 1fr; }
    .workflow-steps { grid-template-columns: 1fr; }
    .main { padding: 18px; }
    .field-row { grid-template-columns: 1fr; }
    .field-evidence { margin-left: 0; }
    .saved-view-form { grid-template-columns: 1fr; }
    .topbar, .page-header { align-items: flex-start; flex-direction: column; }
    .section-heading { flex-direction: column; }
    .topbar .actions, .page-header .actions { justify-content: flex-start; }
    th, td { padding: 12px; }
    .button, .nav a, .nav button, table a, .compact-item a { min-height: 44px; align-items: center; }
    table a, .compact-item a { display: inline-flex; }
    .checkbox-row { min-height: 44px; align-items: center; }
}
