/* Change Request Tracker — a quiet, paper-form inspired operations UI. */
:root {
  --ink: #0b1f3a;
  --ink-2: #1f3a5f;
  --text: #1d2433;
  --muted: #5d6779;
  --line: #dfe3ea;
  --line-2: #eef1f5;
  --bg: #f5f6f8;
  --paper: #ffffff;
  --accent: #c8781a;       /* signal amber: "your action" */
  --accent-soft: #fdf3e6;
  --ok: #1d7a4d; --ok-soft: #e7f5ee;
  --info: #2457a6; --info-soft: #e9f0fb;
  --warn: #9a6200; --warn-soft: #fff6e0;
  --bad: #b42318; --bad-soft: #fdecea;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .04);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--ink-2); }
a:hover { color: var(--ink); }
h1 { font-size: 24px; line-height: 1.25; margin: 0 0 4px; color: var(--ink); letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 14px; color: var(--ink); }
h3 { font-size: 14px; margin: 0 0 10px; color: var(--ink); }
p { margin: 0 0 10px; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.sub { color: var(--muted); font-size: 12px; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; word-break: break-word; }
.mt { margin-top: 18px; } .mt-s { margin-top: 8px; }
.req { color: var(--bad); }
.nil { color: #9aa3b2; font-style: italic; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; color: var(--muted); margin: 0 0 6px; font-weight: 600; }
[hidden] { display: none !important; }

/* ── Top bar ── */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; padding: 0 24px; height: 60px; background: var(--ink); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: #fff; color: var(--ink); font-weight: 800; font-size: 13px; letter-spacing: .02em; box-shadow: inset 0 -3px 0 var(--accent); }
.brand-mark.lg { width: 46px; height: 46px; font-size: 16px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 14px; } .brand-text small { font-size: 11px; opacity: .7; }
.mainnav { display: flex; gap: 4px; }
.mainnav a { color: rgba(255,255,255,.75); text-decoration: none; padding: 8px 12px; border-radius: 6px; font-weight: 500; }
.mainnav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.mainnav a.on { color: #fff; background: rgba(255,255,255,.14); }
.pill { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; text-align: center; line-height: 18px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.bell { position: relative; color: rgba(255,255,255,.85); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; }
.bell:hover { background: rgba(255,255,255,.1); color: #fff; }
.bell .dot { position: absolute; top: 1px; right: 0; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; border-radius: 8px; padding: 0 4px; line-height: 15px; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; }
.usermenu summary::-webkit-details-marker { display: none; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink-2); color: #fff; font-weight: 700; font-size: 12px; border: 2px solid rgba(255,255,255,.3); }
.menu { position: absolute; right: 0; top: 44px; width: 260px; background: #fff; color: var(--text); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(11,31,58,.18); padding: 6px; border: 1px solid var(--line); }
.menu-head { padding: 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; display: flex; flex-direction: column; }
.menu-head small { color: var(--muted); font-size: 12px; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; color: var(--text); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--bg); }

/* ── Layout ── */
.wrap { max-width: 1320px; margin: 0 auto; padding: 24px; }
.foot { text-align: center; color: #9aa3b2; font-size: 12px; padding: 24px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.row-gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-gap form { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-2.tight, .grid-3.tight { gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-side { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
.self-end { align-self: end; padding-bottom: 8px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; }
.empty { color: var(--muted); padding: 8px 0; margin: 0; }
.empty.pad { padding: 24px; }
.empty-page { text-align: center; padding: 80px 20px; }

/* ── Flash & callouts ── */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-weight: 500; border: 1px solid; }
.flash-ok { background: var(--ok-soft); color: var(--ok); border-color: #bfe3cf; }
.flash-bad { background: var(--bad-soft); color: var(--bad); border-color: #f5c2bd; }
.flash-warn { background: var(--warn-soft); color: var(--warn); border-color: #f2d999; }
.callout { padding: 14px 16px; border-radius: 8px; margin-bottom: 18px; border-left: 4px solid; background: #fff; box-shadow: var(--shadow); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.callout > p, .callout > form { flex-basis: 100%; margin: 6px 0 0; }
.callout-info { border-color: var(--info); background: var(--info-soft); }
.callout-warn { border-color: var(--accent); background: var(--warn-soft); }
.callout-bad { border-color: var(--bad); background: var(--bad-soft); }
.callout form.inline { flex-basis: auto; margin: 0 0 0 auto; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--text); font: 600 13.5px/1.2 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { border-color: #c5ccd8; background: #fafbfc; color: var(--text); }
.btn-primary { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.topbar .btn-primary { background: var(--accent); border-color: var(--accent); }
.topbar .btn-primary:hover { background: #b06814; border-color: #b06814; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: #8f1c13; color: #fff; }
.btn-warn { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-warn:hover { background: #b06814; color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; padding: 11px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.linkbtn.danger { color: var(--bad); }
form.inline { display: inline; margin-left: 10px; }

/* ── Forms ── */
.stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field-label { font-weight: 600; font-size: 13px; color: var(--ink); }
.field-label small { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=time], input[type=datetime-local], input:not([type]), select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #cdd3dd; border-radius: 7px; font: 14px/1.4 var(--font); color: var(--text); background: #fff; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--ink-2); box-shadow: 0 0 0 3px rgba(31,58,95,.15); }
textarea { resize: vertical; }
textarea.code { font: 12.5px/1.55 var(--mono); background: #fbfbfc; tab-size: 2; }
.hint { color: var(--muted); font-size: 12.5px; margin: 5px 0 0; }
.check, .radio { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; cursor: pointer; }
.check input, .radio input { margin-top: 3px; accent-color: var(--ink-2); }
.yesno { display: flex; gap: 18px; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-flex; flex-direction: column; padding: 6px 12px; border: 1px solid #cdd3dd; border-radius: 18px; background: #fff; font-size: 13px; user-select: none; }
.chip span small { color: var(--muted); font-size: 11px; }
.chip input:checked + span { background: var(--ink-2); border-color: var(--ink-2); color: #fff; }
.chip input:checked + span small { color: rgba(255,255,255,.75); }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(31,58,95,.25); }
.chips.people { max-height: 220px; overflow: auto; }
.readonly { padding: 8px 10px; background: var(--line-2); border-radius: 7px; }
.readback-check strong { color: var(--ink); }

/* Paper-form layout: field number gutter */
.form-layout { display: grid; grid-template-columns: 210px 1fr; gap: 24px; align-items: start; }
.form-toc { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; }
.form-toc a { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 7px; color: var(--muted); text-decoration: none; font-weight: 500; }
.form-toc a span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; background: #e6e9ef; color: var(--ink); font-size: 11px; font-weight: 700; }
.form-toc a:hover { background: #fff; color: var(--ink); }
.form-section h2 { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); text-transform: uppercase; letter-spacing: .04em; font-size: 13.5px; }
.sec-letter { display: inline-grid; place-items: center; width: 26px; height: 26px; background: var(--ink); color: #fff; border-radius: 6px; font-size: 13px; }
.frow { display: grid; grid-template-columns: 38px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.frow:last-child { border-bottom: 0; padding-bottom: 0; }
.fno { font: 700 12px/26px var(--mono); color: var(--muted); text-align: right; }
.fno-sm { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 5px; margin-right: 8px; border-radius: 4px; background: var(--line-2); font: 700 11px var(--mono); color: var(--muted); }
.fbody { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.form-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; background: rgba(245,246,248,.92); backdrop-filter: blur(6px); border-top: 1px solid var(--line); margin: 0 -24px; }

/* Read-only field list */
dl.fields { margin: 0; }
dl.fields dt { font-weight: 600; font-size: 12.5px; color: var(--muted); }
dl.fields dd { margin: 0; color: var(--text); }
pre.code { margin: 0; padding: 12px 14px; background: #0f1b2d; color: #e4e9f2; border-radius: 8px; font: 12px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word; max-height: 460px; overflow: auto; }
.yn { margin-right: 4px; } .yn-yes { color: var(--warn); } .yn-no { color: var(--ok); }

/* ── Tags & status ── */
.tag { display: inline-block; padding: 2px 8px; border-radius: 5px; background: var(--line-2); color: var(--ink); font-size: 12px; font-weight: 500; margin: 1px 0; }
.tag-strong { background: var(--ink); color: #fff; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-muted { background: #eef0f3; color: #5d6779; }
.status-info { background: var(--accent-soft); color: #9a5a0f; }
.status-ok { background: var(--ok-soft); color: var(--ok); }
.status-done { background: #e8ecf3; color: var(--ink); }
.status-warn { background: var(--warn-soft); color: var(--warn); }
.status-bad { background: var(--bad-soft); color: var(--bad); }
.ref { font-weight: 600; text-decoration: none; color: var(--ink-2); }

/* ── Tables ── */
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 14px; background: #fafbfc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.card:not(.flush) .table td { padding-left: 0; }
.table tr:last-child td { border-bottom: 0; }
.rowlink { cursor: pointer; }
.rowlink:hover td { background: #fafbfd; }
.clip { max-width: 380px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.clip-sm { max-width: 200px; font-size: 12.5px; }
.clip-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
tr.inactive td { opacity: .55; }
.inline-edit { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 4px 14px; }
.inline-edit input[name=name] { max-width: 260px; }
.inline-edit .grow { flex: 1; min-width: 160px; }

/* ── Dashboard ── */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.stat:hover { border-color: #c5ccd8; }
.stat-n { font-size: 28px; font-weight: 700; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-l { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.stat-alert { border-color: var(--accent); background: var(--accent-soft); }
.stat-alert .stat-n { color: #9a5a0f; }
.timeline-list { list-style: none; padding: 0; margin: 0; }
.timeline-list li { display: grid; grid-template-columns: 110px 1fr; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.timeline-list li:last-child { border-bottom: 0; }
.when { display: flex; flex-direction: column; font-size: 13px; } .when span { color: var(--muted); font-size: 12px; }
ul.plain { padding-left: 18px; margin: 0; } ul.plain li { margin: 4px 0; }

/* ── Filters ── */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters .field { min-width: 140px; }
.filters .grow { flex: 1 1 260px; }
.actions-inline { flex-direction: row; gap: 6px; }

/* ── CR view ── */
.cr-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 20px; flex-wrap: wrap; }
.cr-head h1 { max-width: 820px; font-size: 21px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.meta { color: var(--muted); font-size: 13px; } .meta strong { color: var(--text); }
.wrap-actions form { margin: 0; }

.route { list-style: none; display: flex; padding: 16px 20px; margin: 0 0 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; gap: 0; }
.route li { flex: 1; min-width: 130px; display: flex; gap: 10px; position: relative; padding-right: 10px; }
.route li::after { content: ""; position: absolute; top: 9px; left: 22px; right: 0; height: 2px; background: var(--line); z-index: 0; }
.route li:last-child::after { display: none; }
.route li > div { display: flex; flex-direction: column; position: relative; z-index: 1; background: #fff; padding-right: 8px; margin-top: 22px; margin-left: -20px; }
.route-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #c5ccd8; background: #fff; position: relative; z-index: 1; flex: none; }
.route strong { font-size: 13px; color: var(--ink); }
.route small { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.route li.done .route-dot { background: var(--ok); border-color: var(--ok); box-shadow: inset 0 0 0 3px #fff; }
.route li.done::after { background: var(--ok); }
.route li.now .route-dot { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.route li.now strong { color: #9a5a0f; }
.route li.skip { opacity: .45; }
.route li.skip .route-dot { border-style: dashed; }

.action { border: 2px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.action.pulse { animation: pulse 1.4s ease 2; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px var(--accent-soft); } }
.declaration { background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.declaration p { margin: 0; }
.readback-box { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.readback-box > div { background: #fff; border: 1px solid var(--line); border-radius: 7px; padding: 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.readback-box span { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.readback-box strong { color: var(--ink); font-size: 14px; }
.readback-box small { color: var(--muted); font-size: 12px; }
.missing { list-style: none; padding: 0; margin: 0 0 14px; columns: 2; }
.missing li { padding: 3px 0; break-inside: avoid; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { background: none; border: 0; padding: 9px 14px; font: 600 13.5px var(--font); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.on { color: var(--ink); border-color: var(--ink); }

.sigpad { border: 1px dashed #b8c0cc; border-radius: 8px; padding: 10px; background: #fff; max-width: 580px; }
.sigpad.error { border-color: var(--bad); background: var(--bad-soft); }
.sigpad-label { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.sigpad canvas { display: block; width: 100%; height: 160px; background: linear-gradient(to top, transparent 38px, #cfd5de 38px, #cfd5de 39px, transparent 39px), #fff; touch-action: none; cursor: crosshair; border-radius: 4px; }
.sigpad + .field { max-width: 580px; }

.view-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.view-side { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow: auto; }
.sig-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 14px; }
.sig-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.sig-card.signed { border-color: #bfe3cf; background: #fbfefc; }
.sig-card.na { opacity: .55; }
.sig-title { font-weight: 700; color: var(--ink); display: flex; align-items: center; }
.sig-decl { font-size: 12px; color: var(--muted); margin: 0; }
.sig-card img { max-width: 220px; height: 64px; object-fit: contain; object-position: left; border-bottom: 1px solid var(--line); }
.sig-who { display: flex; flex-direction: column; font-size: 12.5px; } .sig-who span { color: var(--muted); }
.sig-empty { color: #9aa3b2; font-style: italic; padding: 18px 0; }
.sig-inline { display: flex; align-items: center; gap: 12px; } .sig-inline img { height: 44px; }

.files { list-style: none; padding: 0; margin: 0 0 10px; }
.files li { display: flex; flex-direction: column; padding: 7px 0; border-bottom: 1px solid var(--line-2); word-break: break-all; }
.files form { margin: 0; }
.upload { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.upload input[type=file] { font-size: 12.5px; max-width: 100%; }
.people-list { list-style: none; padding: 0; margin: 0; }
.people-list li { padding: 5px 0; display: flex; flex-direction: column; }
.people-list .role { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.comment-form { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; margin-bottom: 14px; }
.activity { list-style: none; padding: 0; margin: 0; }
.activity li { padding: 9px 0 9px 14px; border-left: 2px solid var(--line); position: relative; font-size: 13px; }
.activity li::before { content: ""; position: absolute; left: -5px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: #c5ccd8; }
.activity li.act-signed::before, .activity li.act-locked::before { background: var(--ok); }
.activity li.act-returned::before, .activity li.act-rejected::before { background: var(--bad); }
.activity li.act-comment::before { background: var(--info); }
.activity li.act-submitted::before { background: var(--accent); }
.act-detail { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.activity time { color: #9aa3b2; font-size: 11.5px; }

/* ── Notifications ── */
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list a { display: grid; grid-template-columns: 120px 1fr auto; gap: 14px; padding: 12px 6px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line-2); }
.notif-list li.unread a { font-weight: 600; }
.notif-list li.unread .ref::before { content: "● "; color: var(--accent); }
.notif-list .time { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ── Admin ── */
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.subtabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.subtabs a.on { color: var(--ink); border-color: var(--ink); }
fieldset.field .check { margin: 3px 0; }

/* ── Auth ── */
.auth { min-height: calc(100vh - 120px); display: grid; place-items: center; }
.auth-card.wide { max-width: 560px; }
.auth-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 32px; box-shadow: 0 12px 40px rgba(11,31,58,.08); }
.auth-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.auth-brand h1 { font-size: 19px; margin: 0; } .auth-brand p { margin: 0; color: var(--muted); font-size: 13px; }
.auth-card .brand-mark { background: var(--ink); color: #fff; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .view-layout, .grid-side { grid-template-columns: 1fr; }
  .view-side { position: static; max-height: none; }
  .form-layout { grid-template-columns: 1fr; }
  .form-toc { display: none; }
  .stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .wrap { padding: 16px; }
  .topbar { padding: 0 12px; gap: 10px; }
  .brand-text, .topbar-right .btn { display: none; }
  .mainnav a { padding: 8px; font-size: 13px; }
  .grid-2, .grid-3, .readback-box, .sig-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .frow { grid-template-columns: 26px 1fr; gap: 8px; }
  .missing { columns: 1; }
  .route { flex-direction: column; gap: 10px; }
  .route li { min-width: 0; }
  .route li::after { display: none; }
  .route li > div { margin: 0; flex-direction: row; flex-wrap: wrap; gap: 0 8px; align-items: baseline; }
  .cr-head h1 { font-size: 18px; }
  .form-actions { margin: 0 -16px; }
  .notif-list a { grid-template-columns: 1fr; gap: 2px; }
  .table th, .table td { padding: 9px 10px; }
}

/* ── Roles & access ── */
.role-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.role-box { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.role-name { font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.role-user { display: flex; flex-direction: column; text-decoration: none; padding: 4px 0; border-top: 1px solid var(--line-2); }
.role-user small { color: var(--muted); font-size: 11.5px; }
.card-pad { padding: 18px 20px 8px; }
.matrix th { white-space: normal; min-width: 92px; vertical-align: bottom; }
.matrix th:first-child { min-width: 280px; }
.mcell { text-align: center; }
.matrix .yes { color: var(--ok); font-weight: 700; font-size: 15px; }
.matrix .no { color: #c5ccd8; }
.preset-row { display: flex; gap: 6px; flex-wrap: wrap; }
.copyrow { display: flex; gap: 8px; flex-basis: 100%; margin-top: 8px; }
.copyrow input { font-family: var(--mono); font-size: 12.5px; }

/* Company logo (public/logo.*). The white chip keeps any logo readable on the dark top bar. */
.brand-logo { height: 36px; width: auto; max-width: 150px; object-fit: contain; background: #fff; border-radius: 7px; padding: 3px 6px; flex: none; }
.brand-logo.lg { height: 52px; max-width: 200px; padding: 4px 8px; border: 1px solid var(--line); }
.chip-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.chip-group-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.sec-intro { color: var(--muted); font-size: 13px; margin: 12px 0 0; padding: 10px 12px; background: var(--accent-soft); border-radius: 7px; }

/* Dashboard company table */
.co-table th.num, .co-table td.num { text-align: center; white-space: nowrap; }
.co-table td { vertical-align: middle; }
.card:not(.flush) .co-table td { padding-left: 14px; }
.co-n { display: inline-block; min-width: 30px; padding: 2px 8px; border-radius: 12px; font-weight: 700; text-decoration: none; font-variant-numeric: tabular-nums; }
.co-draft, .co-stopped { background: #eef0f3; color: #5d6779; }
.co-returned { background: var(--warn-soft); color: var(--warn); }
.co-open { background: var(--accent-soft); color: #9a5a0f; }
.co-approved, .co-implemented { background: var(--ok-soft); color: var(--ok); }
.co-closed { background: #e8ecf3; color: var(--ink); }
.co-zero { color: #c5ccd8; }
.stats { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.cat-select { width: auto; max-width: 170px; }
