:root {
    --ink: #444050;
    --muted: #676375;
    --line: #e3e1e9;
    --brand-blue: #04569e;
    --brand-sky: #228dcb;
    --accent: var(--brand-blue);
    --accent-hover: #03437c;
    --canvas: #f8f7fa;
    --surface: #fff;
    --surface-hover: #f0eff5;
    --accent-soft: #e4f2fc;
    --shift: var(--brand-blue);
    --sidebar-bg: #10263c;
    --sidebar-ink: #f4f8fc;
    --sidebar-muted: #bbccdc;
    --sidebar-hover: #203d58;
    --sidebar-active: #1774ad;
    --sidebar-width: 260px;
    --workspace-gutter: 24px;
    --workspace-shadow: 0 3px 12px rgb(47 43 61 / .10);
    --bs-primary: var(--accent);
    --bs-primary-rgb: 4, 86, 158;
    --bs-primary-contrast: #fff;
    --bs-primary-text-emphasis: var(--accent);
    --bs-primary-bg-subtle: var(--accent-soft);
    --bs-primary-border-subtle: #a9d5f5;
    --bs-link-color: var(--accent);
    --bs-link-color-rgb: var(--bs-primary-rgb);
    --bs-link-hover-color: var(--accent-hover);
    --bs-link-hover-color-rgb: 3, 67, 124;
    --bs-secondary-color: var(--muted);
    --bs-focus-ring-color: var(--accent);
}

:root[data-bs-theme="dark"] {
    --ink: #e0def0;
    --muted: #b6b4cb;
    --line: #44485e;
    --accent: #74c4ff;
    --accent-hover: #a0d7ff;
    --canvas: #25293c;
    --surface: #2f3349;
    --surface-hover: #383d54;
    --accent-soft: #2a445d;
    --workspace-shadow: 0 3px 12px rgb(13 16 29 / .20);
    --bs-primary-rgb: 116, 196, 255;
    --bs-primary-contrast: #18263a;
    --bs-primary-border-subtle: #3d6c92;
    --bs-link-hover-color-rgb: 160, 215, 255;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: system-ui, "Segoe UI", "Microsoft YaHei", sans-serif;
    font-variant-numeric: tabular-nums;
}
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }
::selection { background: var(--accent-soft); color: var(--ink); }
h1, h2 { color: inherit; margin: 0; letter-spacing: -.025em; }

.workspace { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); min-height: 100vh; }
.sidebar { display: flex; flex-direction: column; padding: 16px 12px; position: sticky; top: 0; height: 100dvh; overflow-y: auto; background: var(--sidebar-bg); color: var(--sidebar-ink); }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 22px; padding-inline-start: 8px; }
.wordmark { display: inline-flex; align-items: center; gap: 9px; min-width: 0; color: var(--sidebar-ink); font-size: 1.125rem; font-weight: 720; line-height: 1.1; text-decoration: none; }
.wordmark-text { min-width: 0; }
.wordmark small { display: block; margin-top: 3px; color: var(--sidebar-muted); font-size: .72rem; font-weight: 450; line-height: 1.25; }
.wordmark:hover { color: white; }
.brand-mark { display: block; flex: none; width: 36px; height: 36px; }
.app-nav { display: grid; gap: 4px; }
.app-nav a { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 12px; border-radius: 6px; color: var(--sidebar-muted); font-size: .875rem; font-weight: 500; }
.app-nav a:hover, .sidebar-toggle:hover { background: var(--sidebar-hover); color: var(--sidebar-ink); }
.app-nav a[aria-current="page"] { background: var(--sidebar-active); color: white; box-shadow: 0 2px 6px rgb(10 29 48 / .24); font-weight: 600; }
.app-nav .workspace-switch { margin-top: 12px; }
.sidebar :focus-visible { outline-color: #8bcaff; }
.app-nav svg, .sidebar-location svg, .queue-link svg { flex: none; }
.sidebar-location { display: flex; align-items: flex-start; gap: 8px; margin-top: auto; padding: 16px 8px 0; border-top: 1px solid var(--sidebar-hover); color: var(--sidebar-muted); font-size: .825rem; }
.sidebar-location small { display: block; margin-top: 4px; }
.sidebar-backdrop, .mobile-location, .sidebar-toggle, .header-icon.mobile-menu-toggle, .theme-control { display: none; }
[data-sidebar] .sidebar-toggle, [data-theme-choice] .theme-control { display: grid; }
.app-header { position: sticky; top: 0; z-index: 6; padding-block: 16px 6px; background: var(--canvas); }
.header-inner, .content { width: calc(100% - 2 * var(--workspace-gutter)); margin-inline: auto; }
.header-inner { position: relative; min-height: 56px; display: flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 6px; background: var(--surface); box-shadow: var(--workspace-shadow); }
.header-context { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; color: var(--muted); font-size: .875rem; }
.header-context span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-context svg { flex: none; }
.header-icon, .sidebar-toggle { place-items: center; flex: none; padding: 0; border: 0; border-radius: 6px; background: transparent; color: inherit; cursor: pointer; }
.header-icon { display: grid; width: 44px; height: 44px; }
.sidebar-toggle { width: 36px; height: 36px; color: var(--sidebar-muted); }
.header-icon:hover, .header-control[open] > summary { color: var(--accent); background: var(--surface-hover); }
.header-icon::-webkit-details-marker { display: none; }
.header-icon::marker { content: ""; }
.header-control { position: relative; flex: none; }
.header-popover { position: absolute; top: calc(100% + 8px); right: 0; min-width: 11rem; width: max-content; max-width: min(19rem, calc(100vw - 32px)); margin: 0; padding: 6px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); box-shadow: var(--workspace-shadow); }
.header-info { padding: 10px 12px; overflow-wrap: anywhere; }
.header-info p { margin: 4px 0 0; color: var(--muted); font-size: .85rem; }
.header-option { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 42px; padding: 8px 12px; border: 0; border-radius: 5px; color: var(--ink); background: transparent; font: inherit; text-align: start; cursor: pointer; }
.header-option:hover { color: var(--accent); background: var(--surface-hover); }
.header-option[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); font-weight: 650; }
.theme-icon { display: none; }
[data-theme-choice="system"] [data-theme-icon="system"],
[data-theme-choice="light"] [data-theme-icon="light"],
[data-theme-choice="dark"] [data-theme-icon="dark"] { display: grid; }
.profile-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--accent); background: var(--accent-soft); }
.content { padding-block: 18px 48px; }
html { scroll-padding-top: 90px; accent-color: var(--accent); }
.page-heading { margin-bottom: 24px; }
.page-heading h1 { font-size: 2rem; line-height: 1.2; font-weight: 620; }
.page-heading p { max-width: 60ch; margin: 8px 0 0; color: var(--muted); font-size: .925rem; }
.shift-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: end; margin-bottom: 22px; padding: 24px; border-radius: 13px; background: var(--shift); color: #fff; }
.shift-panel h2 { color: #e4f2fc; font-size: .95rem; font-weight: 640; }
.shift-total { display: flex; gap: 12px; align-items: baseline; margin-top: 6px; }
.shift-total strong { font-size: 3.35rem; font-weight: 680; line-height: 1.06; letter-spacing: -.035em; }
.shift-total span { color: #e4f2fc; font-size: .875rem; }
.load-track { display: flex; height: 8px; overflow: hidden; border-radius: 20px; background: #ffffff3d; }
.load-waiting, .legend-dot.waiting { background: #95d0fb; }
.load-working, .legend-dot.working { background: #fff; }
.load-legend { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 10px 0 0; font-size: .825rem; }
.load-legend > div, .load-legend dt { display: flex; align-items: center; gap: 7px; }
.load-legend dt { color: #e4f2fc; font-weight: 550; }
.load-legend dd { margin: 0; font-weight: 740; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.panel { overflow: hidden; border: 1px solid transparent; border-radius: 8px; background: var(--surface); box-shadow: var(--workspace-shadow); }
.client-documents { max-width: 54rem; }
.client-documents > a { display: inline-block; margin-block-end: 10px; }
.client-documents-notice { padding: 10px 14px; border: 1px solid var(--bs-warning-border-subtle); border-radius: 8px; background: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); }
.client-documents-list { padding: 0; list-style: none; }
.client-documents-list li + li { border-top: 1px solid var(--line); }
.client-documents-list a { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px clamp(14px, 3vw, 24px); text-decoration: none; }
.client-documents-list a:hover { background: var(--canvas); }
.client-documents-list a:focus-visible { outline-offset: -3px; }
.client-documents-list small { display: block; margin-block-start: 4px; color: var(--muted); }
.client-documents-list svg { flex: none; }
.client-document-body { padding: clamp(16px, 4vw, 32px); line-height: 1.6; overflow-wrap: anywhere; }
.client-document-body > * { max-width: 72ch; }
.client-document-body > :last-child { margin-bottom: 0; }
.client-document-body h2 { margin: 1.5rem 0 .45rem; font-size: 1.125rem; letter-spacing: 0; }
.client-document-body h2:first-child { margin-top: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; min-height: 56px; padding: 12px 20px; }
.panel-heading h2 { font-size: 1.0625rem; font-weight: 620; letter-spacing: 0; }
.queue-link { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; font-size: .85rem; font-weight: 660; }
.queue-link:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: .18em; }
.task-count { display: inline-block; min-width: 28px; padding: 4px 8px; border-radius: 4px; background: var(--surface-hover); color: var(--muted); font-size: .75rem; font-weight: 600; line-height: 16px; text-align: center; }
.queue-table .table { --bs-table-bg: transparent; --bs-table-border-color: var(--line); }
.queue-table th, .queue-table td { padding: 10px 20px; color: var(--ink); }
.queue-table thead { background: var(--canvas); border-top: 1px solid var(--line); }
.queue-table thead th { color: var(--muted); font-size: .8rem; font-weight: 650; text-transform: none; letter-spacing: 0; }
.queue-table tbody th { text-transform: none; letter-spacing: 0; }
.queue-table tbody tr:hover { background: var(--surface-hover); }
.queue-table tbody tr:last-child > * { border-bottom: 0; }
.operation-name, .task-ref { display: block; }
.operation-name { font-weight: 675; }
.task-ref { margin-top: 1px; color: var(--muted); font-size: .75rem; font-weight: 550; }
.task-state { display: inline-flex; gap: 5px; align-items: center; padding: 4px 8px; border-radius: 6px; background: var(--surface-hover); color: var(--ink); font-size: .8rem; font-weight: 620; white-space: nowrap; }
.task-state::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: currentColor; }
.task-active { background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); }
.queue-table .station { color: var(--muted); font-size: .85rem; }
.empty-state { padding: 0 22px 18px; margin: 0; color: var(--muted); }
.skip-link { position: absolute; left: 1rem; top: -5rem; z-index: 10; padding: .5rem; background: var(--surface); }
.skip-link:focus { top: .5rem; }
.portal-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; }
.portal-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 16px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent); color: var(--bs-primary-contrast); font: inherit; font-weight: 650; }
.portal-button:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--bs-primary-contrast); }
.portal-summary { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); margin: 0 0 24px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.portal-summary > div { display: grid; align-content: space-between; gap: 12px; min-width: 0; padding: 20px; }
.portal-summary > div:first-child { background: var(--shift); color: #fff; }
.portal-summary > div:first-child dt { color: #e4f2fc; }
.portal-summary dt { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.portal-summary dt svg { flex: none; }
.portal-summary dt, .receiving-hint { color: var(--muted); font-size: .875rem; }
.portal-summary dd { margin: 0; font-size: 1.5rem; font-weight: 550; line-height: 1.1; overflow-wrap: anywhere; }
.portal-summary > div:first-child dd { font-size: 2.5rem; }
.portal-summary .arrival-empty { font-size: .875rem; color: var(--muted); line-height: 1.4; }
.portal-empty { padding: 22px; }
.portal-empty p { margin: 4px 0 0; color: var(--muted); }
.portal-back { display: inline-block; margin-bottom: 10px; font-size: .9rem; text-decoration: underline; text-underline-offset: .2em; }
.portal-pagination { display: flex; gap: 22px; padding: 12px 22px; border-top: 1px solid var(--line); }
.portal-note { padding: 14px 22px; margin: 0; border-top: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.receiving-form { display: grid; gap: 24px; padding: 24px; max-width: 52rem; }
.receiving-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.receiving-form legend { margin-bottom: 12px; font-size: 1.0625rem; font-weight: 620; }
.receiving-form fieldset + fieldset { border-top: 1px solid var(--line); padding-top: 20px; }
.form-actions { display: flex; justify-content: flex-end; margin: 0 -24px -24px; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--canvas); }
.portal-button:disabled { opacity: .55; cursor: not-allowed; }
.receiving-form label { min-width: 0; font-size: .9rem; font-weight: 600; }
.receiving-form label :is(input, select, textarea) { margin-top: 5px; }
.receiving-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.receiving-item { display: grid; grid-template-columns: minmax(0, 1fr) 9.5rem; align-items: start; gap: 12px 16px; padding: 14px 16px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas); }
.receiving-item-heading { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 32px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.receiving-item-heading strong { color: var(--accent); }
.receiving-item-product, .receiving-product { min-width: 0; }
.receiving-item .form-control { background-color: var(--surface); }
.receiving-item-caption { flex-basis: 100%; font-size: .9rem; font-weight: 600; }
.receiving-item-instructions { grid-column: 1 / -1; min-width: 0; }
.receiving-item-instructions summary { color: var(--accent); cursor: pointer; }
.receiving-item-instructions summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.receiving-item-instructions textarea { margin-top: 8px; resize: vertical; }
.receiving-item-note { margin-top: 8px; font-size: .875rem; font-weight: 400; }
.receiving-item-note span { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }
.receiving-product-results { max-height: 18rem; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; margin-top: 4px; }
.receiving-product-option { padding: 10px 12px; cursor: pointer; }
.receiving-product-option + .receiving-product-option { border-top: 1px solid var(--line); }
.receiving-product-option:hover, .receiving-product-option[aria-selected="true"] { background: var(--accent-soft); }
.receiving-product-summary { display: flex; align-items: flex-start; gap: 10px; overflow-wrap: anywhere; }
.receiving-product-summary img { flex: none; object-fit: contain; background: var(--canvas); border-radius: 4px; }
.receiving-product-summary strong, .receiving-product-summary small { display: block; }
.receiving-product-summary small, .receiving-product-status { color: var(--muted); }
.receiving-product-status { font-size: .875rem; margin: 4px 0 0; }
.receiving-product-chosen { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 5px 12px; }
.receiving-mode { border: 0; padding: 6px 0; background: transparent; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.receiving-import { margin: 0 0 16px; }
.receiving-import summary { width: fit-content; padding: 7px 11px; border: 1px solid var(--line); border-radius: 6px; color: var(--accent); cursor: pointer; }
.receiving-import summary:hover { background: var(--canvas); }
.receiving-import summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.receiving-import > p { margin: 8px 0; }
.receiving-import > label { display: block; margin-top: 8px; }
.receiving-import-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.receiving-import-controls input { flex: 1 1 15rem; min-width: 0; }
.receiving-import-errors { max-height: 14rem; overflow: auto; margin: 8px 0 0; padding-inline-start: 22px; color: var(--bs-danger-text-emphasis); }
.receiving-shipping { padding: 16px; margin: 0 0 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--canvas); }
.receiving-shipping h2 { font-size: 1rem; margin-bottom: 5px; }
.receiving-shipping-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.receiving-copy-field { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; text-align: start; overflow-wrap: anywhere; background: var(--surface); color: var(--ink); }
.receiving-copy-field:first-child { grid-column: 1 / -1; }
.receiving-copy-field:hover { border-color: var(--accent); }
.receiving-copy-field small { display: block; color: var(--muted); }
.receiving-copy-field svg { flex: none; color: var(--accent); }
.receiving-client-code { white-space: nowrap; }
.receiving-shipping [data-shipping-status]:empty { display: none; }
.prices-tabs { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.prices-tabs a { display: inline-flex; align-items: center; min-height: 42px; padding: 6px 4px; color: var(--muted); border-bottom: 2px solid transparent; }
.prices-tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 650; }
.prices-panel { padding: clamp(14px, 3vw, 24px); }
.prices-panel h2 { font-size: 1.125rem; }
.prices-toolbar, .prices-fields { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; }
.prices-toolbar { justify-content: space-between; align-items: start; }
.prices-fields label { flex: 1 1 10rem; min-width: 0; max-width: 100%; }
.prices-fields select { max-width: 24rem; text-overflow: ellipsis; }
.prices-copy { margin-top: 8px; }
.prices-list-heading { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 20px 0 6px; }
.prices-rate { display: grid; grid-template-columns: minmax(0, 1fr) minmax(5.5rem, 8rem) auto; gap: 7px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.prices-rate small { display: block; color: var(--muted); }
.prices-rate strong { overflow-wrap: anywhere; }
.prices-approval { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; }
.prices-panel summary { cursor: pointer; color: var(--accent); }
.prices-panel summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.prices-group-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin: 22px 0 10px; }
.prices-group-heading { font-size: 1rem; margin: 0; }
.prices-rate-copy { position: relative; }
.receiving-assignment { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; }
.receipt-count { min-width: 4.5rem; width: min(100%, 8rem); }
.receipt-short-label { display: none; }
.receipt-job-list { padding-inline: 20px; }
.receipt-job { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; padding-block: 12px; border-top: 1px solid var(--line); }
.receipt-job label { min-width: 0; }
.receipt-job-name { display: block; overflow-wrap: anywhere; }
.parcel-cost-line { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; }
.packing-cost-lines { list-style: none; padding: 0; margin: 10px 0; }
.packing-cost-lines li { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 16px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.receipt-job-manual { grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) auto; }
.receipt-job-group + .receipt-job-group { border-top: 1px solid var(--line); }
.receipt-billing h3 { font-size: 1rem; margin: 0; }
.client-balance { flex-wrap: wrap; gap: 2px 7px; align-items: baseline; font-size: .85rem; }
.client-balance span { width: 100%; color: var(--muted); }
.client-balance strong, .billing-money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.billing-balances { display: flex; flex-wrap: wrap; gap: 10px 22px; font-variant-numeric: tabular-nums; font-size: 1.2rem; }
.receipt-job-total { display: flex; flex-wrap: wrap; align-items: center; justify-content: end; gap: 8px; }
.receipt-job-total output, [data-receipt-total] { font-variant-numeric: tabular-nums; white-space: nowrap; }
.receipt-billing-actions { flex-wrap: wrap; }
.receipt-billing-submit { border-top: 1px solid var(--line); justify-content: flex-end; }
@media (max-width: 760px) {
    .receipt-job { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .receipt-job label:first-child, .receipt-job label:nth-child(2) { grid-column: 1 / -1; }
    .receipt-job-manual .receipt-job-total { grid-column: 1 / -1; }
    .parcel-cost-line { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .parcel-cost-line label:nth-child(2) { grid-column: auto; }
    .billing-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .receipt-actuals .table { table-layout: fixed; }
    .receipt-actuals :is(th, td) { padding-inline: 7px; overflow-wrap: anywhere; }
    .receipt-actuals th:first-child { width: 35%; }
    .receipt-actuals .receipt-count { min-width: 0; min-height: 44px; padding-inline: 4px; font-size: 1rem; }
    .receipt-wide-label { display: none; }
    .receipt-short-label { display: inline; }
    .receipt-job :is(.form-control, .form-select, .btn) { min-height: 44px; font-size: 1rem; }
}
.prices-help { display: inline-block; vertical-align: middle; margin-inline-start: 4px; }
.prices-help summary { list-style: none; display: grid; place-items: center; width: 28px; height: 28px; font-size: .875rem; font-weight: 650; }
.prices-help summary::-webkit-details-marker { display: none; }
.prices-help summary::before { content: ""; position: absolute; width: 20px; height: 20px; border: 1px solid currentColor; border-radius: 50%; }
.prices-help-text { position: absolute; z-index: 4; left: 0; width: min(22rem, calc(100vw - 64px)); padding: 10px 12px; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 4px 12px rgb(0 0 0 / .12); white-space: pre-line; overflow-wrap: anywhere; }

.tariff-workspace { display: grid; gap: 16px; min-width: 0; }
.tariff-group-nav { display: flex; flex-wrap: wrap; gap: 6px 16px; padding-inline: 2px; }
.tariff-block { overflow: visible; scroll-margin-top: 12px; }
.tariff-block-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 14px; padding: 14px 16px; }
.tariff-block-heading h2 { font-size: 1.0625rem; }
.tariff-block-heading a { font-size: .875rem; }
.tariff-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.tariff-unit-col { width: 22%; }
.tariff-rate-col { width: 24%; }
.tariff-table :is(th, td) { padding: 8px 16px; border-top: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }
.tariff-table thead { background: var(--canvas); }
.tariff-table thead th { color: var(--muted); font-size: .8125rem; font-weight: 650; text-align: start; }
.tariff-table tbody th { position: relative; font-weight: 600; text-align: start; }
.tariff-table thead th:last-child, .tariff-rate { text-align: end; }
.tariff-unit { color: var(--muted); font-size: .875rem; }
.tariff-amount { font-weight: 650; }
.tariff-personal { color: var(--accent); }
.tariff-edit-button { display: block; min-height: 32px; margin: 0 -4px 0 auto; padding: 0 4px; border: 0; border-radius: 4px; background: transparent; color: var(--accent); font: inherit; font-size: .8125rem; text-decoration: underline; text-underline-offset: .16em; cursor: pointer; }
.tariff-edit-button:hover { background: var(--canvas); }
.tariff-editor-row[hidden] { display: none; }
.tariff-editor-row td { padding-block: 14px; background: var(--canvas); }
.tariff-add-material { padding: 12px 16px; border-top: 1px solid var(--line); }
.tariff-add-material summary { color: var(--accent); cursor: pointer; }
.tariff-add-material form { margin-top: 12px; }
@media (max-width: 600px) {
    .tariff-block-heading { padding-inline: 10px; }
    .tariff-table :is(th, td) { padding-inline: 8px; }
    .tariff-table tbody th { font-size: .875rem; }
    .tariff-unit-col { width: 23%; }
    .tariff-rate-col { width: 29%; }
    .tariff-edit-button { min-height: 40px; }
}
.prices-service-editor-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); scroll-margin-top: 20px; }
.prices-service-editor-row summary { min-height: 38px; align-content: center; overflow-wrap: anywhere; }
.prices-service-editor-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; align-items: end; margin: 8px 0 4px; }
.prices-service-editor-fields .prices-service-hide { display: flex; gap: 8px; align-items: center; align-self: center; }
.prices-service-moves { display: flex; gap: 4px; }
.prices-service-moves button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; }
@media (max-width: 600px) {
    .prices-service-editor-fields { grid-template-columns: minmax(0, 1fr); }
    .prices-service-moves button { width: 44px; height: 44px; }
}
.prices-note { display: block; max-width: 36rem; }
.prices-material, .prices-event { border-top: 1px solid var(--line); padding: 12px 0; }
.prices-material summary { min-height: 32px; align-content: center; }
.prices-material summary span { font-weight: 650; overflow-wrap: anywhere; }
.prices-material summary small, .prices-event h3 span { margin-inline-start: 6px; color: var(--muted); }
.prices-fields .prices-check { display: flex; align-items: center; gap: 8px; align-self: center; }
.prices-event h3 { font-size: 1rem; margin: 0 0 4px; }
.prices-event p { margin: 0 0 6px; overflow-wrap: anywhere; }
.prices-event-changes { margin-bottom: 0; padding-inline-start: 22px; }
.prices-event-changes li + li { margin-top: 6px; }
.packing-actions button[hidden] { display: none; }
.work-clients { list-style: none; padding: 0; margin: 0; }
.work-clients li { border-top: 1px solid var(--line); }
.work-clients a { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 12px 16px; }
.work-clients a span { color: var(--muted); }
@media (max-width: 520px) {
    .prices-fields :is(select, input, button), .prices-rate input { font-size: 1rem; min-height: 44px; }
}
@media (max-width: 520px) {
    .receiving-shipping-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.catalog-tools { display: flex; flex-wrap: wrap; gap: 8px; width: min(100%, 24rem); }
.catalog-tools input { flex: 1 1 12rem; width: auto; }
.catalog-stores { margin-bottom: 20px; }
.catalog-heading { display: flex; align-items: center; gap: 8px; }
.store-list, .store-routes { list-style: none; margin: 0; padding: 0; }
.store-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 16px 20px; border-top: 1px solid var(--line); }
.store-identity, .store-routes { overflow-wrap: anywhere; }
.store-updated { margin-top: 8px; }
.store-label { color: var(--muted); font-size: .75rem; }
.store-routes li { display: flex; align-items: baseline; gap: 6px; font-size: .875rem; margin-top: 4px; }
.store-routes svg { flex: none; align-self: flex-start; color: var(--accent); }
.store-routes small, .identifier { color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-size: .8rem; }
.store-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: end; align-self: center; }
.store-actions .btn { font-size: .8125rem; }
.order-views.catalog-tabs { margin: 0 0 16px; padding: 0; border-bottom: 1px solid var(--line); }
.catalog-table table { min-width: 58rem; }
.catalog-table th[scope="row"] { min-width: 17rem; }
.catalog-filters { display: grid; grid-template-columns: minmax(12rem, 2fr) repeat(3, minmax(7rem, 1fr)) auto; align-items: end; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.catalog-filters label { min-width: 0; color: var(--muted); font-size: .8125rem; }
.catalog-filters :is(input, select) { margin-top: 4px; }
.catalog-result-heading .receiving-hint { font-size: .75rem; }
.catalog-product, .catalog-listing { display: flex; align-items: center; gap: 8px; }
.catalog-product { align-items: flex-start; gap: 12px; }
.catalog-product-title { display: block; font-weight: 600; }
.catalog-thumbnail { position: relative; display: grid; place-items: center; flex: 0 0 48px; height: 48px; overflow: hidden; border-radius: 6px; background: var(--canvas); color: var(--muted); }
.catalog-thumbnail img { position: absolute; inset: 0; object-fit: contain; background: white; }
img[data-list-image] { visibility: hidden; }
.packed-products .panel-heading { flex-wrap: wrap; }
.packed-products-list { list-style: none; margin: 0; padding: 0; }
.packed-products-list li { display: flex; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); }
.packed-product-info { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.packed-product-quantity { white-space: nowrap; font-variant-numeric: tabular-nums; }
button.catalog-thumbnail { padding: 0; border: 0; cursor: zoom-in; }
.catalog-photo-preview { position: fixed; inset: 0 auto auto 0; width: min(300px, calc(100vw - 24px)); height: min(340px, calc(100vh - 24px)); margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--workspace-shadow); pointer-events: none; }
.catalog-photo-preview img { width: 100%; height: 100%; object-fit: contain; }
.catalog-article { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; color: var(--muted); font-size: .75rem; font-weight: 400; }
.catalog-listings { display: grid; gap: 6px; }
.catalog-listing img { flex: none; border-radius: 4px; }
.catalog-store-name { display: block; font-size: .8125rem; }
.catalog-code .catalog-sku { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.catalog-package span { display: block; white-space: nowrap; }
.catalog-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 12px 20px; border-top: 1px solid var(--line); }
.catalog-pagination > * { display: inline-grid; place-items: center; min-width: 32px; min-height: 32px; padding: 4px 8px; border-radius: 4px; }
.catalog-pagination a:hover, .catalog-pagination [aria-current] { background: var(--accent-soft); color: var(--accent); }
.catalog-table th, .catalog-table td { padding-inline: 12px; }
.catalog-table tr > :first-child { padding-inline-start: 20px; }
.catalog-code { display: inline-flex; align-items: center; gap: 4px; }
.catalog-code .identifier { white-space: nowrap; }
.catalog-barcodes { display: grid; justify-items: start; }
.catalog-copy { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); }
.catalog-copy:hover { color: var(--accent); background: var(--surface-hover); }
.catalog-copy svg { width: 16px; height: 16px; }
.catalog-copy-status { position: fixed; inset: auto 16px 16px auto; z-index: 2; max-width: calc(100% - 32px); margin: 0; padding: 8px 12px; border-radius: 6px; background: var(--shift); color: white; overflow-wrap: anywhere; }
.order-views { display: flex; gap: 16px; padding: 0 20px; }
.order-views a { display: block; padding: 8px 4px; border-bottom: 2px solid transparent; color: var(--muted); }
.order-views a:hover { color: var(--accent); }
.order-views a[aria-current="page"] { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }
.order-table table { min-width: 46rem; }
.order-toolbar .order-views { padding: 0; flex-wrap: wrap; }
.content .btn-outline-secondary, .header-inner .btn-outline-secondary { --bs-btn-color: var(--ink); --bs-btn-border-color: var(--line); --bs-btn-hover-color: var(--ink); --bs-btn-hover-bg: var(--surface-hover); --bs-btn-hover-border-color: var(--muted); }
.content :is(.form-control, .form-select):focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.wb-warehouse-options { max-height: 18rem; overflow: auto; }
.wb-warehouse-options label + label { border-top: 1px solid var(--line); }
.receiving-form [hidden] { display: none !important; }

@media (max-width: 1080px) {
    .catalog-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .catalog-filters label:first-child { grid-column: span 2; }
    .catalog-filters button { grid-area: 1 / 3; }
    .store-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .store-actions { grid-column: 1 / -1; justify-content: start; }
}
@media (min-width: 681px) and (max-width: 900px) {
    :root { --sidebar-width: 212px; --workspace-gutter: 16px; }
}
@media (min-width: 681px) {
    [data-sidebar="collapsed"] { --sidebar-width: 72px; }
    [data-sidebar="collapsed"] .sidebar-heading { flex-direction: column; gap: 8px; padding: 0; }
    [data-sidebar="collapsed"] .app-nav a { justify-content: center; }
    [data-sidebar="collapsed"] .sidebar :is(.wordmark-text, .sidebar-location) { display: none; }
    [data-sidebar="collapsed"] .nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 680px) {
    :root { --workspace-gutter: 12px; }
    .catalog-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-inline: 12px; }
    .catalog-filters button { grid-area: auto; }
    .workspace { display: block; }
    .sidebar { position: static; height: auto; overflow: visible; padding: 12px 16px; }
    [data-sidebar] .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 9; width: min(var(--sidebar-width), 85vw); height: 100dvh; overflow-y: auto; visibility: hidden; }
    [data-drawer-open] .sidebar { visibility: visible; }
    [data-drawer-open] { overflow: hidden; }
    [data-drawer-open] .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 8; background: rgb(19 22 35 / .58); }
    [data-sidebar] .mobile-menu-toggle { display: grid; }
    [data-sidebar] .sidebar-location { display: none; }
    .mobile-location { display: flex; align-items: flex-start; gap: 8px; margin: 0 16px; padding: 12px 0 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .825rem; }
    .mobile-location small { display: block; }
    .app-header { padding-top: 8px; }
    .header-inner { min-height: 52px; gap: 0; padding-inline: 4px; }
    .header-control { position: static; }
    .header-popover { top: calc(100% + 4px); right: 0; }
    .header-context { margin-inline: 4px; }
    .header-context svg { display: none; }
    .content { padding-block: 16px 32px; }
    .page-heading h1 { font-size: 1.75rem; }
    .page-heading { margin-bottom: 18px; }
    .shift-panel { grid-template-columns: 1fr; gap: 14px; padding: 16px; margin-bottom: 16px; }
    .shift-total strong { font-size: 2.6rem; }
    .panel-heading { padding-inline: 12px; }
    .store-row { grid-template-columns: 1fr; padding-inline: 12px; gap: 12px; }
    .portal-summary > div { padding: 12px; }
    .portal-summary dd { font-size: 1.125rem; }
    .queue-table th, .queue-table td { padding-inline: 10px; }
    .receiving-form { padding: 16px; }
    .form-actions { margin: 0 -16px -16px; padding-inline: 16px; }
    .receiving-fields, .receiving-item { grid-template-columns: minmax(0, 1fr); }
    .receiving-product :is(.form-control, button) { min-height: 44px; font-size: 1rem; }
    .receiving-item-quantity { width: min(100%, 9.5rem); }
    .receiving-item :is(input, textarea) { font-size: 1rem; }
}

/* Phone workbench */
.packing-workspace { max-width: 62rem; margin-inline: auto; }
.portal-login { max-width: 32rem; margin-bottom: 16px; }
.portal-login :is(.form-control, .btn) { min-height: 44px; font-size: 1rem; }
.portal-login [hidden] { display: none !important; }
.packing-panel { padding: clamp(12px, 3vw, 24px); margin-block: 0 16px; }
.packing-panel h2 { font-size: 1.15rem; margin: 0 0 12px; }
.packing-actions, .packing-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-block: 0 12px; }
.packing-filters { align-items: end; }
.packing-filters label { flex: 1 1 9rem; }
.packing-order { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.packing-order > span:first-of-type { flex: 1; min-width: 0; }
.packing-order small { display: block; color: var(--muted); }
.packing-order input[type="checkbox"], .packing-option input { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
.packing-order-select { display: block; margin-bottom: 16px; }
.packing-step { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.packing-step span { color: var(--accent); font-variant-numeric: tabular-nums; }
.packing-help { color: var(--muted); margin-bottom: 10px; }
.packing-help:empty { display: none; }
.packing-workspace :is(.btn, .form-control, .form-select) { min-height: 44px; }
.packing-scan .form-control { min-width: 8rem; flex: 1 1 11rem; font-size: 1rem; }
.packing-workspace [hidden] { display: none !important; }
.packing-legend { font-size: 1rem; margin-bottom: 8px; }
@media (max-width: 520px) {
    .packing-order .btn { min-width: 7rem; max-width: 9rem; white-space: normal; }
}
@media print {
    .packing-screen-only { display: none !important; }
    .sidebar, .sidebar-backdrop, .app-header, .mobile-location { display: none !important; }
    :root[data-bs-theme="dark"] { color-scheme: light; --surface: white; --canvas: white; --ink: #161616; --muted: #454545; --line: #bbb; --accent: var(--brand-blue); --bs-primary-contrast: white; }
    .workspace, .workspace-main, .content, .packing-workspace { display: block !important; width: auto !important; max-width: none !important; margin: 0 !important; padding: 0 !important; }
    .packing-panel { border: 0; padding: 0; }
}
.sidebar .brand-mark,
:root[data-bs-theme="dark"] .login-header .brand-mark { filter: brightness(0) invert(1); }
