@font-face {
  font-family: "Source Sans 3";
  src: url("/source-sans-3.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f3f6f8;
  --white: #fff;
  --ink: #172b3b;
  --muted: #516676;
  --border: #dce5eb;
  --nav: #133045;
  --accent: #147361;
  --light: #e6f4ef;
  --warm: #8d5216;
  --danger: #962e2e;
  --danger-border: #e4b7b7;
  --danger-bg: #fff3f3;
  --text-small: .75rem;
  --text-body: .875rem;
  --text-section: 1.125rem;
  --text-title: 1.25rem;
  font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: var(--text-body); line-height: 1.4; background: var(--paper); color: var(--ink); min-height: 100vh; display: grid; grid-template-columns: 204px minmax(0, 1fr); }
button, select, input, textarea { font: inherit; }
button, a.action { cursor: pointer; }
a { color: var(--accent); }
.sidebar { background: var(--nav); color: var(--white); min-height: 100vh; padding: 22px 14px; }
.brand { display: flex; gap: 8px; align-items: center; padding: 0 6px 20px; font-size: 1rem; white-space: nowrap; }
.brand-mark { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 8px; background: #d8f1e7; color: #155347; font-weight: 800; }
nav { display: grid; gap: 4px; }
nav button { text-align: left; background: transparent; color: #d4e5ee; border: 0; border-radius: 8px; padding: 8px 10px; }
nav button:hover, nav button[aria-current="page"] { background: #254961; color: white; }
.security-nav { color: #d4e5ee; border-radius: 8px; padding: 8px 10px; text-decoration: none; }
.security-nav:hover, .security-nav:focus-visible, .security-nav[aria-current="page"] { background: #254961; color: var(--white); }
.security-screen { grid-template-columns: minmax(0, 1fr); align-content: center; justify-items: center; padding: 16px; }
.security-card { width: min(100%, 450px); }
.security-card p { margin-block: 12px; }
.security-action { display: inline-block; border-radius: 8px; padding: 9px 14px; background: var(--accent); color: var(--white); text-decoration: none; }
.security-action:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.security-session-card { padding: 16px; }
.security-session { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 0 0 16px; }
.security-session dt { color: var(--muted); font-size: var(--text-small); }
.security-session dd { margin: 2px 0 0; font-weight: 600; }
.security-frame { display: block; width: 100%; height: max(42rem, 80vh); border: 1px solid var(--border); border-radius: 12px; background: var(--white); }
main { padding: clamp(16px, 2.5vw, 32px); min-width: 0; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-head .actions { align-items: end; }
h1, h2, h3 { font-weight: 600; line-height: 1.25; }
h1 { margin: 0 0 4px; font-size: var(--text-title); }
h2 { margin: 0 0 10px; font-size: var(--text-section); }
h3 { font-size: 1rem; margin: 0 0 8px; }
p { margin: 0 0 8px; }
.muted, small { color: var(--muted); }
small,.eyebrow { font-size: var(--text-small); }
.eyebrow { color: var(--muted); margin: 0 0 4px; }
.actions, .toolbar, .tabs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.toolbar { margin: 0 0 10px; }
.actions button, .toolbar button, .action, .tabs button, .table-button, summary button { background: var(--white); color: var(--ink); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-weight: 600; text-decoration: none; }
button.primary, .action.primary { color: white; background: var(--accent); border-color: var(--accent); }
.actions button:hover, .toolbar button:hover, .action:hover, .tabs button:hover, .table-button:hover { border-color: #84a294; }
button:disabled, a.action[aria-disabled="true"] { opacity: .46; cursor: default; }
input, select, textarea { min-width: 0; max-width: 100%; padding: 6px 9px; color: var(--ink); background: white; border: 1px solid #becdd6; border-radius: 7px; }
.toolbar input[type="search"] { flex: 1 1 240px; }
.toolbar select { max-width: 100%; }
.project-picker label { display: grid; gap: 3px; }
.transfer-project-picker { width: 22rem; max-width: 100%; margin-bottom: 12px; }
.transfer-project-picker label { grid-template-columns: minmax(0, 1fr); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin: 12px 0 16px; }
.metric { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.metric strong { display: block; margin: 2px 0 3px; font-size: clamp(1.125rem, 1.6vw, 1.5rem); font-variant-numeric: tabular-nums; }
.tender-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 22rem),1fr)); gap: 12px; }
.sheet.tender-card { margin: 0; min-width: 0; }
.tender-card > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.tender-card h2 { margin: 0; overflow-wrap: anywhere; }
.tender-counts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.tender-counts .tender-count { display: grid; align-content: start; gap: 2px; min-width: 0; padding: 8px; text-align: left; }
.tender-count strong { font-size: var(--text-section); font-variant-numeric: tabular-nums; }
.tender-count span { color: var(--muted); font-size: var(--text-small); }
.sheet.tender-card-overdue, .tender-counts .tender-count-overdue { border-color: var(--danger-border); }
.tender-counts .tender-count-overdue { background: var(--danger-bg); color: var(--danger); }
.tender-count-overdue span { color: inherit; }
.request-toolbar { align-items: end; }
.request-toolbar label { display: grid; gap: 3px; }
.request-notes { min-width: 9rem; max-width: 22rem; white-space: pre-wrap; overflow-wrap: anywhere; }
td .request-actions { flex-wrap: wrap; }
.request-overdue .request-due, .request-overdue .request-notes, .request-overdue strong { color: var(--danger); }
.request-overdue .request-reminder { color: var(--danger); border-color: var(--danger-border); }
.tabs { border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 10px; }
.tabs button[aria-selected="true"] { background: var(--light); color: #125a4a; border-color: #afcec3; }
.sheet, details { background: var(--white); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; }
.sheet { padding: 12px; }
details > summary { cursor: pointer; list-style-position: inside; padding: 8px 12px; display: list-item; }
details[open] > summary { border-bottom: 1px solid var(--border); }
details .details-body { padding: 8px 12px; }
.material-group-picker { position: relative; flex: 0 1 19rem; min-width: 0; }
.toolbar .material-group-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 6px 9px; border-color: #becdd6; border-radius: 7px; font-weight: 400; }
.material-group-toggle span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.material-group-toggle::after { content: ''; width: 6px; height: 6px; border: solid var(--muted); border-width: 0 1px 1px 0; transform: rotate(45deg); }
.material-group-toggle[aria-expanded="true"]::after { transform: rotate(225deg); }
.material-group-panel { position: absolute; z-index: 3; inset-block-start: calc(100% + 4px); inset-inline-end: 0; width: min(23rem, calc(100vw - 28px)); background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 8px; box-shadow: 0 6px 20px #0002; }
.material-group-options { max-height: min(50vh, 23rem); margin-top: 6px; overflow-y: auto; }
.material-group-option { display: flex; align-items: flex-start; gap: 8px; padding: 7px 8px; border-radius: 6px; cursor: pointer; overflow-wrap: anywhere; }
.material-group-option:hover, .material-group-option:focus-within { background: var(--light); }
.material-group-option input { flex: none; margin: 3px 0 0; accent-color: var(--accent); }
.record-group .record-group, .record-group .supplier-price { margin-bottom: 8px; }
.record-group > .details-body, .supplier-price > .details-body { padding: 8px; }
.supplier-price .summary-right { float: none; display: block; padding-left: 18px; }
.summary-right { float: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.material-scope { display: inline-flex; width: calc(100% - 1.15em); vertical-align: middle; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; }
.material-scope strong { min-width: 0; overflow-wrap: anywhere; }
.material-scope-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--white); }
[data-import-preview] .table-wrap + .table-wrap { margin-top: 12px; }
.import-confirm { display: flex; align-items: baseline; gap: 6px; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: #355062; background: #f0f5f8; font-weight: 600; }
tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: #fbfcfd; }
tbody tr.request-overdue { background: var(--danger-bg); }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td small { display: block; margin-top: 2px; }
td .actions { justify-content: flex-end; flex-wrap: nowrap; white-space: nowrap; }
td .actions button { padding: 4px 7px; font-size: var(--text-body); }
.compact { white-space: nowrap; }
.status { color: var(--warm); font-size: var(--text-small); }
.overdue { color: var(--danger); }
.toolbar button.overdue { color: var(--danger); border-color: var(--danger-border); background: var(--danger-bg); }
.request-scope { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; }
.request-scope legend { padding: 0 4px; font-weight: 600; }
.request-check, form .request-check { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.request-check small { margin-left: 6px; }
.request-mapping { margin-top: 6px; }
.request-mapping label { display: grid; gap: 3px; }
.request-mapping select { width: 100%; }
.nip-lookup { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px; margin-bottom: 9px; }
.nip-lookup label { flex: 1 1 10rem; margin-bottom: 0; }
.nip-lookup [data-lookup-nip] { min-height: 34px; }
.contractor-picker { margin-bottom: 10px; }
.contractor-picker [data-contractor-open] { margin-bottom: 8px; }
.contractor-picker [data-contractor-draft] .actions { justify-content: flex-end; }
[data-review-matches] { margin-top: 8px; }
.empty { padding: 24px 14px; color: var(--muted); }
.two { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.transfer-panels { align-items: start; }
dialog { padding: 16px; color: var(--ink); border: 1px solid var(--border); border-radius: 14px; width: min(760px, calc(100vw - 28px)); max-height: 90vh; }
dialog::backdrop { background: #102b40a8; }
.dialog-head { display: flex; gap: 10px; align-items: start; justify-content: space-between; margin-bottom: 12px; }
.dialog-head h2 { margin: 0; }
form label { display: grid; gap: 3px; margin-bottom: 9px; }
textarea { width: 100%; min-height: 70px; resize: vertical; }
.field-error { color: #9c2c2c; padding: 6px 0; }
.dialog-foot { justify-content: flex-end; margin-top: 12px; }
.dialog-section { margin: 15px 0; }
.source-card { border: 1px solid var(--border); border-radius: 8px; padding: 12px; min-width: 0; overflow-wrap: anywhere; }
.source-card h3 { margin: 0 0 4px; }
.source-card label, .source-card .table-button { margin-top: 8px; }
.source-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1200px, calc(100vw - 28px));
  height: 90dvh;
  max-height: 90dvh;
  overflow: hidden;
  overscroll-behavior: contain;
}
.source-layout {
  display: grid;
  grid-template-columns: minmax(235px, 0.9fr) minmax(0, 2.1fr);
  gap: 16px;
  min-height: 0;
}
.source-sidebar, .source-preview { min-width: 0; min-height: 0; }
.source-layout .source-sidebar {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-inline-end: 6px;
}
.source-layout .source-sidebar:focus-visible { outline-offset: -2px; }
.source-sidebar > h3 { margin-top: 0; }
.source-sidebar > small { display: block; margin-top: 4px; }
.source-preview { display: grid; grid-template-rows: auto auto minmax(0, 1fr); overflow: hidden; }
.source-preview-controls { align-items: center; margin-bottom: 4px; }
.source-preview-controls button:disabled { opacity: .48; }
.source-card [aria-pressed="true"], .source-preview [aria-pressed="true"] { border-color: var(--accent); background: var(--light); }
.source-preview [data-pdf-status] { margin: 4px 0; min-height: 2lh; }
.source-pdf-viewport { overflow: auto; overscroll-behavior: contain; background: var(--paper); border: 1px solid var(--border); border-radius: 8px; }
.source-pdf-viewport:focus-visible { outline-offset: -2px; }
.source-pdf-viewport canvas { display: block; width: 100%; height: auto; }
.source-pdf-zoom canvas { width: max(145%, 640px); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.document-assistant { max-width: 960px; }
.document-agent-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.document-agent-head :is(h2,p) { margin: 0; }
.document-transcript {
  max-height: min(58dvh, 550px);
  min-height: 132px;
  margin-top: 14px;
  padding: 12px;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.document-starters p { margin: 0 0 12px; }
.document-turn { display: grid; gap: 8px; margin-bottom: 12px; }
.document-turn:last-child { margin-bottom: 0; }
.document-user-message, .document-agent-message { margin: 0; padding: 10px 12px; border-radius: 8px; overflow-wrap: anywhere; }
.document-user-message { justify-self: end; max-width: 90%; background: var(--light); }
.document-agent-message { justify-self: start; max-width: 100%; background: var(--white); border: 1px solid var(--border); }
.document-agent-message h3 { margin: 0 0 8px; font-size: var(--text-body); }
.document-agent-message p:last-child, .document-agent-message ul:last-child { margin-bottom: 0; }
.document-assistant form { margin-top: 12px; }
.document-assistant textarea { display: block; min-height: 52px; }
.document-assistant .actions { justify-content: flex-start; margin-top: 6px; }
.document-assistant ul { padding-inline-start: 20px; }
.document-assistant blockquote { margin: 6px 0 14px; padding-inline-start: 10px; border-inline-start: 3px solid var(--border); }
.document-answer-text { white-space: pre-line; overflow-wrap: anywhere; }
@media (max-width: 730px) {
  .source-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
  .source-preview { order: -1; }
  .document-transcript { max-height: 48dvh; padding: 8px; }
}
#notification { position: fixed; right: 20px; bottom: 20px; max-width: min(480px, 90vw); padding: 12px 16px; background: #133045; color: white; border-radius: 8px; box-shadow: 0 6px 20px #0002; z-index: 5; }
:focus-visible { outline: 2px solid #168087; outline-offset: 2px; }
[hidden] { display: none !important; }
@media (max-width: 1000px) { .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 730px) {
  body { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; padding: 12px; }
  .brand { padding-bottom: 11px; }
  nav { display: flex; flex-wrap: wrap; gap: 4px; }
  nav button { padding: 7px 9px; }
  .page-head, .two { display: block; }
  .page-head .actions { margin-top: 10px; }
  .metric { padding: 10px; }
  main { padding: 14px; }
  input, select, textarea { font-size: 1rem; }
  .actions button, .toolbar button, .action, .tabs button, .table-button { min-height: 36px; }
  .material-group-picker { flex: 1 0 100%; }
  .material-group-panel { inset-inline: 0; width: auto; }
  .material-scope { vertical-align: top; }
  .tender-list { grid-template-columns: minmax(0,1fr); }
  .request-list thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .request-list table, .request-list tbody { display: block; }
  .request-list tbody tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border-bottom: 1px solid var(--border); padding: 8px; }
  .request-list tbody tr:last-child { border-bottom: 0; }
  .request-list td { min-width: 0; max-width: none; border: 0; padding: 4px; white-space: normal; overflow-wrap: anywhere; }
  .request-list td:first-child, .request-list td:last-child, .request-list .request-notes { grid-column: 1/-1; }
  .request-list .request-notes { white-space: pre-wrap; }
  .request-list [data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: var(--text-small); }
  .request-list .request-actions { justify-content: flex-start; }
  .scope-offer-lines table { table-layout: fixed; overflow-wrap: anywhere; }
  .scope-offer-lines th:nth-child(2) { width: 25%; }
  .scope-offer-lines th,.scope-offer-lines td { padding-inline: 8px; }
}
