:root {
  --brand: #ec1d3f;
  --brand-dark: #c81231;
  --ink: #17181b;
  --muted: #6b7079;
  --line: #e6e7eb;
  --soft: #f6f7f9;
  --success: #16845b;
  --warning: #b86408;
  --shadow: 0 12px 34px rgba(18, 21, 28, .08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f4f5f7;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: #f4f5f7; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.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; }

.app-header {
  height: 76px;
  padding: 0 clamp(20px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--brand); color: #fff; font-weight: 850; letter-spacing: -.04em; }
.brand strong { display: block; font-size: 17px; letter-spacing: -.02em; }
.brand div span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.user-badge { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.user-badge strong { font-size: 13px; }
.user-badge span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.logout-button { flex: 0 0 auto; color: var(--muted); font-size: 18px; }
.status { color: var(--muted); font-size: 13px; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #23b47e; box-shadow: 0 0 0 4px #e7f7f1; }

.button { min-height: 42px; padding: 0 18px; border: 0; border-radius: 10px; font-weight: 750; transition: transform .12s ease, background .12s ease, opacity .12s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button-primary { background: var(--brand); color: white; box-shadow: 0 7px 18px rgba(236, 29, 63, .2); }
.button-primary:hover { background: var(--brand-dark); }
.button-dark { background: var(--ink); color: #fff; }
.button-quiet { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.button-danger { background: #fff1f3; color: #b60f2a; }
.button-wide { width: 100%; }

.shell { padding: 30px clamp(20px, 4vw, 56px) 48px; }
.workspace { width: min(1440px, 100%); margin: 0 auto; }
.workspace-topbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; margin: 26px 0 16px; }
.scan-card { display: grid; flex: 1 1 560px; max-width: 680px; grid-template-columns: minmax(150px, .5fr) minmax(310px, 1fr); align-items: center; gap: 14px; padding: 10px 12px 10px 16px; color: #fff; border-radius: 14px; background: linear-gradient(115deg, #cf1232, #f02b4b); box-shadow: 0 10px 26px rgba(207,18,50,.16); }
.scan-card[hidden] { display: none; }
.eyebrow { display: block; margin-bottom: 7px; font-size: 11px; font-weight: 850; letter-spacing: .12em; color: inherit; opacity: .7; }
.scan-copy { min-width: 0; }
.scan-copy strong { display: block; font-size: 15px; }
.scan-copy p { margin: 3px 0 0; overflow: hidden; color: rgba(255,255,255,.8); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.scan-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.scan-form input { min-width: 0; height: 46px; padding: 0 16px; border: 2px solid transparent; border-radius: 10px; outline: none; font-size: 17px; font-weight: 750; letter-spacing: .03em; }
.scan-form input:focus { border-color: #17181b; box-shadow: 0 0 0 4px rgba(255,255,255,.25); }

.tabs { display: flex; flex: 0 0 auto; gap: 10px; margin: 0; }
.tab { display: flex; align-items: center; gap: 9px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: #fff; font-weight: 720; }
.tab span { min-width: 24px; padding: 2px 7px; border-radius: 99px; background: var(--soft); font-size: 12px; text-align: center; }
.tab.is-active { color: #fff; background: var(--ink); border-color: var(--ink); }
.tab.is-active span { color: var(--ink); background: #fff; }

.toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.filter-controls { display: flex; align-items: flex-end; flex: 1; flex-wrap: wrap; gap: 12px; min-width: 0; }
.toolbar-meta { display: flex; align-items: center; gap: 14px; }
.sync-status { padding: 6px 9px; border-radius: 999px; color: var(--muted); background: #fff; border: 1px solid var(--line); font-size: 11px; font-weight: 760; }
.sync-status.has-data { color: var(--success); border-color: #bce5d6; background: #eefaf5; }
.sync-status.has-warning { color: var(--warning); border-color: #f0d4ae; background: #fff8ed; }
.search-box { flex: 1 1 300px; width: min(390px, 100%); position: relative; }
.search-box svg { position: absolute; left: 14px; top: 50%; width: 19px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-linecap: round; stroke-width: 1.8; }
.search-box input { width: 100%; height: 44px; padding: 0 14px 0 43px; border: 1px solid var(--line); border-radius: 11px; outline: none; background: #fff; }
.search-box input:focus { border-color: #acb0b8; box-shadow: 0 0 0 3px rgba(23,24,27,.07); }
.facet-filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 7px; }
.select-filter { display: grid; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 720; }
.select-filter select { width: 168px; height: 44px; padding: 0 34px 0 11px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #fff; outline: none; }
.select-filter select:focus { border-color: #acb0b8; box-shadow: 0 0 0 3px rgba(23,24,27,.07); }
.result-limit { color: var(--muted); font-size: 12px; }
.date-filter { display: flex; align-items: flex-end; gap: 7px; padding: 7px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.date-filter-title { align-self: center; padding: 0 5px; color: var(--muted); font-size: 12px; font-weight: 780; }
.date-filter label { display: grid; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 720; }
.date-filter input { width: 132px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; font-size: 12px; }
.date-button { min-height: 34px; padding: 0 11px; font-size: 12px; }

.content-grid { display: grid; grid-template-columns: minmax(520px, 1.12fr) minmax(390px, .88fr); gap: 18px; align-items: start; }
.orders-panel, .detail-panel { min-height: 470px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.orders-list { display: flex; flex-direction: column; }
.order-row { display: grid; grid-template-columns: 1.4fr 1fr 128px 110px; align-items: center; gap: 16px; padding: 18px 20px; border: 0; border-bottom: 1px solid var(--line); background: #fff; color: inherit; text-align: left; }
.order-row:hover { background: #fafafb; }
.order-row.is-selected { box-shadow: inset 4px 0 0 var(--brand); background: #fff8f9; }
.order-row.has-no-guide { box-shadow: inset 4px 0 0 #d97706; background: #fff8e8; }
.order-row.has-no-guide:hover { background: #fff3d6; }
.order-row.has-no-guide.is-selected { box-shadow: inset 4px 0 0 var(--brand); background: #ffedc2; }
.order-id { display: block; font-weight: 820; letter-spacing: -.01em; }
.order-client { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-guide-flag { display: inline-flex; margin-top: 7px; padding: 3px 7px; border-radius: 6px; color: #854d0e; background: #fde4a6; font-size: 10px; font-weight: 850; letter-spacing: .03em; text-transform: uppercase; }
.order-meta { color: var(--muted); font-size: 13px; }
.order-date { display: block; margin-bottom: 4px; color: var(--ink); font-size: 11px; font-weight: 760; text-transform: capitalize; }
.progress { height: 7px; margin-top: 8px; overflow: hidden; border-radius: 99px; background: #eceef1; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.progress-text { font-size: 13px; font-weight: 760; text-align: right; }
.pill { justify-self: end; padding: 5px 9px; border-radius: 99px; color: var(--warning); background: #fff4e5; font-size: 11px; font-weight: 820; text-transform: uppercase; letter-spacing: .04em; }
.pill.archived { color: var(--success); background: #eaf8f2; }
.pill.packing { color: #4c5fc8; background: #eef0ff; }
.pill.cancelled { color: #a43a4b; background: #fff0f2; }
.pill.missing-guide { color: #854d0e; background: #fde4a6; }

.empty-state { display: grid; place-items: center; min-height: 468px; padding: 42px; color: var(--muted); text-align: center; }
.empty-icon { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; background: var(--soft); color: var(--ink); font-size: 24px; }
.empty-state strong { display: block; color: var(--ink); margin-bottom: 6px; }
.empty-state p { margin: 0; max-width: 300px; font-size: 14px; line-height: 1.45; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 16px; border-top: 1px solid var(--line); color: var(--muted); background: #fafafb; font-size: 12px; }
.pagination > div { display: flex; gap: 7px; }
.pagination .button { min-height: 34px; padding: 0 12px; font-size: 12px; }

.detail-panel { position: sticky; top: 20px; }
.detail-workspace { min-height: inherit; }
.remission-info { min-width: 0; }
.detail-empty { display: grid; place-items: center; min-height: 468px; padding: 40px; text-align: center; color: var(--muted); }
.detail-empty strong { display: block; margin-bottom: 7px; color: var(--ink); font-size: 18px; }
.detail-head { padding: 22px 22px 18px; border-bottom: 1px solid var(--line); }
.detail-title-row { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.detail-title-row h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.detail-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.remission-data { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 18px 22px; }
.remission-field { min-width: 0; padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.remission-field-wide { grid-column: 1 / -1; }
.remission-field span, .remission-field strong { display: block; }
.remission-field span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.remission-field strong { margin-top: 5px; overflow-wrap: anywhere; font-size: 14px; line-height: 1.35; }
.remission-guide { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 22px 18px; }
.detail-actions .button { min-height: 36px; padding: 0 12px; font-size: 12px; }
.print-lock { margin: 0 22px 18px; padding: 10px 12px; border-radius: 9px; color: #6b591a; background: #fff9df; font-size: 12px; line-height: 1.4; }
.audit-details { border-bottom: 1px solid var(--line); background: #fafafb; }
.audit-details summary { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 22px; color: var(--muted); cursor: pointer; list-style: none; font-size: 11px; font-weight: 760; user-select: none; }
.audit-details summary::-webkit-details-marker { display: none; }
.audit-details summary::before { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s ease; }
.audit-details[open] summary::before { transform: rotate(45deg); }
.audit-details summary:hover { color: var(--ink); background: #f4f5f7; }
.audit-label-open { display: none; }
.audit-details[open] .audit-label-closed { display: none; }
.audit-details[open] .audit-label-open { display: inline; }
.audit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 9px; padding: 2px 22px 16px; }
.audit-item { min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.audit-item span, .audit-item strong, .audit-item small { display: block; overflow: hidden; text-overflow: ellipsis; }
.audit-item span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.audit-item strong { margin-top: 4px; white-space: nowrap; font-size: 13px; }
.audit-item small { margin-top: 4px; color: var(--muted); white-space: nowrap; font-size: 10px; }
.packing-products { min-width: 0; }
.products-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 22px 22px 14px; border-bottom: 1px solid var(--line); }
.products-head .eyebrow { margin: 0; color: var(--muted); opacity: 1; }
.products-head strong { font-size: 13px; }
.items { padding: 4px 22px 10px; }
.item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item-name { font-weight: 760; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-sku { margin-top: 5px; color: var(--muted); font: 700 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
.qty { display: flex; align-items: center; gap: 10px; font-weight: 850; }
.qty-done { color: var(--brand); font-size: 20px; }
.item.is-done .qty-done { color: var(--success); }
.item.is-done .item-name { text-decoration: line-through; color: var(--muted); }
.shared-order-panel { min-height: 0; }
.order-summary-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(165px, .85fr); align-items: start; gap: 22px; padding-bottom: 18px; }
.order-summary-main { min-width: 0; }
.order-summary-main h2 { margin: 0; overflow-wrap: anywhere; font-size: 22px; letter-spacing: -.03em; }
.order-summary-head .customer-name { margin-top: 7px; color: var(--ink); font-size: 16px; font-weight: 760; }
.order-summary-meta { display: grid; gap: 8px; min-width: 0; margin: 0; }
.order-summary-meta div { min-width: 0; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.order-summary-meta div:last-child { padding-bottom: 0; border-bottom: 0; }
.order-summary-meta dt { color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.order-summary-meta dd { margin: 2px 0 0; overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 760; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.shared-order-detail .detail-actions { padding-top: 14px; border-bottom: 1px solid var(--line); }
.shared-order-detail .packing-products { background: #fff; }
.shared-order-detail .products-head { padding-top: 18px; }

.toast { position: fixed; left: 50%; bottom: 28px; z-index: 10; padding: 13px 17px; border-radius: 10px; color: #fff; background: var(--ink); box-shadow: var(--shadow); font-weight: 720; font-size: 13px; opacity: 0; transform: translate(-50%, 16px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #a81029; }
.toast.success { background: var(--success); }

.dialog { width: min(520px, calc(100% - 30px)); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.28); }
.dialog-large { width: min(720px, calc(100% - 30px)); }
.dialog::backdrop { background: rgba(12,14,18,.58); backdrop-filter: blur(3px); }
.dialog-card { padding: 24px; }
.dialog-header { display: flex; justify-content: space-between; gap: 20px; }
.dialog-header .eyebrow { color: var(--brand); opacity: 1; }
.dialog-header h2 { margin: 0; letter-spacing: -.03em; }
.dialog-copy { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 9px; background: var(--soft); font-size: 24px; line-height: 1; }
.import-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 22px 0; }
.summary-stat { padding: 16px 10px; border-radius: 11px; background: var(--soft); text-align: center; }
.summary-stat strong { display: block; font-size: 24px; }
.summary-stat span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.pdf-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0 16px; }
.pdf-field { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; transition: border-color .12s ease, background .12s ease; }
.pdf-field:hover { border-color: #b7bbc3; background: #fafafb; }
.pdf-field-icon { display: grid; place-items: center; width: 32px; height: 32px; margin-bottom: 12px; border-radius: 9px; color: #fff; background: var(--ink); font-weight: 850; }
.pdf-field strong, .pdf-field small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-field small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.pdf-field input { width: 100%; margin-top: 13px; color: var(--muted); font-size: 11px; }
.pdf-progress { margin: 14px 0 18px; }
.pdf-progress > span { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; }
.pdf-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 9px; margin: 16px 0; }
.pdf-summary .summary-stat { padding: 13px 8px; }
.pdf-summary .summary-stat strong { font-size: 20px; }
.pdf-summary .warning strong { color: var(--warning); }
.sync-warning { margin: 10px 22px 20px; padding: 12px 14px; border: 1px solid #f0d4ae; border-radius: 10px; color: #885019; background: #fff8ed; font-size: 12px; line-height: 1.4; }
.guide-order-summary { margin: 20px 0 14px; padding: 14px; border-radius: 12px; background: var(--soft); }
.guide-order-summary strong, .guide-order-summary span { display: block; }
.guide-order-summary strong { font-size: 15px; }
.guide-order-summary span { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.single-guide-field { display: grid; gap: 8px; margin: 14px 0; color: var(--muted); font-size: 12px; font-weight: 750; }
.single-guide-field input { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.guide-validation { margin: 12px 0 16px; padding: 12px 14px; border: 1px solid #c9e7d5; border-radius: 10px; color: #17633b; background: #effaf3; font-size: 12px; line-height: 1.45; }
.guide-validation.is-error { border-color: #efc5cc; color: #952039; background: #fff3f5; }
.print-pdf-sheet img { display: block; max-width: 100%; max-height: 100%; margin: 0 auto; object-fit: contain; }

.auth-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top left, #fff 0, #f5f5f7 48%, #eceef2 100%); }
.auth-card { width: min(430px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 24px 70px rgba(18,21,28,.12); }
.auth-brand { margin-bottom: 34px; }
.auth-card > .eyebrow { color: var(--brand); opacity: 1; }
.auth-card h1 { margin: 0; font-size: 30px; letter-spacing: -.04em; }
.auth-card > p { margin: 8px 0 24px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.stack-form { display: grid; gap: 15px; }
.stack-form label, .user-form label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 750; }
.stack-form input, .user-form input, .user-form select { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; outline: none; }
.stack-form input:focus, .user-form input:focus, .user-form select:focus { border-color: #9da1a9; box-shadow: 0 0 0 3px rgba(23,24,27,.06); }
.form-message { min-height: 20px; margin: 14px 0 0 !important; color: #9b2438 !important; font-size: 12px !important; }
.user-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0; padding: 18px; border-radius: 13px; background: var(--soft); }
.user-form .button { align-self: end; }
.users-list { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.user-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.user-row:last-child { border-bottom: 0; }
.user-row strong, .user-row small { display: block; }
.user-row small { margin-top: 4px; color: var(--muted); }
.user-row-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.button-delete-user { padding: 7px 11px; border: 1px solid #f4c7ce; border-radius: 9px; color: #b4233a; background: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.button-delete-user:hover { background: #fff0f2; }
.button-delete-user:disabled { opacity: .5; cursor: wait; }
@media (max-width: 520px) { .user-row { align-items: flex-start; flex-direction: column; } }
.role-pill { padding: 5px 9px; border-radius: 99px; color: #4c5fc8; background: #eef0ff; font-size: 11px; font-weight: 800; }

/* La interfaz táctil se activa únicamente para cuentas con rol Empacador. */
.touch-mode button, .touch-mode input, .touch-mode select, .touch-mode summary, .touch-mode a { touch-action: manipulation; }
.touch-mode .app-header { min-height: 84px; height: auto; }
.touch-mode .brand-mark { width: 46px; height: 46px; }
.touch-mode .brand strong { font-size: 19px; }
.touch-mode .brand div span, .touch-mode .user-badge span { font-size: 13px; }
.touch-mode .user-badge strong { font-size: 15px; }
.touch-mode .button { min-height: 50px; padding: 0 20px; font-size: 14px; }
.touch-mode .icon-button { width: 50px; height: 50px; }
.touch-mode .workspace-topbar { margin-top: 0; }
.touch-mode .scan-card { gap: 12px; padding: 10px 12px 10px 16px; }
.touch-mode .scan-copy p { font-size: 13px; }
.touch-mode .scan-form input { height: 52px; font-size: 18px; }
.touch-mode .tabs { gap: 12px; scrollbar-width: thin; }
.touch-mode .tab { min-height: 52px; padding: 0 18px; font-size: 15px; }
.touch-mode .tab span { min-width: 28px; padding: 4px 8px; font-size: 13px; }
.touch-mode .search-box input, .touch-mode .select-filter select { height: 52px; font-size: 15px; }
.touch-mode .select-filter, .touch-mode .date-filter label { font-size: 13px; }
.touch-mode .date-filter { gap: 10px; padding: 10px; }
.touch-mode .date-filter-title { font-size: 14px; }
.touch-mode .date-filter input { height: 48px; font-size: 14px; }
.touch-mode .date-button { min-height: 48px; font-size: 14px; }
.touch-mode .order-row { min-height: 86px; padding: 20px 22px; }
.touch-mode .order-id { font-size: 17px; }
.touch-mode .order-client, .touch-mode .order-meta, .touch-mode .progress-text { font-size: 14px; }
.touch-mode .order-date { font-size: 13px; }
.touch-mode .progress { height: 9px; }
.touch-mode .pagination { font-size: 14px; }
.touch-mode .pagination .button { min-height: 48px; font-size: 14px; }
.touch-mode .detail-head { padding: 24px; }
.touch-mode .detail-title-row h2 { font-size: 25px; }
.touch-mode .detail-head p { font-size: 15px; }
.touch-mode .detail-actions { gap: 12px; }
.touch-mode .detail-actions .button { min-height: 50px; padding: 0 17px; font-size: 14px; }
.touch-mode .audit-details summary { min-height: 50px; font-size: 13px; }
.touch-mode .item { min-height: 70px; padding: 18px 0; }
.touch-mode .item-name { font-size: 16px; }
.touch-mode .item-sku { font-size: 14px; }
.touch-mode .qty-done { font-size: 24px; }
.touch-mode .remission-field span { font-size: 12px; }
.touch-mode .remission-field strong { font-size: 16px; }
.touch-mode .products-head strong { font-size: 15px; }
.touch-mode .shared-order-detail .item { min-height: 64px; padding: 14px 0; }
.touch-mode .shared-order-detail .products-head { padding-top: 16px; }
.touch-mode .order-summary-meta dt { font-size: 10px; }
.touch-mode .order-summary-meta dd { font-size: 14px; }
.touch-mode .toast { padding: 16px 20px; font-size: 15px; }
.touch-mode .button:hover:not(:disabled) { transform: none; }
.touch-mode.touch-scanning.packing-focus .toolbar, .touch-mode.touch-scanning.packing-focus .orders-panel { display: none; }
.touch-mode.touch-scanning.packing-focus .content-grid { grid-template-columns: 1fr; }
.touch-mode.touch-scanning.packing-focus .detail-panel { position: static; min-height: 0; }
.touch-mode.touch-scanning.packing-focus .detail-workspace { display: grid; grid-template-columns: minmax(330px, .78fr) minmax(460px, 1.22fr); }
.touch-mode.touch-scanning.packing-focus .remission-info { border-right: 1px solid var(--line); }
.touch-mode.touch-scanning.packing-focus .items { padding-top: 8px; }
.touch-mode.touch-scanning.packing-focus .detail-title-row h2 { font-size: 30px; }
.touch-mode.touch-scanning.packing-focus .detail-head p { font-size: 16px; }

@media (max-width: 1100px) {
  .touch-mode .content-grid { grid-template-columns: 1fr; }
  .touch-mode .detail-panel { position: static; scroll-margin-top: 18px; }
  .touch-mode.touch-scanning .detail-panel { order: 1; }
  .touch-mode.touch-scanning .orders-panel { order: 2; }
  .touch-mode .toolbar { align-items: stretch; flex-direction: column; }
  .touch-mode .search-box { width: 100%; }
  .touch-mode.touch-scanning.packing-focus .detail-workspace { grid-template-columns: minmax(300px, .8fr) minmax(380px, 1.2fr); }
}

@media (max-width: 920px) {
  .workspace-topbar { align-items: stretch; flex-direction: column; }
  .scan-card, .content-grid { grid-template-columns: 1fr; }
  .scan-card { flex-basis: auto; width: 100%; max-width: none; align-items: stretch; gap: 8px; }
  .detail-panel { position: static; }
  .order-row { grid-template-columns: 1.4fr .8fr 90px; }
  .order-row .pill { display: none; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .filter-controls { flex-wrap: wrap; }
  .search-box { width: 100%; }
  .touch-mode.touch-scanning.packing-focus .detail-workspace { grid-template-columns: 1fr; }
  .touch-mode.touch-scanning.packing-focus .remission-info { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 620px) {
  .app-header { height: auto; padding-top: 14px; padding-bottom: 14px; align-items: flex-start; }
  .status { display: none; }
  .header-actions { gap: 7px; }
  .user-badge { display: none; }
  .header-actions .button { min-height: 38px; padding: 0 11px; font-size: 12px; }
  .shell { padding-top: 18px; }
  .scan-card { padding: 22px 18px; }
  .scan-form { grid-template-columns: 1fr; }
  .tabs { overflow-x: auto; }
  .tab { flex: 0 0 auto; }
  .result-limit, .order-row .order-meta { display: none; }
  .toolbar-meta { display: none; }
  .date-filter { width: 100%; flex-wrap: wrap; }
  .facet-filters { width: 100%; }
  .select-filter { flex: 1 1 150px; }
  .select-filter select { width: 100%; }
  .date-filter-title { width: 100%; padding: 2px 3px; }
  .date-filter label { flex: 1; }
  .date-filter input { width: 100%; }
  .date-button { flex: 1; }
  .pagination { align-items: stretch; flex-direction: column; }
  .pagination > div, .pagination .button { width: 100%; }
  .pdf-fields, .pdf-summary { grid-template-columns: 1fr; }
  .order-row { grid-template-columns: 1fr 82px; }
  .orders-panel, .detail-panel { min-height: 360px; }
  .user-form { grid-template-columns: 1fr; }
  .audit-details summary { padding: 0 18px; }
  .audit-grid { grid-template-columns: 1fr; padding: 2px 18px 14px; }
  .touch-mode .header-actions .button { min-height: 48px; padding: 0 14px; font-size: 14px; }
  .touch-mode .shell { padding: 16px 14px 36px; }
  .touch-mode .workspace-topbar { gap: 12px; }
  .touch-mode .scan-card { padding: 12px; }
  .touch-mode .order-row { grid-template-columns: 1fr 74px; padding: 19px 17px; }
  .touch-mode .detail-actions .button { flex: 1 1 150px; }
  .touch-mode .detail-actions .button-danger { flex-basis: 100%; }
  .order-summary-head { grid-template-columns: minmax(0, 1fr) minmax(145px, .8fr); gap: 14px; padding: 18px; }
  .order-summary-main h2 { font-size: 20px; }
  .order-summary-head .customer-name { font-size: 14px; }
  .order-summary-meta dd { font-size: 11px; }
}

@media print {
  body * { visibility: hidden !important; }
  #printSheet, #printSheet * { visibility: visible !important; }
  #printSheet { position: absolute; inset: 0; padding: 24px; background: #fff; }
  #printSheet.print-pdf-sheet { display: grid; place-items: center; padding: 0; }
  #printSheet.print-pdf-sheet img { max-width: 100%; max-height: 100vh; }
}
