/* Tokens from docs/brand.md (D-50). Amber is the agreed extension for review states (D-25). */
:root {
  --axmed-navy: #261c7a;
  --axmed-cyan: #0cc4ff;
  --axmed-magenta: #e6007e;
  --ink: #1b1b1f;
  --ink-muted: #5c5c66;
  --paper: #ffffff;
  --line: #e2e2e8;
  --amber: #b76e00;
  --green: #1d7a3e;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--font); }
main.page { max-width: 1200px; margin: 0 auto; padding: 24px 16px; }
h1 { font-size: 1.5rem; margin: 0 0 16px; }
a { color: var(--axmed-navy); }
button, input { font: inherit; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--axmed-navy); color: #fff; }
.topbar .brand { color: #fff; text-decoration: none; display: flex; gap: 10px; align-items: baseline; }
.topbar .wordmark { font-weight: 700; letter-spacing: 0.02em; }
.topbar .app-name { opacity: 0.85; }
.topnav { display: flex; gap: 16px; align-items: center; }
.topnav .whoami { opacity: 0.85; }
.linklike { background: none; border: 0; color: #fff; text-decoration: underline; cursor: pointer; padding: 0; }
.demo-note { margin: 0; padding: 6px 16px; background: #f3f2fb; color: var(--ink-muted); font-size: 0.9rem; border-bottom: 1px solid var(--line); }
.login-page main.page { max-width: 420px; padding-top: 12vh; }
.login-card { border: 1px solid var(--line); border-radius: 8px; padding: 24px; }
.login-card label { display: block; margin: 12px 0 4px; font-weight: 600; }
.login-card input[type="text"], .login-card input[type="password"] { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }
.login-card input:focus, button:focus-visible { outline: 3px solid var(--axmed-cyan); outline-offset: 2px; }
button.primary { margin-top: 16px; width: 100%; padding: 10px; background: var(--axmed-navy); color: #fff; border: 0; border-radius: 6px; cursor: pointer; }
.form-error { color: var(--axmed-magenta); font-weight: 600; }
.empty-state { color: var(--ink-muted); border: 1px dashed var(--line); border-radius: 8px; padding: 24px; }
.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.msg { padding: 8px 12px; border-radius: 6px; border: 1px solid var(--line); }
.msg-error { border-color: var(--axmed-magenta); }
.msg-success { border-color: var(--green); }

/* Layout */
.card { border: 1px solid var(--line); border-radius: 8px; padding: 16px 20px; margin-bottom: 24px; }
.card h2, section h2 { font-size: 1.1rem; margin: 0 0 12px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row .grow { flex: 1 1 240px; }
.crumbs { color: var(--ink-muted); margin: 0 0 8px; }
.muted { color: var(--ink-muted); }
.small { font-size: 0.85rem; }
.hint { color: var(--ink-muted); font-size: 0.9rem; }
code { font-size: 0.85em; background: #f3f2fb; padding: 1px 4px; border-radius: 3px; }
/* Forms */
label { display: block; margin: 12px 0 4px; font-weight: 600; }
input[type="text"], input[type="date"], input[type="file"] { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; width: 100%; }
button.narrow, a.button { width: auto; display: inline-block; margin-top: 16px; padding: 10px 16px; background: var(--axmed-navy); color: #fff; border: 0; border-radius: 6px; text-decoration: none; cursor: pointer; }
a.button.secondary { background: #fff; color: var(--axmed-navy); border: 1px solid var(--axmed-navy); }
.actions { display: flex; gap: 12px; }
/* Tables */
.table-scroll { overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: 0.85rem; color: var(--ink-muted); font-weight: 600; }
table.data .num, table.data td.num { text-align: right; }
table.rows td { white-space: nowrap; }
table.evidence tr.cited td { background: #fff7e0; }
table.evidence tr.scope td { background: #eef7ff; }
.tag { font-size: 0.75rem; padding: 1px 6px; border-radius: 10px; background: var(--axmed-navy); color: #fff; }
/* Status labels: colour plus text, never colour alone */
.status { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 0.85rem; border: 1px solid var(--line); }
.status-checks_passed, .status-complete, .status-processed, .status-done { border-color: var(--green); color: var(--green); }
.status-needs_review, .status-partial_failure, .status-running, .status-queued { border-color: var(--amber); color: var(--amber); }
.status-unreadable, .status-failed, .status-failure { border-color: var(--axmed-magenta); color: var(--axmed-magenta); }
.filters a { margin-right: 12px; }
.filters a.active { font-weight: 700; text-decoration: none; }
.filters .right { float: right; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 16px; }
dl.facts dt { color: var(--ink-muted); }
dl.facts dd { margin: 0; }
ul.checks li.ok { color: var(--green); }
ul.checks li.fail { color: var(--axmed-magenta); font-weight: 600; }
ul.findings li.error { color: var(--axmed-magenta); }
ul.findings li.warning { color: var(--amber); }
.warnings { background: #fff7e0; padding: 8px 12px; border-radius: 6px; }
.tag.warn { background: #fff4d6; color: #6b4b00; border: 1px solid #e0b84a; }

/* Review workspace (A8): queue beside detail on desktop, stacked on narrow screens */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 1100px) { .workspace { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; } .detail { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; } }
.filter-bar { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; }
.filter-bar label { margin: 0; font-weight: 600; font-size: 0.85rem; }
.filter-bar select, .filter-bar input[type="search"] { padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; width: auto; font: inherit; }
.filter-bar button.narrow { margin-top: 0; padding: 5px 12px; }
.filter-bar .right { margin-left: auto; }
.bulk-form .actions { align-items: center; }
button.secondary { background: #fff; color: var(--axmed-navy); border: 1px solid var(--axmed-navy); }
table.rows tr.selected td { background: #f3f2fb; }
table.rows tbody tr:focus-within td { outline: 2px solid var(--axmed-cyan); outline-offset: -2px; }
.approval { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.85rem; border: 1px solid var(--line); color: var(--ink-muted); }
.approval-approved { border-color: var(--axmed-navy); color: var(--axmed-navy); font-weight: 600; }
.approval-rejected { border-color: var(--axmed-magenta); color: var(--axmed-magenta); }
.approval-superseded { text-decoration: line-through; }
.detail-head h2 { font-size: 1.25rem; margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.detail-head, .detail-head p, .crumbs, .filter-bar { overflow-wrap: anywhere; min-width: 0; }
.filter-bar input[type="search"], .filter-bar select { max-width: 100%; }
.detail .card { margin-bottom: 16px; }
.detail .two-col { gap: 16px; }
@media (min-width: 1100px) { .detail .two-col { grid-template-columns: minmax(0, 1fr); } }
.detail .card { min-width: 0; overflow-wrap: anywhere; }
.detail table.data { table-layout: auto; }
.detail table.evidence td, .detail table.evidence th { white-space: normal; word-break: break-word; }
.conflict { border: 1px solid var(--axmed-magenta); padding: 8px 12px; border-radius: 6px; }
.state { border-color: var(--amber); }
ul.flags { background: #fff7e0; padding: 8px 12px 8px 28px; border-radius: 6px; margin: 8px 0; }
.snippet { margin: 0 0 12px; }
.snippet img { max-width: 100%; border: 1px solid var(--line); border-radius: 4px; display: block; }
.snippet-text { background: #f7f7fa; border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; white-space: pre-wrap; word-break: break-word; max-height: 240px; overflow: auto; font-size: 0.85rem; }
details.decision { border-top: 1px solid var(--line); padding: 8px 0; }
details.decision summary { cursor: pointer; font-weight: 600; }
details.decision summary:focus-visible { outline: 3px solid var(--axmed-cyan); outline-offset: 2px; }
.decision-form label { margin: 8px 0 2px; font-size: 0.9rem; }
.decision-form input[type="text"], .decision-form textarea { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.decision-form button.narrow { margin-top: 10px; }
.approved-note { margin: 8px 0; }
ol.history, ul.history { padding-left: 20px; margin: 0 0 8px; font-size: 0.9rem; }
ol.history li, ul.history li { margin-bottom: 4px; }
