/* 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; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 15px; border-radius: 9px; border: 1px solid #d3d9e3; background: #fff; color: var(--ink); font: 600 13.5px/1.2 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; box-shadow: 0 1px 2px rgba(16,24,40,.06); transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .seg-btn:focus-visible, .kpi:focus-visible { outline: 3px solid rgba(200,120,26,.35); outline-offset: 2px; }
.btn svg { flex: none; }
.btn:hover { border-color: #c5ccd8; background: #fafbfc; color: var(--text); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: 0 1px 2px rgba(11,31,58,.25), inset 0 1px 0 rgba(255,255,255,.08); }
.btn-primary:hover { background: #163056; border-color: #163056; 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 { min-height: 32px; padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { min-height: 42px; padding: 10px 18px; font-size: 14px; border-radius: 10px; }
.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; }

/* ── v3: dashboard bar that stays visible while scrolling ── */
.dash-bar { position: sticky; top: 60px; z-index: 15; background: rgba(245,246,248,.96); backdrop-filter: blur(6px); margin: -24px -24px 20px; padding: 16px 24px 14px; border-bottom: 1px solid var(--line); }
.dash-bar-in { max-width: 1320px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.dash-bar h1 { font-size: 21px; margin: 0; }
.dash-bar p { margin: 0; }
.stats { grid-template-columns: repeat(7, 1fr); }
.stat-bad { border-color: #f5c2bd; } .stat-bad .stat-n { color: var(--bad); }
.status-live { background: #e3f1fb; color: #0b5c8e; }
.co-live { background: #e3f1fb; color: #0b5c8e; }
.co-rolled_back { background: var(--bad-soft); color: var(--bad); }
.co-up { background: var(--ink-2); color: #fff; }
.co-up-h { color: var(--ink) !important; }
.route li.bad .route-dot { background: var(--bad); border-color: var(--bad); box-shadow: inset 0 0 0 3px #fff; }
.route li.bad strong { color: var(--bad); }

/* To action list */
.action-list { list-style: none; margin: 0; padding: 0; }
.action-list li a { display: grid; gap: 2px; padding: 10px 12px; margin: 0 -12px; border-radius: 8px; text-decoration: none; color: var(--text); border-left: 3px solid transparent; }
.action-list li a:hover { background: #fafbfd; }
.act-label { font-weight: 700; font-size: 13px; color: var(--ink); }
.act-kind-approve a { border-left-color: var(--accent); }
.act-kind-golive a { border-left-color: #0b5c8e; }
.act-kind-lock a, .act-kind-report a { border-left-color: var(--ok); }
.act-kind-expired a { border-left-color: var(--bad); }
.act-kind-draft a { border-left-color: #c5ccd8; }
.act-cr { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Upcoming timeline */
.tl { list-style: none; margin: 0; padding: 0; }
.tl-day { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 0 4px; border-bottom: 1px solid var(--line-2); }
.tl-day:first-child { padding-top: 0; }
.tl-item { display: grid; grid-template-columns: 54px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); position: relative; }
.tl-time { font-weight: 700; color: var(--ink); font-size: 13px; padding-top: 2px; }
.tl-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }

/* Compact go-live list (tables) */
.gl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.gl-list li { display: grid; grid-template-columns: 8px auto 1fr auto; gap: 6px; align-items: baseline; font-size: 12.5px; }
.gl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); align-self: center; }
.gl-live .gl-dot { background: #0b7bbf; } .gl-rolled_back .gl-dot { background: var(--bad); }
.gl-when { color: var(--muted); white-space: nowrap; font-size: 11.5px; }
.gl-what { min-width: 0; }
.gl-st { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px; white-space: nowrap; }
.gl-st-planned { background: var(--accent-soft); color: #9a5a0f; }
.gl-st-live { background: #e3f1fb; color: #0b5c8e; }
.gl-st-rolled_back { background: var(--bad-soft); color: var(--bad); }
.gl-cell { min-width: 320px; }
.desc-cell { min-width: 220px; max-width: 320px; }
.grid-table td { font-size: 13px; }

/* Go-live table in the form view / print */
.gl-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.gl-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.gl-table td { padding: 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; }

/* Go-live rows in the CR form */
.gl-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.gl-row { display: grid; grid-template-columns: 150px 120px 1fr 200px; gap: 10px; padding: 12px; background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; align-items: start; position: relative; }
.gl-row .gl-title { grid-column: 1 / -1; }
.gl-row .gl-remove { position: absolute; top: 8px; right: 12px; font-size: 12px; }
.gl-row .hint { font-size: 11.5px; }

/* Go-live panel on the CR page */
.gl-panel { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.gl-item { border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.gl-item.gl-live { border-color: #b9dcf2; background: #f6fbfe; }
.gl-item.gl-rolled_back { border-color: #f5c2bd; background: #fffafa; }
.gl-item-head { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; }
.gl-num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--line-2); font-weight: 700; font-size: 12px; color: var(--ink); }
.gl-item-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gl-item-when { font-weight: 700; color: var(--ink); font-size: 13px; }
.gl-actions { margin: 10px 0 0 38px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.gl-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; width: 100%; }
.gl-form .field { min-width: 180px; }
.gl-form .grow { flex: 1 1 260px; }
.rb-form { padding: 10px; background: var(--bad-soft); border-radius: 8px; }

/* Read-back list when signing */
.rb-list { display: flex; flex-direction: column; gap: 8px; }
.rb-row { display: grid; grid-template-columns: 26px 1fr; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 7px; padding: 10px; font-size: 13px; }
.rb-n { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; }

@media (max-width: 1100px) { .stats { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 760px) {
  .dash-bar { position: static; margin: -16px -16px 16px; padding: 14px 16px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .gl-row { grid-template-columns: 1fr 1fr; }
  .gl-actions { margin-left: 0; }
  .gl-cell { min-width: 260px; }
}
/* Go-live items: line 1 = when + status, line 2 = system · what */
.gl-list li { grid-template-columns: 8px auto 1fr; grid-template-areas: "dot when st" ". what what"; column-gap: 7px; row-gap: 1px; padding-bottom: 5px; }
.gl-list li .gl-dot { grid-area: dot; } .gl-list li .gl-when { grid-area: when; } .gl-list li .gl-st { grid-area: st; justify-self: start; } .gl-list li .gl-what { grid-area: what; }
.gl-cell { min-width: 300px; }
.grid-table .clip-sm { max-width: 170px; }

/* ── v4: calendar, freezes, reschedule ── */
.inline-form { margin: 0; }
.inline-form select { width: auto; }
.freeze-strip { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 14px; }
.freeze-chip { font-size: 12px; padding: 3px 9px; border-radius: 12px; border: 1px solid; }
.freeze-block { background: var(--bad-soft); color: var(--bad); border-color: #f5c2bd; }
.freeze-warn { background: var(--warn-soft); color: var(--warn); border-color: #f2d999; }
.status-warn { background: var(--warn-soft); color: var(--warn); }
.rs-form { padding: 10px; background: #f4f7fb; border-radius: 8px; }
.resched { color: var(--info); }

/* ═════════ v5: dashboard, calendar, buttons ═════════ */
.hide-sm { }
.link-more { font-size: 13px; font-weight: 600; text-decoration: none; color: var(--ink-2); }
.link-more:hover { text-decoration: underline; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 28px 12px; color: #98a2b3; text-align: center; }
.empty-state p { margin: 0; color: var(--muted); }
.empty-state.pad { padding: 28px 20px; }
.count-pill { min-width: 26px; height: 22px; padding: 0 8px; border-radius: 11px; background: var(--line-2); color: var(--muted); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.count-pill.on { background: var(--accent); color: #fff; }

/* Sticky dashboard bar: stays on screen on every device */
.dash-bar { position: sticky; top: 60px; z-index: 18; margin: -24px -24px 20px; padding: 14px 24px; background: var(--bg); box-shadow: 0 0 0 100vmax var(--bg), 0 1px 0 100vmax var(--line); clip-path: inset(0 -100vmax -1px); }
.dash-bar { backdrop-filter: none; -webkit-backdrop-filter: none; }
.dash-bar.stuck { box-shadow: 0 0 0 100vmax var(--bg), 0 1px 0 100vmax var(--line), 0 8px 16px -12px rgba(16,24,40,.25); clip-path: inset(0 -100vmax -24px); }
.dash-bar-in { max-width: 1272px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.dash-bar h1 { font-size: 22px; margin: 0; letter-spacing: -.015em; }
.dash-bar p { margin: 2px 0 0; font-size: 13px; }
.dash-actions { display: flex; gap: 10px; }

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { --t: var(--ink); --ts: #eef1f6; position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px 16px 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .15s; }
.kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--t); opacity: .9; }
.kpi:hover { border-color: #c9d1dd; box-shadow: 0 6px 18px rgba(16,24,40,.08); transform: translateY(-1px); color: var(--text); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.kpi-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--ts); color: var(--t); flex: none; }
.kpi-n { font-size: 32px; font-weight: 750; line-height: 1.05; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi-hint { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-accent { --t: var(--accent); --ts: var(--accent-soft); background: linear-gradient(180deg, #fffaf3, #fff 70%); border-color: #f1d3ab; }
.kpi-accent .kpi-n { color: #a15c0c; }
.kpi-info { --t: var(--info); --ts: var(--info-soft); }
.kpi-ok { --t: var(--ok); --ts: var(--ok-soft); }
.kpi-live { --t: #0b7bbf; --ts: #e3f1fb; }
.kpi-bad { --t: var(--bad); --ts: var(--bad-soft); } .kpi-bad .kpi-n { color: var(--bad); }
.kpi-done { --t: var(--ink); --ts: #e8ecf3; }
.kpi-muted { --t: #c5ccd8; --ts: #f1f3f6; }

/* Main grid */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: stretch; margin-bottom: 20px; }
.dash-grid .card { margin-bottom: 0; }
.dash-grid .card { min-height: 220px; }
.card-head h2 { margin-bottom: 12px; }
.action-list li + li { border-top: 1px solid var(--line-2); }
.action-list li a { padding: 11px 12px; margin: 0 -12px; border-radius: 8px; border-left-width: 3px; }
.action-list li a:hover { background: #f8f9fb; }
.act-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.act-row .ref { font-size: 11.5px; color: var(--muted); }
.act-cr { color: var(--text); }
.tl-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.co-name { font-weight: 700; color: var(--ink); text-decoration: none; }
.co-name:hover { text-decoration: underline; }
.co-zero { color: #cfd5de; }
.co-table thead th { background: #fafbfc; }
.co-table tbody tr:hover { background: #fafbfd; }

/* ── Calendar ── */
.cal-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-title h1 { font-size: 26px; margin: 0; letter-spacing: -.02em; }
.cal-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cal-tools select { min-height: 38px; border-radius: 9px; min-width: 170px; }
.seg { display: inline-flex; border: 1px solid #d3d9e3; border-radius: 9px; background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.06); overflow: hidden; }
.seg-btn { display: inline-grid; place-items: center; min-width: 38px; height: 38px; padding: 0 10px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 13.5px; }
.seg-btn:hover { background: #f4f6f9; color: var(--ink); }
.seg-mid { border-left: 1px solid #d3d9e3; border-right: 1px solid #d3d9e3; padding: 0 16px; }
.cal-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.cs { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.cs strong { color: var(--ink); }
.cs i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.cs-planned i { background: var(--accent); } .cs-live i { background: #0b7bbf; } .cs-rolled_back i { background: var(--bad); }
.cs-na i { width: 14px; height: 8px; border-radius: 3px; border: 1.5px dashed #98a2b3; background: transparent; }
.cs-fz-block { background: var(--bad-soft); border-color: #f5c2bd; color: var(--bad); } .cs-fz-block strong { color: var(--bad); }
.cs-fz-warn { background: var(--warn-soft); border-color: #f2d999; color: var(--warn); } .cs-fz-warn strong { color: var(--warn); }

.cal { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 20px; }
.cal-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: #fafbfc; }
.cal-head div { padding: 10px 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cal-head .we { color: #98a2b3; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-cell { min-height: 118px; padding: 8px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 6px; min-width: 0; transition: background .12s; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.we { background: #fbfcfd; }
.cal-cell.empty { background: repeating-linear-gradient(135deg, #fafbfc, #fafbfc 6px, #f5f7f9 6px, #f5f7f9 12px); }
.cal-cell:not(.empty):hover { background: #f9fafc; }
.cal-cell.past .cal-d { color: #98a2b3; }
.cal-date { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.cal-d { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 4px; border-radius: 13px; font-weight: 700; font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }
.cal-cell.today .cal-d { background: var(--accent); color: #fff; box-shadow: 0 2px 6px rgba(200,120,26,.35); }
.cal-cell.today { background: #fffaf3; }
.cal-cell.fz-block { background: repeating-linear-gradient(135deg, #fff 0 9px, #fdf1ef 9px 18px); }
.cal-cell.fz-warn { background: #fffbf2; }
.cal-fz { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 6px; border-radius: 5px; background: var(--bad-soft); color: var(--bad); }
.fz-warn .cal-fz { background: var(--warn-soft); color: var(--warn); }
.cal-items { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-item { display: flex; align-items: center; gap: 6px; padding: 4px 7px; border-radius: 6px; font-size: 12px; text-decoration: none; color: var(--ink); background: var(--accent-soft); border-left: 3px solid var(--accent); min-width: 0; transition: transform .1s, box-shadow .1s; }
.cal-item:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(16,24,40,.1); color: var(--ink); }
.cal-item.gl-live { background: #e3f1fb; border-left-color: #0b7bbf; }
.cal-item.gl-rolled_back { background: var(--bad-soft); border-left-color: var(--bad); }
.cal-item.na { background: #fff; border: 1px dashed #c5ccd8; border-left: 3px dashed var(--accent); }
.cal-time { font-weight: 700; font-size: 11px; flex: none; }
.cal-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-weight: 500; }
.cal-more { font-size: 11.5px; font-weight: 600; color: var(--muted); text-decoration: none; padding-left: 4px; }
.cal-more:hover { color: var(--ink); }

/* Agenda */
.agenda .card-head { align-items: baseline; }
.ag-day { display: grid; grid-template-columns: 200px 1fr; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line-2); scroll-margin-top: 80px; }
.ag-day:first-of-type { border-top: 0; }
.ag-date { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ag-d { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: #eef1f6; color: var(--ink); font-weight: 750; font-size: 17px; }
.ag-day.today .ag-d { background: var(--accent); color: #fff; }
.ag-name { font-weight: 600; color: var(--ink); font-size: 13px; flex: 1 1 100px; }
.ag-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ag-item { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 9px; text-decoration: none; color: var(--text); background: #fff; transition: border-color .12s, box-shadow .12s; }
.ag-item:hover { box-shadow: 0 4px 12px rgba(16,24,40,.07); color: var(--text); }
.ag-item.gl-live { border-left-color: #0b7bbf; } .ag-item.gl-rolled_back { border-left-color: var(--bad); }
.ag-time { font-weight: 700; color: var(--ink); }
.ag-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ag-main strong { color: var(--ink); }
.gl-st-na { background: #f1f3f6; color: var(--muted); }

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .hide-sm { display: none; }
  .dash-bar { position: sticky; top: 60px; margin: -16px -16px 14px; padding: 10px 16px; }
  .dash-bar h1 { font-size: 18px; }
  .dash-hello p { display: none; }
  .dash-actions { width: 100%; }
  .dash-actions .btn { flex: 1 1 0; min-height: 40px; padding: 8px 10px; font-size: 13px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px; }
  .kpi-n { font-size: 26px; }
  .cal { display: none; }
  .cal-tools { width: 100%; }
  .cal-tools .inline-form { flex: 1; } .cal-tools select { width: 100%; }
  .ag-day { grid-template-columns: 1fr; gap: 8px; }
  .ag-item { grid-template-columns: 48px minmax(0, 1fr); }
  .ag-item .gl-st { grid-column: 2; justify-self: start; }
}
@media (max-width: 760px) {
  .mainnav { gap: 2px; }
  .mainnav a { white-space: nowrap; padding: 7px 8px; font-size: 13px; }
  .cap-sm { text-transform: capitalize; }
}
@media (max-width: 760px) {
  .topbar { gap: 6px; padding: 0 10px; }
  .topbar-right { gap: 4px; }
  .mainnav a { padding: 7px 7px; font-size: 12.5px; }
}
@media (max-width: 360px) { .mainnav a .pill { display: none; } }

/* ── v5: people who worked on a change ── */
.ct-rows { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 10px; }
.ct-rows:empty { display: none; }
.ct-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto; gap: 12px; align-items: end; padding: 12px; background: #fafbfc; border: 1px solid var(--line); border-radius: 10px; }
.ct-row .field { margin: 0; }
.ct-state { padding-bottom: 9px; }
.ct-row [data-ct-remove] { padding-bottom: 10px; font-size: 12.5px; }
.ct-form { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: #fff; margin-top: 12px; }
.ct-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ct-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 12px; }
.ct-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ct-card.signed { border-color: #bfe3cf; background: #f7fcf9; }
.ct-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ct-top > div { display: flex; flex-direction: column; min-width: 0; }
.ct-details { margin: 0; font-size: 13px; }
.ct-res { font-weight: 700; }
.ct-res-passed { color: var(--ok); } .ct-res-failed { color: var(--bad); }
.act-kind-contribute a { border-left-color: #7a5af8; }
@media (max-width: 760px) {
  .ct-row { grid-template-columns: 1fr; }
  .ct-state, .ct-row [data-ct-remove] { padding-bottom: 0; }
}
.ct-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.ct-top .tag { white-space: nowrap; flex: none; }
.ct-card .sig-inline { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--line); }
.ct-card .sig-inline img { height: 54px; width: auto; max-width: 100%; background: #fff; }
.ct-card .sig-inline span { font-size: 12.5px; color: var(--muted); }
.ct-card .sig-inline strong { color: var(--ink); }
.ct-card .sig-empty { margin-top: auto; }
