:root {
    color-scheme: light;
    --ink: #252b2a;
    --muted: #69716e;
    --line: #dfe4e2;
    --soft: #f4f6f5;
    --red: #dc2027;
    --red-dark: #b91d23;
    --green: #128b55;
    --green-soft: #e9f5ef;
    --white: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: #f3f5f4; }
body { margin: 0; color: var(--ink); font-size: 14px; line-height: 1.45; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(18, 139, 85, .25); outline-offset: 2px; }

.quote-wrap { max-width: 1240px; margin: 0 auto; padding: 22px 28px 36px; }
.quote-topbar { min-height: 38px; display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.quote-logo { display: block; width: min(100%, 980px); }
.quote-logo img { width: 100%; height: auto; display: block; }
.top-login { margin-top: 4px; white-space: nowrap; }
.quote-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; border-top: 1px solid var(--line); margin-top: 20px; padding: 23px 0 18px; }
.eyebrow { color: var(--red); font-size: 11px; font-weight: 700; line-height: 1.3; margin: 0 0 8px; }
h1, h2, p { margin-top: 0; }
.quote-heading h1 { color: #202523; font-size: 24px; line-height: 1.2; margin: 0; font-weight: 750; }
.quote-notice { margin: 8px 0 0; color: var(--muted); max-width: 760px; }
.quote-actions { flex: 0 0 auto; display: flex; gap: 8px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; border: 1px solid transparent; border-radius: 4px; padding: 0 14px; font-weight: 700; text-decoration: none; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.button-primary { background: var(--red); color: #fff; }
.button-primary:hover { background: var(--red-dark); }
.button-secondary { color: #303734; background: #fff; border-color: #cfd6d3; }
.button-secondary:hover { background: #f0f3f1; border-color: #aab4b0; }
.button-wide { width: 100%; min-height: 43px; margin-top: 8px; }
.text-link { color: #15764c; font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.text-button { border: 0; background: none; color: #15764c; font-weight: 700; padding: 0; cursor: pointer; }
.text-button:hover { text-decoration: underline; }
.text-danger { color: #b4232a; }

.catalog-tools { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 16px 0 13px; border-top: 1px solid var(--line); }
.search-wrap { width: min(100%, 420px); display: grid; gap: 6px; }
.search-wrap label, .field-label { color: #3d4542; font-size: 12px; font-weight: 700; }
.search-wrap input, .admin-filters input, .admin-filters select, .form-field input:not([type=checkbox]):not([type=file]), .form-field textarea, .auth-panel input:not([type=checkbox]) {
    min-height: 40px; width: 100%; padding: 9px 11px; border: 1px solid #cfd6d3; border-radius: 4px; color: var(--ink); background: #fff;
}
.search-wrap input::placeholder, .admin-filters input::placeholder { color: #8a9390; }
.catalog-summary { color: var(--muted); padding-bottom: 9px; white-space: nowrap; }
.catalog-summary strong { color: #202523; }
.category-tabs { display: flex; gap: 7px; overflow-x: auto; padding: 0 0 13px; scrollbar-width: thin; }
.category-tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 9px; min-height: 35px; border: 1px solid var(--line); border-radius: 4px; background: #fff; padding: 0 11px; color: #444c49; cursor: pointer; font-weight: 700; }
.category-tab span { color: #7b8581; font-size: 11px; font-weight: 600; }
.category-tab:hover { border-color: #9ca9a3; }
.category-tab.is-active { color: #fff; background: #26322e; border-color: #26322e; }
.category-tab.is-active span { color: #d8e2dd; }
.quote-table-wrap { background: #fff; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.quote-table { border-collapse: collapse; width: 100%; table-layout: fixed; }
.quote-table th, .quote-table td { border-bottom: 1px solid #e8ecea; padding: 10px 12px; text-align: left; vertical-align: middle; }
.quote-table thead th { height: 42px; background: #eef1f0; color: #4c5551; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0; }
.quote-table .col-number { width: 58px; text-align: center; }
.quote-table .col-sku { width: 235px; }
.quote-table .col-image { width: 82px; text-align: center; }
.quote-table .col-price { width: 164px; }
.category-heading th { background: #fbf2f2; border-bottom: 1px solid #f0d1d2; color: #a51e23; font-size: 12px; font-weight: 800; padding: 9px 13px; }
.product-row { min-height: 72px; }
.product-row:hover { background: #fafcfb; }
.cell-number { text-align: center !important; color: #79827e; font-size: 12px; }
.product-name { font-weight: 700; color: #26312d; overflow-wrap: anywhere; }
.product-code { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.cell-image { text-align: center !important; }
.cell-image img { display: block; width: 56px; height: 52px; object-fit: contain; margin: 0 auto; }
.image-placeholder, .admin-thumb-empty { display: inline-grid; place-items: center; width: 46px; height: 46px; background: #f0f2f1; color: #a3aca8; border-radius: 3px; font-weight: 700; }
.cell-description { color: #565f5b; }
.cell-price { white-space: nowrap; }
.cell-price strong { color: #17804f; font-size: 14px; font-variant-numeric: tabular-nums; }
.price-contact { color: #747d79; font-size: 12px; }
.empty-results { color: var(--muted); padding: 30px 12px !important; text-align: center !important; }
.quote-footer { display: flex; justify-content: space-between; gap: 15px; padding-top: 13px; color: #747d79; font-size: 11px; }
.quote-toast { position: fixed; z-index: 10; left: 50%; bottom: 24px; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; border-radius: 4px; background: #26322e; color: #fff; padding: 11px 15px; box-shadow: 0 8px 24px rgba(0,0,0,.17); transition: opacity .18s ease, transform .18s ease; }
.quote-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.admin-page { background: #f3f5f4; min-height: 100vh; }
.admin-shell { max-width: 1440px; min-height: 100vh; margin: 0 auto; background: #fff; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 72px; padding: 12px 30px; border-bottom: 1px solid var(--line); }
.admin-brand { display: block; width: min(300px, 35vw); }
.admin-brand img { display: block; width: 100%; height: auto; }
.admin-topbar-right { display: flex; align-items: center; gap: 21px; }
.admin-user { color: #58615d; }
.admin-topbar-right form { margin: 0; }
.admin-layout { display: grid; grid-template-columns: 218px minmax(0, 1fr); min-height: calc(100vh - 72px); }
.admin-nav { border-right: 1px solid var(--line); padding: 25px 14px; background: #fbfcfb; }
.nav-label { display: block; color: #8b9591; font-size: 10px; font-weight: 800; padding: 0 11px 10px; }
.admin-nav-link { display: block; color: #45504b; text-decoration: none; padding: 10px 11px; border-radius: 4px; font-weight: 700; }
.admin-nav-link:hover { background: #f0f3f1; }
.admin-nav-link.is-current { color: #126f46; background: var(--green-soft); }
.admin-main { min-width: 0; padding: 32px 36px 48px; }
.admin-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.admin-page-heading h1 { margin: 0; font-size: 24px; line-height: 1.2; }
.admin-page-heading .eyebrow { margin-bottom: 5px; }
.page-subtitle { margin: 7px 0 0; color: var(--muted); }
.notice-success { margin-bottom: 18px; border: 1px solid #b8e1ca; border-left: 3px solid var(--green); border-radius: 3px; padding: 11px 13px; background: #f0faf4; color: #17663f; }
.admin-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 13px; }
.admin-filters input { width: min(100%, 360px); }
.admin-filters select { width: min(100%, 255px); }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.admin-table th, .admin-table td { padding: 11px 13px; text-align: left; border-bottom: 1px solid #e8ecea; }
.admin-table th { background: #f1f3f2; color: #68716d; font-size: 10px; text-transform: uppercase; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-product-cell { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.admin-product-cell img, .admin-thumb-empty { width: 42px; height: 42px; flex: 0 0 auto; object-fit: contain; background: #f3f5f4; border-radius: 3px; }
.admin-product-cell strong { display: block; max-width: 230px; overflow-wrap: anywhere; }
.admin-product-cell small { display: block; margin-top: 2px; color: var(--muted); }
.status-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 3px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-on { color: #17663f; background: #e9f5ef; }
.status-off { color: #6b7470; background: #edf0ee; }
.admin-row-actions { display: flex; align-items: center; gap: 13px; white-space: nowrap; }
.admin-row-actions form { margin: 0; }
.pagination-wrap { padding-top: 18px; }
.pagination-wrap nav { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.pagination-wrap nav p { margin: 0; color: var(--muted); font-size: 12px; }
.pagination-wrap nav > div:last-child { display: flex; gap: 4px; }
.pagination-wrap a, .pagination-wrap span[aria-current] span, .pagination-wrap span[aria-disabled] span { display: inline-flex; min-width: 34px; min-height: 34px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 3px; background: #fff; text-decoration: none; }
.pagination-wrap span[aria-current] span { color: #fff; border-color: #26322e; background: #26322e; }
.pagination-wrap span[aria-disabled] span { color: #9aa39f; }
.editor-form { max-width: 860px; border-top: 1px solid var(--line); padding-top: 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.form-field label { color: #3d4542; font-size: 12px; font-weight: 700; }
.form-field label > span { color: var(--red); }
.form-field textarea { resize: vertical; min-height: 100px; }
.form-field input[type=file] { max-width: 100%; padding: 8px; border: 1px solid #cfd6d3; border-radius: 4px; background: #fff; }
.form-span-2 { grid-column: span 2; }
.field-help { color: var(--muted); font-size: 11px; }
.field-error { color: #b4232a; font-size: 12px; margin: 0; }
.current-image { display: flex; align-items: center; gap: 14px; }
.current-image img { width: 90px; height: 80px; object-fit: contain; border: 1px solid var(--line); background: #fff; border-radius: 3px; }
.checkbox-line { display: inline-flex; align-items: center; gap: 8px; color: #46504b; font-weight: 400 !important; }
.checkbox-line input { accent-color: var(--green); width: 16px; height: 16px; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 20px; margin-top: 22px; border-top: 1px solid var(--line); }
.settings-form { display: grid; gap: 19px; }

.order-page { min-height: 100vh; background: #f4f6f5; }
.order-wrap { max-width: 1440px; margin: 0 auto; padding: 16px 28px 42px; }
.order-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.order-logo { display: block; width: min(100%, 370px); }
.order-logo img { display: block; width: 100%; height: auto; }
.order-back-link { display: inline-flex; align-items: center; gap: 7px; color: #15764c; font-weight: 700; text-decoration: none; }
.order-back-link:hover { text-decoration: underline; }
.order-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding: 23px 0 20px; }
.order-heading .eyebrow { margin-bottom: 5px; }
.order-heading h1 { margin: 0; font-size: 28px; line-height: 1.2; }
.order-heading .page-subtitle { margin: 6px 0 0; }
.order-heading-count { display: flex; align-items: baseline; gap: 7px; padding: 0 0 3px; color: var(--muted); }
.order-heading-count strong { color: var(--red); font-size: 22px; font-variant-numeric: tabular-nums; }
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; align-items: start; gap: 22px; }
.order-products { min-width: 0; }
.order-catalog-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.order-catalog-heading h2 { margin: 0; font-size: 17px; }
.order-catalog-heading span { color: var(--muted); font-size: 12px; }
.order-catalog-heading strong { color: var(--ink); }
.order-filter-bar { display: grid; grid-template-columns: minmax(0, 1fr) 235px; gap: 9px; margin-bottom: 12px; }
.order-filter-bar input, .order-filter-bar select, .status-update-form select { min-height: 42px; width: 100%; padding: 8px 11px; border: 1px solid #cfd6d3; border-radius: 4px; color: var(--ink); background: #fff; }
.order-product-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 10px; min-width: 0; }
.order-product { display: grid; grid-template-columns: 74px minmax(0, 1fr) 116px; grid-template-areas: 'image info action'; align-items: center; gap: 11px; min-width: 0; min-height: 126px; padding: 12px; border: 1px solid var(--line); border-radius: 5px; background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
.order-product:hover { border-color: #bbc8c2; box-shadow: 0 4px 14px rgba(26, 44, 34, .06); }
.order-product-image { grid-area: image; display: grid; place-items: center; width: 72px; height: 82px; overflow: hidden; border: 1px solid #edf0ee; border-radius: 4px; background: #fff; }
.order-product-image img { display: block; max-width: 100%; max-height: 100%; width: 70px; height: 80px; object-fit: contain; }
.order-image-placeholder { display: grid; place-items: center; width: 100%; height: 100%; background: #fff5f4; color: #d9383a; font-size: 27px; font-weight: 800; }
.order-product-info { grid-area: info; min-width: 0; }
.product-category-label { display: block; color: #9a2f30; font-size: 10px; font-weight: 700; margin-bottom: 4px; }
.order-product-info h2 { margin: 0; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.order-product-info p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.order-product-action { grid-area: action; display: flex; min-width: 0; flex-direction: column; align-items: flex-end; justify-content: center; gap: 10px; }
.order-product-price { color: #177d4e; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.order-add-controls { display: flex; align-items: center; gap: 5px; }
.order-quantity { width: 46px; height: 36px; border: 1px solid #cfd6d3; border-radius: 4px; padding: 4px; text-align: center; font-variant-numeric: tabular-nums; }
.order-add { min-height: 36px; padding: 0 10px; color: var(--red); border-color: #efc6c8; }
.order-add:hover { background: #fff4f4; border-color: #e6a1a4; }
.order-empty { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--muted); padding: 28px 12px; text-align: center; }
.notice-error { margin: 0 0 10px; border: 1px solid #f1c7c8; border-left: 3px solid var(--red); border-radius: 3px; padding: 10px 12px; background: #fff7f7; color: #982126; }
.order-checkout { position: sticky; top: 16px; align-self: start; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 18px; box-shadow: 0 8px 24px rgba(29, 43, 36, .05); }
.checkout-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.checkout-title h2 { margin: 0; font-size: 18px; }
.checkout-title span { border-radius: 20px; background: var(--soft); color: #4d5752; padding: 4px 9px; font-size: 11px; }
.cart-lines { display: grid; gap: 0; max-height: 240px; overflow-y: auto; }
.cart-empty { color: #78817d; font-size: 12px; text-align: center; margin: 0; padding: 18px 5px; }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 11px 0; border-bottom: 1px solid #edf0ee; }
.cart-line-info { min-width: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.cart-line-info strong { font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.cart-line-info span { color: var(--muted); text-align: right; font-size: 10px; white-space: nowrap; }
.cart-line-controls { display: flex; align-items: center; gap: 7px; }
.cart-line-controls button:not(.cart-remove) { width: 28px; height: 28px; border: 1px solid #d7ddda; border-radius: 3px; color: #313a36; background: #fff; font-size: 17px; line-height: 1; cursor: pointer; }
.cart-line-controls button:not(.cart-remove):hover { background: var(--soft); }
.cart-line-controls > span { min-width: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.cart-remove { margin-left: auto; border: 0; background: transparent; color: #a32328; font-size: 11px; cursor: pointer; }
.cart-total-row, .complete-total { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; }
.cart-total-row { border-bottom: 1px solid var(--line); }
.cart-total-row strong, .complete-total strong { color: #177d4e; text-align: right; }
.checkout-note { margin: 10px 0 14px; border-left: 2px solid var(--green); background: #f2f8f4; color: #4c6256; padding: 8px 10px; font-size: 11px; }
.checkout-section-title { margin-bottom: 10px; color: #303a35; font-size: 13px; font-weight: 700; }
.order-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.order-inputs .form-field { min-width: 0; gap: 5px; }
.order-inputs .form-field:nth-child(n+3) { grid-column: 1 / -1; }
.order-inputs .form-field label { font-size: 11px; }
.order-inputs .form-field input:not([type=checkbox]):not([type=file]), .order-inputs .form-field textarea { min-height: 39px; padding: 8px 9px; font-size: 13px; }
.order-inputs .form-field textarea { min-height: 58px; }
.order-checkout .button-wide { margin-top: 12px; min-height: 44px; }
.order-submit-error { margin-top: 11px; }
.order-sticky { display: none; }
.order-complete-wrap { max-width: 760px; }
.order-complete { margin-top: 32px; border: 1px solid var(--line); border-radius: 4px; background: #fff; padding: 28px; }
.complete-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 22px; margin-bottom: 17px; }
.order-complete h1 { margin: 0; font-size: 24px; }
.complete-copy { margin: 7px 0 19px; color: var(--muted); }
.complete-number { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 13px 0; }
.complete-number span { color: var(--muted); }
.complete-number strong { color: #202523; font-variant-numeric: tabular-nums; }
.complete-items { padding-top: 5px; }
.complete-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 11px 0; border-bottom: 1px solid #edf0ee; }
.complete-item > div { display: grid; gap: 4px; }
.complete-item > div span { color: var(--muted); font-size: 11px; }
.complete-item > strong { white-space: nowrap; color: #177d4e; }
.complete-total { border-bottom: 1px solid var(--line); margin-bottom: 17px; }

.table-subline { display: block; color: var(--muted); margin-top: 3px; font-size: 11px; }
.status-pending { color: #8a5a08; background: #fff3d9; }
.status-processing { color: #195e87; background: #e7f3fa; }
.status-completed { color: #17663f; background: #e9f5ef; }
.status-cancelled { color: #7a3336; background: #f8e9e9; }
.order-detail-heading { align-items: end; }
.order-detail-heading .back-link { margin: 0 0 14px; }
.status-update-form { display: flex; align-items: center; gap: 8px; }
.status-update-form select { width: auto; min-width: 145px; }
.order-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; gap: 18px; }
.detail-section h2, .order-customer-card h2 { font-size: 16px; margin: 0 0 11px; }
.order-detail-table { min-width: 620px; }
.order-detail-table tfoot th { background: #f6f8f7; color: var(--ink); font-size: 12px; text-transform: none; }
.order-customer-card { border: 1px solid var(--line); border-radius: 4px; padding: 16px; background: #fff; }
.order-customer-card dl { display: grid; gap: 13px; margin: 0; }
.order-customer-card dl > div { display: grid; gap: 3px; }
.order-customer-card dt { color: var(--muted); font-size: 11px; }
.order-customer-card dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.order-customer-card a { color: #15764c; text-decoration: none; }

.auth-page { min-height: 100vh; background: #f3f5f4; }
.auth-wrap { width: min(100% - 32px, 460px); margin: 0 auto; padding: 42px 0 55px; }
.auth-logo { display: block; width: min(100%, 400px); margin: 0 auto 22px; }
.auth-logo img { display: block; width: 100%; height: auto; }
.auth-panel { background: #fff; border: 1px solid var(--line); border-radius: 5px; padding: 25px 27px; box-shadow: 0 8px 30px rgba(25, 40, 32, .05); }
.auth-panel h1 { font-size: 23px; margin: 0 0 20px; }
.form-stack { display: grid; gap: 8px; }
.form-stack .field-label:not(:first-child) { margin-top: 7px; }
.auth-panel .checkbox-line { margin: 4px 0; }
.auth-footnote { border-top: 1px solid var(--line); padding-top: 15px; margin: 17px 0 0; font-size: 12px; color: var(--muted); }
.auth-footnote a { color: #15764c; font-weight: 700; }
.back-link { display: inline-block; margin-top: 18px; color: #58615d; font-size: 12px; text-decoration: none; }
.back-link:hover { color: #15764c; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 1100px) {
    .order-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; }
    .order-product-list { grid-template-columns: 1fr; }
    .order-product { grid-template-columns: 74px minmax(0, 1fr) 132px; }
}

@media (max-width: 900px) {
    .order-layout { grid-template-columns: 1fr; }
    .order-product-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .order-product { grid-template-columns: 64px minmax(0, 1fr) 105px; gap: 8px; padding: 10px; }
    .order-product-image { width: 62px; height: 70px; }
    .order-product-action { gap: 7px; }
    .order-add { padding: 0 8px; }
    .order-checkout { position: static; }
}

@media (max-width: 760px) {
    body.order-page { max-width: 100vw; overflow-x: clip; }
    .quote-wrap { padding: 12px 13px 24px; }
    .quote-topbar { align-items: center; gap: 8px; }
    .quote-logo { width: min(100%, 620px); }
    .top-login { font-size: 12px; }
    .quote-heading { align-items: flex-start; flex-direction: column; gap: 13px; margin-top: 12px; padding: 18px 0 14px; }
    .quote-heading h1 { font-size: 20px; }
    .quote-actions { width: 100%; }
    .quote-actions { flex-wrap: wrap; }
    .quote-actions > * { flex: 1 1 calc(50% - 4px); }
    .catalog-tools { align-items: flex-end; gap: 10px; }
    .search-wrap { flex: 1 1 auto; }
    .catalog-summary { font-size: 11px; }
    .quote-table-wrap { overflow: visible; border: 0; background: transparent; }
    .quote-table, .quote-table tbody, .quote-table tr, .quote-table td { display: block; width: 100%; }
    .quote-table { table-layout: auto; }
    .quote-table thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
    .quote-table .product-group { margin-bottom: 13px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: #fff; }
    .quote-table .category-heading th { display: block; }
    .quote-table .product-row { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; grid-template-areas: 'image sku price' 'image description description'; align-items: center; gap: 3px 10px; padding: 10px; border-bottom: 1px solid #e8ecea; }
    .quote-table .product-row:last-child { border-bottom: 0; }
    .quote-table .product-row td { border: 0; padding: 0; min-width: 0; }
    .quote-table .cell-number { display: none; }
    .quote-table .cell-image { grid-area: image; align-self: start; }
    .quote-table .cell-image img { width: 56px; height: 56px; }
    .quote-table .image-placeholder { width: 50px; height: 50px; }
    .quote-table .cell-sku { grid-area: sku; }
    .quote-table .cell-description { grid-area: description; font-size: 12px; overflow-wrap: anywhere; }
    .quote-table .cell-price { grid-area: price; align-self: start; text-align: right; }
    .quote-table .cell-price strong { font-size: 12px; }
    .quote-footer { flex-wrap: wrap; font-size: 10px; }
    .admin-topbar { min-height: 60px; padding: 10px 14px; }
    .admin-brand { width: min(240px, 45vw); }
    .admin-topbar-right { gap: 10px; font-size: 11px; }
    .admin-user { display: none; }
    .admin-layout { grid-template-columns: 1fr; }
    .admin-nav { display: flex; align-items: center; gap: 5px; border-right: 0; border-bottom: 1px solid var(--line); padding: 9px 12px; overflow-x: auto; }
    .nav-label { display: none; }
    .admin-nav-link { flex: 0 0 auto; padding: 8px 10px; font-size: 12px; }
    .admin-main { padding: 22px 14px 36px; }
    .admin-page-heading { align-items: flex-start; }
    .admin-page-heading h1 { font-size: 21px; }
    .admin-page-heading .button { white-space: nowrap; padding: 0 10px; font-size: 12px; }
    .form-grid { grid-template-columns: 1fr; gap: 14px; }
    .form-span-2 { grid-column: auto; }
    .order-wrap { width: 100%; max-width: 100%; overflow-x: clip; padding: 12px 13px 86px; }
    .order-layout, .order-products, .order-filter-bar, .order-product-list, .order-checkout { width: 100%; min-width: 0; }
    .order-header { display: block; min-width: 0; }
    .order-logo { width: min(100%, 230px); min-width: 0; }
    .order-back-link { display: inline-flex; margin-top: 8px; white-space: nowrap; font-size: 12px; }
    .order-heading { padding: 18px 0 15px; }
    .order-heading h1 { font-size: 23px; }
    .order-heading-count strong { font-size: 19px; }
    .order-layout { grid-template-columns: 1fr; gap: 14px; }
    .order-product-list { grid-template-columns: 1fr; }
    .order-filter-bar { grid-template-columns: 1fr; gap: 7px; }
    .order-product { width: 100%; max-width: 100%; grid-template-columns: 58px minmax(0, 1fr); grid-template-areas: 'image info' 'image action'; gap: 8px 11px; min-height: 0; padding: 11px; align-items: start; }
    .order-product-image { width: 56px; height: 64px; }
    .order-product-image img { width: 54px; height: 62px; }
    .order-product-action { flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; }
    .order-add-controls { gap: 5px; }
    .order-quantity { width: 45px; height: 34px; }
    .order-add { min-height: 34px; padding: 0 10px; }
    .order-checkout { position: static; padding: 14px; }
    .cart-lines { max-height: 230px; }
    .order-sticky { position: fixed; z-index: 8; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; border-top: 1px solid var(--line); padding: 9px 13px calc(9px + env(safe-area-inset-bottom)); background: #fff; box-shadow: 0 -5px 18px rgba(32, 45, 38, .08); }
    .order-sticky span { min-width: 0; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
    .order-sticky .button { min-height: 38px; flex: 0 0 auto; }
    .order-detail-grid { grid-template-columns: 1fr; }
    .order-detail-heading { flex-direction: column; align-items: flex-start; }
    .status-update-form { width: 100%; }
    .status-update-form select { flex: 1; }
}

@media (max-width: 420px) {
    .quote-wrap { padding-left: 10px; padding-right: 10px; }
    .quote-topbar { align-items: flex-start; }
    .quote-logo { width: calc(100% - 58px); }
    .top-login { margin-top: 0; }
    .catalog-tools { align-items: flex-start; flex-direction: column; }
    .search-wrap { width: 100%; }
    .catalog-summary { align-self: flex-end; margin-top: -4px; }
    .quote-table .product-row { grid-template-columns: 48px minmax(0, 1fr); grid-template-areas: 'image sku' 'image description' 'image price'; gap: 3px 9px; }
    .quote-table .cell-image img { width: 46px; height: 52px; }
    .quote-table .image-placeholder { width: 42px; height: 42px; }
    .quote-table .cell-price { text-align: left; }
    .order-wrap { padding-left: 10px; padding-right: 10px; }
    .order-logo { width: min(100%, 195px); }
    .order-product { grid-template-columns: 48px minmax(0, 1fr); gap: 7px 9px; padding: 9px; }
    .order-product-image { width: 46px; height: 54px; }
    .order-product-image img { width: 44px; height: 52px; }
    .order-product-info h2 { font-size: 13px; }
    .order-product-info p { font-size: 11px; }
    .order-product-price { font-size: 12px; }
    .order-quantity { width: 42px; }
    .order-add { padding: 0 8px; }
    .order-inputs { grid-template-columns: 1fr; }
    .order-inputs .form-field { grid-column: 1 / -1; }
    .order-complete { padding: 20px 15px; }
    .auth-panel { padding: 22px 18px; }
}

@media print {
    html, body { background: #fff; }
    .quote-wrap { max-width: none; padding: 0; }
    .quote-topbar { min-height: 0; }
    .quote-logo { width: 520px; }
    .top-login, .quote-actions, .catalog-tools, .category-tabs { display: none !important; }
    .quote-heading { margin-top: 8px; padding: 12px 0; }
    .quote-table-wrap { border-radius: 0; }
    .quote-table { display: table; }
    .quote-table thead { position: static; width: auto; height: auto; clip: auto; }
    .quote-table tbody { display: table-row-group; }
    .quote-table tr { display: table-row; }
    .quote-table th, .quote-table td { display: table-cell; padding: 5px 7px; }
    .quote-table .product-row { min-height: 0; }
    .quote-table .cell-image img { width: 42px; height: 38px; }
    .quote-footer { padding-top: 8px; }
    .category-heading, .product-row { break-inside: avoid; }
}
