@font-face { font-family: 'Cambay'; font-weight: 400; font-display: swap; src: url('/assets/fonts/cambay-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cambay'; font-weight: 700; font-display: swap; src: url('/assets/fonts/cambay-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Stack Sans Notch'; font-weight: 400; font-display: swap; src: url('/assets/fonts/stack-sans-notch-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Stack Sans Notch'; font-weight: 500; font-display: swap; src: url('/assets/fonts/stack-sans-notch-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Stack Sans Notch'; font-weight: 600; font-display: swap; src: url('/assets/fonts/stack-sans-notch-latin-600-normal.woff2') format('woff2'); }

:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --rail: #f1f2ee;
  --surface: #fff;
  --ink: #1f2421;
  --ink-2: #3b423e;
  --muted: #5d6560;
  --line: #e3e6df;
  --line-strong: #cfd4ca;
  --lime: #c6d043;
  --lime-hover: #b8c234;
  --lime-soft: #eef2cf;
  --lime-wash: #f6f8e6;
  --olive: #4c560c;
  --danger: #b42318;
  --danger-soft: #fdeceb;
  --warn: #8a4b00;
  --warn-soft: #fff1dc;
  --neutral-soft: #eef0ec;
  --radius: 12px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgb(31 36 33 / 5%), 0 1px 1px rgb(31 36 33 / 3%);
  --font: 'Cambay', 'Segoe UI', system-ui, sans-serif;
  --figure: 'Stack Sans Notch', 'Cambay', 'Segoe UI', system-ui, sans-serif;
  --rail-width: 296px;
  font: 400 16px/1.5 var(--font);
  color: var(--ink);
  background: var(--bg);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; -webkit-font-smoothing: antialiased; }
a { color: var(--olive); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button, .button, summary { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 3px solid #5d6a00; outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-weight: 700; font-size: clamp(1.75rem, 2.4vw, 2.15rem); line-height: 1.1; letter-spacing: -.02em; }
h2 { font-weight: 700; font-size: 1.15rem; line-height: 1.25; }
h3 { font-weight: 700; font-size: 1rem; }
small, .muted { color: var(--muted); }
.figure, .number { font-family: var(--figure); font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 20; background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: var(--radius-sm); }
.skip:focus { top: 1rem; }
.loading { margin: 3rem; color: var(--muted); }
.icon { width: 1.25rem; height: 1.25rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* Estructura */
.frame { min-height: 100dvh; display: grid; grid-template-columns: var(--rail-width) minmax(0, 1fr); }
.rail {
  position: sticky; top: 0; height: 100dvh; background: var(--rail); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 1.5rem 1.25rem 1.25rem 1.75rem; gap: 1.5rem; min-width: 0; overflow-y: auto;
}
.brand { display: block; width: 10.25rem; margin: 0 auto 0 .35rem; border-radius: 50%; }
.brand img { display: block; width: 100%; height: auto; }
.rail .menu-toggle { display: none; }
.nav { display: grid; gap: .3rem; }
.nav a {
  display: flex; align-items: center; gap: .85rem; min-height: 2.9rem; padding: .5rem .9rem; border-radius: 10px;
  color: var(--ink); text-decoration: none; font-size: 1.02rem;
}
.nav a:hover { background: #e7e9e2; }
.nav a[aria-current] { background: var(--lime); font-weight: 700; }
.account { margin-top: auto; border-top: 1px solid var(--line-strong); padding-top: 1rem; display: grid; gap: .65rem; }
.account-name { display: grid; padding: 0 .4rem; line-height: 1.3; }
.account-name strong { font-size: .95rem; overflow-wrap: anywhere; }
.account-name small { font-size: .82rem; }
.link-button { display: flex; align-items: center; gap: .75rem; background: none; border: 0; padding: .55rem .4rem; min-height: 2.75rem; color: var(--ink-2); border-radius: 8px; text-align: left; }
.link-button:hover { background: #e7e9e2; }
main { width: 100%; max-width: 1440px; margin: 0 auto; padding: 2rem clamp(1rem, 3vw, 2.6rem) 3rem; min-width: 0; }
main:focus { outline: none; }

/* Encabezados de página */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1:focus { outline: none; }
.page-head p { color: var(--muted); margin-top: .3rem; }
.crumbs { display: flex; align-items: center; gap: .5rem; font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.crumbs a { color: var(--olive); text-decoration: none; font-weight: 400; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span[aria-hidden] { color: var(--muted); font-weight: 400; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; min-width: 0; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 36rem), 1fr)); gap: 1.25rem; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(17rem, 20rem); gap: 1.25rem; align-items: start; }

/* Botones */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 2.75rem;
  padding: .45rem 1.05rem; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); font-size: .98rem; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.button:hover { background: #f1f3ee; }
.button.primary { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.button.primary:hover { background: var(--lime-hover); border-color: var(--lime-hover); }
.button.large { min-height: 3.1rem; font-size: 1.05rem; padding-inline: 1.4rem; }
.button.block { width: 100%; }
.button.quiet { border-color: transparent; background: transparent; }
.button.quiet:hover { background: #eef0ea; }
.button.small { min-height: 2.25rem; padding: .25rem .7rem; font-size: .9rem; }
.button.danger { color: var(--danger); }
.icon-button { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--ink-2); }
.icon-button:hover { background: #eef0ea; }

/* Control segmentado */
.segmented { display: inline-flex; flex-wrap: wrap; padding: 3px; gap: 2px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); max-width: 100%; }
.segmented label, .segmented button { position: relative; display: inline-flex; flex: 1 0 auto; max-width: 100%; align-items: center; justify-content: center; min-height: 2.5rem; padding: .3rem 1.25rem; border-radius: 8px; font-size: .98rem; font-weight: 400; white-space: nowrap; border: 0; background: none; cursor: pointer; }
.segmented input, .filter-bar .segmented input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; min-width: 0; min-height: 0; margin: 0; cursor: pointer; }
.segmented label:has(input:checked), .segmented button[aria-pressed="true"] { background: var(--lime); font-weight: 700; }
.segmented label:has(input:focus-visible) { outline: 3px solid #5d6a00; outline-offset: 1px; }
.segmented label:not(:has(input:checked)):hover, .segmented button[aria-pressed="false"]:hover { background: #f1f3ee; }

/* Tarjetas */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-pad { padding: 1.35rem 1.5rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: 1.1rem 1.5rem; }
.card-head + .table-wrap, .card-head + .empty-state { border-top: 1px solid var(--line); }
.card-foot { padding: .85rem 1.5rem; border-top: 1px solid var(--line); display: flex; justify-content: center; }
.card > .form-body { padding: 0 1.5rem 1.4rem; }

/* Indicadores */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.kpi { display: flex; align-items: center; gap: 1.1rem; min-width: 0; }
.kpi-badge { display: grid; place-items: center; width: 4.4rem; height: 4.4rem; border-radius: 50%; background: var(--lime-soft); color: var(--olive); flex: none; }
.kpi-badge .icon { width: 1.9rem; height: 1.9rem; }
.kpi > :not(.kpi-badge) { flex: 1; min-width: 0; container-type: inline-size; }
.kpi small { display: block; color: var(--ink-2); font-size: 1.02rem; }
.kpi strong { display: block; font-family: var(--figure); font-weight: 500; font-size: clamp(1.05rem, 13cqi, 2.45rem); line-height: 1.1; letter-spacing: -.01em; white-space: nowrap; }
.kpi .delta { font-size: .9rem; color: var(--muted); }
.kpi-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.kpi-row > .card { padding: 1.25rem 1.4rem; }

/* Gráficos */
.chart-card { padding: 1.4rem 1.5rem 1rem; display: grid; gap: 1.25rem; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--figure); font-size: 13px; fill: var(--ink-2); }
.chart .grid-line { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .axis { stroke: var(--line-strong); }
.chart .series { fill: none; stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart .dot { fill: var(--ink); }
.chart .dot.today { fill: var(--surface); stroke: #7c8800; stroke-width: 2.5; }
.chart .today-band { fill: var(--lime-wash); }
.chart .today-label { fill: #5d6a00; font-weight: 600; }
.chart .bar { fill: #2b302d; }
.chart .bar.current { fill: var(--lime); }
.chart .value { font-size: 12px; fill: var(--ink-2); }
.chart-slot { width: 100%; min-width: 0; }
.wide-segments .segmented label { min-width: 10.5rem; }
.chart-empty { color: var(--muted); padding: 2rem 0; text-align: center; }

/* Tablas */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
td { overflow-wrap: normal; }
@media (min-width: 701px) { table.responsive td.number, table.responsive td.center, table.responsive .figure, table.responsive .pill { white-space: nowrap; } }
th { font-size: .88rem; font-weight: 700; color: var(--ink-2); background: #fafbf8; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 1.25rem; }
th:last-child, td:last-child { padding-right: 1.25rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfcf9; }
td.number, th.number { text-align: right; white-space: nowrap; }
td.center, th.center { text-align: center; }
.product-cell { display: flex; align-items: center; gap: .65rem; min-width: 8rem; }
.product-cell span { display: grid; line-height: 1.3; }
.product-cell small { font-size: .84rem; }
.tile { display: grid; place-items: center; width: 2.15rem; height: 2.15rem; border-radius: 8px; border: 1px solid var(--line); background: #f5f6f2; font-weight: 700; font-size: .82rem; color: var(--ink-2); flex: none; letter-spacing: .02em; }
.ratio strong { color: var(--danger); font-weight: 600; }
.ratio.warn strong { color: var(--warn); }
.ratio.ok strong { color: var(--ink); }

/* Etiquetas de estado */
.pill { display: inline-flex; align-items: center; justify-content: center; min-width: 4.75rem; padding: .2rem .7rem; border-radius: 7px; font-size: .86rem; font-weight: 600; white-space: nowrap; background: var(--neutral-soft); color: var(--ink-2); border: 1px solid transparent; }
.pill.ok { background: var(--lime-wash); color: var(--olive); border-color: #e1e7b9; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: #f6dcb4; }
.pill.bad { background: var(--danger-soft); color: var(--danger); border-color: #f7cdc9; }
.pill.days { min-width: 3.2rem; }

/* Formularios */
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 1rem 1.1rem; align-items: start; }
.fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fields .field-wide { grid-column: 1 / -1; }
.field-wide .segmented { justify-self: start; }
label, .label { display: grid; gap: .35rem; font-size: .95rem; font-weight: 700; min-width: 0; }
.hint { font-weight: 400; font-size: .84rem; color: var(--muted); }
input, select, textarea {
  width: 100%; min-height: 2.75rem; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface);
  padding: .45rem .8rem; font-size: 1rem; font-weight: 400;
}
input:hover, select:hover { border-color: #b6bcb0; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #c9d36b; outline-offset: 0; border-color: #7c8800; }
input:disabled, select:disabled { background: #f1f2ee; color: var(--muted); }
input[aria-invalid="true"] { border-color: var(--danger); }
.search { position: relative; }
.search .icon { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 2.65rem; }
.error { color: var(--danger); font-size: .93rem; font-weight: 600; }
.error:empty { display: none; }
.notice-inline { display: flex; align-items: center; gap: .45rem; color: var(--warn); font-size: .9rem; font-weight: 600; margin-top: .35rem; }
.notice-inline .icon { width: 1.05rem; height: 1.05rem; }
details.more { border-top: 1px solid var(--line); }
details.more summary { list-style: none; display: flex; align-items: center; gap: .7rem; padding: 1.05rem 1.5rem; font-weight: 700; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary .chev { margin-left: auto; transition: transform .15s ease; }
details.more[open] summary .chev { transform: rotate(90deg); }
details.more .form-body { padding: 0 1.5rem 1.4rem; }

/* Búsqueda de productos */
.combo { position: relative; max-width: 34rem; }
.combo-list { position: absolute; z-index: 6; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: .35rem; list-style: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 10px 30px rgb(31 36 33 / 12%); max-height: 20rem; overflow-y: auto; }
.combo-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .75rem; padding: .55rem .6rem; border-radius: 8px; cursor: pointer; }
.combo-list li[aria-selected="true"], .combo-list li:hover { background: var(--lime-wash); }
.combo-list li[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.combo-list .meta { text-align: right; font-size: .88rem; line-height: 1.3; }
.combo-list .meta .figure { display: block; font-weight: 600; }
.combo-empty { padding: .75rem; color: var(--muted); }

/* Líneas de venta */
.lines td { padding-top: .7rem; padding-bottom: .7rem; }
.lines th, .lines td { padding-left: .45rem; padding-right: .45rem; }
.lines [name=price] { width: 6.6rem; }
.lines [name=discount] { width: 5.6rem; }
.lines [name=taxRate] { width: 4.4rem; }
.lines .product-cell { min-width: 8rem; }
.lines input { min-height: 2.5rem; }
.lines .w-num, .lines .w-qty { width: auto; }
.stepper { display: inline-grid; grid-template-columns: 2.3rem 2.7rem 2.3rem; align-items: center; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; background: var(--surface); }
.stepper button { height: 2.5rem; border: 0; background: none; display: grid; place-items: center; }
.stepper button:hover { background: #f1f3ee; }
.stepper input { border: 0; border-radius: 0; text-align: center; padding: 0; min-height: 2.5rem; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.available { font-family: var(--figure); font-weight: 600; color: #4f6b00; }
.available.short { color: var(--danger); }

/* Resumen */
.summary-card { position: sticky; top: 1.5rem; padding: 1.4rem 1.5rem; display: grid; gap: 1.1rem; }
.totals { display: grid; gap: .55rem; margin: 0; }
.totals div { display: flex; justify-content: space-between; gap: 1rem; }
.totals dt { color: var(--ink-2); }
.totals dd { margin: 0; font-family: var(--figure); }
.totals .grand { border-top: 1px solid var(--line); padding-top: .9rem; margin-top: .35rem; align-items: baseline; }
.totals .grand dt { font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.totals .grand dd { font-size: clamp(1.8rem, 3vw, 2.3rem); font-weight: 600; }
.totals .private dd, .totals .private dt { color: var(--muted); font-size: .92rem; }
.mobile-bar { display: none; }

/* Pestañas */
.tabs { display: flex; gap: 1.75rem; border-bottom: 1px solid var(--line-strong); margin-bottom: 1rem; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: .65rem .15rem; font-size: 1.02rem; color: var(--ink-2); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--lime); }
.toolbar { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; margin-bottom: 1rem; }
.toolbar .search { flex: 1 1 18rem; max-width: 26rem; }
.chip { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.75rem; padding: .3rem 1rem; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); font-size: .96rem; }
.chip[aria-pressed="true"] { background: var(--lime-soft); border-color: #c4cc73; font-weight: 700; }

/* Bodegas */
.warehouse-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: .85rem; }
.warehouse-stats div { padding-right: 1rem; }
.warehouse-stats div + div { border-left: 1px solid var(--line); padding-left: 1.25rem; }
.warehouse-stats small { display: block; color: var(--ink-2); font-size: .95rem; }
.warehouse-stats strong { display: block; font-family: var(--figure); font-weight: 500; font-size: clamp(1.35rem, 2vw, 1.75rem); line-height: 1.2; }

/* Reportes */
.filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: .9rem 1rem; padding: 1rem 1.25rem; }
.filter-bar label { font-size: .85rem; }
.filter-bar input, .filter-bar select { min-width: 10rem; }
.filter-bar .grow { flex: 1 1 auto; }
.filter-more { width: 100%; }
.filter-more summary { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; padding: .4rem 0; }
.filter-more .fields { margin-top: .75rem; }
.split-list { list-style: none; margin: 0; padding: 0 1.5rem; }
.split-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: .85rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.split-list .avatar { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--lime-soft); font-weight: 700; color: var(--olive); }
.split-list .total { font-weight: 700; border-bottom: 0; }

/* Detalle y diálogos */
dialog { width: min(820px, calc(100% - 1.5rem)); max-height: calc(100dvh - 1.5rem); border: 1px solid var(--line); border-radius: 14px; padding: 0; color: var(--ink); box-shadow: 0 24px 60px rgb(31 36 33 / 18%); }
dialog::backdrop { background: rgb(31 36 33 / 45%); }
.dialog-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.25rem 1rem 1.5rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.dialog-body { padding: 1.25rem 1.5rem 1.5rem; display: grid; gap: 1.1rem; }
.dialog-actions { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; padding: 1rem 1.5rem; background: var(--surface); border-top: 1px solid var(--line); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .9rem 1.25rem; margin: 0; }
.facts div { display: grid; gap: .1rem; }
.facts dt { font-size: .85rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.review-block { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; display: grid; gap: .6rem; }
.review-block h3 { font-size: .95rem; color: var(--ink-2); }
.review-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.review-lines li { display: flex; justify-content: space-between; gap: 1rem; }
.review-lines .figure { white-space: nowrap; }
.empty-state { padding: 1.4rem 1.5rem; color: var(--muted); }
.receipt-note { font-size: .9rem; color: var(--muted); }

/* Ingreso */
.login-shell { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login-brand { background: var(--lime); display: grid; place-items: center; padding: 3rem; }
.login-brand div { display: grid; gap: 1.75rem; max-width: 26rem; }
.login-brand img { width: min(17rem, 60%); height: auto; }
.login-brand h1 { font-size: clamp(2rem, 3.6vw, 3rem); }
.login-brand p { font-size: 1.1rem; max-width: 30ch; }
.login-main { display: grid; place-items: center; padding: 2rem 1.25rem; }
.login-form { width: min(100%, 25rem); padding: 2rem; display: grid; gap: 1.1rem; }

/* Avisos */
#notice:not(:empty) { position: fixed; right: 1rem; bottom: 1rem; z-index: 30; background: var(--ink); color: #fff; padding: .85rem 1.15rem; border-radius: 10px; max-width: calc(100% - 2rem); box-shadow: 0 10px 30px rgb(31 36 33 / 25%); }

@media (min-width: 701px) and (max-width: 1500px) {
  th, td { padding-inline: .38rem; }
}
@media (max-width: 1180px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .summary-card { position: static; }
}
@media (max-width: 980px) {
  .frame { grid-template-columns: minmax(0, 1fr); }
  .rail { position: sticky; z-index: 10; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; padding: .55rem 1rem; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .brand { width: 3rem; margin: 0; }
  .rail .menu-toggle { display: inline-flex; margin-left: auto; }
  .nav, .account { display: none; width: 100%; }
  .rail.open .nav { display: grid; padding-top: .25rem; }
  .rail.open .account { display: grid; margin-top: 0; }
  main { padding-top: 1.25rem; }
  .cols, .kpis, .kpi-row { grid-template-columns: minmax(0, 1fr); }
  .wide-segments .segmented label { min-width: 0; }
  .kpis { gap: 1.1rem; }
}
@media (max-width: 700px) {
  .login-shell { grid-template-columns: minmax(0, 1fr); }
  .login-brand { padding: 2rem 1.5rem; place-items: start; }
  .login-brand img { width: 7rem; }
  .page-head { align-items: flex-start; }
  .page-head .actions { width: 100%; }
  .page-head .actions .button { flex: 1 1 auto; }
  .card-pad, .card-head, .chart-card, .summary-card { padding-left: 1rem; padding-right: 1rem; }
  .card > .form-body, details.more summary, details.more .form-body { padding-left: 1rem; padding-right: 1rem; }
  .fields.two { grid-template-columns: minmax(0, 1fr); }
  .warehouse-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .warehouse-stats div + div { padding-left: .7rem; }
  .warehouse-stats small { font-size: .82rem; }
  .warehouse-stats strong { font-size: clamp(.8rem, 3.6vw, 1.1rem); white-space: nowrap; }
  .warehouse-stats > div { min-width: 0; }
  .kpi-badge { width: 3.4rem; height: 3.4rem; }
  /* Tablas como tarjetas */
  table.responsive thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.responsive, table.responsive tbody, table.responsive tr, table.responsive td { display: block; width: 100%; }
  table.responsive tr { padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
  table.responsive tbody tr:last-child { border-bottom: 0; }
  table.responsive td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border: 0; padding: .22rem 0; text-align: right; }
  table.responsive td::before { content: attr(data-label); font-size: .85rem; font-weight: 700; color: var(--muted); text-align: left; }
  table.responsive td.primary { padding-bottom: .45rem; text-align: left; }
  table.responsive td.primary::before { display: none; }
  table.responsive td:empty { display: none; }
  table.responsive td.row-actions::before { display: none; }
  table.responsive td.row-actions { justify-content: flex-end; padding-top: .45rem; }
  .lines .stepper { grid-template-columns: 2.75rem 3rem 2.75rem; }
  .lines .w-num, .lines .w-qty { width: auto; }
  .lines td input { max-width: 9rem; }
  .mobile-bar { display: flex; position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; align-items: center; gap: 1rem; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgb(31 36 33 / 8%); }
  .mobile-bar div { display: grid; line-height: 1.15; }
  .mobile-bar small { font-size: .82rem; }
  .mobile-bar strong { font-family: var(--figure); font-size: 1.35rem; font-weight: 600; }
  .mobile-bar .button { margin-left: auto; }
  .has-mobile-bar main { padding-bottom: 6.5rem; }
  .summary-card .summary-submit { display: none; }
  dialog { width: 100%; max-width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .dialog-actions .button { flex: 1 1 auto; }
  .split-list { padding: 0 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
