/* IOP CRM — application styles.  No external fonts or scripts: everything the
   browser loads comes from this server (Content-Security-Policy: self). */

:root {
  --bg: #f1f0eb;
  --surface: #ffffff;
  --surface-2: #f8f7f3;
  --ink: #1c2420;
  --ink-2: #4a524d;
  --muted: #7a827c;
  --line: #dddad2;
  --line-2: #ecebe5;
  --green: #1f5a46;
  --green-2: #17483a;
  --green-soft: #e3efe9;
  --green-ink: #174a39;
  --ok: #2e8b6a;
  --ok-soft: #e2f1ea;
  --warn: #b7791f;
  --warn-soft: #fbf1dd;
  --bad: #b4372c;
  --bad-soft: #f9e5e2;
  --info: #2f6fa3;
  --info-soft: #e3eef7;
  --violet: #6b4fa0;
  --violet-soft: #ece6f6;
  --focus: #2f6fa3;
  --radius: 8px;
  --radius-sm: 5px;
  --shadow: 0 1px 2px rgba(28, 36, 32, 0.06), 0 1px 0 rgba(28, 36, 32, 0.03);
  --sidebar: 228px;
  --font: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.45; font-variant-numeric: tabular-nums; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 20px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0 0 8px; }
small, .muted { color: var(--muted); }
.muted { font-size: 12.5px; }
code, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ----- layout -------------------------------------------------------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { padding: 18px 18px 14px; border-bottom: 1px solid var(--line-2); }
.brand .name { font-weight: 700; font-size: 15px; display: block; color: var(--ink); }
.brand .tag { color: var(--muted); font-size: 12px; }
.nav { padding: 10px 10px; flex: 1; overflow-y: auto; }
.nav .group { margin: 10px 8px 4px; font-size: 11.5px; color: var(--muted); text-transform: none; letter-spacing: 0; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.nav a.active { background: var(--green-soft); color: var(--green-ink); }
.nav a svg { width: 16px; height: 16px; flex: none; opacity: 0.8; }
.nav .count { margin-left: auto; font-size: 11.5px; background: var(--surface-2); color: var(--ink-2); padding: 1px 7px; border-radius: 10px; }
.nav a.active .count { background: #fff; }
.userbox { border-top: 1px solid var(--line-2); padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.userbox .who { min-width: 0; flex: 1; }
.userbox .who strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userbox .who span { font-size: 12px; color: var(--muted); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--green-soft); color: var(--green-ink); font-weight: 600; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.avatar.lg { width: 44px; height: 44px; font-size: 16px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 14px 28px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar h1 { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .crumbs { font-size: 12.5px; color: var(--muted); display: block; font-weight: 400; margin-bottom: 1px; }
.topbar .crumbs a { color: var(--muted); }
.topbar .actions { flex-wrap: nowrap; }
.search-form { display: flex; gap: 6px; flex-wrap: nowrap; }
.content { padding: 22px 28px 60px; }
.content.narrow { max-width: 820px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
@media (max-width: 1180px) { .detail { grid-template-columns: 1fr; } }

/* ----- cards -------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.tint { background: var(--surface-2); }
.card-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.card-head h2, .card-head h3 { flex: 1; }
.card-body { padding: 16px; }
.card-body.flush { padding: 0; overflow-x: auto; }
.section + .section { border-top: 1px solid var(--line-2); }

/* ----- buttons ------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; line-height: 1.2; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-2); }
.btn-danger { color: var(--bad); border-color: #e8c7c3; }
.btn-danger:hover { background: var(--bad-soft); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--green); }
.btn-ghost:hover { background: var(--green-soft); }
.btn-sm { padding: 4px 9px; font-size: 12.5px; }
.btn-icon { padding: 6px; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn-link { background: none; border: 0; padding: 0; color: var(--green); font: inherit; cursor: pointer; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--bad); }

/* ----- tiles --------------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden; }
.tile { padding: 14px 18px; border-right: 1px solid var(--line-2); min-width: 0; }
.tile:last-child { border-right: 0; }
.tile .label { font-size: 12.5px; color: var(--muted); display: block; margin-bottom: 3px; }
.tile .value { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.tile .value.bad { color: var(--bad); }
.tile .value.warn { color: var(--warn); }
.tile .value.ok { color: var(--ok); }
.tile .sub { font-size: 12px; color: var(--muted); margin-top: 2px; display: block; }
.tile a { color: inherit; }

/* ----- filters & tables ---------------------------------------------- */
.filters { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin-bottom: 14px; }
.filters .field { margin: 0; min-width: 150px; }
.filters .field.grow { flex: 1; min-width: 220px; }
.filters .actions { display: flex; gap: 8px; }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 10px 14px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line-2); }
.table th { font-weight: 600; color: var(--ink-2); font-size: 12.5px; background: var(--surface-2); white-space: nowrap; }
.table th a { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.table th a:hover { text-decoration: none; color: var(--ink); }
.table th .dir { font-size: 10px; opacity: 0.6; }
.table tbody tr:hover { background: #fbfaf7; }
.table tbody tr[data-href] { cursor: pointer; }
.table td.num, .table th.num { text-align: right; }
.table td.actions { text-align: right; white-space: nowrap; }
.table .name { font-weight: 500; color: var(--ink); display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.table tr.warn-row td { background: #fffaf0; }
.table tr.bad-row td { background: #fff5f4; }
.table-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.pagination { display: flex; align-items: center; gap: 4px; }
.pagination a, .pagination span.cur { padding: 4px 9px; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 12.5px; }
.pagination span.cur { border-color: var(--green); color: var(--green); font-weight: 600; }
.pagination a:hover { text-decoration: none; background: var(--surface-2); }
.pagination .ellipsis { padding: 0 4px; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink-2); margin-bottom: 4px; font-weight: 600; }

/* ----- status ----------------------------------------------------- */
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.status.ok::before, .status.completed::before, .status.admitted::before, .status.current::before, .status.paid::before, .status.approved::before { background: var(--ok); }
.status.warn::before, .status.pending::before, .status.in_progress::before, .status.in_review::before, .status.assigned::before, .status.processed::before, .status.partial::before, .status.submitted::before, .status.open::before, .status.appeal::before, .status.appealed::before { background: var(--warn); }
.status.bad::before, .status.canceled::before, .status.denied::before, .status.expired::before, .status.exhausted::before, .status.inactive::before { background: var(--bad); }
.status.info::before, .status.discharged::before, .status.closed::before, .status.inquiry::before, .status.scheduled::before { background: var(--info); }
.status.hold_off::before { background: var(--violet); }
.chip { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip.green { background: var(--green-soft); color: var(--green-ink); }

/* ----- forms -------------------------------------------------------- */
.field { margin-bottom: 14px; min-width: 0; }
.field label { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 4px; }
.field .help { font-size: 12px; color: var(--muted); margin-top: 3px; }
.field .error { font-size: 12.5px; color: var(--bad); margin-top: 3px; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--bad); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], input[type="url"], input[type="tel"], select, textarea {
  width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; line-height: 1.3;
}
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: 2px solid rgba(47, 111, 163, 0.18); outline-offset: 0; }
textarea { resize: vertical; min-height: 70px; }
select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a827c' stroke-width='2.5'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 9px center; padding-right: 28px; }
input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--green); vertical-align: -2px; margin-right: 6px; }
.check { display: flex; align-items: center; gap: 4px; font-size: 13px; padding-top: 22px; }
.check label { margin: 0; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: span 3; }
.form-grid .span-all { grid-column: 1 / -1; }
@media (max-width: 900px) { .form-grid, .form-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .form-grid, .form-grid.cols-2, .form-grid.cols-4 { grid-template-columns: 1fr; } .form-grid .span-2, .form-grid .span-3 { grid-column: auto; } }
.form-actions { display: flex; gap: 10px; align-items: center; padding-top: 10px; border-top: 1px solid var(--line-2); margin-top: 6px; }
.form-actions .spacer { flex: 1; }
.form-section { padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.form-section:last-child { border-bottom: 0; }
.form-section h3 { margin-bottom: 12px; font-size: 13px; color: var(--green-ink); }
.nonfield { background: var(--bad-soft); color: var(--bad); padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 13px; }
ul.errorlist { margin: 0; padding: 0; list-style: none; }
.file-input { display: flex; align-items: center; gap: 10px; }
.file-input input[type="file"] { font-size: 12.5px; }
.inline-form { display: inline; }

/* ----- messages ----------------------------------------------------- */
.messages { padding: 0 28px; }
.alert { padding: 10px 14px; border-radius: var(--radius-sm); margin: 14px 0 0; font-size: 13px; border: 1px solid transparent; display: flex; gap: 10px; align-items: flex-start; }
.alert.success { background: var(--ok-soft); color: #1f5f48; border-color: #cfe6da; }
.alert.info { background: var(--info-soft); color: #1f4d75; border-color: #cddff0; }
.alert.warning { background: var(--warn-soft); color: #7a4f0e; border-color: #f0dcb4; }
.alert.error { background: var(--bad-soft); color: #7c2219; border-color: #efc9c4; }
.alert svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.alert .close { margin-left: auto; background: none; border: 0; cursor: pointer; color: inherit; font-size: 16px; line-height: 1; padding: 0 2px; }

/* ----- definition lists / facts --------------------------------------- */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px 20px; }
.facts.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fact .k { font-size: 11.5px; color: var(--muted); display: block; margin-bottom: 1px; }
.fact .v { font-weight: 500; word-break: break-word; }
.fact .v.big { font-size: 15px; }
.kv { width: 100%; font-size: 13px; border-collapse: collapse; }
.kv th { text-align: left; font-weight: 500; color: var(--muted); padding: 5px 12px 5px 0; width: 40%; vertical-align: top; }
.kv td { padding: 5px 0; vertical-align: top; }
.kv tr + tr th, .kv tr + tr td { border-top: 1px solid var(--line-2); }

/* ----- profile header & coverage meter --------------------------------- */
.profile-head { display: flex; gap: 18px; align-items: flex-start; padding: 18px; }
.profile-head .title h1 { font-size: 22px; }
.profile-head .meta { color: var(--muted); font-size: 13px; margin-top: 2px; display: flex; gap: 14px; flex-wrap: wrap; }
.profile-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.coverage { background: var(--surface-2); border-top: 1px solid var(--line-2); padding: 14px 18px; display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 18px; align-items: center; }
@media (max-width: 900px) { .coverage { grid-template-columns: 1fr 1fr; } }
.coverage .k { font-size: 11.5px; color: var(--muted); display: block; }
.coverage .v { font-weight: 600; font-size: 15px; }
.meter { margin-top: 6px; }
.meter .bar { height: 7px; border-radius: 4px; background: #e4e1d9; overflow: hidden; }
.meter .fill { height: 100%; background: var(--green); border-radius: 4px; }
.meter .fill.full { background: var(--ok); }
.meter .legend { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.coverage .none { color: var(--muted); font-weight: 400; font-size: 13px; }

/* ----- stepper --------------------------------------------------------- */
.stepper { display: flex; align-items: flex-start; padding: 14px 10px 10px; overflow-x: auto; }
.step { flex: 1; min-width: 96px; position: relative; text-align: left; padding: 0 10px; }
.step::before { content: ""; position: absolute; left: 10px; right: -10px; top: 9px; height: 2px; background: var(--line); }
.step:last-child::before { right: 10px; }
.step.done::before { background: var(--green); }
.step .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); background: #fff; position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; }
.step.done .dot { border-color: var(--green); background: var(--green); color: #fff; }
.step.current .dot { box-shadow: 0 0 0 4px var(--green-soft); }
.step.canceled .dot { border-color: var(--bad); background: var(--bad); color: #fff; }
.step .dot svg { width: 11px; height: 11px; }
.step .lbl { display: block; font-size: 12.5px; font-weight: 600; margin-top: 6px; color: var(--ink-2); }
.step.done .lbl { color: var(--ink); }
.step .when { display: block; font-size: 11px; color: var(--muted); }

/* ----- rail (comments / attachments / activity / notes) ----------------- */
.rail .tabs { display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--line-2); }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 11px 10px; font: inherit; font-weight: 500; color: var(--ink-2); cursor: pointer; margin-bottom: -1px; }
.tabs button.active { color: var(--green-ink); border-bottom-color: var(--green); }
.tabs button .n { font-size: 11px; color: var(--muted); margin-left: 4px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.feed { max-height: 520px; overflow-y: auto; }
.feed-item { padding: 12px 14px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.feed-item .who { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.feed-item .who strong { color: var(--green-ink); font-size: 12.5px; }
.feed-item .who .ctx { font-size: 11px; color: var(--muted); }
.feed-item .body { white-space: pre-wrap; word-break: break-word; }
.feed-item .body.important { background: #fff7d6; border-left: 3px solid var(--warn); padding: 6px 8px; border-radius: 3px; }
.feed-item .when { font-size: 11.5px; color: var(--muted); margin-top: 4px; display: flex; gap: 10px; align-items: center; }
.feed-item .when form { display: inline; }
.composer { padding: 12px 14px; border-top: 1px solid var(--line-2); background: var(--surface-2); }
.composer textarea { min-height: 62px; }
.composer .row { margin-top: 8px; }
.attachment { display: flex; align-items: center; gap: 10px; }
.attachment .icon { width: 30px; height: 30px; border-radius: 6px; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; flex: none; }
.attachment .meta { min-width: 0; flex: 1; }
.attachment .meta a { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.activity .change { display: block; font-size: 12px; color: var(--ink-2); }
.activity .change b { font-weight: 500; color: var(--ink); }

/* ----- dropdown -------------------------------------------------------- */
.dropdown { position: relative; display: inline-block; }
.dropdown .menu { display: none; position: absolute; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(28, 36, 32, 0.12); min-width: 200px; z-index: 20; padding: 6px; }
.dropdown.open .menu { display: block; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 7px 10px; border: 0; background: none; font: inherit; color: var(--ink); border-radius: 4px; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--surface-2); text-decoration: none; }
.menu .sep { height: 1px; background: var(--line-2); margin: 5px 0; }
.menu .danger { color: var(--bad); }

/* ----- auth pages ----------------------------------------------------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.auth .box { width: 100%; max-width: 400px; }
.auth .card-body { padding: 26px; }
.auth h1 { font-size: 20px; margin-bottom: 4px; }
.auth .lead { color: var(--muted); margin-bottom: 18px; }
.auth .brandline { text-align: center; margin-bottom: 18px; color: var(--ink-2); font-weight: 600; }
.auth .btn-primary { width: 100%; justify-content: center; padding: 10px; }
.qr { display: flex; justify-content: center; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin: 12px 0; }
.qr svg { width: 224px; height: 224px; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; letter-spacing: 0.04em; padding: 14px; background: var(--surface-2); border-radius: var(--radius-sm); }
.manual-key { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; letter-spacing: 0.06em; background: var(--surface-2); padding: 8px 10px; border-radius: 4px; display: inline-block; }

/* ----- utilities (no inline styles: the CSP forbids them) --------------- */
.center { text-align: center; }
.inherit { color: inherit; }
.w-auto { width: auto; }
.w-220 { width: 220px; }
.maxw-220 { max-width: 220px; }
.maxw-260 { max-width: 260px; }
.maxw-300 { max-width: 300px; }
.pt-0 { padding-top: 0; }
.py-10 { padding: 10px 0; }
.gap-6 { gap: 6px; }
.gap-10 { gap: 0 10px; }
.col-all { grid-column: 1 / -1; }
.col-span-3 { grid-column: span 3; }
.pre { white-space: pre-wrap; }
.fw-400 { font-weight: 400; }

/* ----- misc --------------------------------------------------------- */
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 9px 0; border-bottom: 1px solid var(--line-2); display: flex; gap: 10px; align-items: center; }
.list-plain li:last-child { border-bottom: 0; }
.list-plain .grow { flex: 1; min-width: 0; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.critical li { margin-bottom: 6px; }
.critical .q { color: var(--ink-2); }
.critical .a { font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
details.collapse > summary { cursor: pointer; list-style: none; padding: 12px 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
details.collapse > summary::-webkit-details-marker { display: none; }
details.collapse > summary::before { content: "›"; display: inline-block; transition: transform 0.15s; color: var(--muted); width: 10px; }
details.collapse[open] > summary::before { transform: rotate(90deg); }
.report-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.report-cards a.card { display: block; padding: 16px; color: inherit; }
.report-cards a.card:hover { text-decoration: none; border-color: var(--green); }
.report-cards .card h3 { margin-bottom: 4px; color: var(--green-ink); }
.print-only { display: none; }
@media print { .sidebar, .topbar .actions, .rail, .composer, .btn, .filters { display: none !important; } .app { display: block; } .content { padding: 0; } }
@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .nav .group { width: 100%; }
  .content { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .messages { padding: 0 16px; }
}
