/* ---------- Tokens ----------
   Identidad compartida con el sistema de Registro de Clientes MCH:
   fondo casi negro, acento ámbar, botones gris pizarra y rojo para "Salir". */
:root {
  --bg: #0d0d0d;
  --surface: #161616;
  --surface-2: #1d1d1d;
  --line: #2a2a2a;
  --line-strong: #3b3b3b;
  --text: #ececec;
  --muted: #9a9a9a;
  --accent: #f59e0b;
  --accent-h: #fbbf24;
  --accent-text: #fbbf24;
  --accent-soft: #2b2007;
  --on-accent: #1a1204;
  --btn-bg: #3b4452;
  --btn-h: #485364;
  --btn-line: #556073;
  --btn-text: #f3f5f8;
  --ok: #4ade80;       --ok-soft: #12301d;
  --warn: #fbbf24;     --warn-soft: #33260a;
  --danger: #f87171;   --danger-soft: #2e1717;  --danger-line: #7f2d2d;
  --side: #111111;
  --side-line: #262626;
  --side-text: #a3a3a3;
  --side-hover: #ffffff;
  --side-active: rgba(245, 158, 11, .12);
  --radius: 8px;
  --shadow: none;
  --toast-bg: #ececec; --toast-text: #111;
  --sidebar-w: 248px;
  --tabbar-h: 62px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f3f1;
  --surface: #ffffff;
  --surface-2: #f8f7f5;
  --line: #e4e2dd;
  --line-strong: #cfccc5;
  --text: #1a1814;
  --muted: #69655d;
  --accent: #f59e0b;
  --accent-h: #d98706;
  --accent-text: #a85a00;
  --accent-soft: #fdf0d5;
  --on-accent: #1a1204;
  --btn-bg: #ffffff;
  --btn-h: #f4f3f1;
  --btn-line: #cfccc5;
  --btn-text: #1a1814;
  --ok: #0f7b4a;       --ok-soft: #e3f4ec;
  --warn: #9a5600;     --warn-soft: #fdf0dc;
  --danger: #b42318;   --danger-soft: #fdeceb;  --danger-line: #efb4ae;
  --shadow: 0 1px 2px rgba(26, 24, 20, .06);
  --toast-bg: #1a1814; --toast-text: #fff;
  color-scheme: light;
}
/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; line-height: 1.25; }
h2 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .92em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Shell ---------- */
#shell { min-height: 100vh; min-height: 100dvh; }
#sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--side);
  display: flex; flex-direction: column; padding: 18px 12px 14px; z-index: 20;
}
#content { margin-left: var(--sidebar-w); min-width: 0; }
#view { max-width: 1120px; margin: 0 auto; padding: 28px 32px 56px; }
#mobilebar, #tabbar { display: none; }

.brand { display: flex; align-items: center; gap: 10px; color: #fff; padding: 2px 8px 18px; }
.brand:hover { text-decoration: none; }
.brand-name { font-weight: 650; font-size: 1.02rem; letter-spacing: -.01em; }
.logo { width: 30px; height: 30px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; color: var(--on-accent); flex: none; }
.logo .ic { width: 18px; height: 18px; }

#nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
#nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 7px;
  color: var(--side-text); font-weight: 500; position: relative;
}
#nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
#nav a.active { background: var(--side-active); color: var(--accent-h); }
#nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }

.side-user { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--side-line); padding-top: 12px; }
.side-user a { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: #fff; padding: 4px 6px; border-radius: 7px; }
.side-user a:hover { background: rgba(255, 255, 255, .06); text-decoration: none; }
.who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.who b { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { color: var(--side-text); font-size: .78rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: #fbbf24; border: 1px solid rgba(245, 158, 11, .45); display: grid; place-items: center; font-size: .78rem; font-weight: 650; flex: none; letter-spacing: .02em; }
.icon-btn { background: none; border: 0; color: var(--side-text); cursor: pointer; padding: 8px; border-radius: 7px; display: grid; place-items: center; }
.icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .88rem; margin-bottom: 10px; }
.back:hover { color: var(--text); text-decoration: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.card-body { padding: 20px; }
.stack > * + * { margin-top: 18px; }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.kpi { padding: 16px 20px; }
.kpi + .kpi { border-left: 1px solid var(--line); }
.kpi span { display: block; font-size: .82rem; color: var(--muted); }
.kpi b { display: block; font-size: 1.65rem; line-height: 1.2; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi.alert b { color: var(--warn); }

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px;
  font: inherit; font-weight: 600; font-size: .92rem; color: var(--btn-text); background: var(--btn-bg);
  border: 1px solid var(--btn-line); border-radius: 7px; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--btn-h); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-h); border-color: var(--accent-h); }
.btn.danger { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-line); }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 18%, var(--danger-soft)); }
.btn.sm { height: 32px; padding: 0 10px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }

label { display: block; font-size: .84rem; font-weight: 600; margin-bottom: 5px; color: var(--text); }
input, select, textarea {
  width: 100%; height: 40px; padding: 0 12px; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 7px; appearance: none; -webkit-appearance: none;
}
select { padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2393a0b2' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
textarea { height: auto; min-height: 92px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 0; border-color: var(--accent); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; padding: 0; appearance: auto; -webkit-appearance: auto; accent-color: var(--accent); }
.segmented input[type=radio] { width: 100%; height: 100%; appearance: none; -webkit-appearance: none; }
.field { margin-bottom: 14px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.error { color: var(--danger); background: var(--danger-soft); border-radius: 7px; padding: 9px 12px; font-size: .88rem; margin: 4px 0 14px; }
.pw { position: relative; }
.pw input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 4px; top: 4px; width: 32px; height: 32px; display: grid; place-items: center; background: none; border: 0; border-radius: 6px; color: var(--muted); cursor: pointer; }
.pw-toggle:hover { background: var(--surface-2); color: var(--text); }
.caps { display: flex; align-items: center; gap: 7px; margin-top: 7px; padding: 6px 10px; border-radius: 6px; background: var(--warn-soft); color: var(--warn); font-size: .82rem; font-weight: 600; }
.caps .ic { width: 15px; height: 15px; }
.input-icon { position: relative; }
.input-icon .ic { position: absolute; left: 11px; top: 11px; color: var(--muted); pointer-events: none; }
.input-icon input { padding-left: 36px; }
.input-action { display: flex; gap: 8px; }
.input-action input { flex: 1; }

.toolbar { display: flex; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.toolbar .input-icon { flex: 1 1 280px; }
.toolbar select { width: 200px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; margin: 0; cursor: pointer; font-size: .9rem; }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 3px; gap: 3px; margin-bottom: 14px; }
.segmented label { margin: 0; position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.segmented span { display: block; text-align: center; padding: 7px 4px; border-radius: 6px; font-size: .88rem; font-weight: 600; color: var(--muted); }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .76rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th.num, td.num { text-align: right; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
.cell-title { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: .84rem; max-width: 380px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); margin-bottom: 4px; font-size: 1rem; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; font-size: .76rem; font-weight: 600; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok, .pill.entrada { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.danger, .pill.salida, .pill.off { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.pill.ajuste, .pill.info { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.pill.plain::before { display: none; }
.qty-cell { font-weight: 650; font-variant-numeric: tabular-nums; }
.qty-cell small { color: var(--muted); font-weight: 400; margin-left: 4px; }
.delta-pos { color: var(--ok); } .delta-neg { color: var(--danger); }

/* ---------- Detalle de equipo ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.detail .card { margin-bottom: 0; }
.kv { display: grid; grid-template-columns: 150px 1fr; margin: 0; }
.kv dt, .kv dd { padding: 11px 0; border-bottom: 1px solid var(--line); margin: 0; }
.kv dt { color: var(--muted); font-size: .88rem; }
.kv dd { word-break: break-word; }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }
.qty-big { font-size: 3rem; line-height: 1; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.qty-panel { padding: 20px; border-bottom: 1px solid var(--line); }
.chip { display: inline-block; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .82rem; background: var(--surface-2); border: 1px solid var(--line); padding: 2px 8px; border-radius: 6px; color: var(--muted); }
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Login ---------- */
body.guest #sidebar, body.guest #mobilebar, body.guest #tabbar { display: none; }
body.guest #content { margin: 0; }
body.guest #view { max-width: none; padding: 0; }
.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.login-aside { background: var(--side); color: #fff; padding: 44px 52px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-aside .brand { padding: 0; }
.login-aside h2 { font-size: 2rem; line-height: 1.2; font-weight: 650; letter-spacing: -.02em; max-width: 14ch; margin-bottom: 14px; }
.login-aside p { color: var(--side-text); max-width: 38ch; font-size: 1.02rem; }
.login-aside .bars { height: 54px; opacity: .5; background: repeating-linear-gradient(90deg, var(--accent) 0 2px, transparent 2px 5px, var(--accent) 5px 6px, transparent 6px 11px, var(--accent) 11px 15px, transparent 15px 18px, var(--accent) 18px 19px, transparent 19px 24px); -webkit-mask: linear-gradient(90deg, #000 40%, transparent); mask: linear-gradient(90deg, #000 40%, transparent); }
.login-main { position: relative; display: grid; place-items: center; padding: 28px 20px; }
.login-box { width: 100%; max-width: 360px; }
.login-box .brand { color: var(--text); display: none; padding: 0 0 22px; }
.login-box h1 { margin-bottom: 4px; }
.login-box > p { color: var(--muted); margin-bottom: 22px; }

/* ---------- Aviso de contraseña temporal ---------- */
#notice { max-width: 1120px; margin: 0 auto; padding: 16px 32px 0; }
body.guest #notice { display: none; }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); border-radius: var(--radius); padding: 10px 14px; font-size: .9rem; }
.notice span { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.notice .btn { height: 30px; font-size: .84rem; }

/* ---------- Tema claro / oscuro ---------- */
.side-tools { margin-bottom: 10px; }
.nav-btn { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border-radius: 7px; background: none; border: 0; color: var(--side-text); font: inherit; font-weight: 500; cursor: pointer; }
.nav-btn:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.theme-fab { position: absolute; top: 16px; right: 16px; }

/* ---------- Escáner ---------- */
.scan-wrap { max-width: 560px; margin: 0 auto; }
#reader { width: 100%; border-radius: var(--radius); overflow: hidden; background: #000; min-height: 220px; }
#reader video { border-radius: var(--radius); }
.scan-hint { margin-top: 12px; color: var(--muted); font-size: .88rem; text-align: center; }

/* ---------- Modal / toast / etiquetas ---------- */
dialog.modal { border: 1px solid var(--line); border-radius: 12px; padding: 0; width: min(92vw, 400px); background: var(--surface); color: var(--text); box-shadow: 0 20px 50px rgba(0, 0, 0, .3); }
dialog.modal::backdrop { background: rgba(8, 12, 20, .55); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 20px; display: grid; justify-items: center; gap: 14px; background: var(--surface-2); }
dialog.modal.wide { width: min(94vw, 460px); }
.modal-body.form { display: block; justify-items: stretch; background: var(--surface); padding: 20px 20px 6px; }
.modal-form { margin: 0; }
.modal-foot { padding: 14px 18px; display: flex; gap: 8px; align-items: center; justify-content: flex-end; border-top: 1px solid var(--line); }
.modal-foot .copies { display: flex; align-items: center; gap: 8px; margin-right: auto; }
.modal-foot .copies label { margin: 0; font-weight: 500; }
.modal-foot .copies input { width: 64px; height: 34px; }
.modal-head .icon-btn { color: var(--muted); } .modal-head .icon-btn:hover { background: var(--surface-2); color: var(--text); }

#toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 10px); background: var(--toast-bg); color: var(--toast-text); padding: 10px 16px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 60; max-width: 90vw; font-size: .9rem; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

.label { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 16px; border: 1px solid #d0d5dd; border-radius: 6px; background: #fff; color: #000; text-align: center; }
.label img { width: 132px; height: 132px; image-rendering: pixelated; }
.label svg { max-width: 220px; height: auto; }
.label .l-name { font-weight: 700; font-size: .9rem; max-width: 230px; line-height: 1.25; }
#print-area { display: none; }

/* ---------- Responsive ---------- */
@media (min-width: 721px) {
  td:not(.td-main):not(.empty) { white-space: nowrap; }
  .cell-sub { max-width: 300px; }
}
@media (min-width: 721px) and (max-width: 1180px) {
  .hide-md { display: none; }
  .cell-sub { max-width: 210px; }
  th, td { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 1000px) {
  .detail { display: flex; flex-direction: column; align-items: stretch; gap: 18px; }
  .detail > :last-child { order: -1; } /* existencias y movimientos primero */
}
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  #sidebar { display: none; }
  #content { margin-left: 0; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  #view { padding: 18px 16px 28px; }
  #notice { padding: 14px 16px 0; }
  #mobilebar { display: flex; position: sticky; top: 0; z-index: 15; align-items: center; justify-content: space-between; background: var(--side); padding: 9px 16px; padding-top: calc(9px + env(safe-area-inset-top)); }
  #mobilebar .brand { padding: 0; }
  .mobilebar-actions { display: flex; align-items: center; gap: 4px; }
  #tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: var(--surface); border-top: 1px solid var(--line); height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }
  #tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: .7rem; font-weight: 600; }
  #tabbar a:hover { text-decoration: none; }
  #tabbar a.active { color: var(--accent-text); }
  #tabbar .ic { width: 22px; height: 22px; }
  #toast { bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom)); }
  body.guest #toast { bottom: 22px; }
  h1 { font-size: 1.3rem; }

  .login { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .login-box .brand { display: flex; }
  .login-main { align-items: start; padding-top: 12vh; }
}
@media (max-width: 720px) {
  .kpis { grid-template-columns: 1fr 1fr 1fr; }
  .kpi { padding: 12px 12px; }
  .kpi b { font-size: 1.3rem; }
  .kpi span { font-size: .74rem; }
  .form-grid { grid-template-columns: 1fr; }
  .toolbar select { width: 100%; }
  .card-body, .card-pad { padding: 16px; }
  .card-head { padding: 12px 16px; }
  .kv { grid-template-columns: 112px 1fr; }
  .page-head .actions .btn { flex: 1; }

  /* Tablas -> tarjetas */
  .table-wrap { overflow: visible; }
  table.stack-sm thead { display: none; }
  table.stack-sm, table.stack-sm tbody, table.stack-sm tr, table.stack-sm td { display: block; }
  table.stack-sm tbody { padding: 10px; }
  table.stack-sm tr { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; background: var(--surface); }
  table.stack-sm tr:last-child { margin-bottom: 0; }
  table.stack-sm td { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 4px 0; border: 0; text-align: right; }
  table.stack-sm td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; text-align: left; flex: none; }
  table.stack-sm td.td-main { display: block; text-align: left; padding-bottom: 6px; }
  table.stack-sm td.td-main::before { display: none; }
  table.stack-sm td.td-main .cell-sub { max-width: none; white-space: normal; }
  table.stack-sm td.num { text-align: right; }
  table.stack-sm tr.click:hover td { background: none; }
  table.stack-sm td.td-actions { display: block; text-align: left; padding-top: 8px; }
  table.stack-sm td.td-actions::before { display: none; }
  table.stack-sm td.empty-row { display: block; text-align: center; }
  table.stack-sm td.empty-row::before { display: none; }
  .modal-foot { flex-wrap: wrap; }
}

/* ---------- Impresión ---------- */
@media print {
  body > *:not(#print-area) { display: none !important; }
  body { background: #fff; }
  #print-area { display: flex; flex-wrap: wrap; gap: 8px; }
  .label { border: 1px solid #000; border-radius: 0; break-inside: avoid; }
}
