:root {
  color-scheme: dark;
  --canvas: #100a17;
  --sidebar: #170d21;
  --surface: #21132c;
  --field: #190f24;
  --raised: #2c1936;
  --hover: #34213f;
  --text: #fff8fc;
  --muted: #d3bbd9;
  --border: #51365b;
  --field-border: #8b6a97;
  --accent: #fc2084;
  --accent-hover: #ff67ae;
  --accent-copy: #f7b6de;
  --accent-ink: #1d0916;
  --accent-wash: #421b38;
  --accent-border: #ad4c85;
  --error: #ffabc7;
  --error-surface: #431f35;
  --round: 8px;
  font-family: "DM Sans", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.5;
  letter-spacing: .01em;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 320px; margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 100% 0, #2b132a 0, transparent 440px), var(--canvas); color: var(--text); }
:where(h1,h2,h3,p) { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select, summary, [type="date"] { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 3px; }
svg { display: block; width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
small { display: block; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.shell { display: grid; min-height: 100vh; grid-template-columns: 222px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; background: linear-gradient(155deg, #240f2b, var(--sidebar) 180px); border-right: 1px solid var(--border); padding: 34px 19px 24px; }
.brand { display: inline-flex; width: max-content; max-width: 100%; align-items: center; gap: 10px; font-size: 17px; font-weight: 770; letter-spacing: -.03em; line-height: 1.3; }
.sidebar .brand { margin-left: 8px; }
.brand-mark { display: block; width: 96px; height: auto; flex: none; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 3px; font-weight: 600; letter-spacing: .05em; }
.staff-nav { display: grid; gap: 5px; margin-top: 54px; }
.staff-nav a { padding: 12px 14px; border: 1px solid transparent; border-radius: 5px; font-size: 14px; font-weight: 660; color: var(--muted); display: flex; gap: 11px; align-items: center; min-height: 44px; }
.staff-nav a svg { font-size: 18px; }
.staff-nav a:hover { background: var(--hover); color: var(--text); }
.staff-nav a[aria-current="page"] { background: var(--accent-wash); border-color: var(--accent-border); box-shadow: inset 2px 0 var(--accent); color: var(--text); }
.staff-nav a[aria-current="page"] svg { color: var(--accent-copy); }
.sidebar-end { margin-top: auto; display: grid; gap: 12px; padding: 20px 8px 0; }
.store-link { display: inline-flex; justify-content: space-between; align-items: center; border: 1px solid var(--border); padding: 10px 11px; border-radius: 9px; font-size: 12px; font-weight: 660; }
.store-link:hover { background: var(--raised); }
.link { color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; padding: 0; text-align: left; }
.link:hover { color: var(--accent-copy); }

.workspace { min-width: 0; width: min(100%, 1496px); margin-inline: auto; padding: 21px clamp(24px, 3.5vw, 59px) 58px; }
.workspace-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 45px; border-bottom: 1px solid var(--border); border-image: linear-gradient(90deg, var(--accent-border), var(--border) 45%) 1; padding-bottom: 12px; font-size: 13px; color: var(--muted); }
.workspace-actions { display: flex; align-items: center; gap: 9px; }
.demo-label { display: inline-flex; align-items: center; gap: 5px; color: #f4ce9f; background: #3f2b2d; padding: 5px 8px; font-weight: 650; font-size: 11px; border-radius: 8px; }
.demo-label span { width: 6px; height: 6px; border-radius: 50%; background: #f4ce9f; }
.icon-button { display: inline-grid; place-items: center; height: 40px; width: 40px; background: var(--surface); color: var(--accent-copy); border: 1px solid var(--field-border); border-radius: 5px; flex: none; }
.icon-button:hover:not(:disabled) { background: var(--hover); }
.icon-button svg { width: 18px; height: 18px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 30px 0 23px; }
h1 { font-size: clamp(31px, 3.4vw, 47px); font-weight: 770; letter-spacing: -.042em; line-height: 1.16; }
.page-heading p { color: var(--muted); margin-top: 8px; font-size: 14px; }
.page-heading .button { flex: none; }

.button { display: inline-flex; gap: 7px; align-items: center; justify-content: center; min-height: 42px; border-radius: 5px; padding: 8px 13px; border: 1px solid transparent; font-weight: 680; font-size: 13px; line-height: 1.45; }
.button-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.button-primary:hover:not(:disabled) { background: var(--accent-hover); }
.button-secondary { background: var(--surface); border-color: var(--field-border); }
.button-secondary:hover:not(:disabled) { background: var(--hover); }
.button-danger { background: var(--error-surface); border-color: #a86582; color: var(--error); }
.button-danger:hover:not(:disabled) { background: #5c2946; }
.button-small { min-height: 34px; }
:is(input, select, textarea) { min-height: 42px; border-radius: 5px; border: 1px solid var(--field-border); background: var(--field); padding: 8px 10px; min-width: 0; }
input::placeholder { color: #b9a0c2; }
:is(input, select, textarea):focus { border-color: var(--accent-hover); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 23px; }
.stat-card { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--round); background: linear-gradient(145deg, var(--raised), var(--surface) 70%); min-height: 105px; padding: 15px 16px; text-align: left; }
.stat-card:hover { border-color: var(--accent-border); }
.stat-card[aria-pressed="true"] { border-color: var(--accent-border); box-shadow: inset 0 2px var(--accent); }
.stat-card strong, .stat-card span { display: block; }
.stat-card strong { font-size: 31px; line-height: 1.12; font-weight: 730; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.stat-card span:first-child { font-size: 13px; color: var(--muted); margin-bottom: 7px; font-weight: 610; }
.stat-icon { width: 35px; height: 35px; border-radius: 5px; display: grid; place-items: center; color: var(--accent-copy); background: var(--accent-wash); }
.stat-icon svg { width: 18px; height: 18px; }
.stat-card:first-child .stat-icon { background: #422b24; color: #f5cf9a; }
.stat-card:nth-child(3) .stat-icon { background: #1d3836; color: #9fe5cd; }
.stat-card:nth-child(4) .stat-icon { background: #36294a; color: #d8c7ff; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--round); min-width: 0; overflow: clip; }
.panel + .panel { margin-top: 20px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 20px; }
.panel-heading h2 { font-size: 18px; font-weight: 740; letter-spacing: -.025em; }
.panel-heading p { color: var(--muted); font-size: 13px; margin-top: 3px; }
#result-count { color: var(--muted); font-size: 12px; font-weight: 640; display: inline-block; margin-left: 4px; }
.searchbox { display: flex; align-items: center; flex: 0 1 325px; position: relative; }
.searchbox svg { position: absolute; left: 11px; color: var(--accent-copy); }
.searchbox input { width: 100%; padding-left: 35px; font-size: 13px; background: var(--field); }
.filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--border); padding: 0 20px 14px; }
.status-tabs { display: flex; flex-wrap: wrap; gap: 5px; }
.status-tabs button { font-size: 12px; padding: 6px 10px; min-height: 34px; border-radius: 5px; border: 1px solid transparent; background: transparent; font-weight: 640; color: var(--muted); }
.status-tabs button:hover { background: var(--hover); }
.status-tabs button[aria-pressed="true"] { background: var(--accent-wash); border-color: var(--accent-border); color: var(--accent-copy); }
.batch-filter { display: flex; align-items: center; gap: 8px; min-width: min(100%, 195px); max-width: 100%; color: var(--muted); font-size: 12px; }
.batch-filter span { flex: none; }
.batch-filter select { flex: 1 1 auto; max-width: 230px; min-height: 36px; font-size: 12px; color: var(--text); text-overflow: ellipsis; }

table { border-collapse: collapse; width: 100%; text-align: left; font-size: 13px; }
th, td { padding: 10px 12px; vertical-align: middle; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
th { background: var(--raised); color: var(--muted); font-size: 11px; font-weight: 670; white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:last-child { border-bottom: 0; }
tbody tr:hover { background: var(--hover); }
td { overflow-wrap: anywhere; }
td small { color: var(--muted); margin-top: 2px; font-size: 11px; }
.order-number { font-variant-numeric: tabular-nums; font-weight: 735; font-size: 12px; letter-spacing: .01em; }
.amount { font-variant-numeric: tabular-nums; font-weight: 720; white-space: nowrap; }
.open-order { width: 38px; height: 38px; }
.badge { display: inline-flex; align-items: center; width: fit-content; gap: 5px; font-size: 11px; white-space: nowrap; padding: 4px 8px; border-radius: 100px; font-weight: 680; color: #d5c1df; background: #352740; }
.badge::before { content: ""; width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.badge-pending { background: #422b24; color: #f5cf9a; }
.badge-review { background: var(--accent-wash); color: var(--accent-copy); }
.badge-paid, .badge-open { background: #1d3836; color: #9fe5cd; }
.badge-delivered { background: #36294a; color: #d8c7ff; }
.badge-cancelled { background: var(--error-surface); color: var(--error); }
.empty { padding: 26px 20px; font-size: 13px; color: var(--muted); text-align: center; }
.packing-scroll { overflow-x: auto; }
.packing-scroll table { min-width: 310px; }
.packing-scroll :is(th, td):not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.packing-scroll th[scope="row"] { color: var(--text); background: none; font-size: 13px; white-space: normal; overflow-wrap: anywhere; }
.packing-scroll th[scope="row"] small { color: var(--muted); font-weight: 500; font-size: 11px; }
.packing-count { font-variant-numeric: tabular-nums; }
.packing-subtitle { padding: 4px 20px 12px; color: var(--muted); font-size: 12px; }

.notice { margin: 0 20px 12px; background: var(--raised); color: var(--muted); padding: 9px 12px; font-size: 13px; border-left: 2px solid var(--accent-border); border-radius: 0 5px 5px 0; }
.notice-error { margin: 12px 0 0; border-color: var(--error); color: var(--error); background: var(--error-surface); }
.date-filter { display: inline-flex; gap: 7px; align-items: center; color: var(--muted); font-size: 12px; }
.date-filter input { width: 150px; }
.delivery-grid:has(.map-area:not([hidden])) { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(250px, 1fr); gap: 12px; margin: 0 20px 20px; align-items: stretch; }
.delivery-grid:has(.map-area:not([hidden])) .address-list { max-height: 416px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--round); }
.map-area { position: relative; height: 416px; min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--round); background: var(--field); }
.map-demo { background: #dbdfd4; }
.map-demo canvas { display: block; width: 100%; height: 100%; }
.map-demo-tag { position: absolute; z-index: 1; left: 10px; bottom: 10px; background: var(--field); color: var(--text); padding: 5px 9px; font-size: 11px; border-radius: 6px; box-shadow: 0 2px 7px #100a1740; }
.map-pin { background: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 5px #100a1780; border: 2px solid var(--text); width: 31px; height: 31px; border-radius: 50% 50% 50% 4px; display: grid; place-items: center; transform: rotate(-45deg); font: 720 11px/1 system-ui, sans-serif; cursor: pointer; }
.map-pin span { transform: rotate(45deg); }
.map-pin.is-delivered { background: #392a4c; color: var(--text); }
.map-pin.is-demo { position: absolute; margin: -24px 0 0 -16px; }
.map-pin:focus-visible, .map-pin:hover { background: var(--accent-hover); color: var(--accent-ink); z-index: 2; }
.address-list { margin: 0; padding: 0; list-style: none; }
.address-list li { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-bottom: 1px solid var(--border); }
.address-list li:last-child { border-bottom: 0; }
.address-list li > div { flex: 1; min-width: 0; }
.address-list p { font-size: 12px; overflow-wrap: anywhere; }
.address-list .text-order { display: inline-block; max-width: 100%; color: var(--text); font-size: 12px; font-weight: 730; text-align: left; border: 0; background: transparent; padding: 0; overflow-wrap: anywhere; }
.address-list .text-order:hover { color: var(--accent-copy); text-decoration: underline; }
.number-chip { border-radius: 50%; width: 27px; height: 27px; display: grid; place-items: center; flex: none; background: var(--accent-wash); color: var(--accent-copy); font-size: 11px; font-variant-numeric: tabular-nums; font-weight: 710; }
.address-list a { display: inline-flex; gap: 2px; align-items: center; white-space: nowrap; font-size: 12px; min-height: 38px; color: var(--accent-copy); text-decoration: underline; text-underline-offset: 2px; }
.address-list .map-state { color: var(--muted); font-size: 10px; }
.small-note { font-size: 12px; color: var(--muted); }

dialog { position: fixed; width: min(100% - 26px, 545px); max-height: min(90dvh, 740px); border: 1px solid var(--field-border); border-radius: var(--round); background: var(--surface); color: var(--text); padding: 0; box-shadow: 0 25px 80px #060209aa; }
dialog::backdrop { background: #0b0612bc; }
dialog:modal { overscroll-behavior: contain; }
.close-form { position: absolute; top: 15px; right: 15px; margin: 0; z-index: 1; }
.dialog-content { padding: 24px; }
.dialog-content h2 { font-size: 24px; line-height: 1.25; letter-spacing: -.035em; padding-right: 35px; overflow-wrap: anywhere; }
.dialog-content > p { color: var(--muted); font-size: 14px; margin-top: 8px; }
.detail-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; }
.detail-data { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: start; gap: 7px 8px; margin: 17px 0; font-size: 13px; }
.detail-data dt { color: var(--muted); }
.detail-data dd { margin: 0; overflow-wrap: anywhere; }
.detail-data a { color: var(--accent-copy); text-decoration: underline; text-underline-offset: 2px; }
.detail-items { margin-top: 6px; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.detail-items th, .detail-items td { padding: 7px 10px; }
.detail-items :is(th,td):last-child { text-align: right; }
.detail-total { display: flex; justify-content: space-between; margin-top: 9px; padding: 10px 0 2px; font-size: 14px; }
.proof-section, .receipt-section, .audit-section { margin-top: 19px; padding-top: 15px; border-top: 1px solid var(--border); font-size: 13px; }
.proof-section h3, .receipt-section h3, .audit-section h3 { font-size: 15px; }
.proof-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; margin-bottom: 9px; }
.proof-heading time { color: var(--muted); font-size: 12px; }
.proof-preview { display: block; overflow: hidden; border: 1px solid var(--field-border); border-radius: 5px; background: var(--field); color: var(--accent-copy); }
.proof-preview img { display: block; width: 100%; min-height: 50px; max-height: 240px; object-fit: contain; color: var(--muted); }
.proof-preview > span { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 40px; padding: 8px 10px; border-top: 1px solid var(--border); }
.proof-preview:hover > span { background: var(--hover); text-decoration: underline; }
.receipt-waiting { margin-top: 14px; color: var(--muted); font-size: 13px; }
.audit-section > p { margin-top: 5px; color: var(--muted); }
.receipt-form { display: grid; gap: 10px; margin-top: 10px; }
.receipt-form label { color: var(--muted); font-weight: 630; }
.receipt-form input { width: 100%; }
.receipt-form input[aria-invalid="true"] { border-color: var(--error); }
#receipt-help { color: var(--muted); font-size: 12px; }
.receipt-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.audit-list { display: grid; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.audit-list li { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; overflow-wrap: anywhere; }
.audit-meta { margin-top: 3px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.dialog-buttons { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.dialog-buttons .button { min-height: 40px; }
.form-error { color: var(--error); font-size: 13px; overflow-wrap: anywhere; margin-top: 9px; }
.batch-form, .product-form { display: grid; gap: 12px; margin-top: 19px; }
.form-fields { display: grid; gap: 12px; min-width: 0; border: 0; margin: 0; padding: 0; }
.form-fields label, #login-form label { display: grid; gap: 4px; color: var(--muted); font-size: 13px; font-weight: 630; min-width: 0; }
.batch-cutoff { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; padding: 9px 11px; color: var(--muted); background: var(--raised); border-left: 2px solid var(--accent-border); border-radius: 0 5px 5px 0; font-size: 12px; }
.batch-cutoff svg { color: var(--accent-copy); }
.batch-cutoff strong { color: var(--text); font-weight: 680; }
.form-fields :is(input, select, textarea), #login-form input { width: 100%; }
.form-fields textarea { resize: vertical; }
.batch-form > .button, .product-form > .button { justify-self: end; }
.batch-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.batch-actions .button { white-space: nowrap; }
.batch-product-picker { min-width: 0; margin: 0; padding: 10px; border: 1px solid var(--border); border-radius: var(--round); }
.batch-product-picker legend { padding-inline: 4px; font-size: 14px; font-weight: 700; }
.product-picker-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px 10px; flex-wrap: wrap; margin: 10px 0 8px; }
#batch-product-summary { color: var(--accent-copy); font-weight: 680; }
.selection-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.product-picker-options { max-height: min(240px, 34dvh); overflow: auto; padding: 3px; border: 1px solid var(--border); border-radius: 5px; background: var(--field); }
.product-picker-option, .form-fields .product-check { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.product-picker-option { min-height: 46px; padding: 6px 8px; overflow-wrap: anywhere; font-size: 13px; }
.product-picker-option:hover { background: var(--hover); }
.product-picker-option + .product-picker-option { border-top: 1px solid var(--border); }
.product-picker-option small { color: var(--muted); }
:is(.product-picker-option, .product-check) input { flex: none; width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--accent); cursor: pointer; }
.product-fields-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.product-image-field { display: flex; gap: 10px; align-items: center; }
.product-image-field > div { flex: 1; min-width: 0; }
.product-image-field input { margin: 4px 0; font-size: 13px; cursor: pointer; }
.product-image-field input::file-selector-button { background: var(--raised); color: var(--text); border: 1px solid var(--field-border); border-radius: 4px; padding: 3px 7px; margin-inline-end: 7px; font: inherit; cursor: pointer; }
#product-image-preview, .catalog-image { flex: none; border: 1px solid var(--border); border-radius: 5px; background: var(--field); object-fit: cover; }
.catalog-item > div { display: flex; align-items: center; gap: 10px; }
.catalog-actions { text-align: right; white-space: nowrap; }
#catalog-error, #batch-catalog-error { color: var(--error); border-color: var(--error); background: var(--error-surface); }

.access { display: grid; min-height: 100vh; place-items: center; padding: 20px; }
.access-card { position: relative; width: min(100%, 420px); border: 1px solid var(--accent-border); background: linear-gradient(150deg, #30172f 0, var(--surface) 62%); border-radius: var(--round); padding: clamp(19px, 5vw, 32px); display: grid; align-items: start; gap: 14px; box-shadow: 0 24px 70px #06020988; }
.access-card::before { content: ""; position: absolute; inset: 0 auto auto 21px; width: 92px; height: 2px; background: var(--accent); transform: skewX(-28deg); }
.access-card .brand-mark { width: 122px; }
.access-card h1 { font-size: 32px; margin-top: 9px; }
.access-card p { font-size: 14px; color: var(--muted); }
.access-card form { display: grid; gap: 7px; }
.access-card input { min-height: 43px; }
.access-card .link { margin-top: 5px; }
.toast { position: fixed; z-index: 3; right: clamp(12px, 3vw, 40px); bottom: clamp(12px, 3vw, 40px); border: 1px solid var(--accent-border); border-radius: 5px; background: var(--raised); color: var(--text); box-shadow: 0 8px 30px #06020988; padding: 11px 15px; font-size: 13px; max-width: 84vw; }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 177px minmax(0, 1fr); }
  .sidebar { padding-inline: 13px; }
  .sidebar .brand { margin-left: 2px; gap: 8px; font-size: 15px; }
  .sidebar .brand-mark { width: 86px; }
  .workspace { padding-inline: 22px; }
  .stat-card { padding: 13px 12px; }
}
@media (max-width: 850px) {
  .shell { display: block; }
  .sidebar { height: auto; position: static; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border-right: 0; border-bottom: 1px solid var(--border); padding: 13px 20px 9px; }
  .sidebar .brand { margin-left: 0; font-size: 16px; }
  .sidebar .brand-mark { width: 94px; }
  .staff-nav { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
  .staff-nav a { flex: 1; min-width: max-content; justify-content: center; min-height: 44px; padding: 8px 10px; font-size: 13px; }
  .sidebar-end { padding: 0; gap: 3px; }
  .sidebar-end .link { justify-self: end; }
  .store-link { padding: 6px 8px; gap: 4px; }
  .workspace { padding-top: 11px; }
}
@media (max-width: 600px) {
  .sidebar { padding-inline: 13px; }
  .sidebar .brand-mark { width: 84px; }
  .staff-nav a { padding-inline: 6px; gap: 6px; }
  .workspace { padding-inline: 13px; padding-bottom: 35px; }
  .workspace-bar { font-size: 12px; }
  .page-heading { padding: 22px 0 15px; align-items: flex-start; flex-wrap: wrap; gap: 10px; }
  .page-heading p { font-size: 13px; margin-top: 5px; }
  .page-heading .button { min-height: 42px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
  .stat-card { min-height: 76px; padding: 10px 11px; }
  .stat-card strong { font-size: 26px; }
  .stat-card span:first-child { font-size: 12px; margin-bottom: 3px; }
  .stat-icon { width: 31px; height: 31px; }
  .panel + .panel { margin-top: 14px; }
  .panel-heading { padding: 12px; flex-wrap: wrap; gap: 8px; }
  .panel-heading h2 { font-size: 16px; }
  .searchbox { flex: 1 1 100%; }
  .searchbox input, .batch-filter select, .date-filter input, .access-card input, .form-fields :is(input, select, textarea), .receipt-form input { font-size: 16px; }
  .filters { padding: 0 12px 10px; gap: 6px; }
  .status-tabs { gap: 3px; }
  .status-tabs button { min-height: 38px; padding-inline: 7px; font-size: 11px; }
  :is(.order-table, .batch-table, .catalog-table), :is(.order-table, .batch-table, .catalog-table) tbody { display: block; }
  :is(.order-table, .batch-table, .catalog-table) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  .order-table tr, .batch-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto 42px; grid-template-rows: auto auto auto; gap: 3px 7px; padding: 10px 12px; align-items: start; }
  :is(.order-table, .batch-table, .catalog-table) td { display: block; padding: 0; }
  .order-table .cell-number { grid-area: 1 / 1; }
  .order-table .cell-recipient { grid-area: 2 / 1; }
  .order-table .cell-batch { grid-area: 3 / 1 / 4 / 3; color: var(--muted); font-size: 11px; }
  .order-table .cell-batch small { display: inline; margin-left: 5px; }
  .order-table .cell-amount { grid-area: 2 / 2; justify-self: end; }
  .order-table .cell-status { grid-area: 1 / 2; justify-self: end; }
  .order-table .cell-open { grid-area: 1 / 3 / 4 / 4; align-self: center; }
  .open-order { width: 42px; height: 42px; }
  .batch-table tr { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto auto auto; gap: 5px 8px; font-size: 12px; }
  .batch-table .cell-batch-name { grid-area: 1 / 1; }
  .batch-table .cell-batch-status { grid-area: 1 / 2; justify-self: end; }
  .batch-table .cell-cutoff { grid-area: 2 / 1; }
  .batch-table .cell-delivery-date { grid-area: 3 / 1; }
  .batch-table .cell-batch-products { grid-area: 4 / 1; }
  .batch-table .cell-batch-actions { grid-area: 2 / 2 / 5 / 3; align-self: center; }
  .batch-table :is(.cell-cutoff, .cell-delivery-date, .cell-batch-products)::before { content: attr(data-label) " "; color: var(--muted); }
  .batch-actions { flex-direction: column; }
  .catalog-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 10px 12px; }
  .catalog-table .catalog-status { justify-self: end; }
  .catalog-image { width: 36px; height: 36px; }
  .packing-scroll :is(th, td) { padding-inline: 7px; }
  .packing-scroll :is(th, td):first-child { padding-left: 12px; }
  .packing-scroll :is(th, td):last-child { padding-right: 12px; }
  .packing-subtitle { padding-inline: 12px; }
  .notice { margin-inline: 12px; font-size: 12px; }
  .notice-error { margin-inline: 0; }
  .delivery-grid:has(.map-area:not([hidden])) { grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 0 12px 12px; }
  .map-area { height: 290px; }
  .delivery-grid:has(.map-area:not([hidden])) .address-list { max-height: none; }
  .dialog-content { padding: 17px; }
  .dialog-content h2 { font-size: 21px; }
  .close-form { top: 11px; right: 11px; }
}
@media (max-width: 420px) {
  .staff-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}

.google-map-host { width: 100%; height: 100%; }
.map-csv-help a { color: var(--accent-copy); font-weight: 680; text-decoration: underline; text-underline-offset: 2px; }
.map-csv-help p { margin: 0; }
.map-csv-help details { margin-top: 8px; }
.map-csv-help summary { color: var(--accent-copy); cursor: pointer; width: fit-content; }
.map-csv-help details p { margin-top: 6px; }
