:root {
  --navy: #142a46;
  --navy-2: #1d3d63;
  --navy-3: #284f7a;
  --ink: #172033;
  --muted: #657084;
  --line: #dce2ea;
  --line-2: #e9edf2;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef3f8;
  --background: #f3f6fa;
  --green: #16794b;
  --green-bg: #e8f7ef;
  --amber: #9a5b00;
  --amber-bg: #fff4d9;
  --red: #b42318;
  --red-bg: #feeceb;
  --blue: #1d5fa7;
  --blue-bg: #eaf3ff;
  --gray-bg: #edf0f4;
  --shadow: 0 8px 24px rgba(20, 42, 70, 0.08);
  --radius: 14px;
  --radius-sm: 9px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--background); }
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 252px; background: var(--navy); color: white; display: flex; flex-direction: column; z-index: 20; overflow-y: auto; }
.brand-block { padding: 22px 18px 16px; display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: white; color: var(--navy); font-weight: 800; letter-spacing: -1px; }
.brand-title { font-weight: 750; font-size: 17px; }
.brand-subtitle { font-size: 11px; color: #b9c8da; margin-top: 2px; letter-spacing: .04em; }
.demo-banner { margin: 0 18px 13px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; color: #f7ce72; font-size: 11px; letter-spacing: .12em; text-align: center; font-weight: 700; }
.nav-list { padding: 0 10px 20px; }
.nav-section { color: #7991ac; font-size: 10px; text-transform: uppercase; letter-spacing: .15em; font-weight: 700; padding: 18px 12px 7px; }
.nav-item { width: 100%; border: 0; background: transparent; color: #cfdae7; border-radius: 9px; padding: 10px 12px; display: flex; align-items: center; gap: 11px; text-align: left; margin: 2px 0; transition: .16s ease; }
.nav-item:hover { background: rgba(255,255,255,.07); color: white; }
.nav-item.active { background: white; color: var(--navy); font-weight: 700; }
.nav-icon { width: 20px; font-size: 16px; text-align: center; }
.sidebar-footer { margin-top: auto; padding: 14px 18px 22px; }
.security-note { padding: 12px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05); border-radius: 10px; font-size: 11px; line-height: 1.5; color: #b9c8da; }
.security-note strong { color: white; }
.main-area { margin-left: 252px; min-width: 0; flex: 1; }
.topbar { height: 70px; position: sticky; top: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.bid-selector-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bid-selector-wrap label { font-size: 12px; color: var(--muted); font-weight: 650; white-space: nowrap; }
.bid-selector-wrap select { max-width: 430px; min-width: 270px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.connection-dot { width: 8px; height: 8px; border-radius: 50%; background: #aaa; }
.connection-dot.ok { background: var(--green); box-shadow: 0 0 0 4px var(--green-bg); }
.connection-dot.error { background: var(--red); box-shadow: 0 0 0 4px var(--red-bg); }
.connection-label { font-size: 12px; color: var(--muted); }
.mobile-menu { display: none !important; }
.progress-strip { min-height: 44px; background: white; border-bottom: 1px solid var(--line); padding: 0 28px; display: flex; align-items: center; gap: 8px; overflow-x: auto; }
.progress-step { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.progress-step::after { content: "›"; margin-left: 3px; color: #aab3c0; }
.progress-step:last-child::after { display: none; }
.progress-step .step-dot { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--gray-bg); font-size: 10px; font-weight: 750; }
.progress-step.done { color: var(--green); font-weight: 650; }
.progress-step.done .step-dot { background: var(--green-bg); }
.progress-step.current { color: var(--blue); font-weight: 700; }
.progress-step.current .step-dot { background: var(--blue-bg); }
.content-area { padding: 28px; max-width: 1800px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; animation: fadeIn .15s ease; }
@keyframes fadeIn { from { opacity: .65; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.page-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 20px; }
.page-heading h1 { margin: 3px 0 7px; font-size: 28px; letter-spacing: -.025em; }
.page-description { margin: 0; color: var(--muted); max-width: 850px; line-height: 1.55; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; color: var(--blue); font-size: 10px; font-weight: 800; margin: 0; }
.heading-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.button { border: 1px solid transparent; border-radius: 9px; padding: 10px 14px; font-weight: 700; font-size: 13px; transition: .15s ease; display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-decoration: none; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.button.primary { background: var(--navy); color: white; }
.button.primary:hover { background: var(--navy-2); }
.button.secondary { background: white; color: var(--navy); border-color: var(--line); }
.button.secondary:hover { border-color: #b9c4d2; background: var(--surface-2); }
.button.ghost { background: transparent; color: var(--blue); border-color: transparent; }
.button.danger { background: var(--red-bg); color: var(--red); border-color: #fac8c5; }
.button.small { padding: 7px 10px; font-size: 12px; }
.button.full { width: 100%; }
.icon-button { border: 0; background: transparent; width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); font-size: 20px; }
.icon-button:hover { background: var(--surface-3); color: var(--ink); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 1px rgba(20,42,70,.02); padding: 20px; margin-bottom: 20px; min-width: 0; }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel-header h2, .panel h2 { margin: 0 0 4px; font-size: 17px; }
.panel-header p, .panel > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.subtle-panel { background: #f8fafc; box-shadow: none; }
.form-panel { max-width: 1000px; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span, .switch-field strong { font-size: 12px; font-weight: 700; color: #39465a; }
.field input, .field select, .field textarea, select, input, textarea { width: 100%; border: 1px solid #cfd7e2; border-radius: 8px; padding: 10px 11px; color: var(--ink); background: white; outline: none; transition: .15s ease; }
.field input:focus, .field select:focus, .field textarea:focus, select:focus, input:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29,95,167,.12); }
textarea { resize: vertical; }
.span-2 { grid-column: span 2; }
.span-4 { grid-column: span 4; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line-2); padding-top: 16px; }
.workflow-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 16px; }
.workflow-steps > div { padding: 15px; background: white; border: 1px solid var(--line); border-radius: 10px; }
.workflow-steps span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: white; font-size: 11px; font-weight: 700; margin-bottom: 10px; }
.workflow-steps strong { display: block; margin-bottom: 5px; }
.workflow-steps p { font-size: 12px; color: var(--muted); line-height: 1.45; }
.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi-card { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 17px; }
.kpi-card .kpi-label { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.kpi-card .kpi-value { font-size: 29px; font-weight: 800; margin: 9px 0 4px; letter-spacing: -.03em; }
.kpi-card .kpi-note { color: var(--muted); font-size: 11px; }
.kpi-card.risk .kpi-value { color: var(--red); }
.kpi-card.good .kpi-value { color: var(--green); }
.two-column-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.documents-layout { grid-template-columns: minmax(330px, .75fr) minmax(0, 1.25fr); }
.alert { border-radius: 10px; border: 1px solid; padding: 13px 15px; margin-bottom: 18px; font-size: 13px; line-height: 1.5; }
.alert.warning { color: #6b4600; background: var(--amber-bg); border-color: #f2d98f; }
.alert.info { color: #174c82; background: var(--blue-bg); border-color: #c8def6; }
.alert.success { color: #12623c; background: var(--green-bg); border-color: #bce8d1; }
.alert.danger { color: #8f1d15; background: var(--red-bg); border-color: #fac7c3; }
.upload-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 190px; border: 1.5px dashed #aebdce; border-radius: 12px; background: var(--surface-2); margin: 16px 0; padding: 22px; cursor: pointer; transition: .15s ease; }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--blue); background: var(--blue-bg); }
.upload-zone input { display: none; }
.upload-icon { font-size: 28px; color: var(--blue); margin-bottom: 9px; }
.upload-zone small { color: var(--muted); margin-top: 7px; }
.trust-box { border-left: 3px solid var(--blue); background: var(--surface-2); border-radius: 0 9px 9px 0; padding: 12px 14px; margin-top: 15px; }
.trust-box strong { font-size: 12px; }
.trust-box p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.document-card { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line-2); }
.document-card:last-child { border-bottom: 0; }
.file-icon { width: 38px; height: 38px; border-radius: 8px; background: var(--surface-3); display: grid; place-items: center; color: var(--navy); font-weight: 800; font-size: 11px; }
.document-meta { flex: 1; min-width: 0; }
.document-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.document-info { color: var(--muted); font-size: 11px; margin-top: 4px; }
.document-actions { display: flex; gap: 3px; }
.table-panel { padding: 0; overflow: hidden; }
.table-panel .panel-header { padding: 20px 20px 0; }
.table-toolbar { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.search-field { display: flex; align-items: center; gap: 8px; min-width: 280px; max-width: 520px; flex: 1; border: 1px solid #cfd7e2; border-radius: 8px; padding: 0 10px; background: white; }
.search-field input { border: 0; box-shadow: none; padding-left: 0; }
.search-field input:focus { box-shadow: none; }
.table-scroll { overflow-x: auto; }
.table-scroll.wide table { min-width: 1450px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { background: #f8fafc; color: #526075; text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: top; line-height: 1.45; }
tbody tr:hover { background: #fbfcfe; }
tfoot td { background: #f8fafc; font-weight: 800; border-top: 2px solid var(--line); }
.table-title { font-weight: 700; }
.table-subtitle { font-size: 11px; color: var(--muted); margin-top: 4px; max-width: 500px; }
.table-actions { display: flex; gap: 4px; flex-wrap: wrap; white-space: nowrap; }
.summary-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.summary-pill { display: flex; align-items: center; gap: 8px; background: white; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; font-size: 12px; }
.summary-pill strong { font-size: 14px; }
.status-chip { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 4px 8px; font-size: 10px; font-weight: 800; letter-spacing: .03em; white-space: nowrap; }
.status-chip.pass, .status-chip.approved, .status-chip.active { color: var(--green); background: var(--green-bg); }
.status-chip.partial, .status-chip.pending, .status-chip.conditional { color: var(--amber); background: var(--amber-bg); }
.status-chip.fail, .status-chip.disqualified, .status-chip.discontinued { color: var(--red); background: var(--red-bg); }
.status-chip.unknown, .status-chip.inactive, .status-chip.draft { color: #5d6675; background: var(--gray-bg); }
.status-chip.primary { color: var(--blue); background: var(--blue-bg); }
.status-chip.demo { color: #6d4d8c; background: #f1eafb; }
.source-tag { display: inline-block; background: var(--surface-3); border-radius: 5px; padding: 2px 5px; font-size: 10px; color: #556274; margin-top: 5px; }
.priority-controls { display: flex; align-items: center; gap: 5px; }
.priority-number { width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: white; display: grid; place-items: center; font-weight: 800; }
.priority-arrow { border: 1px solid var(--line); background: white; border-radius: 6px; width: 25px; height: 25px; }
.local-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.matching-legend { background: white; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; margin-bottom: 16px; color: var(--muted); font-size: 11px; }
.empty-state { background: white; border: 1px dashed #b9c5d3; border-radius: var(--radius); min-height: 330px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px; }
.empty-state .empty-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--blue-bg); color: var(--blue); display: grid; place-items: center; font-size: 25px; }
.empty-state h2 { margin: 15px 0 5px; }
.empty-state p { color: var(--muted); max-width: 500px; line-height: 1.5; }
.match-item-block { margin-bottom: 22px; }
.match-item-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.match-item-heading h2 { margin: 0; font-size: 18px; }
.candidate-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.candidate-card { background: white; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.candidate-card.disqualified { border-color: #e6aaa5; }
.candidate-card.selected { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(29,95,167,.10); }
.candidate-top { padding: 16px; display: flex; justify-content: space-between; gap: 10px; }
.candidate-name { font-size: 15px; font-weight: 800; }
.candidate-brand { color: var(--muted); font-size: 11px; margin-bottom: 3px; }
.score-ring { width: 56px; height: 56px; border: 6px solid var(--surface-3); border-top-color: var(--blue); border-radius: 50%; display: grid; place-items: center; font-weight: 850; font-size: 13px; flex: 0 0 auto; }
.score-breakdown { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.score-breakdown div { padding: 9px 5px; text-align: center; border-right: 1px solid var(--line-2); }
.score-breakdown div:last-child { border-right: 0; }
.score-breakdown strong { display: block; font-size: 14px; }
.score-breakdown span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }
.candidate-actions { padding: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.requirement-matrix { border-top: 1px solid var(--line); }
.requirement-row { padding: 11px 13px; display: grid; grid-template-columns: 88px minmax(170px, 1fr); gap: 10px; border-bottom: 1px solid var(--line-2); }
.requirement-row:last-child { border-bottom: 0; }
.requirement-detail { font-size: 11px; }
.requirement-detail strong { display: block; font-size: 12px; margin-bottom: 3px; }
.evidence-box { background: var(--surface-2); border-radius: 7px; padding: 8px; margin-top: 7px; color: #4f5d70; }
.details-toggle { width: 100%; border: 0; background: #f8fafc; padding: 10px; color: var(--blue); font-weight: 700; font-size: 11px; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; }
.external-result { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.external-result:last-child { border-bottom: 0; }
.external-result h3 { margin: 0 0 4px; font-size: 14px; }
.external-result p { color: var(--muted); font-size: 12px; margin: 4px 0; }
.price-placeholder { display: inline-block; max-width: 110px; color: var(--amber); font-size: 9px; font-weight: 800; text-transform: uppercase; line-height: 1.2; }
.price-input { min-width: 90px; padding: 7px !important; font-size: 11px; }
.offer-layout { display: grid; grid-template-columns: minmax(380px, .8fr) minmax(520px, 1.2fr); gap: 20px; align-items: start; }
.offer-editor, .offer-preview-panel { margin: 0; }
.offer-section-card { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 12px; overflow: hidden; }
.offer-section-heading { display: flex; align-items: center; justify-content: space-between; padding: 11px 13px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.offer-section-heading strong { font-size: 13px; }
.offer-section-card textarea { border: 0; border-radius: 0; box-shadow: none; min-height: 130px; }
.offer-section-actions { padding: 8px 10px; text-align: right; border-top: 1px solid var(--line-2); }
.offer-preview-panel { max-height: calc(100vh - 145px); overflow: auto; }
.panel-header.sticky { position: sticky; top: 0; background: white; z-index: 2; padding-bottom: 10px; }
.paper-preview { background: #dfe5eb; padding: 20px; border-radius: 9px; }
.paper-page { background: white; max-width: 794px; min-height: 1123px; margin: 0 auto 18px; padding: 58px 62px; box-shadow: 0 3px 12px rgba(0,0,0,.12); font-family: Arial, sans-serif; color: #111; font-size: 12px; line-height: 1.55; }
.paper-page h1 { color: var(--navy); font-size: 28px; margin: 0 0 20px; }
.paper-page h2 { color: var(--navy); font-size: 18px; margin: 24px 0 8px; border-bottom: 1px solid #ccd5df; padding-bottom: 5px; }
.paper-page p { white-space: pre-wrap; }
.paper-page table { font-size: 9px; margin: 10px 0 20px; }
.paper-page th, .paper-page td { border: 1px solid #bfc8d2; padding: 5px; }
.paper-cover { display: flex; flex-direction: column; justify-content: center; text-align: center; }
.paper-cover .cover-company { margin-top: 150px; color: #526075; }
.approval-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.approval-card { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.approval-card.approved { border-color: #9ed8bb; }
.approval-number { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: white; font-weight: 800; margin-bottom: 13px; }
.approval-card h2 { font-size: 15px; min-height: 38px; }
.approval-meta { color: var(--muted); font-size: 11px; min-height: 38px; margin: 8px 0 12px; }
.approval-actions { display: flex; gap: 7px; }
.action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.action-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: var(--surface-2); }
.action-card strong { display: block; margin-bottom: 4px; }
.action-card p { color: var(--muted); font-size: 12px; margin: 0 0 10px; }
.activity-row, .gate-row { padding: 10px 0; border-bottom: 1px solid var(--line-2); display: flex; gap: 10px; align-items: flex-start; }
.activity-row:last-child, .gate-row:last-child { border-bottom: 0; }
.activity-icon { width: 29px; height: 29px; background: var(--surface-3); border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; }
.activity-main { flex: 1; }
.activity-title { font-weight: 700; font-size: 12px; }
.activity-meta { color: var(--muted); font-size: 10px; margin-top: 3px; }
.gate-row { align-items: center; }
.gate-number { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); font-size: 11px; font-weight: 800; }
.gate-main { flex: 1; }
.gate-name { font-weight: 700; font-size: 12px; }
.gate-meta { color: var(--muted); font-size: 10px; margin-top: 2px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.stack-form { display: flex; flex-direction: column; gap: 16px; }
.switch-field { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 9px; padding: 12px; }
.switch-field input { width: auto; margin-top: 3px; }
.switch-field span { display: flex; flex-direction: column; gap: 3px; }
.switch-field small { color: var(--muted); }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input { padding: 0; box-shadow: none; }
.range-row output { min-width: 40px; text-align: center; font-weight: 800; color: var(--blue); }
.code-block { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #101b2b; color: #d4e4f7; border-radius: 9px; padding: 11px 12px; margin: 10px 0; }
.code-block code { overflow-wrap: anywhere; }
.weights-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; margin-top: 14px; }
.weights-grid div { text-align: center; padding: 12px 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; }
.weights-grid strong { display: block; color: var(--navy); font-size: 18px; }
.weights-grid span { color: var(--muted); font-size: 10px; }
.modal { border: 0; padding: 0; border-radius: 15px; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 40px); box-shadow: 0 20px 70px rgba(12,28,48,.25); }
.modal::backdrop { background: rgba(10,23,39,.55); backdrop-filter: blur(2px); }
.modal-card { margin: 0; }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 4px 0 0; font-size: 20px; }
.modal-body { padding: 20px 22px; max-height: calc(100vh - 190px); overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-grid .full-row { grid-column: 1 / -1; }
.toast-container { position: fixed; top: 82px; right: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 290px; max-width: 430px; background: white; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 9px; box-shadow: var(--shadow); padding: 12px 14px; animation: toastIn .2s ease; }
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }
.toast-title { font-weight: 800; font-size: 12px; }
.toast-message { color: var(--muted); font-size: 11px; margin-top: 3px; line-height: 1.45; }
@keyframes toastIn { from { transform: translateX(16px); opacity: 0; } }
.loading-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(255,255,255,.80); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.spinner { width: 38px; height: 38px; border: 4px solid #dbe4ed; border-top-color: var(--navy); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay p { color: var(--navy); font-weight: 700; }

@media (max-width: 1250px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .candidate-grid { grid-template-columns: repeat(2, 1fr); }
  .weights-grid { grid-template-columns: repeat(4, 1fr); }
  .offer-layout { grid-template-columns: 1fr; }
  .offer-preview-panel { max-height: none; }
}

@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); transition: .2s ease; box-shadow: 10px 0 30px rgba(0,0,0,.18); }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .mobile-menu { display: grid !important; }
  .topbar { padding: 0 16px; gap: 10px; }
  .topbar-actions .connection-label { display: none; }
  .bid-selector-wrap { flex: 1; }
  .bid-selector-wrap select { min-width: 0; max-width: none; }
  .content-area { padding: 20px 16px; }
  .progress-strip { padding: 0 16px; }
  .two-column-grid, .settings-grid, .documents-layout { grid-template-columns: 1fr; }
  .approval-grid, .action-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .page-heading { flex-direction: column; }
  .heading-actions { justify-content: flex-start; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .candidate-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2, .span-4 { grid-column: span 1; }
  .workflow-steps { grid-template-columns: 1fr 1fr; }
  .table-toolbar { align-items: stretch; flex-direction: column; }
  .search-field { min-width: 0; max-width: none; }
  .inline-form { flex-direction: column; }
  .weights-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-grid { grid-template-columns: 1fr; }
  .modal-grid .full-row { grid-column: auto; }
  .connection-dot, .connection-label { display: none; }
}

@media print {
  body * { visibility: hidden !important; }
  #offerPreview, #offerPreview * { visibility: visible !important; }
  #offerPreview { position: absolute; left: 0; top: 0; width: 100%; background: white; padding: 0; }
  .paper-page { box-shadow: none; margin: 0; max-width: none; min-height: auto; page-break-after: always; }
  .paper-page:last-child { page-break-after: auto; }
  @page { size: A4; margin: 0; }
}

/* NexBid official logo update v1.1.1 START */
.brand-block {
  padding: 14px 15px 12px;
  display: block;
}
.brand-logo-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 10px 12px 9px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
  border: 1px solid rgba(255, 255, 255, .32);
}
.brand-logo {
  display: block;
  width: 100%;
  max-width: 205px;
  height: auto;
  max-height: 86px;
  object-fit: contain;
  margin: 0 auto;
}
.brand-app-name {
  margin-top: 8px;
  color: #d9e5f1;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: .09em;
  text-align: center;
  text-transform: uppercase;
}
.offer-cover-logo {
  display: block;
  width: 225px;
  max-width: 58%;
  height: auto;
  max-height: 96px;
  object-fit: contain;
  margin: 0 auto;
}
@media (max-width: 980px) {
  .brand-logo { max-width: 195px; }
}
@media print {
  .offer-cover-logo { width: 225px; max-width: 58%; }
}
/* NexBid official logo update v1.1.1 END */

/* NexBid Team authentication and multi-user UI v2.0.0 START */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  background:
    radial-gradient(circle at 15% 20%, rgba(29, 95, 167, .13), transparent 36%),
    radial-gradient(circle at 85% 75%, rgba(20, 42, 70, .12), transparent 40%),
    linear-gradient(145deg, #eef3f8 0%, #ffffff 52%, #e9eff6 100%);
}
.auth-card {
  width: min(560px, 100%);
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 24px 70px rgba(20, 42, 70, .16);
}
.auth-brand {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  align-items: center;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line-2);
}
.auth-brand img { display: block; width: 100%; height: auto; }
.auth-brand h1 { margin: 4px 0 7px; font-size: 28px; letter-spacing: -.025em; }
.auth-brand p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.auth-form { display: flex; flex-direction: column; gap: 15px; }
.auth-form-heading h2 { margin: 0 0 5px; font-size: 20px; }
.auth-form-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.password-rules { padding: 11px 12px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.45; }
.auth-footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 22px; padding-top: 15px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: 10px; }

.user-menu { position: relative; }
.user-menu-button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 10px;
  padding: 5px 9px 5px 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  min-width: 190px;
  text-align: left;
}
.user-menu-button:hover { background: var(--surface-2); }
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--navy);
  color: white;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
}
.user-avatar.large { width: 52px; height: 52px; font-size: 16px; }
.user-meta { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.user-meta strong { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  width: 190px;
  padding: 7px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 50;
}
.user-menu-dropdown button { width: 100%; border: 0; background: transparent; border-radius: 7px; padding: 9px 10px; text-align: left; color: var(--ink); font-size: 12px; }
.user-menu-dropdown button:hover { background: var(--surface-3); }
.account-summary { display: flex; align-items: center; gap: 14px; }
.account-summary strong { display: block; font-size: 15px; }
.account-summary p { margin: 3px 0 7px; color: var(--muted); font-size: 12px; }
.user-name-cell { display: flex; flex-direction: column; gap: 2px; }
.user-name-cell strong { font-size: 12px; }
.user-name-cell small { color: var(--muted); font-size: 10px; }
.permission-disabled { opacity: .48 !important; pointer-events: none !important; }

@media (max-width: 980px) {
  .user-menu-button { min-width: 0; }
  .user-menu-button .user-meta { display: none; }
  .topbar-actions .connection-label { display: none; }
}
@media (max-width: 600px) {
  .auth-card { padding: 21px; border-radius: 15px; }
  .auth-brand { grid-template-columns: 1fr; text-align: center; }
  .auth-brand img { max-width: 230px; margin: 0 auto; }
  .auth-footer { flex-direction: column; gap: 5px; }
  .topbar-actions #quickNewBid { display: none; }
}
/* NexBid Team authentication and multi-user UI v2.0.0 END */
.demo-banner.team { color: #bfe7d1; border-color: rgba(191,231,209,.30); background: rgba(22,121,75,.10); }
