:root {
  color-scheme: light;
  --ink: #14293d;
  --ink-2: #31485d;
  --muted: #687887;
  --line: #dfe5e9;
  --line-strong: #cbd4db;
  --paper: #ffffff;
  --canvas: #f1f4f6;
  --navy: #173f67;
  --navy-dark: #102f4d;
  --sky: #eaf2f8;
  --amber: #b66a0f;
  --amber-bg: #fff4df;
  --red: #aa3f35;
  --red-bg: #fff0ed;
  --green: #21664e;
  --green-bg: #e9f6f0;
  --violet: #674b91;
  --violet-bg: #f1ecf8;
  --shadow: 0 1px 2px rgb(20 41 61 / 7%), 0 7px 24px rgb(20 41 61 / 5%);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 16px 18px; background: var(--ink); color: #e9eff4; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; color: white; text-decoration: none; font-size: 20px; font-weight: 720; letter-spacing: -.02em; padding: 0 10px; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: #f4f7f9; color: var(--ink); font-size: 18px; }
.workspace-label { margin: 31px 12px 10px; color: #91a4b5; font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.nav-list { display: grid; gap: 4px; }
.nav-item { border: 0; background: transparent; color: #bdc9d3; display: grid; grid-template-columns: 23px 1fr auto; align-items: center; gap: 8px; width: 100%; padding: 11px 12px; border-radius: 8px; text-align: left; cursor: pointer; }
.nav-item:hover { background: rgb(255 255 255 / 6%); color: white; }
.nav-item.active { background: #29445c; color: white; box-shadow: inset 3px 0 #70a5d1; }
.nav-icon { font-size: 18px; color: #99adbe; }
.count { min-width: 24px; padding: 2px 7px; border-radius: 999px; background: rgb(255 255 255 / 10%); font-size: 12px; text-align: center; }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgb(255 255 255 / 11%); padding: 18px 4px 0; display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; }
.user-avatar, .mini-avatar { display: grid; place-items: center; border-radius: 50%; background: #dce9f3; color: var(--navy); font-style: normal; font-weight: 750; }
.user-avatar { width: 36px; height: 36px; font-size: 12px; }
.sidebar-footer strong { display: block; color: white; font-size: 13px; }
.sidebar-footer small { display: block; color: #91a4b5; font-size: 11px; margin-top: 2px; }
.icon-button { border: 0; background: transparent; color: #a7b6c2; cursor: pointer; }
.main-content { min-width: 0; padding: 32px clamp(24px, 3vw, 46px) 46px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 28px; }
.eyebrow { margin: 0 0 5px; color: var(--muted); font-size: 13px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(25px, 2.4vw, 33px); letter-spacing: -.035em; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.search { width: min(28vw, 310px); height: 40px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: white; display: flex; align-items: center; gap: 7px; color: var(--muted); }
.search input { border: 0; outline: 0; min-width: 0; width: 100%; color: var(--ink); }
.primary-button, .secondary-button, .text-button { min-height: 40px; border-radius: 8px; padding: 0 15px; font-weight: 650; cursor: pointer; }
.primary-button { border: 1px solid var(--navy); background: var(--navy); color: white; box-shadow: 0 1px 2px rgb(20 41 61 / 16%); }
.primary-button:hover { background: var(--navy-dark); }
.secondary-button { border: 1px solid var(--line-strong); background: white; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 28px 0 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); box-shadow: var(--shadow); overflow: hidden; }
.metrics article { padding: 19px 21px; border-right: 1px solid var(--line); }
.metrics article:last-child { border-right: 0; }
.metrics span, .metrics small { display: block; color: var(--muted); }
.metrics span { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.metrics strong { display: block; margin: 7px 0 3px; font-size: 25px; letter-spacing: -.03em; }
.metrics small { font-size: 12px; }
.metrics .urgent strong { color: var(--red); }
.work-grid { display: grid; grid-template-columns: minmax(650px, 1.75fr) minmax(315px, .8fr); gap: 18px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: 10px; background: var(--paper); box-shadow: var(--shadow); overflow: hidden; }
.panel-heading { min-height: 76px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin-bottom: 4px; font-size: 17px; }
.panel-heading p { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.segmented { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--canvas); }
.segmented button { border: 0; border-radius: 5px; padding: 6px 10px; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.segmented button.selected { background: white; color: var(--ink); box-shadow: 0 1px 3px rgb(20 41 61 / 12%); }
.queue-table { overflow-x: auto; }
.queue-row { min-width: 760px; width: 100%; min-height: 69px; display: grid; grid-template-columns: 72px 1.3fr .9fr 1.1fr .7fr; gap: 13px; align-items: center; padding: 10px 18px; border: 0; border-bottom: 1px solid #edf0f2; background: white; text-align: left; cursor: pointer; }
.queue-row:not(.queue-head):hover { background: #f8fafb; }
.queue-row.selected-row { background: #f4f8fb; box-shadow: inset 3px 0 var(--navy); }
.queue-head { min-height: 39px; background: #f8fafb; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; cursor: default; }
.queue-row strong, .queue-row small { display: block; }
.queue-row strong { margin-bottom: 4px; font-size: 14px; }
.queue-row small { color: var(--muted); font-size: 12px; }
.sla { font-size: 13px; font-variant-numeric: tabular-nums; }
.sla.critical { color: var(--red); }
.sla.warning { color: var(--amber); }
.status { display: inline-block; width: fit-content; padding: 4px 7px; border-radius: 5px; font-size: 11px; font-style: normal; font-weight: 700; white-space: nowrap; }
.status.amber { color: #87500d; background: var(--amber-bg); }
.status.blue { color: var(--navy); background: var(--sky); }
.status.violet { color: var(--violet); background: var(--violet-bg); }
.status.green { color: var(--green); background: var(--green-bg); }
.status.red { color: var(--red); background: var(--red-bg); }
.status.neutral { color: #566572; background: #edf1f3; }
.mini-avatar { display: inline-grid; width: 24px; height: 24px; margin-right: 6px; font-size: 9px; vertical-align: middle; }
.mini-avatar.purple { background: #e7dff1; color: #66448b; }
.muted { color: var(--muted); }
.detail-panel { padding: 21px; }
.detail-topline { display: flex; align-items: center; justify-content: space-between; }
.case-id { color: var(--muted); font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.detail-panel h2 { margin: 18px 0 4px; font-size: 22px; letter-spacing: -.025em; }
.customer { color: var(--muted); font-size: 13px; line-height: 1.5; }
.deadline { margin: 19px 0; padding: 13px; border: 1px solid #f1d3cf; border-radius: 8px; background: var(--red-bg); display: flex; gap: 11px; align-items: center; }
.deadline strong, .deadline small { display: block; }
.deadline strong { color: var(--red); font-size: 13px; }
.deadline small { color: #80625f; font-size: 11px; margin-top: 2px; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgb(170 63 53 / 12%); }
.progress-label { display: flex; justify-content: space-between; margin-top: 18px; font-size: 12px; }
.progress { height: 6px; margin-top: 7px; border-radius: 999px; background: #e7ebee; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--amber); border-radius: inherit; }
.case-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 14px; margin: 22px 0; }
.case-facts div { min-width: 0; }
.case-facts dt { color: var(--muted); font-size: 11px; }
.case-facts dd { margin: 3px 0 0; font-size: 13px; font-weight: 650; }
.callout { padding: 13px; border-left: 3px solid var(--navy); background: #f4f7f9; }
.callout strong { font-size: 12px; }
.callout p { margin: 4px 0 0; color: var(--ink-2); font-size: 12px; line-height: 1.5; }
.full { width: 100%; margin-top: 17px; }
.text-button { border: 0; background: transparent; color: var(--navy); }
.activity { margin-top: 17px; padding-top: 18px; border-top: 1px solid var(--line); }
.activity h3 { font-size: 13px; }
.activity > div { position: relative; display: flex; gap: 11px; margin: 13px 0; }
.activity > div > span { flex: 0 0 auto; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: #6a8dac; box-shadow: 0 0 0 3px #e8f0f6; }
.activity p { margin: 0; }
.activity strong, .activity small { display: block; }
.activity strong { font-size: 12px; }
.activity small { margin-top: 3px; color: var(--muted); font-size: 11px; }
#toast { position: fixed; right: 24px; bottom: 24px; z-index: 10; max-width: 340px; padding: 12px 16px; border-radius: 8px; background: var(--ink); color: white; box-shadow: 0 8px 30px rgb(20 41 61 / 20%); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
#toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1120px) {
  .work-grid { grid-template-columns: 1fr; }
  .detail-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
  .detail-topline, .detail-panel h2, .detail-panel .customer, .deadline, .full, .activity { grid-column: 1 / -1; }
  .case-facts { margin-top: 16px; }
}
@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; width: 100%; height: auto; padding: 14px 16px; flex-direction: row; align-items: center; gap: 16px; overflow-x: auto; }
  .brand { padding: 0; }
  .workspace-label, .sidebar-footer { display: none; }
  .nav-list { display: flex; margin-left: auto; }
  .nav-item { display: flex; width: auto; white-space: nowrap; padding: 8px 10px; }
  .nav-icon, .nav-item .count { display: none; }
  .main-content { padding: 22px 16px 32px; }
  .topbar { align-items: flex-start; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; }
  .search { order: 3; width: 100%; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metrics article:nth-child(2) { border-right: 0; }
  .metrics article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .sidebar { align-items: flex-start; }
  .brand span:last-child { display: none; }
  .nav-list { max-width: calc(100vw - 82px); overflow-x: auto; }
  .topbar { display: block; }
  .top-actions { margin-top: 18px; justify-content: flex-start; }
  .secondary-button { display: none; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metrics article { padding: 15px; }
  .metrics strong { font-size: 21px; }
  .panel-heading { align-items: flex-start; gap: 12px; }
  .segmented button:last-child { display: none; }
  .detail-panel { display: block; }
  .case-facts { grid-template-columns: 1fr 1fr; }
}

.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); }
.boot .brand-mark { width: 44px; height: 44px; background: var(--ink); color: white; }
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.1fr) minmax(430px, .9fr); background: white; }
.login-brand { min-height: 100vh; padding: clamp(34px, 5vw, 72px); background: var(--ink); color: white; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; position: relative; }
.login-brand::after { content: ""; position: absolute; width: 470px; height: 470px; right: -180px; bottom: -210px; border: 1px solid rgb(255 255 255 / 12%); border-radius: 50%; box-shadow: 0 0 0 70px rgb(255 255 255 / 3%), 0 0 0 140px rgb(255 255 255 / 2%); }
.login-logo { padding: 0; position: relative; z-index: 1; }
.login-brand > div { max-width: 700px; position: relative; z-index: 1; }
.login-brand h1 { max-width: 660px; margin: 12px 0 22px; font-size: clamp(38px, 5vw, 68px); line-height: 1.04; letter-spacing: -.055em; }
.login-brand p:not(.eyebrow) { max-width: 560px; color: #b7c5d1; font-size: 18px; line-height: 1.65; }
.eyebrow.inverse { color: #8eb6d6; }
.login-proof { display: flex; flex-wrap: wrap; gap: 9px; }
.login-proof span { padding: 7px 10px; border: 1px solid rgb(255 255 255 / 16%); border-radius: 6px; color: #c8d3dc; font-size: 12px; }
.login-form-wrap { display: grid; place-items: center; padding: 36px; }
.login-form { width: min(390px, 100%); }
.login-form h2 { margin: 8px 0 5px; font-size: 30px; letter-spacing: -.04em; }
.form-intro { margin-bottom: 28px; color: var(--muted); }
.login-form label, .form-panel label, .award-bar label { display: grid; gap: 7px; color: var(--ink-2); font-size: 12px; font-weight: 650; }
input, textarea, select { width: 100%; min-height: 42px; border: 1px solid var(--line-strong); border-radius: 7px; background: white; color: var(--ink); padding: 9px 11px; outline: none; font: inherit; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: #6d91b0; box-shadow: 0 0 0 3px rgb(23 63 103 / 9%); }
.login-form label + label { margin-top: 17px; }
.form-error { min-height: 20px; margin: 9px 0 -7px; color: var(--red); font-size: 12px; }
.security-note { display: block; margin-top: 18px; color: var(--muted); text-align: center; line-height: 1.5; }
.mobile-logo { display: none; }
button:disabled { cursor: not-allowed; opacity: .48; }
#toast.error { background: #7e2d28; }
#view { margin-top: 28px; }
.record-count { color: var(--muted); font-size: 12px; }
.records-panel { overflow-x: auto; }
.inbox-controls { display: grid; grid-template-columns: minmax(240px, 1fr) 190px auto; gap: 12px; align-items: end; margin-bottom: 16px; padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: var(--shadow); }
.inbox-controls label { display: grid; gap: 6px; color: var(--ink-2); font-size: 11px; font-weight: 700; }
.inbox-pagination { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 13px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.inbox-pagination > div { display: flex; gap: 8px; }
.record-row { min-width: 820px; width: 100%; min-height: 70px; display: grid; grid-template-columns: 1.7fr .55fr .55fr .75fr .7fr 24px; gap: 16px; align-items: center; border: 0; border-bottom: 1px solid #edf0f2; padding: 12px 18px; background: white; text-align: left; cursor: pointer; }
.record-row:hover:not(.record-head) { background: #f8fafb; }
.record-row div strong, .record-row div small { display: block; }
.record-row div small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.record-row > span { font-size: 13px; }
.record-head { min-height: 40px; background: #f8fafb; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; cursor: default; }
.order-row { grid-template-columns: 1.45fr .9fr .65fr .65fr .65fr 24px; }
.empty-inline, .empty-state { padding: 44px 22px; color: var(--muted); text-align: center; }
.empty-state { border: 1px dashed var(--line-strong); border-radius: 10px; background: white; }
.empty-state h2 { color: var(--ink); }
.form-panel { overflow: hidden; }
.form-section { padding: 26px; border-bottom: 1px solid var(--line); }
.form-section h2 { margin-bottom: 20px; }
.section-kicker { margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .1em; }
.section-heading, .document-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 22px; }
.form-grid { display: grid; gap: 17px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-grid.four { grid-template-columns: repeat(4, 1fr); }
.line-editor { display: grid; gap: 9px; overflow-x: auto; }
.item-line { min-width: 1100px; display: grid; grid-template-columns: 24px 1.2fr 1.4fr .42fr .42fr .75fr .5fr .42fr 30px; gap: 10px; align-items: end; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; }
.item-line > b { align-self: center; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #e9eff4; font-size: 11px; }
.item-line input { min-height: 37px; }
.remove-line { width: 30px; height: 37px; border: 0; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; }
.form-footer { padding: 17px 25px; background: #f8fafb; display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(285px, .7fr); gap: 18px; align-items: start; }
.document-card { padding: 24px; overflow-x: auto; }
.document-header { margin-bottom: 25px; }
.document-header h2 { margin: 11px 0 4px; font-size: 23px; }
.document-header p { margin: 0; color: var(--muted); }
.document-header > div:last-child { text-align: right; }
.document-header > div:last-child small { display: block; margin-top: 8px; color: var(--muted); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { padding: 10px; border-bottom: 2px solid var(--line-strong); color: var(--muted); font-size: 11px; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
.data-table td { padding: 13px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table td small, .data-table th small { display: block; margin-top: 4px; color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; }
.action-card { padding: 21px; }
.action-card > .primary-button { width: 100%; }
.ocr-layout { display: grid; grid-template-columns: minmax(330px, .72fr) minmax(0, 1.28fr); gap: 18px; align-items: start; }
.ocr-intake { padding: 25px; }
.ocr-intro h2 { margin: 7px 0 9px; font-size: 23px; letter-spacing: -.03em; }
.ocr-intro > p:last-child { color: var(--muted); font-size: 13px; line-height: 1.6; }
.drop-zone { min-height: 220px; margin-top: 23px; border: 1px dashed #9aafbf; border-radius: 10px; background: #f7fafc; display: grid; place-content: center; justify-items: center; gap: 7px; cursor: pointer; text-align: center; transition: .15s ease; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--navy); background: var(--sky); }
.drop-zone small { color: var(--muted); font-weight: 400; }
.scan-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 5px; border-radius: 12px; background: var(--ink); color: white; font-size: 26px; }
.selected-file { margin-top: 12px; padding: 11px; border: 1px solid var(--line); border-radius: 8px; display: grid; grid-template-columns: 42px 1fr auto; gap: 11px; align-items: center; }
.selected-file[hidden] { display: none; }
.selected-file strong, .selected-file small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-file small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.file-badge { display: grid; place-items: center; min-width: 38px; height: 34px; padding: 0 7px; border-radius: 6px; background: #e8f0f6; color: var(--navy); font-size: 10px; font-weight: 800; letter-spacing: .05em; }
.ocr-privacy { margin: 12px 4px 0; color: var(--muted); font-size: 11px; line-height: 1.5; text-align: center; }
.intake-divider { display: flex; align-items: center; gap: 10px; margin: 22px 0 16px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.intake-divider::before, .intake-divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.voice-box { padding: 15px; border: 1px solid var(--line); border-radius: 9px; background: #fafbfc; }
.voice-box label { display: grid; gap: 6px; color: var(--ink-2); font-size: 12px; font-weight: 650; }
.voice-button { width: 100%; min-height: 48px; margin-top: 12px; border: 1px solid #a9b7c2; border-radius: 8px; background: white; cursor: pointer; }
.voice-button span { margin-right: 7px; color: var(--red); }
.voice-button.recording { border-color: #d58e86; background: var(--red-bg); color: var(--red); }
.voice-button.recording span { animation: pulse-record 1.2s infinite; }
.voice-box p { min-height: 30px; margin: 10px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
@keyframes pulse-record { 50% { opacity: .28; } }
.ocr-result { min-height: 478px; padding: 25px; }
.ocr-empty { min-height: 426px; display: grid; place-content: center; justify-items: center; color: var(--muted); text-align: center; }
.ocr-empty span { font-size: 38px; color: #96a8b6; }
.ocr-empty h2 { margin: 11px 0 5px; color: var(--ink); font-size: 19px; }
.ocr-result-head { display: flex; justify-content: space-between; gap: 20px; }
.ocr-result-head h2 { margin: 6px 0; font-size: 21px; }
.ocr-result-head p { color: var(--muted); font-size: 12px; }
.ocr-empty.processing span { animation: spin 1.2s linear infinite; }
.ocr-empty.failed span { color: var(--red); }
@keyframes spin { to { transform: rotate(360deg); } }
.bom-table-wrap { margin-top: 20px; overflow-x: auto; }
.bom-table { min-width: 1060px; }
.bom-table input { min-width: 85px; min-height: 35px; padding: 7px 8px; font-size: 12px; }
.bom-table th:nth-child(2) { min-width: 145px; }
.bom-table th:nth-child(3) { min-width: 180px; }
.bom-table th:nth-child(6) { min-width: 120px; }
.remove-bom { border: 0; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; }
.source-text { margin-top: 18px; }
.source-text summary { color: var(--ink-2); font-size: 12px; font-weight: 650; cursor: pointer; }
.source-text textarea { min-height: 120px; margin-top: 8px; background: #fbfcfd; font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; }
.ocr-text-label { display: grid; gap: 7px; margin-top: 20px; color: var(--ink-2); font-size: 12px; font-weight: 650; }
.ocr-text-label textarea { min-height: 285px; background: #fbfcfd; font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; }
.ocr-result-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 13px; }
.ocr-result-actions span { margin-right: auto; color: var(--muted); font-size: 11px; line-height: 1.4; }
.ocr-history { margin-top: 18px; overflow-x: auto; }
.ocr-history-row { min-width: 760px; width: 100%; display: grid; grid-template-columns: 54px minmax(240px, 1.4fr) .45fr .55fr .6fr 24px; gap: 14px; align-items: center; min-height: 66px; padding: 10px 18px; border: 0; border-top: 1px solid var(--line); background: white; text-align: left; cursor: pointer; }
.ocr-history-row:hover { background: #f8fafb; }
.ocr-history-row strong, .ocr-history-row small, .ocr-history-row span > b { display: block; }
.ocr-history-row small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.ocr-history-row time { color: var(--muted); font-size: 12px; }
.quote-editor { overflow-x: auto; }
.commercial-fields { padding: 0 25px 23px; }
.quote-line { min-width: 1040px; display: grid; grid-template-columns: 30px 1.35fr 1.1fr .65fr .55fr .5fr .65fr; gap: 10px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); }
.quote-line > div strong, .quote-line > div small { display: block; }
.quote-line > div small { margin-top: 4px; color: var(--muted); }
.quote-line label { font-size: 11px; }
.quote-line input { min-height: 36px; }
.line-number { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #e9eff4; font-weight: 700; font-size: 11px; }
.availability { grid-template-columns: 17px 1fr !important; align-items: center; margin-top: 16px; }
.availability input { min-height: auto; }
.remarks { margin: 20px 25px; }
.quote-total { margin-left: auto; margin-right: 16px; text-align: right; }
.quote-total small, .quote-total strong { display: block; }
.quote-total small { color: var(--muted); }
.quote-total strong { margin-top: 3px; font-size: 19px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.request-card { border: 1px solid var(--line); border-radius: 10px; padding: 20px; background: white; box-shadow: var(--shadow); text-align: left; cursor: pointer; }
.request-card:hover { border-color: #9fb2c2; transform: translateY(-1px); }
.request-card h2 { margin: 17px 0 6px; font-size: 18px; }
.request-card p { min-height: 38px; color: var(--muted); font-size: 13px; }
.request-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.request-card dt { color: var(--muted); font-size: 11px; }
.request-card dd { margin: 4px 0; font-size: 13px; font-weight: 650; }
.request-card > span { display: block; margin-top: 18px; color: var(--navy); font-weight: 650; }
.vendor-grid .request-card { cursor: default; }
.vendor-logo { float: right; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; background: var(--ink); color: white; font-weight: 750; }
.comparison-wrap { padding-bottom: 100px; }
.comparison-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 14px; }
.comparison-summary article { padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.comparison-summary span, .comparison-summary strong, .comparison-summary small { display: block; }
.comparison-summary span { color: var(--muted); font-size: 12px; }
.comparison-summary strong { margin: 7px 0 3px; font-size: 19px; }
.comparison-summary small { color: var(--muted); font-size: 11px; }
.comparison-table-wrap { overflow-x: auto; }
.comparison-table { min-width: 980px; }
.comparison-table th:not(:first-child) { min-width: 190px; }
.comparison-table td:first-child { min-width: 230px; }
.offer { display: grid; grid-template-columns: 18px 1fr; gap: 9px; cursor: pointer; }
.offer input { min-height: auto; margin-top: 4px; }
.offer b, .offer small, .offer em { display: block; }
.offer small { min-height: 31px; margin: 4px 0 7px; }
.match { width: fit-content; padding: 3px 5px; border-radius: 4px; background: var(--green-bg); color: var(--green); font-size: 9px; font-style: normal; font-weight: 750; }
.match.equivalent { background: var(--amber-bg); color: var(--amber); }
.match.alternative { background: var(--violet-bg); color: var(--violet); }
.not-quoted { color: var(--muted); }
.award-bar { position: fixed; left: 254px; right: 18px; bottom: 16px; z-index: 5; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: end; padding: 14px 18px; border: 1px solid var(--line-strong); border-radius: 10px; background: rgb(255 255 255 / 96%); box-shadow: 0 10px 40px rgb(20 41 61 / 17%); backdrop-filter: blur(8px); }
.award-bar textarea { min-height: 56px; }
.award-bar > div { display: flex; align-items: center; gap: 13px; }
.award-bar small { color: var(--muted); }
.po-document { padding: 28px; overflow-x: auto; }
.po-heading { display: grid; grid-template-columns: .9fr 1.6fr; gap: 28px; margin-bottom: 28px; }
.po-heading h2 { margin: 5px 0 12px; font-size: 24px; }
.po-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.po-parties div { padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.po-parties span, .po-parties strong, .po-parties small { display: block; }
.po-parties span { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .08em; }
.po-parties strong { margin: 7px 0 4px; }
.po-parties small { color: var(--muted); }
.po-total { display: flex; justify-content: flex-end; padding: 20px 10px; }
.po-total > div { width: 330px; display: grid; grid-template-columns: 1fr auto; gap: 8px 22px; }
.po-total span { color: var(--muted); }
.po-total strong { padding-top: 10px; border-top: 2px solid var(--ink); font-size: 17px; }
.approval-note { display: flex; justify-content: flex-end; align-items: center; gap: 20px; padding: 18px; border-radius: 8px; background: var(--amber-bg); }
.approval-note p { margin: 0; color: #70532f; font-size: 12px; }
.audit-list article { display: grid; grid-template-columns: 12px 1fr 110px 120px; gap: 14px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.audit-dot { width: 8px; height: 8px; border-radius: 50%; background: #6a8dac; box-shadow: 0 0 0 4px #e8f0f6; }
.audit-list strong { font-size: 13px; }
.audit-list p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.audit-list code, .audit-list time { color: var(--muted); font-size: 11px; }

@media (max-width: 980px) {
  .login-page { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .mobile-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 38px; font-size: 19px; }
  .login-form-wrap { min-height: 100vh; }
  .detail-layout { grid-template-columns: 1fr; }
  .ocr-layout { grid-template-columns: 1fr; }
  .form-grid.four { grid-template-columns: 1fr 1fr; }
  .award-bar { left: 16px; }
}
@media (max-width: 820px) {
  #view { margin-top: 20px; }
  .award-bar { grid-template-columns: 1fr; right: 16px; }
  .award-bar > div { justify-content: space-between; }
}
@media (max-width: 620px) {
  .inbox-controls { grid-template-columns: 1fr; }
  .inbox-pagination { align-items: stretch; flex-direction: column; }
  .inbox-pagination > div { display: grid; grid-template-columns: 1fr 1fr; }
  .form-grid.two, .form-grid.four { grid-template-columns: 1fr; }
  .form-section { padding: 20px 16px; }
  .item-line { min-width: 0; grid-template-columns: 24px 1fr 1fr 30px; }
  .item-line label:nth-of-type(1), .item-line label:nth-of-type(2), .item-line label:nth-of-type(5) { grid-column: 2 / 4; }
  .item-line label:nth-of-type(3), .item-line label:nth-of-type(6) { grid-column: 2; }
  .item-line label:nth-of-type(4), .item-line label:nth-of-type(7) { grid-column: 3; }
  .document-header, .section-heading { display: block; }
  .document-header > div:last-child { margin-top: 14px; text-align: left; }
  .po-heading { grid-template-columns: 1fr; }
  .po-parties { grid-template-columns: 1fr; }
  .approval-note { display: block; }
  .approval-note button { width: 100%; margin-top: 12px; }
  .ocr-result-head, .ocr-result-actions { align-items: flex-start; flex-direction: column; }
  .ocr-result-actions span { margin-right: 0; }
  .award-bar > div { align-items: stretch; flex-direction: column; }
  .audit-list article { grid-template-columns: 12px 1fr; }
  .audit-list code, .audit-list time { display: none; }
}
