/* ============================================================
   Pedido Automático · Hoja de estilos
   Diseño limpio, moderno y responsive.
   ============================================================ */

:root {
  /* Paleta */
  --bg: #f4f5fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e9ebf3;
  --line-strong: #dfe2ee;

  --text: #1c2233;
  --muted: #6b7390;
  --muted-2: #9aa1bb;

  --primary: #b00020;
  --primary-600: #8a0019;
  --primary-50: #fbe9ec;
  --primary-grad: linear-gradient(160deg, #2a2a2a 0%, #111 100%);

  --ok: #10b981;
  --ok-bg: #e7f8f1;
  --warn: #f59e0b;
  --warn-bg: #fff3da;
  --danger: #ef4444;
  --danger-bg: #fdeaea;

  --shadow-sm: 0 1px 2px rgba(20, 24, 60, .06), 0 1px 3px rgba(20, 24, 60, .05);
  --shadow: 0 6px 22px rgba(28, 34, 80, .08);
  --shadow-lg: 0 18px 48px rgba(28, 34, 80, .18);

  --radius: 16px;
  --radius-sm: 10px;
  --sidebar-w: 252px;
  --content-max: 1140px; /* ancho máx del contenido (no ocupar 100% de la pantalla) */

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
svg { display: block; }

/* ---------- Layout ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--primary-grad);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 22px;
}
.brand-logo {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.16);
  border-radius: 13px;
  color: #fff;
  backdrop-filter: blur(4px);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.brand-text span { font-size: 12px; color: rgba(255,255,255,.72); }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar__foot { margin-top: 10px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.16); }
.sidebar__version { font-size: 11px; color: rgba(255,255,255,.5); padding: 9px 13px 2px; letter-spacing: .02em; }

.nav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 11px;
  color: rgba(255,255,255,.82);
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, transform .1s ease;
  position: relative;
}
.nav__item .ic { width: 21px; height: 21px; fill: currentColor; flex: none; opacity: .9; }
.nav__item:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav__item.is-active { background: #fff; color: var(--primary-600); font-weight: 600; box-shadow: var(--shadow-sm); }
.nav__item.is-active .ic { opacity: 1; }
.nav__badge {
  margin-left: auto;
  min-width: 22px; height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: var(--warn);
  color: #3a2a00;
  font-size: 12px; font-weight: 800;
  display: grid; place-items: center;
}
.nav__item.is-active .nav__badge { background: var(--warn); color: #3a2a00; }

.sidebar-scrim {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15, 18, 45, .45);
  z-index: 35;
}

/* ---------- Main ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  /* fondo full-bleed pero contenido centrado al ancho máx (alineado con .view) */
  padding: 18px max(30px, calc((100% - var(--content-max)) / 2));
  background: rgba(244,245,251,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__title h1 { font-size: 21px; }
.topbar__title p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.topbar__actions { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* Toggle Cajas / Unidades (estilo iOS) — solo cambia cómo se muestran las cantidades */
.unit-toggle { display: flex; align-items: center; }
.uswitch { display: inline-flex; align-items: center; gap: 9px; padding: 4px; border: 0; background: none; cursor: pointer; font: inherit; }
.uswitch__lbl { font-size: 12.5px; font-weight: 700; letter-spacing: .2px; color: var(--muted); transition: color .15s; }
.uswitch__track { position: relative; flex: none; width: 46px; height: 27px; border-radius: 999px; background: #c8ccd6; transition: background .2s; box-shadow: inset 0 1px 2px rgba(0,0,0,.18); }
.uswitch__knob { position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.3); transition: transform .2s; }
.uswitch.is-on .uswitch__track { background: #34c759; }
.uswitch.is-on .uswitch__knob { transform: translateX(19px); }
.uswitch.is-on .uswitch__lbl--on { color: #1fa84a; }
.uswitch:not(.is-on) .uswitch__lbl--off { color: var(--text); }

.view { padding: 26px max(30px, calc((100% - var(--content-max)) / 2)) 60px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--text);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(176,0,32,.28); }
.btn--primary:hover { background: var(--primary-600); }
.btn--ghost { background: var(--surface); border-color: var(--line-strong); color: var(--text); box-shadow: var(--shadow-sm); }
.btn--ghost:hover { border-color: var(--muted-2); }
.btn--danger { background: var(--danger-bg); color: #b42318; }
.btn--danger:hover { background: #fbdcdc; }
.btn--sm { padding: 7px 11px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.iconbtn {
  border: none; background: transparent; color: var(--muted);
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.iconbtn svg { fill: currentColor; }
.iconbtn:hover { background: var(--line); color: var(--text); }

.only-mobile { display: none; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card__head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.card__head h2 { font-size: 16px; }
.card__head .spacer { flex: 1; }
.card__body { padding: 20px; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.stat__ic {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; margin-bottom: 12px;
}
.stat__ic svg { width: 22px; height: 22px; }
.stat__label { font-size: 13px; color: var(--muted); font-weight: 500; }
.stat__value { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.stat__hint { font-size: 12px; color: var(--muted-2); margin-top: 4px; }
.tone-primary .stat__ic { background: var(--primary-50); color: var(--primary); }
.tone-ok .stat__ic { background: var(--ok-bg); color: var(--ok); }
.tone-warn .stat__ic { background: var(--warn-bg); color: #b9760a; }
.tone-danger .stat__ic { background: var(--danger-bg); color: var(--danger); }
.tone-primary .stat__ic svg, .tone-ok .stat__ic svg, .tone-warn .stat__ic svg, .tone-danger .stat__ic svg { fill: currentColor; }

/* ---------- Grid de artículos ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.search {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 11px; padding: 0 12px; height: 42px; min-width: 240px; flex: 1; max-width: 420px;
  box-shadow: var(--shadow-sm);
}
.search svg { width: 18px; height: 18px; fill: var(--muted-2); flex: none; }
.search input { border: none; outline: none; background: transparent; font-size: 14px; width: 100%; color: var(--text); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all .14s ease;
}
.chip:hover { border-color: var(--muted-2); color: var(--text); }
.chip.is-active { background: var(--text); color: #fff; border-color: var(--text); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 18px; }

.article-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .14s ease, box-shadow .18s ease, border-color .18s ease;
  display: flex; flex-direction: column;
}
.article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.article-card__media { position: relative; aspect-ratio: 16 / 10; background: var(--surface-2); overflow: hidden; }
.article-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.article-card__flag {
  position: absolute; top: 10px; left: 10px;
  font-size: 11.5px; font-weight: 700; padding: 5px 9px; border-radius: 8px;
  backdrop-filter: blur(6px);
}
.flag-ok { background: rgba(16,185,129,.92); color: #fff; }
.flag-warn { background: rgba(245,158,11,.95); color: #3a2a00; }
.flag-danger { background: rgba(239,68,68,.94); color: #fff; }

.article-card__body { padding: 14px 15px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.article-card__code { font-size: 11.5px; color: var(--muted-2); font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.article-card__name { font-size: 15.5px; font-weight: 700; line-height: 1.25; }
.article-card__desc { font-size: 12.5px; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.stock-row { display: flex; align-items: baseline; justify-content: space-between; margin-top: 2px; }
.stock-row .now { font-size: 19px; font-weight: 800; }
.stock-row .max { font-size: 12.5px; color: var(--muted); }
.bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar__fill { height: 100%; border-radius: 999px; transition: width .5s cubic-bezier(.2,.7,.3,1); }
.fill-ok { background: var(--ok); }
.fill-warn { background: var(--warn); }
.fill-danger { background: var(--danger); }

.article-card__foot { display: flex; gap: 8px; margin-top: 6px; }
.article-card__foot .btn { flex: 1; justify-content: center; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 7px;
}
.badge--ok { background: var(--ok-bg); color: #06794f; }
.badge--warn { background: var(--warn-bg); color: #95620a; }
.badge--danger { background: var(--danger-bg); color: #b42318; }
.badge--muted { background: var(--line); color: var(--muted); }
.badge--primary { background: var(--primary-50); color: var(--primary-600); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- Tablas ---------- */
.table-wrap { overflow: visible; }
@media (max-width: 720px) { .table-wrap { overflow-x: auto; } } /* mobile: scroll horizontal (cede el header fijo) */

/* Header de tabla fijo al scrollear, pegado bajo el topbar (alto medido en --topbar-h). En modales no aplica. */
.view .table thead th { position: sticky; top: var(--topbar-h, 78px); z-index: 5; box-shadow: 0 1px 0 var(--line); }

/* Selector de sucursal de entrega (pantalla Stocks) */
.sucbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; padding: 12px 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); }
.sucbar__lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.sucbar__btns { display: flex; gap: 8px; flex-wrap: wrap; }
.sucbtn { padding: 9px 16px; border-radius: 10px; border: 1.5px solid var(--line-strong); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.sucbtn:hover { border-color: var(--primary); color: var(--primary); }
.sucbtn.is-active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(176,0,32,.28); }
.ranking { max-width: 680px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; background: var(--surface-2); }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .right { text-align: right; }
.cell-art { display: flex; align-items: center; gap: 11px; }
.cell-art img { width: 42px; height: 42px; border-radius: 9px; object-fit: cover; border: 1px solid var(--line); flex: none; }
.cell-art .nm { font-weight: 600; line-height: 1.2; }
.cell-art .cd { font-size: 12px; color: var(--muted-2); }

.qty-input {
  width: 92px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 9px;
  font-size: 14px; text-align: right; font-variant-numeric: tabular-nums; outline: none; background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.qty-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }

/* ---------- Formularios ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.label { font-size: 13px; font-weight: 600; color: var(--text); }
.label .opt { color: var(--muted-2); font-weight: 500; }
.hint { font-size: 12px; color: var(--muted); }
.input, .textarea, .select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 11px;
  font-size: 14px; font-family: inherit; color: var(--text); background: var(--surface); outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.textarea { resize: vertical; min-height: 78px; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; }
.input-prefix .input { padding-left: 30px; }

/* Carga de imagen */
.imgdrop {
  border: 2px dashed var(--line-strong); border-radius: 13px; padding: 16px;
  display: flex; align-items: center; gap: 14px; cursor: pointer; background: var(--surface-2);
  transition: border-color .15s ease, background .15s ease;
}
.imgdrop:hover { border-color: var(--primary); background: var(--primary-50); }
.imgdrop__preview { width: 84px; height: 84px; border-radius: 11px; object-fit: cover; background: var(--line); flex: none; border: 1px solid var(--line); }
.imgdrop__text strong { display: block; font-size: 13.5px; }
.imgdrop__text span { font-size: 12px; color: var(--muted); }

.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }

/* Pop-up de revisión del pedido (steppers +/−) */
.pedlist { max-height: 46vh; overflow-y: auto; margin-bottom: 14px; }
.pedrow { display: flex; align-items: center; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.pedrow__info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.pedrow__cod { font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: .02em; }
.pedrow__name { font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pedrow__meta { font-size: 11.5px; color: var(--muted); font-weight: 600; margin-top: 1px; }
.pedrow__meta strong { color: var(--text); }
.pedrow__del { flex: none; width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: var(--muted-2); font-size: 21px; line-height: 1; cursor: pointer; display: grid; place-items: center; transition: background .12s, color .12s; }
.pedrow__del:hover { background: var(--danger-bg); color: var(--danger); }
.stepper { display: flex; align-items: center; gap: 6px; flex: none; }
.stepper__btn { width: 33px; height: 33px; border-radius: 9px; border: 1.5px solid var(--line-strong); background: var(--surface-2); color: var(--text); font-size: 20px; font-weight: 700; line-height: 1; cursor: pointer; display: grid; place-items: center; transition: border-color .12s, color .12s; }
.stepper__btn:hover { border-color: var(--primary); color: var(--primary); }
.stepper__inp { width: 54px; height: 33px; text-align: center; border: 1.5px solid var(--line-strong); border-radius: 9px; font: inherit; font-weight: 700; font-size: 14px; color: var(--text); -moz-appearance: textfield; }
.stepper__inp::-webkit-outer-spin-button, .stepper__inp::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pedtot { text-align: right; font-size: 15px; font-weight: 700; margin-bottom: 8px; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(17, 20, 48, .5); backdrop-filter: blur(3px); animation: fade .18s ease; }
.modal__card {
  position: relative; background: var(--surface); border-radius: 20px; width: 100%; max-width: 560px;
  max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg); animation: pop .2s cubic-bezier(.2,.8,.3,1);
}
.modal__head { display: flex; align-items: center; padding: 20px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal__head h2 { font-size: 18px; flex: 1; }
.modal__body { padding: 22px; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 11px;
  background: var(--text); color: #fff; padding: 13px 16px; border-radius: 12px;
  box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500; min-width: 240px; max-width: 360px;
  animation: slidein .25s cubic-bezier(.2,.8,.3,1);
}
.toast svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.toast--ok { background: #0c8a5f; }
.toast--warn { background: #b9760a; }
.toast--danger { background: #c0392b; }
@keyframes slidein { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty__ic {
  width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 22px;
  background: var(--primary-50); color: var(--primary); display: grid; place-items: center;
}
.empty__ic svg { width: 40px; height: 40px; fill: currentColor; }
.empty h3 { font-size: 18px; color: var(--text); margin-bottom: 6px; }
.empty p { max-width: 420px; margin: 0 auto 18px; line-height: 1.5; }

/* ---------- Pedido / impresión ---------- */
.order-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 18px; }
.order-meta { font-size: 13px; color: var(--muted); line-height: 1.7; }
.order-meta strong { color: var(--text); }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin: 26px 0 12px; }

.callout {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--primary-50); border: 1px solid #dcdcfb; color: var(--primary-600);
  padding: 14px 16px; border-radius: 13px; font-size: 13.5px; line-height: 1.5;
}
.callout svg { width: 20px; height: 20px; fill: currentColor; flex: none; margin-top: 1px; }
.callout--warn { background: var(--warn-bg); border-color: #f3dca5; color: #95620a; }

.list-reset { list-style: none; margin: 0; padding: 0; }
.timeline-item { display: flex; gap: 13px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.timeline-dot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.timeline-dot svg { width: 17px; height: 17px; fill: currentColor; }
.t-entrega { background: var(--ok-bg); color: var(--ok); }
.t-venta { background: var(--primary-50); color: var(--primary); }
.t-ajuste { background: var(--warn-bg); color: #b9760a; }
.timeline-main { flex: 1; min-width: 0; }
.timeline-main .ttl { font-size: 14px; font-weight: 600; }
.timeline-main .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.timeline-qty { font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- Util ---------- */
.row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }
.mt-0 { margin-top: 0; }
.text-c { text-align: center; }
.nowrap { white-space: nowrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 280px; transform: translateX(-100%); transition: transform .26s cubic-bezier(.3,.8,.3,1);
  }
  .app.menu-open .sidebar { transform: none; }
  .app.menu-open .sidebar-scrim { display: block; }
  .only-mobile { display: grid; }
  .topbar { padding: 14px 18px; }
  .view { padding: 18px 18px 60px; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr; }
  .topbar__title h1 { font-size: 18px; }
  .topbar__actions .btn span.lbl { display: none; }
  .uswitch__lbl { font-size: 11.5px; }
}

/* ---------- Print ---------- */
@media print {
  .sidebar, .topbar, .sidebar-scrim, .toasts, .no-print { display: none !important; }
  .app { display: block; }
  .view { padding: 0; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
