/* Letra Inter (licencia OFL) guardada en la app: se ve igual en todos los celulares y funciona sin internet. */
@font-face { font-family: 'Inter'; src: url('fonts/inter.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

/* Identidad propia "realeza dorada" (la mascota lleva corona y corazón): oro + tinta profunda + coral de corazón.
   Los temas y el modo oscuro solo cambian estas variables; el resto del CSS no conoce colores fijos. */
:root {
  --brand: #14b1c4;
  --brand-2: #0e97ab;
  --brand-soft: #daf4f7;
  --accent: #ffc93c;
  --accent-ink: #3a2a00;
  --cta: #14b1c4;
  --cta-2: #0e97ab;
  --cta-shadow: #0a6a78;
  --head-1: #1c1c1c;
  --head-2: #000000;
  --head-ink: #ffffff;
  --bg: #f3f3f3;
  --card: #ffffff;
  --ink: #111111;
  --muted: #6e6e6e;
  --line: #e2e2e2;
  --ok: #1f9d63;
  --ok-soft: #d7f5e6;
  --warn: #c98200;
  --warn-soft: #fff1cc;
  --bad: #e5484d;
  --bad-soft: #ffe0e0;
  --box: #d9a45f;
  --box-2: #a86f2c;
  --chart: #0e97ab; /* validado para gráficas sobre tarjeta clara y oscura */
  --radius: 20px;
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
:root[data-theme='oro'] { --brand: #f29400; --brand-2: #d17400; --brand-soft: #ffe8b0; --bg: #fff6dc; --line: #f6dcaa; --ink: #3a2208; --muted: #7a5a38; --head-1: #ffb700; --head-2: #ff7a00; --cta: #ff4f64; --cta-2: #e23350; --cta-shadow: #a81d34; }
:root[data-theme='fuego'] { --brand: #ff6a2b; --brand-2: #e14f12; --brand-soft: #ffe6da; --bg: #fff4ee; --line: #ffe0d1; --ink: #4a1d08; --muted: #9a6248; --head-1: #ff6a2b; --head-2: #c83a0a; --head-ink: #fff; }
:root[data-theme='limon'] { --brand: #2fb36a; --brand-2: #1d8f50; --brand-soft: #dcf6e7; --bg: #effbf4; --line: #d2f0de; --ink: #10402a; --muted: #4f8a6b; --head-1: #2fb36a; --head-2: #16753f; --head-ink: #fff; }

:root[data-mode='dark'] {
  --bg: #0f0f0f; --card: #1c1c1c; --ink: #f2f2f2; --muted: #a3a3a3; --line: #303030; --brand-soft: #123f45;
  --ok-soft: #173d2c; --warn-soft: #3d3114; --bad-soft: #4a2124; --shadow: 0 6px 18px rgba(0, 0, 0, 0.4); --head-1: #1c1c1c; --head-2: #000000;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-mode='auto'] {
    --bg: #0f0f0f; --card: #1c1c1c; --ink: #f2f2f2; --muted: #a3a3a3; --line: #303030; --brand-soft: #123f45;
    --ok-soft: #173d2c; --warn-soft: #3d3114; --bad-soft: #4a2124; --shadow: 0 6px 18px rgba(0, 0, 0, 0.4); --head-1: #1c1c1c; --head-2: #000000;
    color-scheme: dark;
  }
}
:root[data-size='big'] { font-size: 19px; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* íconos de trazo (Lucide): toman el color del texto */
.i { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
h1 .i { color: var(--brand); width: 1.05em; height: 1.05em; vertical-align: -0.15em; }
.section-title .i { color: var(--brand); }
.with-ic, .setting .txt strong.with-ic { display: flex; gap: 10px; align-items: flex-start; }
.with-ic .i { margin-top: 2px; color: var(--brand); }
.segmented button .i, .tabs button .i { width: 1.1em; height: 1.1em; }
.photo-btn i .i { width: 13px; height: 13px; }
[hidden] { display: none !important; }
.chip:empty { display: none; }
html { font-size: 16px; }
body {
  margin: 0;
  font: 500 1rem/1.4 var(--font);
  background: var(--bg);
  color: var(--ink);
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

/* ---------- encabezado ---------- */
#top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 12px;
  background: linear-gradient(135deg, var(--head-1), var(--head-2));
  color: var(--head-ink); border-radius: 0 0 22px 22px; box-shadow: var(--shadow);
}
#top .logo { width: 40px; height: 40px; border-radius: 50%; background: #fff; flex: none; }
#top .title { font-weight: 800; font-size: 1.15rem; letter-spacing: 0.2px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip {
  color: inherit;
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.22); font-weight: 700; font-size: 0.85rem; white-space: nowrap;
}
.chip.dark { background: var(--ink); color: var(--bg); }

main { max-width: 900px; margin: 0 auto; padding: 16px; }
main.enter { animation: slideUp 0.28s ease-out; }

/* ---------- menú inferior ---------- */
nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 5;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 14px rgba(15, 59, 69, 0.06);
}
nav[hidden] { display: none; }
nav button {
  border: 0; background: none; color: var(--muted); padding: 8px 2px 10px; font: 700 0.8rem var(--font);
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 0; box-shadow: none;
}
nav button .ic { display: grid; place-items: center; width: 56px; height: 30px; border-radius: 999px; transition: background 0.2s; }
nav button .ic .i { width: 24px; height: 24px; }
nav button.active { color: var(--brand); }
nav button.active .ic { background: color-mix(in srgb, var(--brand) 16%, transparent); }
nav button.active .ic .i { stroke-width: 2.4; }

/* ---------- tipografía ---------- */
h1 { font-size: 1.6rem; font-weight: 800; margin: 6px 0 14px; letter-spacing: -0.02em; }
h2 { font-size: 1.1rem; font-weight: 800; margin: 22px 0 10px; }
p { margin: 6px 0; }
.muted { color: var(--muted); font-size: 0.9rem; }
.hello h1 { margin-bottom: 0; }
.hello p { margin-top: 2px; }

/* ---------- tarjetas y mosaicos ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.card.clickable, .tile, .kpi.clickable { cursor: pointer; transition: transform 0.12s; }
.card.clickable:active, .tile:active, .kpi.clickable:active { transform: scale(0.97); }
.card.accent { background: linear-gradient(135deg, var(--accent), #ffd966); border: 0; color: var(--accent-ink); }
.card.alert { border-left: 6px solid var(--bad); }
.card.good { border-left: 6px solid var(--ok); }
.section-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.05rem; margin-bottom: 8px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 14px 0; }
.tile {
  position: relative; overflow: hidden; border-radius: 22px; padding: 16px; min-height: 128px;
  color: #fff; display: flex; flex-direction: column; justify-content: flex-end; box-shadow: var(--shadow);
  animation: pop 0.35s ease-out both;
}
.tile .emoji { position: absolute; top: 8px; right: 10px; font-size: 3rem; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2)); animation: float 3s ease-in-out infinite; }
.tile strong { font-size: 1.08rem; font-weight: 800; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
.tile span { font-size: 0.82rem; opacity: 0.95; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
.g-orange { background: linear-gradient(135deg, #ff9a3c, #ff5e1a); }
.g-teal { background: linear-gradient(135deg, #22c3d6, #0b8fa3); }
.g-purple { background: linear-gradient(135deg, #3a3a3a, #0d0d0d); }
.g-yellow { background: linear-gradient(135deg, #ffcf3f, #f4a100); }
.g-green { background: linear-gradient(135deg, #3fcf86, #189c5a); }
.g-pink { background: linear-gradient(135deg, #ff7ab6, #e5407f); }
.g-gray { background: linear-gradient(135deg, #7a7a7a, #3d3d3d); }
.g-coral { background: linear-gradient(135deg, #ff7a8a, #e23350); }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0; }
@media (min-width: 620px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow);
  animation: pop 0.35s ease-out both;
}
.kpi .v { font-size: 1.55rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .l { font-size: 0.82rem; color: var(--muted); font-weight: 700; }
.kpi .e { float: right; color: var(--muted); }
.kpi .e .i { width: 22px; height: 22px; }
.kpi.hot .e { color: var(--accent-ink); }
.kpi.hot { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.kpi.hot .l { color: var(--accent-ink); }

/* ---------- insignias ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 3px; padding: 3px 9px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 700; background: var(--brand-soft); color: var(--brand-2);
}
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }

/* ---------- botones y campos ---------- */
button, .btn {
  font: 700 0.95rem var(--font); border-radius: 14px; border: 2px solid var(--line);
  background: var(--card); color: var(--ink); padding: 10px 16px; min-height: 46px; cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
button:active, .btn:active { transform: translateY(2px); }
button.primary, .btn.primary {
  background: linear-gradient(180deg, var(--cta), var(--cta-2)); color: #fff; border: 0;
  box-shadow: 0 4px 0 var(--cta-shadow); text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}
button.primary:active { box-shadow: 0 1px 0 var(--cta-shadow); }
button.brand { background: var(--brand); color: #fff; border-color: var(--brand); }
button.danger { color: var(--bad); border-color: var(--bad-soft); }
button.small { min-height: 38px; padding: 6px 12px; font-size: 0.85rem; border-radius: 12px; }
button.small.primary { box-shadow: 0 3px 0 var(--cta-shadow); }
button.big { width: 100%; min-height: 56px; font-size: 1.1rem; border-radius: 18px; }
button:disabled { opacity: 0.45; cursor: default; transform: none; }
input, select, textarea {
  font: 600 1rem var(--font); width: 100%; padding: 11px 14px; min-height: 48px;
  border: 2px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
input[type='checkbox'] { width: auto; min-height: 0; }
label { display: block; margin: 12px 0 5px; font-size: 0.88rem; color: var(--muted); font-weight: 700; }
label.check { display: flex; gap: 10px; align-items: center; color: var(--ink); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }

/* interruptor tipo celular */
.switch { position: relative; width: 52px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i { position: absolute; inset: 0; background: var(--line); border-radius: 30px; transition: background 0.2s; cursor: pointer; }
.switch i::after {
  content: ''; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); transition: transform 0.2s;
}
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(22px); }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.setting:first-of-type { border-top: 0; }
.setting .txt strong { display: block; font-weight: 700; }
.setting .txt span { font-size: 0.85rem; color: var(--muted); }

input[type='range'] { -webkit-appearance: none; appearance: none; height: 10px; padding: 0; min-height: 0; border: 0; border-radius: 10px; background: var(--brand-soft); }
input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); border: 4px solid #fff; box-shadow: var(--shadow); }
input[type='range']::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--brand); border: 4px solid #fff; }
.big-number { font-size: 2rem; font-weight: 800; color: var(--brand); }

.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 54px; height: 54px; border-radius: 16px; border: 3px solid transparent; padding: 0; min-height: 0; box-shadow: var(--shadow); }
.swatch.on { border-color: var(--ink); transform: scale(1.08); }
.segmented { display: flex; background: var(--brand-soft); border-radius: 14px; padding: 4px; gap: 4px; }
.segmented button { flex: 1; border: 0; background: transparent; min-height: 40px; }
.segmented button.on { background: var(--card); box-shadow: var(--shadow); color: var(--brand-2); }

.tabs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 4px; scrollbar-width: none; }
.tabs button { white-space: nowrap; border-radius: 999px; }
.tabs button.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- tablas y cantidades ---------- */
table { width: 100%; border-collapse: collapse; }
td, th { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 0.85rem; color: var(--muted); font-weight: 700; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.qty { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-width: 180px; }
.qty input { text-align: center; padding: 8px 4px; font-weight: 700; }
.total-bar {
  position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); background: var(--card);
  border: 2px solid var(--brand-soft); border-radius: var(--radius); padding: 14px 16px; margin-top: 12px; box-shadow: var(--shadow);
}
.total-bar .error:empty { display: none; }
.total-bar #total { font-size: 1.5rem; font-weight: 800; color: var(--brand-2); }
.empty { text-align: center; color: var(--muted); padding: 36px 0; font-weight: 700; }
.empty .big { font-size: 3rem; display: block; margin-bottom: 6px; animation: float 3s ease-in-out infinite; }

/* tarjeta de pedido con franja de color por estado */
.order { border-left: 7px solid var(--brand); }
.order.QUEUED { border-left-color: var(--warn); }
.order.ASSIGNED { border-left-color: #8a8a8a; }
.order.DONE { border-left-color: var(--ok); }
.order.DELIVERED { border-left-color: var(--cta); }
.order.PAID { border-left-color: var(--line); }
.order.CANCELLED { border-left-color: var(--bad); opacity: 0.75; }
.order .num { font-size: 1.1rem; font-weight: 800; }

/* ---------- ventanas ---------- */
dialog {
  border: 0; border-radius: 26px; padding: 0; width: min(520px, calc(100vw - 24px)); max-height: 90vh;
  background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
dialog[open] { animation: pop 0.22s ease-out; }
dialog::backdrop { background: rgba(10, 40, 48, 0.5); backdrop-filter: blur(2px); }
dialog form, dialog .body { padding: 20px; }
dialog h3 { margin: 0 0 8px; font-size: 1.3rem; font-weight: 800; }
dialog .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.error { color: var(--bad); font-size: 0.9rem; margin-top: 8px; min-height: 1em; font-weight: 700; }
.pin-show { font-size: 2.6rem; font-weight: 800; letter-spacing: 8px; text-align: center; color: var(--brand-2); padding: 10px; background: var(--brand-soft); border-radius: 18px; margin: 10px 0; }

#toast {
  position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 16px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 30; max-width: 90vw; box-shadow: var(--shadow);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.ok { background: var(--ok); color: #fff; }
#toast.bad { background: var(--bad); color: #fff; }

/* ---------- entrada ---------- */
.login { max-width: 380px; margin: 4vh auto 0; text-align: center; }
.login .mascot { width: 150px; height: 150px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); animation: float 3s ease-in-out infinite; }
.login form { text-align: left; }
.dev-credit { text-align: center; margin: 28px 0 10px; color: var(--muted); font-weight: 700; font-size: 0.85rem; }
.dev-credit .brandline { color: #b8902f; }
.dev-credit img { display: block; width: 56px; height: 56px; margin: 8px auto 0; border-radius: 50%; }

/* ---------- animaciones ---------- */
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); opacity: 0.2; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 122, 26, 0.5); } 50% { box-shadow: 0 0 0 10px rgba(255, 122, 26, 0); } }
.shake { animation: shake 0.35s; }
.pulse { animation: pulse 1.6s infinite; }
.confetti { position: fixed; top: -40px; z-index: 40; font-size: 1.6rem; pointer-events: none; animation: fall linear forwards; }
.tiles .tile:nth-child(2) { animation-delay: 0.04s; } .tiles .tile:nth-child(3) { animation-delay: 0.08s; }
.tiles .tile:nth-child(4) { animation-delay: 0.12s; } .tiles .tile:nth-child(5) { animation-delay: 0.16s; }
.tiles .tile:nth-child(6) { animation-delay: 0.2s; } .kpis .kpi:nth-child(2) { animation-delay: 0.05s; }
.kpis .kpi:nth-child(3) { animation-delay: 0.1s; } .kpis .kpi:nth-child(4) { animation-delay: 0.15s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.kpis-report { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
@media print {
  #top, nav, .no-print { display: none !important; }
  body { padding: 0; background: #fff; color: #000; }
  .card, .kpi { break-inside: avoid; box-shadow: none; }
}

/* ---------- inventario con cajitas ---------- */
.sku-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.sku-card { border-left: 7px solid var(--ok); margin-bottom: 0; animation: pop 0.3s ease-out both; }
.sku-card.warn { border-left-color: var(--warn); }
.sku-card.bad { border-left-color: var(--bad); background: linear-gradient(0deg, var(--bad-soft), var(--card) 60%); }
.boxes { display: flex; flex-wrap: wrap; gap: 2px; margin: 10px 0 4px; min-height: 30px; align-items: center; }
.bx { font-size: 1.45rem; line-height: 1; filter: drop-shadow(0 2px 2px rgba(120, 70, 0, 0.2)); animation: pop 0.25s ease-out both; }
.bx.half { opacity: 0.4; }
.bx-more { font-weight: 800; color: var(--brand-2); margin-left: 4px; font-size: 1.05rem; }
.qtyline strong { font-size: 1.15rem; }
.sku-actions { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 6px; margin-top: 10px; }

/* control − / + para cajas */
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper input { width: 80px; text-align: center; font-size: 1.3rem; font-weight: 800; }
.stepper button { width: 48px; min-height: 48px; font-size: 1.4rem; padding: 0; background: var(--brand-soft); border-color: transparent; color: var(--brand-2); }
.qty-wrap { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.qty-wrap .loose { width: 110px; text-align: center; }

/* productos del cliente */
.prod-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 0; border-top: 1px solid var(--line); align-items: center; }
.prod-row:first-child { border-top: 0; }
.meter { height: 8px; border-radius: 8px; background: var(--brand-soft); overflow: hidden; grid-column: 1 / -1; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--head-1), var(--head-2)); border-radius: 8px; }
details summary { cursor: pointer; font-weight: 700; color: var(--brand-2); margin: 10px 0; }
.flavor-row { padding: 10px 0; border-top: 1px solid var(--line); }
.flavor-row:first-of-type { border-top: 0; }
.flavor-row .boxes { margin: 6px 0 2px; min-height: 0; }
.flavor-row .bx { font-size: 1.15rem; }
.sku-card { margin-bottom: 12px; }

/* ---------- fotos de sabor ---------- */
.thumb { width: var(--sz); height: var(--sz); flex: none; border-radius: calc(var(--sz) * 0.28); object-fit: cover; background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); }
.thumb.ph { display: inline-grid; place-items: center; color: #fff; font-weight: 800; font-size: calc(var(--sz) * 0.45); background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 70%, #000)); }
.photo-btn { position: relative; flex: none; }
.photo-btn i { position: absolute; right: -4px; bottom: -4px; font-style: normal; font-size: 0.85rem; background: var(--card); border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; box-shadow: var(--shadow); }

/* ---------- cajas dibujadas: cerradas y la abierta con su nivel ---------- */
.boxes { gap: 3px; }
.box { width: 30px; height: 27px; flex: none; animation: pop 0.25s ease-out both; }
.box-body { fill: var(--box); stroke: var(--box-2); stroke-width: 1.5; }
.box-lid { fill: var(--box-2); }
.box-tape { fill: color-mix(in srgb, var(--box) 55%, #fff); }
.box-flap { fill: var(--box-2); }
.open-box { display: inline-flex; align-items: center; gap: 4px; margin-right: 6px; padding: 2px 8px 2px 2px; border-radius: 12px; background: var(--warn-soft); }
.open-box .box.big { width: 54px; height: 54px; overflow: visible; }
.open-box .box-body { fill: color-mix(in srgb, var(--box-2) 30%, var(--card)); stroke-width: 2; }
.box-fill { fill: var(--accent); stroke: color-mix(in srgb, var(--accent) 60%, #000); stroke-width: 1; transform-box: fill-box; transform-origin: bottom; transform: scaleY(var(--lvl)); animation: drain 1s cubic-bezier(0.3, 1.3, 0.5, 1) both; }
.open-box b { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.open-box small { font-size: 0.8rem; color: var(--muted); font-weight: 700; }
.open-box.empty { background: var(--bad-soft); }
@keyframes drain { from { transform: scaleY(1); } to { transform: scaleY(var(--lvl)); } }

/* ---------- nuevo pedido: tarjeta por sabor ---------- */
.pick-list { display: grid; gap: 10px; margin-top: 10px; }
.pick {
  display: grid; min-width: 0; grid-template-columns: auto 1fr auto; grid-template-areas: 'img info price' 'qty qty qty';
  gap: 8px 12px; align-items: center; padding: 10px; border: 2px solid var(--line); border-radius: 18px; transition: border-color 0.15s, background 0.15s;
}
.pick > .thumb { grid-area: img; }
.pick.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, var(--card)); }
.pick-info { grid-area: info; min-width: 0; }
.pick-info strong { font-size: 1.1rem; }
.pick-info .out { color: var(--bad); font-weight: 700; }
.pick-price { grid-area: price; text-align: right; }
.pick-qty { grid-area: qty; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.stepper.sm { gap: 3px; flex-wrap: wrap; justify-content: center; }
.stepper.sm input { width: 46px; min-height: 44px; padding: 6px 2px; font-size: 1.15rem; }
.stepper.sm button { width: 40px; min-height: 44px; font-size: 1.3rem; }
.stepper.sm span { order: -1; width: 100%; text-align: center; font-size: 0.85rem; color: var(--muted); font-weight: 700; }

/* ---------- tomar producto ---------- */
.big-seg button { min-height: 52px; font-size: 1rem; }
.take-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.take-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; cursor: pointer; user-select: none;
  padding: 12px 8px; border: 2px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: var(--shadow); transition: border-color 0.15s, transform 0.1s;
}
.take-card:active { transform: scale(0.96); }
.take-card.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--card)); }
.take-card.none { opacity: 0.45; }
.take-card .muted { font-size: 0.8rem; }
.take-card .count:empty, .take-card:not(.on) .less { display: none; }
.take-card .count {
  position: absolute; top: -8px; right: -6px; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 16px;
  background: var(--brand); color: #fff; font-size: 1.05rem; display: grid; place-items: center; box-shadow: var(--shadow);
}
.take-card .less {
  position: absolute; top: -8px; left: -6px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card); border: 2px solid var(--line); font-weight: 800; font-size: 1.2rem; color: var(--ink);
}
.take-card.bump .count { animation: bump 0.25s ease-out; }
@keyframes bump { 50% { transform: scale(1.3); } }

/* surtido "menos un sabor": el tachado no entra en el reparto */
.skip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 8px; }
.chip-btn { min-height: 36px; padding: 4px 12px; border-radius: 999px; font-size: 0.85rem; }
.chip-btn.off { text-decoration: line-through; color: var(--bad); border-color: var(--bad); background: var(--bad-soft); }
.chip-btn.off::before { content: '✖ '; }

/* ---------- rejilla de acciones (detalle de pedido y de cliente) ---------- */
.act-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 8px; margin: 12px 0; }
.act {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 66px; padding: 8px 4px;
  border: 2px solid var(--line); border-radius: 16px; background: var(--card); color: var(--ink); text-decoration: none;
  font: 700 0.8rem/1.15 var(--font); text-align: center; cursor: pointer;
}
.act .i { width: 22px; height: 22px; color: var(--brand); }
.act:active { transform: scale(0.96); }
.act.danger { color: var(--bad); border-color: var(--bad-soft); }
.act.danger .i { color: var(--bad); }
h2 .i { color: var(--brand); }

/* líneas del pedido con foto */
.lines { border-top: 1px solid var(--line); }
.line { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.line .grow { flex: 1; min-width: 0; }
.line .num { font-variant-numeric: tabular-nums; }
.line.total { font-size: 1.1rem; border-bottom: 0; }

/* pestañas parejas: caben todas sin deslizar */
.tabs.even { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; overflow: visible; }
.tabs.even button { flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 0.78rem; white-space: normal; line-height: 1.1; border-radius: 14px; }
.tabs.even button .i { width: 20px; height: 20px; }
.empty button .i { width: 1.1em; height: 1.1em; }

/* ---------- reportes ---------- */
.card.hero { padding: 18px 18px 14px; }
.hero-v { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin: 2px 0 4px; font-variant-numeric: tabular-nums; }
.hero-v.neg { color: var(--bad); }
.hero-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.hero-row b { display: block; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.hero-row span { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.chart { width: 100%; height: auto; display: block; touch-action: pan-y; }
.chart .bar { fill: var(--chart); opacity: 0.55; }
.chart .best .bar, .chart .on .bar { opacity: 1; }
.chart .hit { fill: transparent; }
.chart .base { stroke: var(--line); stroke-width: 1; }
.chart .lbl { fill: var(--ink); font: 700 11px var(--font); }
.chart .axis { fill: var(--muted); font: 600 10px var(--font); }
.pbar { padding: 10px 0; border-top: 1px solid var(--line); }
.pbar:first-child { border-top: 0; padding-top: 0; }
.pbar summary { list-style: none; cursor: pointer; color: var(--ink); margin: 0; }
.pbar summary::-webkit-details-marker { display: none; }
.hbar { height: 10px; border-radius: 6px; background: var(--brand-soft); margin: 6px 0 4px; overflow: hidden; }
.hbar i { display: block; height: 100%; border-radius: 6px; background: var(--chart); }

/* ---------- qué pedir ---------- */
.rrow { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.rrow:first-child { border-top: 0; padding-top: 0; }
.rrow .grow { flex: 1; min-width: 0; }
.cover { position: relative; height: 8px; border-radius: 6px; background: var(--brand-soft); margin: 6px 0 2px; }
.cover i { display: block; height: 100%; border-radius: 6px; background: var(--ok); }
.cover.bad i { background: var(--bad); }
.cover b { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--ink); opacity: 0.5; border-radius: 1px; }
