:root { --navy: #344f74; --orange: #d48535; --ink: #202327; --muted: #5b6168; --border: #c9d3de; --paper: #f7f7f6; --warm: #fdf3e8; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
a { color: var(--navy); }
a:hover { color: #ab5d1b; }
button, input { font: inherit; }
button, .choose-button { cursor: pointer; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.topbar { min-height: 62px; padding: 12px max(24px, calc((100% - 1080px) / 2 + 24px)); display: flex; justify-content: space-between; align-items: center; background: white; border-bottom: 1px solid #e6e6e3; }
.topbar img { display: block; width: 106px; height: auto; }
.topbar nav { display: flex; gap: 22px; align-items: center; }
.legacy-link { font-size: 12px; text-decoration: none; color: #727983; }
.nav-button { display: inline-block; padding: 8px 16px; border: 1px solid var(--navy); border-radius: 5px; background: white; color: var(--navy); font-size: 16px; font-weight: 600; text-decoration: none; }
.nav-button span { color: #8a9096; font-weight: 400; }
.workspace { width: 100%; max-width: 1080px; padding: 40px 24px 64px; margin: 0 auto; }
.steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.step { border: 2px solid var(--border); border-radius: 10px; min-height: 68px; padding: 16px 20px; display: flex; align-items: center; gap: 12px; background: white; text-decoration: none; color: var(--ink); }
.step.active { border-color: var(--orange); background: var(--warm); box-shadow: 0 0 0 3px #e8e6e2; }
.step.complete { border-color: var(--navy); }
.step.disabled { color: #9ca2ab; }
.step-dot { border-radius: 50%; width: 28px; height: 28px; background: #eef0f2; color: #8a9096; font-size: 14px; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }
.active .step-dot { background: var(--orange); color: white; }
.complete .step-dot { background: var(--navy); color: white; }
.step small { display: block; color: #8a9096; letter-spacing: .06em; font-size: 11px; text-transform: uppercase; margin-bottom: 3px; }
.step strong { font-size: 15px; }
.upload-screen { max-width: 620px; margin: 12px auto 0; }
.intro { font-size: 17px; font-weight: 500; line-height: 1.5; text-align: center; margin: 0 0 24px; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 56px 24px; border: 2px dashed var(--navy); border-radius: 10px; background: white; text-align: center; }
.dropzone.dragging { border-color: var(--orange); background: var(--warm); }
.upload-icon { width: 42px; height: 42px; border: 1px solid var(--orange); border-radius: 8px; color: var(--orange); display: grid; place-items: center; font-size: 22px; }
.dropzone h1 { font-size: 17px; margin: 2px 0 0; }
.dropzone p { color: var(--muted); font-size: 13px; margin: 0; }
.dropzone small { color: #8a9096; font-size: 12px; }
.choose-button { background: var(--navy); color: white; border-radius: 6px; padding: 10px 18px; font-size: 13px; font-weight: 600; }
.dropzone input { max-width: 100%; font-size: 12px; }
.extract-button { background: white; color: var(--navy); border: 1px solid var(--navy); border-radius: 5px; padding: 8px 12px; font-size: 13px; }
.js .dropzone input, .js .extract-button { position: absolute; width: 1px; height: 1px; padding: 0; clip-path: inset(50%); overflow: hidden; }
.dropzone:focus-within { outline: 2px solid var(--orange); outline-offset: 4px; }
.processing { max-width: 620px; text-align: center; margin: 110px auto 0; }
.processing h2 { font-size: 17px; overflow-wrap: anywhere; }
.processing p, .processing small { color: var(--muted); font-size: 13px; }
.progress-bar { height: 4px; background: #e6e6e3; border-radius: 2px; overflow: hidden; max-width: 320px; margin: 24px auto; }
.progress-bar span { display: block; width: 40%; height: 100%; background: var(--orange); animation: progress 1.5s infinite linear; }
@keyframes progress { from { transform: translateX(-100%); } to { transform: translateX(350%); } }
.page-heading { margin-bottom: 20px; }
h1 { font-size: 26px; letter-spacing: -.025em; margin: 0 0 6px; font-weight: 600; }
.page-heading p { margin: 0; font-size: 14px; color: var(--muted); }
.notice { border: 1px solid; border-radius: 8px; padding: 13px 17px; font-size: 14px; line-height: 1.5; margin-bottom: 20px; }
.success { color: var(--ink); background: #eef6f1; border-color: #cfe5d8; }
.warning { background: var(--warm); border-color: #f0c89a; color: #8f4f0e; }
.error, .upload-error { color: #9b3027; background: #fff0ee; border-color: #e4b3ab; }
.review-card, .history-card { background: white; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.source-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #e6e6e3; font-size: 13px; }
.source-name { display: flex; gap: 8px; align-items: center; min-width: 0; }
.source-name strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.source-bar a { white-space: nowrap; }
.file-badge { color: #a33a2a; border: 1px solid #e3c2bc; border-radius: 3px; font-size: 10px; font-weight: 700; padding: 1px 4px; flex-shrink: 0; }
.order-area { padding: 20px; }
.order-area h2, .line-heading { font-size: 14px; font-weight: 600; margin: 0 0 12px; }
.missing-notice { font-size: 13px; padding: 10px 14px; margin-bottom: 22px; }
.header-fields { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.header-fields label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 12px; }
input { width: 100%; min-width: 0; padding: 7px 9px; font-size: 13px; color: var(--ink); border: 1px solid #dcdee1; background: white; border-radius: 5px; }
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input.missing { background: var(--warm); border-color: #f0c89a; }
input:focus { border-color: var(--orange); }
input[readonly] { cursor: default; }
.line-heading { padding: 0 20px; }
.line-heading span { color: #8a9096; font-weight: 400; }
.table-scroll { overflow-x: auto; contain: paint; }
table { border-collapse: collapse; width: 100%; text-align: left; }
.items-table { table-layout: fixed; min-width: 970px; font-size: 13px; }
th { background: var(--paper); color: var(--muted); font-size: 12px; font-weight: 500; padding: 11px 10px; }
.items-table td { padding: 6px 8px; border-top: 1px solid #eeeeec; }
.items-table th:first-child { padding-left: 16px; }
.items-table input { padding: 7px 9px; }
.product-col { width: 22%; } .style-col { width: 19%; } .sku-col { width: 15%; } .color-col { width: 8%; } .size-col { width: 10%; } .qty-col { width: 7%; } .cost-col { width: 8%; } .total-col { width: 9%; } .remove-col { width: 3%; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.line-total-input { text-align: right; }
.remove-line { border: 0; background: none; color: #9a6b60; font-size: 18px; padding: 4px; }
.remove-line:hover { color: #b22822; }
.table-footer { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid #e6e6e3; padding: 14px 20px; font-size: 13px; color: var(--muted); }
.text-button { color: var(--navy); background: none; border: 0; padding: 0; font-size: 13px; }
.totals { display: flex; gap: 24px; font-variant-numeric: tabular-nums; }
.totals strong { color: var(--ink); }
.total-note { color: #737982; font-size: 11px; line-height: 1.5; margin: 10px 0 18px; }
.mismatch-mark { color: #a86019; }
.save-actions { display: flex; align-items: center; justify-content: flex-end; gap: 20px; margin-top: 20px; }
.export-links { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; }
.save-button { padding: 16px 36px; border: none; background: var(--orange); color: white; border-radius: 8px; font-size: 16px; font-weight: 700; }
.save-button:hover:not(:disabled) { background: #b86a1c; }
.save-button:disabled { opacity: .75; }
.save-button.saved-button { background: #3d7d50; opacity: 1; }
.save-button.saved-only-button { background: #747b82; opacity: 1; }
#save-status { color: var(--muted); font-size: 13px; text-align: right; }
.history-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.history-actions { display: flex; align-items: center; column-gap: 14px; }
.history-actions .nav-button { display: inline-flex; align-items: center; justify-content: center; height: 42px; min-height: 42px; line-height: 1.2; border-radius: 6px; white-space: nowrap; }
.history-actions .workbook-button { border-color: var(--navy); background: var(--navy); color: white; }
.history-actions .workbook-button:hover { background: #263f5e; color: white; }
.history-table { min-width: 900px; font-size: 13px; }
.history-table > thead th { padding: 12px 8px 8px; }
.history-table > thead th:first-child { padding-left: 16px; }
.history-table > thead th:last-child { padding-right: 16px; }
.history-table .filters th { padding-top: 0; padding-bottom: 12px; }
.filters input { font-size: 12px; border-color: var(--border); font-weight: 400; }
.history-row > td { padding: 13px 8px; border-top: 1px solid #eeeeec; }
.history-row > td:first-child { padding-left: 16px; }
.history-row > td:last-child { padding-right: 16px; }
.history-row { cursor: pointer; }
.history-row:hover { background: #fafaf9; }
.history-row.expanded { background: var(--warm); }
.expand-button { display: inline-flex; align-items: center; gap: 8px; text-align: left; padding: 0; border: none; background: transparent; color: var(--ink); font-size: 13px; }
.caret { display: inline-block; color: var(--orange); font-size: 18px; transition: transform .15s; }
.expanded .caret { transform: rotate(90deg); }
.file-link { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.date-cell { color: var(--muted); white-space: nowrap; }
.history-detail > td { padding: 16px 16px 20px; border-left: 3px solid var(--orange); background: #fbfcfd; }
.history-header-fields { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.history-header-fields div { display: flex; flex-direction: column; gap: 5px; }
.history-header-fields span { font-size: 12px; color: var(--muted); }
.history-header-fields strong { font-size: 13px; font-weight: 500; }
.history-items { background: white; border: 1px solid var(--border); font-size: 12px; }
.history-items th, .history-items td { padding: 8px 10px; }
.history-items td { border-top: 1px solid #eeeeec; }
.history-detail-footer { margin-top: 14px; display: flex; justify-content: flex-end; gap: 16px; font-size: 12px; color: var(--muted); }
#no-matches td { padding: 24px 16px; text-align: center; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 700px) {
  .topbar { padding: 12px 16px; } .topbar nav { gap: 12px; } .legacy-link { max-width: 68px; text-align: right; font-size: 10px; }
  .nav-button { padding: 8px 12px; font-size: 13px; } .workspace { padding: 28px 16px 48px; }
  .steps { gap: 10px; margin-bottom: 26px; } .step { padding: 12px; gap: 8px; min-height: 68px; } .step strong { font-size: 13px; }
  .intro { font-size: 15px; } .dropzone { padding: 40px 20px; } .header-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-bar { padding: 14px; font-size: 11px; } .order-area { padding: 16px; } .line-heading { padding: 0 16px; }
  .table-footer { padding: 14px 16px; } .totals { gap: 12px; } .save-actions { flex-direction: column-reverse; align-items: stretch; }
  .save-button { width: 100%; } .export-links { justify-content: center; } .history-heading { flex-wrap: wrap; } .history-heading h1 { font-size: 24px; } .history-actions { width: 100%; flex-wrap: wrap; justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) { .progress-bar span { animation: none; width: 100%; } .caret { transition: none; } }
