:root {
  --navy: #0b1f3a;
  --navy-2: #122b4f;
  --blue: #2458a6;
  --blue-soft: #eaf1fb;
  --teal: #0c8b78;
  --ink: #142033;
  --muted: #69768a;
  --line: #dce3ec;
  --panel: #ffffff;
  --canvas: #f3f6fa;
  --danger: #b42318;
  --shadow: 0 12px 30px rgba(13, 31, 58, .07);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--canvas); }
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 245px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 26px 18px 20px; color: #fff; background: linear-gradient(180deg, var(--navy), #07172d); display: flex; flex-direction: column; overflow: hidden; }
.brand { color: #fff; display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; flex: 0 0 auto; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: inline-grid; place-items: center; background: linear-gradient(135deg, #4d8ae5, #0b9c87); color: #fff; font-weight: 800; letter-spacing: -.03em; box-shadow: 0 10px 20px rgba(0,0,0,.2); }
.brand strong, .brand small { display: block; }
.brand small { color: #9fb0c8; font-size: 11px; margin-top: 3px; }
.sidebar nav { display: grid; gap: 5px; overflow-y: auto; overscroll-behavior: contain; padding: 0 4px 10px; margin: 0 -4px; scrollbar-width: thin; }
.sidebar nav a { color: #b9c6d8; padding: 11px 13px; border-radius: 10px; display: flex; gap: 11px; align-items: center; font-size: 14px; }
.sidebar nav a span { width: 18px; text-align: center; color: #7f98b8; }
.sidebar nav a:hover, .sidebar nav a.active { color: #fff; background: rgba(255,255,255,.09); }
.sidebar nav a.active span { color: #65d5c2; }
.sidebar-foot { margin-top: auto; flex: 0 0 auto; font-size: 11px; color: #91a3bc; border-top: 1px solid rgba(255,255,255,.1); padding: 14px 8px 0; }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #3fd49f; margin-right: 8px; box-shadow: 0 0 0 4px rgba(63,212,159,.12); }

.main { min-width: 0; padding: 32px 38px 60px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 26px; }
.topbar h1 { margin: 3px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(28px, 3vw, 40px); font-weight: 600; letter-spacing: -.035em; color: var(--navy); }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .14em; color: var(--teal); font-size: 10px; font-weight: 800; }
.top-actions, .form-actions, .document-toolbar > div { display: flex; gap: 10px; align-items: center; }
.button { min-height: 39px; border-radius: 9px; padding: 9px 15px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.button.primary { background: var(--blue); color: #fff; box-shadow: 0 7px 14px rgba(36,88,166,.16); }
.button.secondary { background: #fff; border-color: var(--line); color: var(--navy); }
.button.danger { background: #fff0ef; border-color: #f1aaa4; color: var(--danger); }
.button.full, .full { grid-column: 1 / -1; width: 100%; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.notification-button { position: relative; }
.notification-button b { min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--danger); color: #fff; font-size: 9px; line-height: 1; margin-left: 7px; }
.user-pill { display: grid; gap: 2px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--navy); background: #fff; }
.user-pill strong { font-size: 10px; }
.user-pill small { color: var(--muted); font-size: 8px; }

.alert { border-radius: 10px; padding: 12px 15px; margin: 0 0 20px; border: 1px solid #9bd9c9; background: #e8f8f3; color: #0b6659; font-size: 13px; }
.alert.error { background: #fff0ef; border-color: #f4b4ae; color: var(--danger); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 18px; }
.metric-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.metric { padding: 21px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.metric[href] { text-decoration: none; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.metric[href]:hover { transform: translateY(-2px); border-color: var(--blue); box-shadow: 0 10px 24px rgba(28,74,138,.14); }
.metric span, .metric small { display: block; color: var(--muted); }
.metric span { font-size: 12px; font-weight: 700; }
.metric strong { display: block; font-family: Georgia, serif; font-size: 27px; color: var(--navy); margin: 13px 0 7px; }
.metric small { font-size: 10px; line-height: 1.5; }
.notification-list { display: grid; gap: 9px; }
.notification-item { display: grid; grid-template-columns: 11px minmax(0,1fr) auto; gap: 13px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
.notification-item:hover { border-color: #a9bfdf; background: #fbfdff; }
.notification-marker { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.notification-item.warning .notification-marker { background: #bb7e00; box-shadow: 0 0 0 4px #fff3cf; }
.notification-item.critical .notification-marker { background: var(--danger); box-shadow: 0 0 0 4px #fee7e5; }
.notification-item > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.notification-item small { color: var(--teal); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.notification-item strong { color: var(--navy); font-size: 13px; }
.notification-item em { color: var(--muted); font-size: 11px; font-style: normal; line-height: 1.45; }
.notification-item > b { color: var(--blue); font-size: 11px; white-space: nowrap; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,2fr) minmax(280px,1fr); gap: 18px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 21px; margin-bottom: 18px; }
.panel.span-2 { min-width: 0; }
.panel-head { min-height: 45px; display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 17px; }
.panel-head.wrap { flex-wrap: wrap; align-items: center; }
.panel-head h2 { margin: 3px 0 0; color: var(--navy); font-family: Georgia, serif; font-size: 22px; font-weight: 600; }
.panel-head > a { font-size: 12px; font-weight: 700; }
.table-wrap, .line-table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { color: var(--muted); text-transform: uppercase; font-size: 9px; letter-spacing: .08em; text-align: left; padding: 10px; border-bottom: 1px solid var(--line); }
td { padding: 12px 10px; border-bottom: 1px solid #edf1f5; vertical-align: top; }
td small, td strong { display: block; }
td small { color: var(--muted); margin-top: 4px; font-size: 10px; }
.right { text-align: right; }
.strong-link { color: var(--navy); font-weight: 800; }
.status { display: inline-flex; border-radius: 999px; padding: 5px 8px; font-size: 9px; font-weight: 800; color: #44536a; background: #edf1f5; white-space: nowrap; }
.status-active, .status-approved, .status-paid, .status-received, .status-accepted, .status-available, .status-completed, .status-closed { color: #08705f; background: #dcf5ed; }
.status-sent, .status-in-transit, .status-acknowledged, .status-partially-received, .status-partially-accepted, .status-booked, .status-submitted, .status-released, .status-ready, .status-assigned, .status-in-progress { color: #1c54a3; background: #e5efff; }
.status-pending-approval, .status-planning, .status-draft, .status-preparing, .status-pending, .status-customs { color: #875a00; background: #fff3cf; }
.status-cancelled, .status-exception, .status-rejected, .status-receipt-exception, .status-open, .status-variance, .status-on-hold, .status-quantity-variance, .status-price-variance, .status-quantity-price-variance, .status-quarantine, .status-scrapped { color: #9b2119; background: #fee7e5; }
.status-issued { color: #5c4b89; background: #eee9fb; }
.status-matched, .status-delivered, .status-cleared, .status-not-required { color: #08705f; background: #dcf5ed; }
.status-held { color: #9b2119; background: #fee7e5; }
.status-inspection-required, .status-certification-pending, .status-engineering-review, .status-inspection { color: #5c4b89; background: #eee9fb; }
.status-critical, .status-major { color: #9b2119; background: #fee7e5; }
.status-minor, .status-priority, .status-work-complete, .status-rectification { color: #875a00; background: #fff3cf; }
.status-deferred, .status-not-applicable { color: #44536a; background: #edf1f5; }
.empty { text-align: center; padding: 36px 18px; color: var(--muted); }
.empty strong { color: var(--navy); display: block; }
.quick-list { display: grid; gap: 10px; }
.quick-list a { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); }
.quick-list a:hover { border-color: #9eb9df; background: var(--blue-soft); }
.quick-list a > span { color: var(--teal); font-size: 10px; font-weight: 900; }
.quick-list strong, .quick-list small { display: block; }
.quick-list small { color: var(--muted); font-size: 10px; margin-top: 3px; }
.split-layout { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(300px, .8fr); gap: 18px; align-items: start; }
.split-layout > .form-panel,
.po-control-grid > .form-panel { position: sticky; top: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.form-grid.four { grid-template-columns: repeat(4, minmax(0,1fr)); }
.form-grid .span-2 { grid-column: span 2; }
label { display: grid; gap: 6px; color: #526176; font-size: 10px; font-weight: 800; }
input, select, textarea { width: 100%; color: var(--ink); border: 1px solid #ccd6e2; border-radius: 8px; background: #fff; padding: 9px 10px; font-size: 12px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: #6b98da; box-shadow: 0 0 0 3px rgba(64,119,195,.12); }
textarea { resize: vertical; }
.checkbox { display: flex; align-items: center; gap: 8px; }
.checkbox input { width: auto; }
.filter-tabs { display: flex; flex-wrap: wrap; gap: 5px; }
.filter-tabs a { font-size: 9px; font-weight: 800; color: var(--muted); border-radius: 999px; padding: 6px 9px; border: 1px solid var(--line); }
.filter-tabs a.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.document-chip { padding: 7px 10px; border-radius: 7px; color: #fff; background: var(--navy); font-size: 10px; font-weight: 900; }
.line-table { min-width: 1040px; }
.line-table th, .line-table td { padding: 7px 5px; }
.line-table td:first-child { width: 26px; text-align: center; color: var(--muted); }
.line-table select, .line-table input { min-width: 72px; padding: 7px; font-size: 10px; }
.line-table td:nth-child(2) { width: 92px; }
.line-table td:nth-child(3) { width: 125px; }
.line-table td:nth-child(4) { width: 210px; }
.line-table td:nth-child(5) { width: 55px; }
.line-table td:nth-child(6) { width: 60px; }
.line-table td:nth-child(7) { width: 55px; }
.line-table td:nth-child(8) { width: 85px; }
.line-table td:nth-child(9) { width: 155px; }
.line-table td input + input { margin-top: 5px; }
.icon-button { width: 28px; height: 28px; border: 0; border-radius: 8px; color: var(--danger); background: #fff0ef; font-size: 18px; }
.totals-editor { display: flex; gap: 13px; justify-content: flex-end; align-items: end; margin: 18px 0; }
.totals-editor label { width: 125px; }
.totals-editor > div { min-width: 190px; padding: 10px 13px; border-radius: 9px; background: var(--navy); color: #fff; }
.totals-editor span, .totals-editor strong { display: block; }
.totals-editor span { color: #b9c6d8; font-size: 9px; }
.totals-editor strong { margin-top: 3px; }
.form-actions { justify-content: flex-end; margin-top: 16px; }

.quote-entry-table { min-width: 1150px; }
.quote-entry-table input:not([type="checkbox"]) { min-width: 86px; padding: 7px; font-size: 10px; }
.quote-entry-table td:nth-child(4) { min-width: 190px; }
.quote-check { width: 17px; height: 17px; accent-color: var(--blue); }
.comparison-panel { padding-bottom: 24px; }
.comparison-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 11px; }
.comparison-table { min-width: 920px; border-collapse: separate; border-spacing: 0; }
.comparison-table th, .comparison-table td { min-width: 210px; padding: 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: top; }
.comparison-table thead th { color: var(--navy); background: #eef3f9; font-size: 10px; text-transform: none; letter-spacing: 0; }
.comparison-table thead th strong, .comparison-table thead th small, .comparison-table tbody th strong, .comparison-table tbody th small { display: block; }
.comparison-table thead th small, .comparison-table tbody th small { color: var(--muted); font-size: 9px; line-height: 1.55; margin-top: 5px; font-weight: 500; }
.comparison-table .sticky-col { position: sticky; left: 0; z-index: 2; min-width: 230px; background: #f8fafc; box-shadow: 5px 0 9px rgba(11,31,58,.04); }
.comparison-table thead .sticky-col { z-index: 3; }
.award-option { display: flex; grid-template-columns: none; flex-direction: row; align-items: flex-start; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); cursor: pointer; }
.award-option:hover { border-color: #86a8d7; background: var(--blue-soft); }
.award-option:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 2px rgba(36,88,166,.12); }
.award-option input { width: 16px; margin-top: 2px; accent-color: var(--blue); }
.award-option strong, .award-option small { display: block; }
.award-option small { color: var(--muted); font-size: 9px; line-height: 1.5; margin-top: 4px; }
.no-bid { display: block; text-align: center; color: #99a5b5; padding: 22px 0; font-size: 11px; }
.award-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 18px; padding: 16px; border-radius: 11px; background: var(--navy); color: #fff; }
.award-footer strong, .award-footer small { display: block; }
.award-footer small { color: #b9c6d8; margin-top: 4px; font-size: 10px; }
.po-edit-table { min-width: 1050px; }
.po-edit-table input { min-width: 75px; padding: 7px; font-size: 10px; }
.po-edit-table td:nth-child(2) input { min-width: 210px; }
.receipt-entry-table { min-width: 1450px; }
.receipt-entry-table input { min-width: 80px; padding: 7px; font-size: 10px; }
.receipt-entry-table td:first-child { min-width: 180px; }
.receipt-entry-table td input + input { margin-top: 5px; }
.po-control-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.workflow-steps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.workflow-steps span { padding: 6px 8px; border-radius: 999px; background: #edf1f5; color: var(--muted); font-size: 9px; font-weight: 800; }
.workflow-steps span.current { color: #fff; background: var(--blue); box-shadow: 0 4px 10px rgba(36,88,166,.2); }
.po-actions { display: grid; gap: 9px; }
.po-actions form { display: grid; grid-template-columns: minmax(150px,1fr) auto; gap: 8px; }
.po-actions input { min-width: 0; }
.po-progress-list { display: grid; gap: 14px; }
.po-progress-list > div > div:first-child { display: flex; justify-content: space-between; gap: 15px; font-size: 11px; }
.po-progress-list span, .po-progress-list small { color: var(--muted); }
.po-progress-list small { display: block; font-size: 9px; margin-top: 5px; }
.progress-track { height: 6px; border-radius: 999px; overflow: hidden; background: #e5ebf2; margin-top: 6px; }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--teal)); }
.event-list { display: grid; gap: 0; }
.event-list > div { display: grid; grid-template-columns: 14px 1fr; gap: 10px; min-height: 55px; }
.event-list i { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); margin-top: 4px; position: relative; }
.event-list i::after { content: ""; position: absolute; left: 3px; top: 10px; width: 1px; height: 43px; background: var(--line); }
.event-list > div:last-child i::after { display: none; }
.event-list p { margin: 0; }
.event-list strong, .event-list span, .event-list small { display: block; }
.event-list strong { color: var(--navy); font-size: 11px; }
.event-list span { color: var(--muted); font-size: 10px; margin-top: 3px; }
.event-list small { color: #99a5b5; font-size: 8px; margin-top: 3px; }
.grn-document .document-bottom { grid-template-columns: 1fr; }
.subsection-title { margin: 22px 0 10px; color: var(--navy); font: 600 16px Georgia, serif; }
.dispute-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.dispute-summary div { padding: 13px; border-bottom: 1px solid var(--line); }
.dispute-summary div:nth-child(odd) { border-right: 1px solid var(--line); }
.dispute-summary dt { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .07em; }
.dispute-summary dd { margin: 5px 0 0; color: var(--navy); font-size: 12px; font-weight: 700; }
.dispute-notice .document-bottom { grid-template-columns: 1fr; }
.login-card form { margin-top: 20px; }
.account-layout { grid-template-columns: minmax(0,1fr) minmax(320px,.7fr); }
.supplier-picker { max-width: 620px; margin: 40px auto; }
.invoice-entry-table { min-width: 1250px; }
.invoice-entry-table input[type="number"] { min-width: 95px; padding: 7px; font-size: 10px; }
.invoice-summary-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.invoice-summary-grid h2 { margin: 5px 0 18px; color: var(--navy); font: 600 22px Georgia,serif; }
.invoice-total-box { width: min(380px,100%); margin: 20px 0 20px auto; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.invoice-total-box > div { display: flex; justify-content: space-between; gap: 20px; padding: 9px 12px; font-size: 11px; border-bottom: 1px solid var(--line); }
.invoice-total-box span { color: var(--muted); }
.invoice-total-box .grand { background: var(--navy); color: #fff; border: 0; }
.invoice-total-box .grand span { color: #fff; }

.shipment-entry-table { min-width: 920px; }
.shipment-entry-table input[type="number"] { min-width: 100px; padding: 7px; font-size: 10px; }
.document-check-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.checkbox-card { display: flex; grid-template-columns: none; align-items: flex-start; gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #f9fbfd; }
.checkbox-card input { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--teal); }
.checkbox-card span, .checkbox-card strong, .checkbox-card small { display: block; }
.checkbox-card small { color: var(--muted); font-size: 9px; line-height: 1.4; margin-top: 3px; }
.readiness-list { display: grid; gap: 9px; }
.readiness-list > div { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; }
.readiness-list > div > span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; font-weight: 900; }
.readiness-list .complete > span { color: #08705f; background: #dcf5ed; }
.readiness-list .missing > span { color: #9b2119; background: #fee7e5; }
.readiness-list strong { color: var(--navy); font-size: 11px; }
.readiness-list small { color: var(--muted); font-size: 9px; }
.metric .metric-date { font-size: 19px; }
.inventory-filter { display: flex; gap: 8px; align-items: center; }
.inventory-filter input { min-width: 230px; }
.inventory-filter select { width: 150px; }
.inventory-actions-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; align-items: start; }
.inventory-actions-grid .panel h2 { margin: 4px 0 16px; color: var(--navy); font: 600 21px Georgia,serif; }
.inventory-events { max-height: 430px; overflow-y: auto; }
.billing-line-table { min-width: 980px; }
.billing-line-table input, .billing-line-table select { min-width: 80px; padding: 7px; font-size: 10px; }
.billing-line-table td:nth-child(4) input { min-width: 230px; }
.payment-form { margin-top: 16px; }
.payment-row { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; margin: 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.payment-row span { color: var(--muted); }
.profit-table { min-width: 1350px; }
.positive { color: #08705f; }
.negative { color: var(--danger); }

.document-toolbar { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 16px; }
.document-toolbar small { color: var(--muted); }
.inline-form { display: flex; gap: 8px; }
.inline-form select { width: auto; }
.print-document { max-width: 1000px; margin: 0 auto; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 42px; }
.document-heading { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; border-bottom: 3px solid var(--navy); padding-bottom: 20px; }
.document-heading p { margin: 4px 0; font-size: 12px; line-height: 1.5; }
.document-heading .company-name { font-family: Georgia, serif; font-size: 20px; color: var(--blue); font-weight: 700; }
.document-heading h2 { margin: 0 0 16px; text-align: right; font-family: Georgia, serif; color: var(--navy); text-transform: uppercase; font-size: 30px; }
.document-heading dl { margin: 0; }
.document-heading dl div { display: grid; grid-template-columns: 1fr 1.3fr; gap: 14px; font-size: 11px; padding: 3px 0; }
.document-heading dt { color: var(--muted); text-align: right; }
.document-heading dd { margin: 0; font-weight: 800; }
.document-parties { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-top: 0; }
.document-parties > div { padding: 14px; min-height: 125px; }
.document-parties > div + div { border-left: 1px solid var(--line); }
.document-parties span, .document-bottom span, .signature-row span { display: block; color: var(--blue); text-transform: uppercase; letter-spacing: .08em; font-size: 8px; font-weight: 900; }
.document-parties strong { display: block; margin: 7px 0; font-size: 12px; }
.document-parties p { font-size: 10px; line-height: 1.5; margin: 0; }
.document-lines { margin-top: 13px; border: 1px solid var(--line); }
.document-lines thead { background: var(--navy); color: #fff; }
.document-lines th { color: #fff; border: 0; }
.document-lines td { font-size: 10px; }
.procurement-lines { font-size: 9px; }
.procurement-lines th, .procurement-lines td { padding-left: 6px; padding-right: 6px; }
.line-table { min-width: 1550px; }
.admin-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.admin-actions form { margin: 0; }
.admin-actions .button { white-space: nowrap; }
.rfq-tracking-table { min-width: 1050px; }
.supplier-check-list { display: grid; gap: 8px; max-height: 360px; overflow: auto; }
.rfq-events { max-height: 520px; overflow: auto; }
.material-entry-table { min-width: 1450px; }
.material-entry-table input, .material-entry-table select { min-width: 105px; }
.material-line-card { display: grid; gap: 14px; }
.material-coverage-grid { display: grid; grid-template-columns: repeat(6, minmax(105px, 1fr)); gap: 8px; }
.material-coverage-grid > div { padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: #f8fbfd; }
.material-coverage-grid span, .material-coverage-grid strong { display: block; }
.material-coverage-grid span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.material-coverage-grid strong { color: var(--navy); margin-top: 4px; }
.supply-link-list { display: flex; flex-wrap: wrap; gap: 7px; }
.supply-link-list a { padding: 7px 9px; border-radius: 8px; background: #eef6fb; font-size: 10px; font-weight: 700; }
.stock-reservation-grid { display: grid; gap: 8px; }
.stock-reservation-card { display: grid; grid-template-columns: minmax(260px, 1fr) 100px 150px auto; align-items: end; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #f9fbfd; }
.stock-reservation-card strong, .stock-reservation-card small { display: block; }
.stock-reservation-card small { color: var(--muted); margin-top: 3px; }
.reservation-actions { display: grid; gap: 6px; }
.empty.compact { padding: 12px; }
@media (max-width: 1100px) { .material-coverage-grid { grid-template-columns: repeat(3, 1fr); } .stock-reservation-card { grid-template-columns: 1fr 90px; } }
.attachment-list { display: grid; gap: 9px; }
.attachment-card { display: flex; justify-content: space-between; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #f9fbfd; }
.attachment-card strong, .attachment-card span, .attachment-card small, .attachment-card em { display: block; }
.attachment-card span { color: var(--navy); margin-top: 3px; }
.attachment-card small { color: var(--muted); font-size: 9px; line-height: 1.5; margin-top: 5px; }
.attachment-card em { font-size: 9px; margin-top: 5px; font-style: normal; font-weight: 700; }
.attachment-actions { display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; }
.attachment-actions form { margin: 0; }
.rfq-duplicate-warning { margin-top: 7px; padding: 8px; min-width: 250px; border: 1px solid #f2b8ad; border-radius: 8px; background: #fff2ef; color: #8f271b; font-size: 10px; line-height: 1.35; }
.rfq-duplicate-warning strong { display: block; margin-bottom: 4px; }
.rfq-duplicate-warning p { margin: 4px 0 0; }
.rfq-duplicate-warning a { color: #8f271b; font-weight: 800; text-decoration: underline; }
.duplicate-acknowledgement { margin-top: 14px; color: #8f271b; }
.document-bottom { display: grid; grid-template-columns: 1fr 290px; gap: 30px; padding-top: 22px; }
.document-bottom p { font-size: 10px; line-height: 1.55; white-space: normal; }
.commercial { display: flex; gap: 25px; font-size: 10px; }
.commercial div { display: flex; gap: 6px; }
.commercial dt { color: var(--muted); }
.commercial dd { margin: 0; font-weight: 700; }
.document-totals { margin: 0; }
.document-totals div { display: flex; justify-content: space-between; gap: 20px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.document-totals dt { color: var(--muted); }
.document-totals dd { margin: 0; font-weight: 800; }
.document-totals .grand { padding: 12px; background: var(--navy); color: #fff; border: 0; margin-top: 7px; }
.document-totals .grand dt { color: #fff; }
.signature-row { display: grid; grid-template-columns: 1fr 1fr 170px; gap: 25px; margin-top: 70px; }
.signature-row > div { border-top: 1px solid var(--ink); padding-top: 7px; }
.signature-row strong { font-size: 10px; }

.setup-page { min-height: 100vh; display: grid; place-items: center; padding: 25px; background: radial-gradient(circle at top, #173f70 0, var(--navy) 45%, #07172d 100%); }
.setup-card { width: min(480px,100%); background: #fff; border-radius: 20px; padding: 38px; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.setup-card .brand-mark { margin-bottom: 25px; }
.setup-card h1 { font: 600 34px/1.1 Georgia, serif; color: var(--navy); margin: 7px 0 14px; }
.setup-card > p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.connection-summary { border: 1px solid var(--line); border-radius: 11px; padding: 8px 14px; margin: 20px 0; }
.connection-summary div { display: flex; justify-content: space-between; padding: 8px 0; font-size: 12px; }
.connection-summary div + div { border-top: 1px solid var(--line); }
.connection-summary dt { color: var(--muted); }
.connection-summary dd { margin: 0; font-weight: 700; }
.fine-print { font-size: 10px !important; }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .split-layout { grid-template-columns: 1fr; }
  .split-layout > .form-panel,
  .po-control-grid > .form-panel { position: static; }
  .form-grid.four { grid-template-columns: repeat(2, 1fr); }
  .po-control-grid { grid-template-columns: 1fr; }
  .invoice-summary-grid { grid-template-columns: 1fr; }
  .document-check-grid { grid-template-columns: repeat(2,1fr); }
  .inventory-actions-grid { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 16px; }
  .sidebar nav { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .sidebar-foot { display: none; }
  .main { padding: 22px 16px 45px; }
  .topbar, .document-toolbar { align-items: flex-start; flex-direction: column; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .document-bottom { grid-template-columns: 1fr; }
  .award-footer { align-items: stretch; flex-direction: column; }
}
@media (max-width: 560px) {
  .metric-grid, .metric-grid.three, .form-grid, .form-grid.four { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .top-actions { width: 100%; }
  .top-actions .button { flex: 1; }
  .inline-form { flex-direction: column; width: 100%; }
  .totals-editor { align-items: stretch; flex-direction: column; }
  .totals-editor label, .totals-editor > div { width: 100%; }
  .document-check-grid { grid-template-columns: 1fr; }
  .inventory-filter { width: 100%; flex-direction: column; align-items: stretch; }
  .inventory-filter input, .inventory-filter select { width: 100%; min-width: 0; }
}

@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff; }
  .sidebar, .topbar, .no-print, .alert, .main > *:not(.print-document) { display: none !important; }
  .app-shell, .main { display: block; padding: 0; }
  .print-document { display: block !important; max-width: none; border: 0; box-shadow: none; padding: 0; }
  .document-heading h2 { font-size: 24px; }
  .signature-row { margin-top: 45px; }
}
