:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --surface: #ffffff;
  --text: #20242a;
  --muted: #68707d;
  --line: #dfe3e8;
  --accent: #2754c5;
  --accent-strong: #173b95;
  --warning: #9a5b00;
  --warning-bg: #fff4d6;
  --ok: #167047;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }

/* Inline monochrome SVG icons — inherit text colour, align to the baseline. */
.icon {
  display: inline-block;
  vertical-align: -0.15em;
  flex: 0 0 auto;
  stroke: currentColor;
}
.icon-muted { color: var(--muted); }

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}
.login-panel {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 48px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 48px;
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}
h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: clamp(30px, 4vw, 48px); line-height: 1.04; }
h2 { margin-bottom: 18px; font-size: 20px; }
.muted { color: var(--muted); }
.login-form, .search-form, .sync-form { display: flex; gap: 10px; }
.login-form { flex-direction: column; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 14px; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font: inherit;
  padding: 11px 12px;
  border-radius: 6px;
}
button {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 700;
  padding: 11px 16px;
  cursor: pointer;
}
button:hover { background: var(--accent-strong); }
.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
.ghost:hover { background: #eef1f5; color: var(--text); }
.alert {
  border: 1px solid #ffd2d2;
  background: #fff1f1;
  color: #9b1c1c;
  padding: 10px 12px;
  border-radius: 6px;
}

.topbar {
  min-height: 92px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 22px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.workspace, .detail {
  padding: 24px 32px 48px;
}
.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}
.search-form input { min-width: 360px; }
.sync-form input { width: 82px; }
.checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.checkbox input { width: auto; }
.status-row {
  display: flex;
  gap: 28px;
  color: var(--muted);
  padding: 14px 0 20px;
}
.status-row span {
  color: var(--text);
  font-weight: 800;
}
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: auto;
}
.table-wrap.flat {
  border: 0;
  background: transparent;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  background: #fafbfc;
}
tbody tr { cursor: pointer; }
tbody tr:hover { background: #f7f9fc; }
.detail-table tbody tr { cursor: default; }
.detail-table tbody tr:hover { background: transparent; }
td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  max-width: 360px;
}
.quote {
  color: var(--muted);
  line-height: 1.35;
}
.needs-review {
  color: var(--warning);
  font-weight: 700;
}
.empty { color: var(--muted); text-align: center; padding: 32px; }
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ok);
  background: #e9f7ef;
}
.badge.needs_review { color: var(--warning); background: var(--warning-bg); }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 24px;
}
.summary-grid > div {
  background: var(--surface);
  padding: 18px;
}
.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.summary-grid strong { font-size: 18px; }
.columns {
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 24px;
  margin-bottom: 28px;
}
.columns > div, .detail > section:not(.summary-grid):not(.columns) {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 22px;
}
.facts {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px 18px;
  margin: 0;
}
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

@media (max-width: 900px) {
  .login-panel, .toolbar, .columns, .summary-grid { grid-template-columns: 1fr; }
  .search-form, .sync-form, .status-row, .topbar { flex-direction: column; align-items: stretch; }
  .search-form { display: grid; }
  .search-form input { min-width: 0; }
  .workspace, .detail, .topbar { padding-left: 16px; padding-right: 16px; }
}

.topnav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
  background: var(--surface-2, rgba(255,255,255,0.02));
  font-size: 13px;
}
.topnav a {
  color: inherit;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 4px;
  opacity: 0.7;
}
.topnav a:hover { opacity: 1; background: rgba(255,255,255,0.06); }
.topnav a.active { opacity: 1; background: rgba(255,255,255,0.08); }
.topnav .brand { font-weight: 700; opacity: 1; display: inline-flex; align-items: center; gap: 6px; }
.topnav-spacer { flex: 1; }
.username { opacity: 0.6; font-size: 11px; }

.workbench {
  display: grid;
  grid-template-columns: 280px 1fr 380px;
  height: calc(100vh - 56px);
  font-size: 13px;
}
.workbench__queue {
  border-right: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  overflow: auto;
  padding: 10px;
}
.workbench__card {
  overflow: auto;
  padding: 16px;
}
.workbench__source {
  border-left: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  overflow: auto;
  padding: 12px;
}
.center { text-align: center; padding: 40px 0; }
.muted { opacity: 0.6; font-size: 12px; }

.queue__tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.queue__tab {
  background: rgba(0,0,0,0.05); border: 1px solid rgba(0,0,0,0.08); color: inherit;
  padding: 4px 10px; border-radius: 4px; font-size: 11px; cursor: pointer;
}
.queue__tab.active { background: rgba(76,175,80,0.15); color: #2e7d32; border-color: rgba(76,175,80,0.3); }
.queue__count { opacity: 0.6; margin-left: 4px; font-size: 10px; }
.queue__search {
  width: 100%; box-sizing: border-box; padding: 6px 8px;
  background: rgba(0,0,0,0.04); border: 1px solid rgba(0,0,0,0.08);
  color: inherit; border-radius: 4px; margin-bottom: 8px; font-size: 11px;
}
.queue-item {
  padding: 8px; border-radius: 4px; cursor: pointer;
  margin-bottom: 4px; border-left: 3px solid transparent;
}
.queue-item:hover { background: rgba(0,0,0,0.04); }
.queue-item.is-needs-review { border-left-color: orange; background: rgba(255,165,0,0.06); }
.queue-item__head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.queue-item__num { font-size: 11px; }
.queue-item__meta { font-size: 10px; opacity: 0.6; margin-top: 2px; }
.badge {
  display: inline-block; padding: 2px 6px; border-radius: 4px;
  font-size: 10px; text-transform: lowercase;
}
.badge.needs_review { background: rgba(255,165,0,0.2); color: #b06a00; }
.badge.approved { background: rgba(76,175,80,0.2); color: #2e7d32; }
.badge.rejected { background: rgba(255,107,107,0.2); color: #c62828; }
.badge.reviewed { background: rgba(100,200,255,0.2); color: #1565c0; }
.badge.auto_extracted { background: rgba(0,0,0,0.08); color: #444; }
.badge.needs_reprocessing { background: rgba(255,200,0,0.2); color: #b8860b; }
.empty { text-align: center; padding: 24px; opacity: 0.5; font-size: 11px; }

.card-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.card-title { margin: 0 0 4px 0; font-size: 18px; }
.card-meta { font-size: 11px; opacity: 0.85; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn {
  background: rgba(0,0,0,0.06); color: inherit; border: 1px solid rgba(0,0,0,0.1);
  padding: 6px 12px; border-radius: 4px; font-size: 11px; cursor: pointer;
}
.btn:hover { background: rgba(0,0,0,0.1); }
.btn--approve { background: rgba(76,175,80,0.15); color: #2e7d32; border-color: rgba(76,175,80,0.3); }
.btn--reject { background: rgba(255,107,107,0.1); color: #c62828; border-color: rgba(255,107,107,0.2); }
.card-amount { padding: 12px; background: rgba(0,0,0,0.04); border-radius: 6px; margin-bottom: 12px; }
.card-amount .big { font-size: 22px; font-weight: 700; margin: 4px 0; }
.recompute-log { font-size: 10px; background: rgba(0,0,0,0.08); padding: 8px; border-radius: 4px; overflow: auto; }
.card-block { padding: 10px 0; border-top: 1px solid rgba(0,0,0,0.08); }
.card-block h3 { font-size: 12px; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 8px 0; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 4px 12px; margin: 0; font-size: 12px; }
.kv dt { opacity: 0.6; }
.kv dd { margin: 0; }
.conf { font-size: 10px; opacity: 0.5; margin-left: 6px; }
.quote { font-size: 10px; opacity: 0.7; font-style: italic; padding-left: 8px; border-left: 2px solid rgba(0,0,0,0.1); margin-top: 4px; }
.changes-table { width: 100%; font-size: 11px; border-collapse: collapse; }
.changes-table th, .changes-table td { text-align: left; padding: 4px 8px; border-bottom: 1px solid rgba(0,0,0,0.08); }
.changes-table th { opacity: 0.6; font-weight: 500; }

.source__tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.source__tab {
  background: rgba(0,0,0,0.05); color: inherit; border: 1px solid rgba(0,0,0,0.08);
  padding: 4px 10px; border-radius: 4px; font-size: 11px; cursor: pointer; opacity: 0.8;
}
.source__tab.active { opacity: 1; background: rgba(0,0,0,0.1); border-color: rgba(0,0,0,0.2); }
.source__text {
  background: #fff; color: #222; padding: 12px; border-radius: 4px;
  font-size: 11px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
  max-height: calc(100vh - 200px); overflow: auto; border: 1px solid rgba(0,0,0,0.1);
}
.source__meta { margin-top: 6px; font-size: 10px; }

.btn--next { background: rgba(100,200,255,0.1); color: #1565c0; border-color: rgba(100,200,255,0.2); text-decoration: none; display: inline-flex; align-items: center; }

.editable {
  display: inline-block; min-width: 60px; padding: 1px 4px; border-radius: 3px;
  border: 1px dashed transparent;
}
.editable:hover { border-color: rgba(0,0,0,0.15); }
.editable:focus { outline: none; border-color: rgba(100,200,255,0.5); background: rgba(100,200,255,0.06); }
.editable.saved { background: rgba(76,175,80,0.15); }
.editable.error { background: rgba(255,107,107,0.15); }
.editable:empty::before {
  content: '—';
  opacity: 0.3;
}

.upload-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
}
.upload-card, .sync-card {
  background: rgba(0,0,0,0.04);
  padding: 24px;
  border-radius: 8px;
}
.upload-card h2, .sync-card h2 { margin-top: 0; font-size: 16px; }
.upload-form { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.upload-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.upload-form input[type="text"], .upload-form input[type="number"] {
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(0,0,0,0.15);
  padding: 8px;
  border-radius: 4px;
  color: inherit;
  font-size: 12px;
}
.dropzone {
  border: 2px dashed rgba(0,0,0,0.15);
  border-radius: 8px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  background: rgba(255,255,255,0.4);
}
.dropzone:hover { background: rgba(255,255,255,0.6); }
.dropzone__hint { font-size: 11px; opacity: 0.6; margin-top: 8px; }
.checkbox {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 6px;
}
.sync-status { font-size: 13px; line-height: 1.6; margin-bottom: 12px; }
.sync-card form { display: flex; flex-direction: column; gap: 8px; }
.sync-card label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.sync-card input[type="number"] {
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(0,0,0,0.15);
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 12px;
}
@media (max-width: 800px) {
  .upload-page { grid-template-columns: 1fr; }
}

.legacy-summary {
  padding: 10px;
  background: rgba(255,165,0,0.06);
  border-left: 3px solid rgba(255,165,0,0.4);
  border-radius: 0 4px 4px 0;
  font-size: 12px;
}
.legacy-summary__text { line-height: 1.5; }
.legacy-summary__note { font-size: 11px; opacity: 0.65; margin-top: 6px; font-style: italic; }
.btn--reanalyze { background: rgba(100,200,255,0.1); color: #1565c0; border-color: rgba(100,200,255,0.2); }
.htmx-indicator { opacity: 0; transition: opacity 200ms; }
.htmx-request .htmx-indicator { opacity: 1; }

.card-head__left { flex: 1; min-width: 0; }
.card-counterparty {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  opacity: 0.6;
  margin-bottom: 4px;
}
.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px 0;
  font-size: 20px;
  font-weight: 700;
  word-break: break-word;
}
.doctype-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.doctype-chip--contract { background: rgba(100,200,255,0.2); color: #1565c0; }
.doctype-chip--additional_agreement { background: rgba(255,165,0,0.2); color: #b06a00; }
.doctype-chip--appendix { background: rgba(150,200,150,0.2); color: #2e7d32; }
.doctype-chip--offer, .doctype-chip--invoice { background: rgba(0,0,0,0.1); }
.small { font-size: 10px; }
.dot { opacity: 0.3; }

.recompute { margin-top: 10px; font-size: 11px; }
.recompute summary { cursor: pointer; opacity: 0.7; }
.recompute summary:hover { opacity: 1; }
.recompute-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 11px; }
.recompute-table th, .recompute-table td { padding: 4px 8px; text-align: left; border-bottom: 1px solid rgba(0,0,0,0.06); }
.recompute-table th { opacity: 0.6; font-weight: 500; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.recompute-row--base td { opacity: 0.7; font-style: italic; }
.recompute-row--final { background: rgba(76,175,80,0.06); }
.recompute-row--final td { font-weight: 600; }
.kind { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10px; }
.kind--delta { background: rgba(100,200,255,0.15); color: #1565c0; }
.kind--revision { background: rgba(255,165,0,0.15); color: #b06a00; }
.kind--skipped { background: rgba(0,0,0,0.06); color: #888; }

/* Counterparty detail page (Task 2.2) */
.cp-detail-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 16px 0; border-bottom: 1px solid #e1e4e8; margin-bottom: 16px; }
.cp-detail-header h1 { margin: 0 0 4px; }
.cp-meta, .cp-counts { font-size: 12px; }
.cp-total { text-align: right; }
.cp-total-amount { font-size: 22px; font-weight: 700; }
.cp-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 12px; background: #f6f8fa; color: var(--text); font-size: 12px; font-weight: 400; cursor: pointer; border: 0; }
.chip:hover { background: #eaeef2; color: var(--text); }
.chip-active { background: #d1d9e0; }
.cp-contracts { display: flex; flex-direction: column; gap: 10px; }
.contract-row { border: 1px solid #d0d7de; border-radius: 6px; padding: 12px; background: white; }
.contract-row-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.contract-row-amount { text-align: right; }
.contract-row-amount .amount { font-size: 16px; font-weight: 700; }
.contract-row-amount .small { font-size: 10px; }
.contract-row-subject { font-size: 11px; margin-top: 4px; }
.contract-row-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 600; background: #d1e7dd; color: #0a5530; margin-right: 6px; }
.contract-row-badge--additional_agreement { background: #cfe2ff; color: #084298; }
.contract-row-badge--unknown { background: #e8eaed; color: #444; }
.contract-row-info { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; padding: 2px 6px; border-radius: 4px; background: #f0f0f0; color: #444; }
.row-open .icon { transition: transform 0.12s ease; }
.row-open:hover .icon { transform: translateX(2px); }
.pill-reviewed { background: #e8eaed; color: #444; }
.pill-comment { background: #cfe2ff; color: #084298; }
.pill-ai { background: #fff3cd; color: #856404; }
.pill-time { background: #f0f0f0; color: #555; }
.contract-row-progress { margin-top: 8px; height: 6px; background: #e1e4e8; border-radius: 3px; overflow: hidden; }
.contract-row-progress-bar { height: 100%; background: linear-gradient(90deg, #198754, #28a745); }
.orphan-actions { display: flex; gap: 6px; margin-top: 10px; align-items: center; flex-wrap: wrap; }
.pill-orphan { background: #fee; color: #842029; }
.pill-ref-ok { background: #e8eef5; color: #2c5777; text-decoration: none; }
.pill-ref-warn { background: #fff3cd; color: #856404; text-decoration: none; }
a.pill-ref-ok:hover, a.pill-ref-warn:hover { filter: brightness(0.96); }
.dossier-child-refwarn { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; padding: 1px 6px; border-radius: 4px; background: #fff3cd; color: #856404; white-space: nowrap; }
.btn-mini { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; font-size: 11px; background: white; color: var(--text); border: 1px solid #d0d7de; border-radius: 4px; cursor: pointer; font-weight: 400; }
.btn-mini:hover { background: #f3f5f7; color: var(--text); }
.btn-mini-primary { background: #0969da; color: white; border-color: #0969da; }
.btn-mini-primary:hover { background: var(--accent-strong); color: white; }
.btn-mini:disabled { opacity: 0.5; cursor: not-allowed; }
.inline-form { display: inline; }
.row-open { font-size: 11px; color: #0969da; text-decoration: none; margin-left: auto; padding-left: 8px; }
.row-open:hover { text-decoration: underline; }

/* Header cash summary + sparkline */
.cp-cash { margin-top: 10px; padding-top: 8px; border-top: 1px dashed #e1e4e8; }
.cp-cash-paid { font-size: 16px; font-weight: 700; color: var(--ok); }
.cp-cash-pending { font-weight: 600; color: var(--warning); }
.cp-cash-sep { color: var(--muted); margin: 0 5px; }
.cp-spark { display: block; height: 24px; width: auto; max-width: 200px; margin: 6px 0 0 auto; }

/* Payments ledger (cat-6 cash flow) — distinct block */
.cp-payments { margin-top: 28px; padding: 16px 18px; border: 1px solid #e1e4e8; border-radius: 8px; background: var(--surface); }
.cp-pay-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.cp-pay-head h2 { margin: 0; font-size: 16px; display: inline-flex; align-items: center; gap: 7px; }
.cp-pay-count { font-size: 12px; font-weight: 400; }
.cp-pay-totals { text-align: right; font-size: 13px; }
.cp-pay-projects { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.cp-pay-projects .chip { cursor: pointer; text-decoration: none; }
.cp-pay-slice { font-size: 13px; margin: -4px 0 10px; }
.cp-pay-paid { font-size: 18px; font-weight: 700; color: var(--ok); }
.cp-pay-pending { color: var(--warning); }
.cp-pay-list { display: flex; flex-direction: column; }
.cp-pay-row { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto auto auto auto; gap: 12px; align-items: center; padding: 7px 0; border-bottom: 1px solid #eef1f4; font-size: 13px; }
.cp-pay-contract { font-size: 11px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: middle; }
.cp-pay-attr { margin: 0; }
.cp-pay-attr select { font-size: 12px; padding: 2px 7px; border: 1px solid #d0d7de; border-radius: 4px; max-width: 240px; color: var(--muted); background: #fff; cursor: pointer; }
.cp-pay-attr-set select { color: var(--text); border-color: #9aa7b4; font-weight: 500; }
.cp-pay-date { font-size: 12px; font-variant-numeric: tabular-nums; }
.cp-pay-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-pay-amt { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.cp-pay-badge { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.cp-pay-badge-paid { background: #d1e7dd; color: #0a5530; }
.cp-pay-badge-pending { background: #fff3cd; color: #856404; }
.cp-pay-badge-rejected { background: #f0f0f0; color: #842029; }
.cp-pay-badge-stale { background: #eceff1; color: #6b7280; }
.cp-pay-row-rejected, .cp-pay-row-stale { opacity: 0.55; }
.cp-pay-row-rejected .cp-pay-amt, .cp-pay-row-stale .cp-pay-amt { text-decoration: line-through; }
.cp-pay-more { font-size: 12px; padding-top: 8px; }

/* Contract detail page (Task 3.1) */
.contract-detail { padding: 16px; }
.crumbs { font-size: 12px; margin-bottom: 12px; display: flex; gap: 6px; align-items: center; }
.crumbs a { color: #0969da; text-decoration: none; }
.detail-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; background: #f6f8fa; padding: 16px; border-radius: 8px; margin-bottom: 16px; }
.detail-header h1 { margin: 4px 0; font-size: 22px; }
.detail-header-actions { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.section-title { font-size: 14px; margin: 20px 0 12px; }
.key-values { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; padding: 14px; background: #f6f8fa; border-radius: 8px; }
.key-value { font-size: 12px; }
.key-value-amount { font-size: 16px; font-weight: 700; }
.timeline-field { background: white; border: 1px solid #d0d7de; border-radius: 6px; padding: 14px; margin-bottom: 10px; }
.timeline-field-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.timeline-row { display: flex; gap: 4px; align-items: stretch; overflow-x: auto; padding-bottom: 4px; }
.timeline-card { flex: 0 0 auto; min-width: 130px; padding: 8px 10px; border-radius: 4px; }
.timeline-card-value { font-weight: 700; font-size: 13px; margin-top: 2px; }
.timeline-card-base { background: #f6f8fa; border-left: 3px solid #6e7681; }
.timeline-card-delta { background: #cff4fc; border-left: 3px solid #0dcaf0; }
.timeline-card-new_revision { background: #fff3cd; border-left: 3px solid #ffc107; }
.timeline-card-current { background: #d1e7dd; border-left: 3px solid #198754; }
.timeline-card-unknown { background: #e8eaed; border-left: 3px solid #999; }
.timeline-card-gap_placeholder { background: #f8f9fa; border: 1px dashed #d0d7de; opacity: 0.7; padding: 8px 10px; text-align: center; min-width: 100px; font-style: italic; color: #68707d; }
.timeline-arrow { align-self: center; opacity: 0.4; font-size: 14px; }
.timeline-static { padding: 10px; background: #f6f8fa; border-radius: 4px; }
.linked-docs { background: white; border: 1px solid #d0d7de; border-radius: 6px; padding: 12px; }
.linked-doc-row { display: grid; grid-template-columns: 1fr 3fr auto; gap: 10px; padding: 6px 0; border-bottom: 1px solid #f0f0f0; font-size: 11px; }
.linked-doc-row:last-child { border-bottom: none; }
.sparkline { display: block; width: 100%; max-width: 160px; height: 22px; margin-top: 6px; overflow: visible; }

/* Diff panel under timeline (Task 3.4) */
.timeline-card-clickable { cursor: pointer; }
.timeline-card-clickable:hover { box-shadow: 0 0 0 2px #0dcaf0; }
.diff-slot:empty { display: none; }
.diff-panel { margin-top: 12px; padding: 12px; background: #f6f8fa; border-radius: 4px; border-left: 3px solid #0dcaf0; }
.diff-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 12px; }
.diff-close { background: transparent; border: none; cursor: pointer; font-size: 16px; line-height: 1; color: #555; padding: 0 6px; }
.diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: 11px; font-family: ui-monospace, monospace; }
.diff-side { padding: 8px; border-left: 2px solid #ccc; }
.diff-side-was { background: #ffeef0; border-left-color: #d73a49; }
.diff-side-now { background: #e6ffed; border-left-color: #28a745; }
.diff-value { font-weight: 600; margin-top: 2px; }
.diff-quote { margin-top: 10px; padding: 8px; background: white; border-radius: 4px; font-size: 11px; }
.diff-quote-text { margin-top: 4px; line-height: 1.5; }

/* AI findings block (Task 3.6) */
.ai-findings { background: #fff8e1; border: 1px solid #ffc107; border-radius: 8px; padding: 14px; margin-bottom: 16px; }
.ai-findings-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ai-findings-list { list-style: none; padding: 0; margin: 0; }
.ai-finding { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,0.06); font-size: 12px; line-height: 1.5; align-items: flex-start; }
.ai-finding:last-child { border-bottom: none; }
.ai-finding-body { flex: 1; }
.ai-finding-detail { color: #555; margin-top: 2px; }
.ai-finding-quote { margin-top: 4px; }
.ai-finding-quote summary { cursor: pointer; }
.ai-finding-quote-text { margin-top: 4px; padding: 6px 8px; background: white; border-radius: 4px; }
.ai-finding-error strong { color: #842029; }
.ai-finding-warning strong { color: #856404; }
.ai-finding-info strong { color: #444; }

/* Comments (Task 4.1) */
.comment-list { display: flex; flex-direction: column; gap: 8px; }
.comment-item { display: flex; gap: 8px; align-items: flex-start; font-size: 11px; }
.comment-avatar { width: 24px; height: 24px; border-radius: 50%; background: #0969da; color: white; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; flex-shrink: 0; }
.comment-body { flex: 1; }
.comment-head { display: flex; gap: 8px; align-items: baseline; }
.comment-text { margin-top: 2px; }

/* Comments threaded into timeline / per-contract (Task 4.4) */
.mention { background: #cfe2ff; color: #084298; padding: 1px 4px; border-radius: 3px; font-weight: 600; }
.comments-block { margin-top: 12px; padding: 10px; background: #f6f8fa; border-radius: 4px; }
.comments-block-field { font-size: 11px; }
.comments-list-slot { margin-bottom: 8px; }
.comments-form { display: flex; gap: 6px; margin-top: 6px; }
.comments-form input[type="text"] { flex: 1; padding: 5px 10px; border: 1px solid #d0d7de; border-radius: 4px; font-size: 11px; }

/* Linked documents grouped by type (Task 5.2) */
.linked-docs-grouped { background: white; border: 1px solid #d0d7de; border-radius: 6px; overflow: hidden; }
.linked-docs-group { padding: 0; }
.linked-docs-group-head { background: #f6f8fa; padding: 6px 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.linked-docs-list { list-style: none; margin: 0; padding: 0; }
.linked-doc-row-grouped { display: flex; justify-content: space-between; gap: 10px; padding: 6px 12px; border-bottom: 1px solid #f0f0f0; font-size: 11px; }
.linked-doc-row-grouped:last-child { border-bottom: none; }

/* Global Ctrl+K search (Task 5.1) */
.topnav-search { position: relative; flex: 1; max-width: 480px; margin: 0 12px; }
.topnav-search input { width: 100%; padding: 4px 10px 4px 30px; border: 1px solid #d0d7de; border-radius: 4px; font-size: 12px; background: white; box-sizing: border-box; }
.topnav-search-icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search-results-wrapper { position: absolute; top: 100%; left: 0; right: 0; z-index: 200; }
.search-results { background: white; border: 1px solid #d0d7de; border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); margin-top: 4px; max-height: 400px; overflow-y: auto; }
.search-results:empty { display: none; }
.search-group { padding: 6px 0; border-bottom: 1px solid #f0f0f0; }
.search-group:last-child { border-bottom: none; }
.search-group-head { padding: 4px 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.search-group-list { list-style: none; padding: 0; margin: 0; }
.search-group-list li a { display: block; padding: 6px 12px; text-decoration: none; color: inherit; }
.search-group-list li a:hover { background: #f6f8fa; }
.search-empty { padding: 12px; }

/* Split-view drawer for the original document (Task 5.6) */
.split-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 0;
  background: #1e1e1e;
  color: #e1e4e8;
  display: flex;
  flex-direction: column;
  transition: width 0.18s ease;
  z-index: 300;
  overflow: hidden;
  box-shadow: -4px 0 16px rgba(0,0,0,0.18);
}
.split-drawer.open { width: 440px; }
.split-drawer-head {
  padding: 8px 12px;
  background: #2a2a2a;
  border-bottom: 1px solid #444;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.split-drawer-close {
  background: #444;
  border: none;
  color: #e1e4e8;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 14px;
}
.split-drawer iframe { flex: 1; border: 0; background: white; }
body.split-open .workspace { margin-right: 440px; transition: margin-right 0.18s ease; }
.linked-doc-row-grouped { align-items: center; }
.linked-doc-row-main { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.linked-doc-row-actions { flex-shrink: 0; display: flex; gap: 8px; align-items: center; }

/* =====================================================
   Contract detail v3 polish — match mockup Экран 2
   ===================================================== */

/* Header card */
.detail-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: flex-start;
  background: #f6f8fa;
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}
.detail-header h1 { margin: 4px 0; font-size: 24px; font-weight: 700; }
.detail-header-info { min-width: 0; }
.detail-eyebrow { text-transform: uppercase; letter-spacing: 0.5px; }
.detail-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.detail-pills .pill { font-size: 11px; padding: 3px 8px; border-radius: 4px; background: #f0f0f0; color: #555; }
.detail-pills .pill-reviewed { background: #e8eaed; color: #444; }
.detail-pills .pill-comment { background: #cfe2ff; color: #084298; }

.detail-header-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
  min-width: 240px;
}
.detail-header-actions .btn-mini { white-space: nowrap; text-align: left; padding: 6px 12px; }
.detail-header-actions .reviewed-toggle .btn-mini { width: 100%; }

/* Key values block */
.key-values {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
  margin-bottom: 16px;
  padding: 14px;
  padding-top: 14px;
  background: #f6f8fa;
  border-radius: 8px;
}
.key-value-amount { font-size: 18px; font-weight: 700; }
.sparkline-label { margin-top: 4px; font-size: 10px; }
.sparkline-delta { color: #198754; font-weight: 600; }

/* Timeline header (mode toggle) */
.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0 12px;
  gap: 12px;
}
.timeline-header .section-title { margin: 0; }
.timeline-mode-toggle {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
}
.timeline-mode-toggle .chip {
  padding: 3px 8px;
  border-radius: 4px;
  background: #f6f8fa;
  cursor: pointer;
}
.timeline-mode-toggle .chip-active { background: #d1d9e0; color: #20242a; }
.timeline-mode-toggle .chip-disabled { opacity: 0.6; cursor: help; }

/* Timeline cards: tighter ring on hover / selected */
.timeline-card-clickable:hover { box-shadow: 0 0 0 2px #0dcaf0; }

/* Diff panel polish */
.diff-panel-head { gap: 8px; }
.diff-show-doc { color: #0969da; font-size: 11px; cursor: help; white-space: nowrap; }
.diff-calc {
  margin-top: 10px;
  padding: 8px 10px;
  background: white;
  border-radius: 4px;
  font-size: 11px;
  border: 1px solid #e1e4e8;
}
.diff-calc strong { font-weight: 700; }

/* Comments — colored circle + gray bubble */
.comment-item { display: flex; gap: 10px; align-items: flex-start; }
.comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0969da;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.comments-block-field .comment-avatar { width: 24px; height: 24px; font-size: 10px; }
.comment-body { flex: 1; min-width: 0; }
.comment-bubble {
  background: white;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e1e4e8;
}
.comments-block-field .comment-bubble { background: #fafbfc; }
.comment-head { display: flex; gap: 8px; align-items: baseline; font-size: 11px; }
.comment-text { font-size: 12px; line-height: 1.5; margin-top: 4px; word-wrap: break-word; }

/* OCR badge (stub) */
.ocr-badge { font-size: 9px; padding: 2px 6px; border-radius: 3px; font-weight: 600; white-space: nowrap; }
.ocr-ok { background: #d1e7dd; color: #0a5530; }
.ocr-warning { background: #fff3cd; color: #856404; }
.ocr-error { background: #fee; color: #842029; }

/* Linked docs polish */
.linked-docs-group-head { font-weight: 600; padding-top: 8px; padding-bottom: 6px; }

@media (max-width: 900px) {
  .detail-header { grid-template-columns: 1fr; }
  .detail-header-actions { min-width: 0; }
  .key-values { grid-template-columns: 1fr 1fr; }
}

/* =====================================================
   v3 two-column layouts (registry + detail)
   ===================================================== */

/* Registry — sidebar + main */
.cp-workspace { padding: 0; }
.cp-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: calc(100vh - 56px);
}
.counterparty-sidebar {
  background: #fafbfc;
  border-right: 1px solid #e1e4e8;
  padding: 12px;
  overflow-y: auto;
  max-height: calc(100vh - 56px);
}
.cp-search-wrap { position: relative; margin-bottom: 6px; }
.cp-search-icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.cp-sidebar-search {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 10px 6px 30px;
  border: 1px solid #d0d7de;
  border-radius: 4px;
  font-size: 12px;
}
.cp-sidebar-hint {
  margin-bottom: 10px;
  padding-left: 4px;
  font-size: 10px;
  opacity: 0.6;
}
.cp-sidebar-divider {
  font-size: 10px;
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.counterparty-sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.counterparty-sidebar .counterparty-row {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
  border-left: 3px solid transparent;
  /* override the global .counterparty-row border that the legacy
     /counterparties list partial styles via this class */
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
}
.counterparty-sidebar .counterparty-row:hover {
  background: rgba(9, 105, 218, 0.05);
}
.counterparty-row-active {
  background: rgba(9, 105, 218, 0.07);
  border-left: 3px solid #0969da !important;
  border-radius: 0 4px 4px 0;
}
.cp-row-ico { color: #8a93a0; margin-top: 2px; }
.counterparty-row-active .cp-row-ico { color: #0969da; }
.cp-row-text { min-width: 0; flex: 1; }
.cp-row-name {
  font-weight: 600;
  font-size: 13px;
  word-break: break-word;
}
.cp-row-counts { display: flex; align-items: center; gap: 4px; margin-top: 2px; flex-wrap: wrap; }
.cp-row-dot { opacity: 0.5; }
.cp-row-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.cp-badge { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px; border-radius: 8px; font-size: 9px; font-weight: 600; }
.cp-badge-ai { background: #fff3cd; color: #856404; }
.cp-badge-orphan { background: #fee; color: #842029; }
.cp-sidebar-empty {
  padding: 8px 10px;
}

/* Sort + quick-filter controls */
.cp-sidebar-sortrow { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; color: var(--muted); }
.cp-sidebar-sort { flex: 1; padding: 4px 6px; border: 1px solid #d0d7de; border-radius: 4px; font-size: 11px; background: white; }
.cp-sidebar-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.chip-sm { font-size: 10px; padding: 2px 8px; border: 0; }
.cp-sidebar-chips .chip-active { background: #d1e7dd; color: #0a5530; }
.cp-main {
  padding: 20px 24px;
  overflow-y: auto;
  max-height: calc(100vh - 56px);
}

/* Detail — main + permanent PDF panel */
.detail-workspace { padding: 0; }
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  min-height: calc(100vh - 100px);
}
.detail-main {
  padding: 20px 24px;
  overflow-y: auto;
  border-right: 1px solid #e1e4e8;
  max-height: calc(100vh - 100px);
  min-width: 0;
}
.pdf-panel {
  display: flex;
  flex-direction: column;
  background: #1e1e1e;
  color: #e1e4e8;
  overflow: hidden;
  max-height: calc(100vh - 100px);
}
.pdf-panel-head {
  padding: 10px 14px;
  background: #2a2a2a;
  border-bottom: 1px solid #444;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.pdf-panel-head .muted { color: #b0b6bd; }
.pdf-panel-title-wrap { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.pdf-panel-title-wrap #pdf-panel-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-panel iframe {
  flex: 1;
  border: 0;
  background: white;
  width: 100%;
}
.pdf-panel-foot {
  padding: 8px 14px;
  background: #2a2a2a;
  border-top: 1px solid #444;
  color: #b0b6bd;
}
.pdf-panel-empty {
  padding: 24px;
  text-align: center;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Crumbs flush with the new 0-padding workspace */
.detail-workspace .crumbs {
  padding: 8px 24px;
  background: #f8f9fa;
  border-bottom: 1px solid #e1e4e8;
  margin: 0;
  font-size: 11px;
}

@media (max-width: 1024px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .pdf-panel {
    max-height: 480px;
    border-top: 1px solid #e1e4e8;
  }
  .detail-main {
    border-right: 0;
  }
}
@media (max-width: 800px) {
  .cp-grid {
    grid-template-columns: 1fr;
  }
  .counterparty-sidebar {
    border-right: 0;
    border-bottom: 1px solid #e1e4e8;
    max-height: 320px;
  }
}

.cp-empty {
  text-align: center;
  padding: 48px 24px;
  border: 1px dashed #d0d7de;
  border-radius: 8px;
  background: #fafbfc;
  margin-top: 8px;
}
.cp-empty-icon { font-size: 32px; opacity: 0.6; }
.cp-empty-title { font-weight: 600; font-size: 15px; margin: 8px 0 4px; }
.cp-empty p { max-width: 420px; margin: 0 auto; }

.dossier-group { margin-bottom: 12px; }
.dossier-group-head { text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; margin: 0 0 5px; }
.dossier-children { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.dossier-item { display: flex; flex-direction: column; }
.dossier-child-toggle { cursor: pointer; }
.dossier-caret { color: var(--muted); display: inline-flex; transition: transform 0.12s ease; flex-shrink: 0; }
.dossier-child-toggle:not(.expanded) .dossier-caret { transform: rotate(-90deg); }
.dossier-child-detail { border: 1px solid #e3e7ec; border-top: none; border-radius: 0 0 6px 6px; background: #fafbfc; padding: 10px 12px; margin: -3px 0 2px; font-size: 12px; }
.dossier-facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 0 0 8px; }
.dossier-facts > div { display: contents; }
.dossier-facts dt { color: var(--muted); }
.dossier-facts dd { margin: 0; }
.dossier-child-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.dossier-child {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border: 1px solid #d0d7de; border-radius: 6px;
  background: white; text-decoration: none; color: inherit; font-size: 12px;
}
.dossier-child:hover { background: #f6f8fa; }
.dossier-child-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dossier-child-amt { font-weight: 600; }

.requisites-card { background: #f6f8fa; border: 1px solid #e1e4e8; border-radius: 8px; padding: 14px 16px; margin-bottom: 16px; }
.requisites-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 10px 24px; }
.requisite > .muted { text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 2px; }
.requisite-links { display: flex; gap: 14px; flex-wrap: wrap; }
@media (max-width: 760px) { .requisites-grid { grid-template-columns: 1fr; } }

.changes-feed { display: flex; flex-direction: column; gap: 0; border: 1px solid #d0d7de; border-radius: 8px; overflow: hidden; }
.change-row { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; border-bottom: 1px solid #f0f0f0; font-size: 12px; }
.change-row:last-child { border-bottom: 0; }
.change-row:nth-child(even) { background: #fafbfc; }
.change-row-top { display: flex; gap: 12px; align-items: baseline; }
.change-row-meta { flex: 0 0 150px; display: flex; gap: 6px; align-items: baseline; }
.change-dc { background: #eef1f4; border-radius: 4px; padding: 1px 6px; font-size: 10px; font-weight: 600; }
.change-row-body { flex: 1; display: flex; gap: 10px; justify-content: space-between; align-items: baseline; flex-wrap: wrap; }
.change-cond { font-weight: 600; }
.change-vals { font-family: ui-monospace, monospace; font-size: 11px; }
.change-old { color: #b35900; text-decoration: line-through; opacity: 0.7; }
.change-new { color: #0a5530; font-weight: 600; }
.change-quote { font-size: 11px; color: #57606a; font-style: italic; padding-left: 162px; }
@media (max-width: 760px) { .change-quote { padding-left: 0; } }
.changes-cat-head { background: #f1f3f5; padding: 5px 12px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #57606a; border-bottom: 1px solid #e1e4e8; }

/* Project (ЖК) dimension */
.pill-project { background: #eef2e8; color: #4a6b2a; }
.pill-project-mini {
  display: inline-block; background: #eef2e8; color: #4a6b2a;
  border-radius: 6px; font-size: 10.5px; font-weight: 600;
  padding: 0 6px; vertical-align: 1px; white-space: nowrap;
}

/* Feedback (testing-phase data-issue reports) */
.fb-flag { background: none; border: none; cursor: pointer; color: #9aa4ae; padding: 2px 4px; display: inline-flex; align-items: center; gap: 4px; border-radius: 4px; line-height: 1; }
.fb-flag:hover { color: #b3382c; background: #f9ecea; }
.fb-flag-text { font-size: 12px; margin-top: 6px; padding: 2px 0; }
.fb-form { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 4px; padding: 10px 12px; border: 1px dashed #d8aaa2; border-radius: 8px; background: #fdf8f7; max-width: 480px; flex-basis: 100%; }
.fb-form-head { font-size: 12px; font-weight: 600; color: #8c4a42; display: inline-flex; gap: 5px; align-items: center; }
.fb-form select, .fb-form textarea { font-size: 13px; padding: 5px 8px; border: 1px solid #d0d7de; border-radius: 5px; font-family: inherit; background: #fff; }
.fb-form-actions { display: flex; gap: 8px; }
.fb-done { margin: 8px 0 4px; padding: 7px 12px; border-radius: 8px; background: #eaf6ee; color: #1c7c3c; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.fb-admin-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.fb-admin-head h1 { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.fb-table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--surface); border: 1px solid #e1e4e8; }
.fb-table th { text-align: left; padding: 8px 10px; border-bottom: 2px solid #e1e4e8; font-size: 12px; color: #6a737d; }
.fb-table td { padding: 8px 10px; border-bottom: 1px solid #eef1f4; vertical-align: top; }
.fb-row-resolved { opacity: .55; }
.pill-fb { background: #fdeeec; color: #8c4a42; }
.fb-message { max-width: 380px; }
.fb-status { font-size: 12px; padding: 3px 6px; border: 1px solid #d0d7de; border-radius: 5px; background: #fff; }
.fb-status-new { border-color: #c9a23b; }
