/* POS Emiliano's — estilos */
:root {
  --bg: #f6f3ef;
  --surface: #ffffff;
  --surface-2: #faf8f5;
  --line: #e7e1d9;
  --line-strong: #d6cdc2;
  --text: #241f1b;
  --text-2: #5f564d;
  --muted: #8c8278;
  --accent: #8a4b22;
  --accent-2: #a85f2e;
  --accent-soft: #f4e8dd;
  --side: #221c18;
  --side-2: #2f2722;
  --side-text: #d9cfc5;
  --ok: #2f7d4a;
  --ok-soft: #e4f2e8;
  --warn: #9a6a00;
  --warn-soft: #fbf0d4;
  --bad: #b3261e;
  --bad-soft: #fbe5e3;
  --info-soft: #e6eef8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(36, 31, 27, .06), 0 2px 8px rgba(36, 31, 27, .04);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  color: var(--text);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .6em; line-height: 1.2; }
h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
h4 { font-size: .92rem; font-weight: 650; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.icon { flex: none; vertical-align: -3px; }
[hidden] { display: none !important; }

/* ---------- Estructura ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex: none; background: var(--side); color: var(--side-text);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: .7rem; padding: 1.1rem 1.1rem 1rem; color: #fff; text-decoration: none !important; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, #b8733c, #7a3f18); color: #fff; font-weight: 800; font-size: 1.05rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}
.brand-mark.lg { width: 52px; height: 52px; font-size: 1.5rem; border-radius: 13px; }
.brand-name { font-weight: 750; letter-spacing: .04em; font-size: .95rem; }
.sidebar nav { flex: 1; overflow-y: auto; padding: .3rem .6rem 1rem; }
.nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; color: #8f8378; padding: 1rem .6rem .35rem; }
.nav-link {
  display: flex; align-items: center; gap: .65rem; padding: .55rem .65rem; border-radius: 8px;
  color: var(--side-text); text-decoration: none !important; font-size: .93rem;
}
.nav-link:hover { background: var(--side-2); color: #fff; }
.nav-link.is-active { background: #3b3029; color: #fff; box-shadow: inset 3px 0 0 #c27a42; }
.sidebar-foot { padding: .8rem 1.2rem; font-size: .75rem; color: #7d7268; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 1rem; padding: .7rem 1.6rem; background: var(--surface);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.scan {
  flex: 1; max-width: 560px; display: flex; align-items: center; gap: .5rem;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 0 .75rem; color: var(--muted);
}
.scan:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.scan input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: .6rem 0 !important; flex: 1; font-size: .95rem; }
.topbar-user { margin-left: auto; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .9rem;
}
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; z-index: 30;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12);
  padding: .35rem; display: flex; flex-direction: column;
}
.menu-pop a, .menu-pop button {
  display: flex; align-items: center; gap: .5rem; text-align: left; padding: .5rem .65rem; border-radius: 7px;
  color: var(--text); background: none; border: 0; font: inherit; font-size: .9rem; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); }
.menu-pop form { margin: 0; }
.menu-pop form button { width: 100%; }
.menu-head { padding: .5rem .65rem .6rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; font-weight: 600; }
.menu-head small { display: block; color: var(--muted); font-weight: 400; }
.content { padding: 1.5rem 1.6rem 6rem; max-width: 1320px; width: 100%; }
.only-mobile { display: none; }

/* ---------- Encabezados ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .count { font-size: 1rem; font-weight: 500; margin-left: .3rem; }
.crumbs { font-size: .82rem; color: var(--muted); margin-bottom: .25rem; }
.head-meta { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .55rem; }
.head-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- Tarjetas ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.15rem 1.25rem; margin-bottom: 1rem; }
.card.flush { padding: 0; overflow: hidden; }
.card .pad, .pad { padding: 1rem 1.25rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .6rem; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card.flush .card-head { margin: 0; border-bottom: 1px solid var(--line); }
.narrow-form { max-width: 640px; }
.narrow-form.wide { max-width: 820px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 1rem; }
.grid-2.top { align-items: start; gap: 1rem; }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }

/* ---------- Formularios ---------- */
.form label { display: block; margin-bottom: .85rem; font-size: .86rem; font-weight: 550; color: var(--text-2); }
.form label > input, .form label > select, .form label > textarea, .form label > .input-with-btn { margin-top: .3rem; }
input, select, textarea {
  width: 100%; font: inherit; font-size: .95rem; color: var(--text); background: #fff;
  border: 1px solid var(--line-strong); border-radius: 8px; padding: .55rem .7rem;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[readonly], input:disabled { background: var(--surface-2); color: var(--muted); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
textarea { resize: vertical; }
.form small, label small { font-weight: 400; }
.form label > input + small, .form label > select + small, .form label > textarea + small { display: block; margin-top: .3rem; }
label.check small { margin-left: .3rem; }
label.check { display: flex !important; align-items: center; gap: .5rem; font-weight: 500; color: var(--text); cursor: pointer; }
.input-with-btn { display: flex; gap: .4rem; }
.input-with-btn select { flex: 1; }
.form-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .5rem; }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .7rem; }
.inline-form label { margin-bottom: 0; }
.inline-form label.grow { flex: 1; min-width: 200px; }
.inline-form.compact { margin: .4rem 0; }
.inline-form.compact input { width: 260px; }
.form.compact label { margin-bottom: .55rem; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .7rem; padding: .9rem 1rem; }
.filters label { margin: 0; font-size: .8rem; color: var(--text-2); font-weight: 550; }
.filters label > input, .filters label > select { margin-top: .25rem; min-width: 140px; }
.filters .grow { flex: 1; min-width: 220px; }
.filters label.check { padding-bottom: .55rem; }
.money { font-variant-numeric: tabular-nums; }
.upper { text-transform: uppercase; }
.upper::placeholder { text-transform: none; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-size: .9rem; font-weight: 600;
  padding: .55rem .95rem; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); border-color: #c5baad; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(0,0,0,.04); border-color: transparent; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: #962019; }
.btn-danger-ghost { background: transparent; border-color: transparent; color: var(--bad); }
.btn-danger-ghost:hover { background: var(--bad-soft); }
.btn-sm { padding: .35rem .65rem; font-size: .83rem; }
.btn-xs { padding: .2rem .5rem; font-size: .78rem; }
.btn-lg { padding: .75rem 1.3rem; font-size: 1rem; }
.btn-block { width: 100%; }
.icon-btn { background: none; border: 0; padding: .35rem; border-radius: 7px; cursor: pointer; color: var(--text-2); font: inherit; }
.icon-btn:hover { background: var(--surface-2); }
details > summary.btn { list-style: none; width: fit-content; }
details > summary.btn::-webkit-details-marker { display: none; }

/* ---------- Avisos ---------- */
.alert { padding: .75rem 1rem; border-radius: 9px; margin-bottom: 1rem; border: 1px solid transparent; font-size: .93rem; }
.alert-success { background: var(--ok-soft); color: #1d5432; border-color: #c4e2cd; }
.alert-error { background: var(--bad-soft); color: #7d1a14; border-color: #f2c5c1; }
.alert-info { background: var(--info-soft); color: #1d3d66; border-color: #c9d9ee; }
.plain-alert { max-width: 520px; margin: 1rem auto 0; }
.pill {
  display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem; border-radius: 999px; font-size: .76rem; font-weight: 600;
  background: #efebe6; color: var(--text-2); white-space: nowrap;
}
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-accent { background: var(--accent-soft); color: var(--accent); }
.toast-wrap { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 100; }
.toast { background: #2a2420; color: #fff; padding: .75rem 1rem; border-radius: 9px; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: 380px; font-size: .92rem; transition: opacity .3s, transform .3s; }
.toast-success { background: #1f5e37; }
.toast-error { background: #8f1f18; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- Tablas ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; padding: .65rem .9rem; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.table td { padding: .62rem .9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table.compact td { padding: .4rem .6rem; }
.table td.p0 { padding: 0; }
.row-link { cursor: pointer; }
.row-link:hover td { background: #fcfaf7; }
tr.is-muted td { opacity: .55; }
tr.is-highlight td { background: #fff6e8 !important; }
tr.is-highlight td:first-child { box-shadow: inset 4px 0 0 #d08a3e; }
.pos { color: var(--ok); font-weight: 600; }
.neg { color: var(--bad); font-weight: 600; }
.pagination { display: flex; gap: .3rem; justify-content: center; margin: 1rem 0; flex-wrap: wrap; }
.page { padding: .4rem .75rem; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: .88rem; text-decoration: none !important; }
.page.is-current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Inicio ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .25rem; color: var(--text); }
.stat-link:hover { border-color: var(--accent); text-decoration: none; }
.stat-label { font-size: .8rem; color: var(--muted); font-weight: 550; }
.stat-value { font-size: 1.7rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.stat-value.warn { color: var(--warn); }

/* ---------- Login / instalador ---------- */
body.plain { background: var(--bg); }
.center-card { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login-bg { background: radial-gradient(1200px 600px at 20% 0%, #efe2d4 0%, transparent 60%), var(--bg); }
.card.login { width: 100%; max-width: 380px; padding: 2rem; }
.login-brand { text-align: center; margin-bottom: 1.4rem; }
.login-brand .brand-mark { margin: 0 auto .8rem; }
.login-brand h1 { margin-bottom: .1rem; letter-spacing: .04em; }
.card.wide-form { width: 100%; max-width: 620px; padding: 1.8rem; }
.card.narrow { max-width: 460px; text-align: center; }
.install-head { display: flex; gap: 1rem; align-items: center; margin-bottom: 1.2rem; }
.install-head h1 { margin: 0; }
.checks { list-style: none; padding: 0; margin: 0 0 1.2rem; display: grid; gap: .3rem; font-size: .9rem; }
.checks .ok { color: var(--ok); }
.checks .bad { color: var(--bad); font-weight: 600; }
.error-code { font-size: 3rem; color: var(--accent); margin: 0; }

/* ---------- Roles ---------- */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.perm-grid .card { margin: 0; }
.perm-grid label.check { margin-bottom: .45rem; font-size: .9rem; }

/* ---------- Bitácora ---------- */
.audit td { vertical-align: top; }
.diff summary { cursor: pointer; color: var(--accent); font-size: .82rem; margin-top: .25rem; }
.diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-top: .4rem; }
.diff pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; padding: .5rem; font-size: .78rem; margin: .2rem 0 0; white-space: pre-wrap; word-break: break-word; }

/* ---------- Categorías ---------- */
.add-card > summary { margin-bottom: 0; }
.add-card[open] > summary { margin-bottom: 1rem; }
.cat-row { border-bottom: 1px solid var(--line); }
.cat-row:last-child { border-bottom: 0; }
.cat-row > summary {
  list-style: none; display: flex; align-items: center; gap: 1rem; cursor: pointer;
  padding: .6rem 1.1rem .6rem calc(1.1rem + var(--depth) * 1.6rem);
}
.cat-row > summary::-webkit-details-marker { display: none; }
.cat-row > summary:hover { background: var(--surface-2); }
.cat-row[open] > summary { background: var(--accent-soft); }
.cat-name { font-weight: 600; min-width: 180px; }
.cat-branch { color: #c1b6aa; margin-right: .45rem; font-weight: 400; }
.cat-meta { display: flex; gap: .5rem; align-items: center; flex: 1; flex-wrap: wrap; }
.cat-edit { color: var(--muted); }
.cat-panel { padding: 1rem 1.1rem 1.1rem calc(1.1rem + var(--depth) * 1.6rem); background: #fffdfb; border-top: 1px dashed var(--line); }
.cat-actions { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); flex-wrap: wrap; }

/* ---------- Marcas ---------- */
.row-form { display: grid; grid-template-columns: 1.5fr 1fr 80px auto auto; gap: .8rem; align-items: center; padding: .5rem .9rem; }
.row-form label.check { margin: 0; }

/* ---------- Tallas ---------- */
.eq-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.eq-form label { margin-bottom: .4rem; }

/* ---------- Alta de producto ---------- */
.product-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.product-layout .card { margin: 0; }
.product-layout .full { grid-column: 1 / -1; }
.step {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: .8rem; margin-right: .45rem; vertical-align: 1px;
}
.system-picker, .width-picker { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: .9rem; padding: .7rem .8rem; background: var(--surface-2); border-radius: 9px; border: 1px solid var(--line); }
.system-picker .label, .width-picker .label { font-weight: 600; font-size: .88rem; }
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; background: #fff; }
.segmented label { margin: 0 !important; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: .45rem .9rem; font-size: .88rem; font-weight: 600; color: var(--text-2); }
.segmented label + label span { border-left: 1px solid var(--line-strong); }
.segmented input:checked + span { background: var(--accent); color: #fff; }
.segmented input:focus-visible + span { box-shadow: inset 0 0 0 2px var(--accent-soft); }
.chips { display: flex; gap: .35rem; flex-wrap: wrap; }
.chip { margin: 0 !important; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: block; padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--line-strong); background: #fff; font-weight: 650; font-size: .85rem; }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.size-grid { margin-bottom: .8rem; }
.grid-table { border-collapse: collapse; width: 100%; }
.grid-table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-align: left; padding: .35rem .5rem; border-bottom: 1px solid var(--line); }
.grid-table th.num { text-align: center; }
.grid-table td { padding: .2rem .5rem; border-bottom: 1px solid #f1ece6; }
.grid-table td.num { text-align: center; }
.grid-table tr:hover td { background: #fdfaf6; }
.size-label { white-space: nowrap; }
.size-label b { font-size: 1rem; font-variant-numeric: tabular-nums; }
.size-label small { color: var(--muted); margin-left: .2rem; font-weight: 600; }
.eq { color: var(--muted); font-size: .8rem; margin-left: .6rem; }
.qty { width: 74px; text-align: center; padding: .35rem .3rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.qty.has-qty { background: #fff6e8; border-color: #d9a066; }
.matrix-wrap { overflow-x: auto; }
.matrix .qty { width: 58px; }
.exists { font-size: .75rem; color: var(--muted); font-style: italic; }
.code { width: 100%; max-width: 280px; }
.code-status { margin-left: .5rem; font-size: .82rem; font-weight: 600; }
.code-status.ok { color: var(--ok); }
.code-status.bad { color: var(--bad); }
.sticky-actions {
  position: sticky; bottom: 0; margin: 1rem -1.6rem -6rem; padding: .85rem 1.6rem; background: rgba(255,255,255,.96);
  border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: flex-end; gap: 1rem; z-index: 15;
  backdrop-filter: blur(6px);
}

/* ---------- Ficha de producto ---------- */
.product-head h1 { font-size: 1.45rem; }
.product-summary { display: grid; grid-template-columns: 1fr 300px; gap: 1rem; }
.product-summary .card { margin-bottom: 1rem; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem 1.2rem; margin: 0; }
.facts dt { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.facts dd { margin: .15rem 0 0; font-weight: 550; }
.facts .price { font-size: 1.35rem; font-weight: 750; color: var(--accent); }
.desc { margin: 1rem 0 0; color: var(--text-2); font-size: .92rem; }
.model-code { display: flex; flex-direction: column; align-items: center; gap: .6rem; text-align: center; }
.model-code img { max-width: 100%; height: auto; }
.variants .size { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.variants .eq { display: block; margin: .1rem 0 0; }
.size-cell { white-space: nowrap; }
.code-line { display: flex; align-items: center; gap: .4rem; font-size: .88rem; }
.code-line.primary .mono { font-weight: 650; }
.code-line + .code-line { margin-top: .15rem; color: var(--text-2); }
.stock-num { font-size: 1.15rem; }
.stock-num.zero { color: #bbb0a5; }
.actions { white-space: nowrap; }
.actions .btn { margin-left: .25rem; }
.actions .menu { display: inline-block; }
.right-menu .menu-pop { min-width: 250px; }
.w-check { width: 34px; }
.bulk-labels { display: flex; align-items: center; gap: .7rem; }
.variant-edit td { background: #fffaf3; }
.variant-edit-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; padding: .4rem 0; }
.code-edit { display: flex; align-items: center; gap: .5rem; margin-bottom: .35rem; }
.code-edit form { margin: 0; }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(28, 22, 18, .45); display: grid; place-items: center; z-index: 90; padding: 1rem; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 480px; padding: 1.4rem; box-shadow: 0 20px 60px rgba(0,0,0,.25); max-height: 90vh; overflow: auto; }
.modal label { display: block; margin-bottom: .8rem; font-size: .86rem; font-weight: 550; color: var(--text-2); }
.modal label > input, .modal label > select { margin-top: .3rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
.modal .segmented { margin-bottom: .9rem; }
.roll-warning { display: flex; gap: 1rem; align-items: center; background: #fff3dc; border: 2px solid #e2a53b; border-radius: 12px; padding: .9rem 1rem; margin-bottom: 1.1rem; font-size: .95rem; }
.roll-size { font-size: 2rem; font-weight: 850; color: #8a5a00; line-height: 1; padding: .4rem .6rem; background: #fff; border-radius: 9px; border: 2px solid #e2a53b; }
.print-list { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; }
.print-item { display: flex !important; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 !important; padding: .4rem .7rem; border-bottom: 1px solid var(--line); }
.print-item:last-child { border-bottom: 0; }
.print-item input { width: 80px; margin: 0 !important; text-align: center; }

/* ---------- Zona de riesgo ---------- */
.danger-zone { border-color: #efc6c2; }
.danger-zone h2 { color: var(--bad); }

/* ---------- Vista previa de etiquetas ---------- */
.preview-page { padding: 1rem; display: flex; flex-direction: column; align-items: center; gap: 1.2rem; }
.preview-bar { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; justify-content: center; }
.preview-item { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.lbl { background: #fff; color: #000; position: relative; font-family: "Arial Narrow", "Helvetica Neue Condensed", Arial, sans-serif; font-weight: 700; box-shadow: 0 2px 10px rgba(0,0,0,.15); overflow: hidden; }
.lbl-box { width: 1218px; height: 812px; transform-origin: top left; zoom: .6; border: 1px solid #ccc; }
.lbl-box::before { content: ""; position: absolute; left: 14px; top: 14px; width: 1190px; height: 784px; border: 7px solid #000; box-sizing: border-box; }
.lb-sku { position: absolute; left: 48px; top: 36px; white-space: nowrap; }
.lb-details { position: absolute; left: 44px; top: 205px; width: 590px; }
.lb-details div { height: 96px; line-height: 70px; white-space: nowrap; font-weight: 600; }
.lb-mx, .lb-us { position: absolute; left: 646px; width: 558px; text-align: center; white-space: nowrap; }
.lb-mx { top: 205px; } .lb-us { top: 365px; }
.lb-box-lines { display: none; }
.lbl-box .lb-store { position: absolute; left: 44px; top: 610px; white-space: nowrap; font-weight: 900; }
.lb-code { position: absolute; left: 650px; top: 520px; width: 540px; display: flex; justify-content: center; }
.lb-code svg { max-width: 540px; height: auto; }
.lbl-box { background-image:
  linear-gradient(#000, #000), linear-gradient(#000, #000), linear-gradient(#000, #000), linear-gradient(#000, #000);
  background-size: 1190px 6px, 1190px 6px, 6px 326px, 564px 6px;
  background-position: 14px 180px, 14px 500px, 640px 180px, 640px 340px;
  background-repeat: no-repeat; }
.lbl-sample { width: 406px; height: 203px; zoom: 1.4; border: 1px dashed #bbb; border-radius: 8px; padding: 8px 14px; }
.ls-sku { white-space: nowrap; line-height: 1.15; }
.ls-row { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; }
.ls-color { white-space: nowrap; font-weight: 500; }
.ls-price { font-size: 40px; font-weight: 900; line-height: 1; }
.ls-code { display: flex; justify-content: center; margin-top: 4px; }
.ls-code svg { max-width: 378px; height: auto; }
@media print { .no-print { display: none !important; } .lbl { box-shadow: none; } }

/* ---------- Celular / tableta ---------- */
@media (max-width: 1100px) {
  .product-layout, .product-summary { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .eq-tabs { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .only-mobile { display: inline-flex; }
  .sidebar { position: fixed; left: -260px; z-index: 50; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .topbar { padding: .6rem 1rem; }
  .user-name { display: none; }
  .content { padding: 1rem 1rem 6rem; }
  .grid-2, .grid-3, .grid-2.top, .facts, .variant-edit-grid, .diff-grid { grid-template-columns: 1fr; }
  .row-form { grid-template-columns: 1fr 1fr; }
  .table { font-size: .86rem; }
  .card.flush { overflow-x: auto; }
  .sticky-actions { margin: 1rem -1rem -6rem; padding: .8rem 1rem; }
}

/* ---------- Tipo de talla (v0.2) ---------- */
.choice-picker { display: flex; flex-direction: column; gap: .6rem; margin-bottom: .9rem; padding: .75rem .85rem; background: var(--accent-soft); border: 1px solid #ead6c4; border-radius: 9px; }
.choice-row { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.choice-row .label { font-weight: 650; font-size: .9rem; }
.choice-check { margin: 0 !important; font-weight: 600 !important; }
.choice-hint { padding: 1.2rem .5rem; text-align: center; color: var(--muted); font-size: .9rem; }
.grid-table.entry tr.sep td { padding-top: .8rem; font-size: .78rem; color: var(--muted); border-bottom: 0; }
.free-size { width: 82px; text-align: center; padding: .35rem .3rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.free-size.single { width: 120px; }
.pair-in { display: inline-flex; align-items: center; gap: .35rem; }
.pair-in .x { color: var(--muted); font-weight: 700; }
.grid-table.entry + .btn { margin-top: .6rem; }
.save-presets { margin-top: .7rem !important; font-size: .86rem !important; }
.delete-warning { background: var(--bad-soft); border: 1px solid #efc6c2; border-radius: 9px; padding: .7rem .85rem; margin-bottom: .9rem; }
.delete-warning p { margin: 0 0 .35rem; }
.delete-warning p:last-child { margin-bottom: 0; }

/* ---------- Caja y ventas (v0.3) ---------- */
.big-input { font-size: 1.5rem !important; font-weight: 750; padding: .6rem .8rem !important; font-variant-numeric: tabular-nums; }
.btn-xl { width: 100%; padding: 1rem 1.2rem; font-size: 1.25rem; font-weight: 750; justify-content: center; }
kbd { font: 600 .72em var(--mono); padding: .05rem .35rem; border-radius: 5px; background: rgba(255,255,255,.22); margin-left: .4rem; }
.btn:not(.btn-primary) kbd { background: var(--surface-2); border: 1px solid var(--line); }
.label-like { font-size: .86rem; font-weight: 550; color: var(--text-2); margin-bottom: .4rem; }
.register-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.register-opt { margin: 0 !important; cursor: pointer; }
.register-opt input { position: absolute; opacity: 0; }
.register-opt span { display: flex; flex-direction: column; gap: .15rem; padding: .85rem 1rem; border: 1.5px solid var(--line-strong); border-radius: 10px; background: #fff; }
.register-opt span b { font-size: 1.05rem; color: var(--text); }
.register-opt span small { color: var(--muted); font-weight: 500; }
.register-opt input:checked + span { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.register-opt input:focus-visible + span { outline: 2px solid var(--accent); }
.register-opt.is-busy { cursor: not-allowed; opacity: .55; }

.caja-head { align-items: flex-end; }
.caja { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1rem; align-items: start; }
.caja-cart { padding: 0; overflow: hidden; }
.caja-scan { display: flex; align-items: center; gap: .6rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line); background: var(--surface-2); color: var(--muted); }
.caja-scan input { flex: 1; font-size: 1.15rem; padding: .7rem .85rem; }
.cart-wrap { min-height: 320px; }
.cart td { vertical-align: middle; }
.cart tbody tr.flash-row td { animation: flashrow 1.2s ease-out; }
@keyframes flashrow { from { background: #fff1d6; } to { background: transparent; } }
.cart-empty { text-align: center; color: var(--muted); padding: 3.5rem 1rem; }
.cart-empty .icon { opacity: .5; }
.qty-ctl { display: inline-flex; align-items: center; gap: .35rem; }
.qty-ctl b { min-width: 1.6rem; text-align: center; font-variant-numeric: tabular-nums; }
.qty-ctl .icon-btn { border: 1px solid var(--line-strong); width: 28px; height: 28px; padding: 0; font-weight: 700; }
.cart button.pill { border: 0; cursor: pointer; font: inherit; font-size: .78rem; }
.caja-side { position: sticky; top: 80px; display: flex; flex-direction: column; gap: .7rem; }
.totals { margin: 0; display: flex; flex-direction: column; gap: .35rem; }
.totals div { display: flex; justify-content: space-between; }
.totals dt { color: var(--text-2); }
.totals dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.grand { display: flex; justify-content: space-between; align-items: baseline; border-top: 2px solid var(--text); padding-top: .6rem; }
.grand span { font-weight: 700; font-size: 1.05rem; }
.grand b { font-size: 2.1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.sale-disc-btn { justify-content: flex-start; }
.sale-disc-btn.is-on { color: var(--accent); background: var(--accent-soft); }
.last-sale { font-size: .85rem; color: var(--muted); text-align: center; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.size-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .5rem; }
.size-btn { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .7rem .4rem; border: 1.5px solid var(--line-strong); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; }
.size-btn b { font-size: 1.15rem; }
.size-btn span { font-size: .85rem; color: var(--text-2); }
.size-btn small { font-size: .74rem; color: var(--muted); }
.size-btn:hover:not([disabled]), .size-btn:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.size-btn[disabled] { opacity: .45; cursor: not-allowed; }
.pick-list { display: flex; flex-direction: column; max-height: 55vh; overflow: auto; border: 1px solid var(--line); border-radius: 9px; }
.pick-row { display: grid; grid-template-columns: auto 1fr auto; gap: .2rem .6rem; text-align: left; padding: .6rem .8rem; border: 0; border-bottom: 1px solid var(--line); background: #fff; font: inherit; cursor: pointer; }
.pick-row small { grid-column: 2; }
.pick-row .right { grid-row: 1; grid-column: 3; font-weight: 650; }
.pick-row:hover, .pick-row:focus-visible { background: var(--accent-soft); outline: none; }
.modal.modal-wide { max-width: 640px; }
.pay-total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; padding-bottom: .7rem; border-bottom: 1px solid var(--line); }
.pay-total span { font-weight: 650; color: var(--text-2); }
.pay-total b { font-size: 2.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.pay-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem; margin-bottom: .4rem; }
.pay-row > label { flex: 1 1 160px; margin-bottom: .5rem !important; }
.pay-row > label.ref { flex: 1.3 1 180px; }
.pay-row > .btn { margin-bottom: .55rem; }
.quick { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: .55rem; }
.pay-status { font-size: 1.15rem; padding: .7rem .9rem; border-radius: 9px; text-align: center; margin-top: .5rem; }
.pay-status b { font-size: 1.6rem; margin-left: .3rem; }
.pay-status.ok { background: var(--ok-soft); color: var(--ok); }
.pay-status.bad { background: var(--bad-soft); color: var(--bad); }
.done { text-align: center; }
.done-change { margin: 1rem 0; display: flex; flex-direction: column; }
.done-change span { color: var(--text-2); font-weight: 600; }
.done-change b { font-size: 3rem; font-weight: 800; color: var(--ok); font-variant-numeric: tabular-nums; }
.modal-actions.center { justify-content: center; }
.ticket-frame { position: absolute; left: -9999px; top: 0; width: 1px; height: 1px; border: 0; }
.corte-result { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1rem; }
.corte-result div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; display: flex; flex-direction: column; gap: .2rem; }
.corte-result span { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.corte-result b { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.corte-result.is-ok div:last-child { background: var(--ok-soft); border-color: #c4e2cd; color: var(--ok); }
.corte-result.is-short div:last-child { background: var(--bad-soft); border-color: #f2c5c1; color: var(--bad); }
.corte-result.is-over div:last-child { background: var(--warn-soft); border-color: #ecd9a6; color: var(--warn); }
.ok-text { color: var(--ok); font-weight: 650; }
.bad-text { color: var(--bad); font-weight: 650; }
.table tr.b td, .table tfoot td { font-weight: 700; }
.denoms .qty { width: 80px; }
.open-shift-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
@media (max-width: 1000px) {
  .caja { grid-template-columns: 1fr; }
  .caja-side { position: static; }
  .corte-result { grid-template-columns: 1fr; }
}
