/* =========================================================
   WEST WING — Estilos (diseño nuevo, 26.10.2026)
   - Letra propia: Plus Jakarta Sans (en fonts/, funciona sin internet)
   - Iconos dibujados (están en index.html, se usan con <use href="#i-…">)
   - Día / Noche: sigue al móvil; en el menú ⋮ se puede forzar
     (html[data-theme="light"] o html[data-theme="dark"])
   - Letras grandes y mucho contraste: se lee bien en la furgoneta
   ========================================================= */

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/jakarta.woff2) format('woff2');
}

/* ---------- Colores: DÍA ---------- */
:root {
  --bg: #f3f5fa;
  --card: #ffffff;
  --soft: #eef1f7;          /* fondos suaves dentro de tarjetas */
  --text: #121829;
  --muted: #5d6680;
  --border: #dfe3ec;
  --brand: #1d3a8f;          /* azul West Wing */
  --brand-2: #2f56c9;
  --brand-soft: #e6ecfb;
  --on-brand: #ffffff;
  --gold: #c9a24a;
  --pending: #c26a05;        /* naranja = pendiente */
  --pending-soft: #fff3e2;
  --done: #15803d;           /* verde = hecho */
  --done-soft: #e3f4e8;
  --danger: #b42318;
  --danger-soft: #fdeceb;
  --ink: #121829;            /* botón principal (negro) */
  --on-ink: #ffffff;
  --shadow: 0 1px 2px rgba(18, 24, 41, .06), 0 6px 18px rgba(18, 24, 41, .06);
  --backdrop: rgba(10, 14, 28, .5);
  color-scheme: light;
}

/* ---------- Colores: NOCHE ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1020;
    --card: #161c2f;
    --soft: #1d2439;
    --text: #eef1f8;
    --muted: #9aa2ba;
    --border: #283049;
    --brand: #7396ff;
    --brand-2: #8ba8ff;
    --brand-soft: #1c2850;
    --on-brand: #0b1020;
    --gold: #e3c26e;
    --pending: #f5a524;
    --pending-soft: #33240c;
    --done: #3ccf74;
    --done-soft: #11301e;
    --danger: #ff6b5e;
    --danger-soft: #3a1714;
    --ink: #eef1f8;
    --on-ink: #0b1020;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    --backdrop: rgba(0, 0, 0, .65);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1020;
  --card: #161c2f;
  --soft: #1d2439;
  --text: #eef1f8;
  --muted: #9aa2ba;
  --border: #283049;
  --brand: #7396ff;
  --brand-2: #8ba8ff;
  --brand-soft: #1c2850;
  --on-brand: #0b1020;
  --gold: #e3c26e;
  --pending: #f5a524;
  --pending-soft: #33240c;
  --done: #3ccf74;
  --done-soft: #11301e;
  --danger: #ff6b5e;
  --danger-soft: #3a1714;
  --ink: #eef1f8;
  --on-ink: #0b1020;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  --backdrop: rgba(0, 0, 0, .65);
  color-scheme: dark;
}

/* Cualquier elemento con [hidden] se oculta siempre */
[hidden] { display: none !important; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.4;
  background: var(--bg);
  color: var(--text);
  /* Hueco para que el botón de abajo no tape contenido */
  padding-bottom: calc(110px + env(safe-area-inset-bottom));
  overscroll-behavior-y: contain;
  transition: background .25s, color .25s;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  touch-action: manipulation; /* evita el retraso/zoom por doble toque */
}

/* Iconos dibujados: todos con el mismo grosor */
.ic {
  width: 22px; height: 22px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}

/* ---------- Cabecera ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
}
.topbar-row { display: flex; align-items: center; gap: 12px; max-width: 640px; margin: 0 auto; }
.brand-logo { width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; box-shadow: var(--shadow); }
.topbar-text { flex: 1; min-width: 0; }
.topbar-label { margin: 0; font-size: 14px; font-weight: 600; color: var(--muted); }
.topbar-label::first-letter { text-transform: uppercase; }
.topbar h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.icon-btn {
  width: 46px; height: 46px;
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}
.icon-btn:active { transform: scale(.94); }

/* ---------- Tarjeta azul de arriba: lo que toca hoy + anillo de progreso ---------- */
.hero {
  max-width: 616px;
  margin: 4px auto 0;
  margin-left: max(12px, calc(50% - 308px));
  margin-right: max(12px, calc(50% - 308px));
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: var(--on-brand);
  box-shadow: var(--shadow);
}
.hero-txt { flex: 1; min-width: 0; }
.hero-plan { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .03em; opacity: .9; }
.hero-progress { margin: 4px 0 0; font-size: 18px; font-weight: 800; line-height: 1.25; }
.ring { width: 64px; height: 64px; flex-shrink: 0; position: relative; }
.ring svg { width: 64px; height: 64px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; }
.ring-bg { stroke: currentColor; opacity: .25; }
.ring-fg { stroke: currentColor; stroke-linecap: round; transition: stroke-dashoffset .6s cubic-bezier(.2, .8, .2, 1); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px; font-weight: 800; }

/* ---------- Avisos ---------- */
.banner {
  max-width: 616px;
  margin: 12px auto 0;
  margin-left: max(12px, calc(50% - 308px));
  margin-right: max(12px, calc(50% - 308px));
  background: var(--pending-soft);
  border-radius: 16px;
  padding: 14px;
}
.banner-offline { background: var(--brand-soft); color: var(--brand); font-weight: 700; }

/* ---------- Secciones ---------- */
main {
  max-width: 640px;
  margin: 0 auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section { display: flex; flex-direction: column; gap: 10px; }
.section-head { display: flex; align-items: center; }
.section-toggle {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 0 4px;
}
.section-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex-shrink: 0; }
.section-icon .ic { width: 20px; height: 20px; }
.section-title { margin: 0; font-size: 19px; font-weight: 800; flex: 1; min-width: 0; letter-spacing: -.01em; }
.chev { width: 20px; height: 20px; color: var(--muted); transition: transform .2s; }
.collapsed .chev { transform: rotate(-90deg); }

.count {
  font-size: 14px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--pending-soft);
  color: var(--pending);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.count.all-done { background: var(--done-soft); color: var(--done); }
.count.zero { background: var(--soft); color: var(--muted); }

.collapsed .section-body { display: none; }
.section-body { display: flex; flex-direction: column; gap: 12px; }

.empty {
  margin: 0;
  padding: 18px;
  border-radius: 18px;
  background: var(--card);
  color: var(--muted);
  font-size: 16px;
  box-shadow: var(--shadow);
}

/* ---------- Parada / restaurante (tarjeta) ---------- */
.rest-group {
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 14px;
  transition: opacity .4s;
}
.rest-name { margin: 0 0 6px; display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; }
.rest-name .ic { color: var(--brand); }
.stop-num {
  width: 30px; height: 30px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  flex-shrink: 0;
  transition: background .3s, color .3s;
}
.rest-group.complete .stop-num { background: var(--done); color: #fff; }
.stop-tag { margin-left: auto; font-size: 12px; font-weight: 800; padding: 4px 9px; border-radius: 99px; background: var(--pending-soft); color: var(--pending); }
.rest-group.complete .stop-tag { background: var(--done-soft); color: var(--done); }

.order { padding: 8px 0 0; }
.order + .order { margin-top: 8px; border-top: 1px dashed var(--border); }
.order-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.zone { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 800; color: var(--muted); }
.zone .ic { width: 18px; height: 18px; }
.status { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 99px; }
.status-nuevo { background: var(--pending-soft); color: var(--pending); }
.status-pedido { background: var(--brand-soft); color: var(--brand); }
.status-entregado { background: var(--done-soft); color: var(--done); }
.order-who { margin: 4px 0 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.order-ordered { margin: -2px 0 6px; color: var(--brand); font-weight: 800; }
.badge { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; letter-spacing: .02em; }
.badge-aligro { background: var(--brand-soft); color: var(--brand); }
.badge-almacen { background: var(--pending-soft); color: var(--pending); }

/* ---------- Productos de un pedido ---------- */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.item { border-top: 1px solid var(--border); }
.order .list .item:first-child { border-top: 0; }
.item-main {
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  text-align: left;
}
.item-main:disabled { cursor: default; color: inherit; }
.item-body { flex: 1; min-width: 0; }
.item-text { display: block; font-size: 17px; font-weight: 700; word-break: break-word; transition: color .3s; }
.item-sub { display: block; margin-top: 1px; font-size: 14px; color: var(--muted); }
.item-qty { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Foto del producto (de Aligro) o, si no hay, el icono de su familia */
.thumb {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: #fff;                /* las fotos de Aligro tienen fondo blanco */
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; padding: 3px; transition: opacity .3s, filter .3s; }
.thumb-icon { background: var(--soft); color: var(--muted); }
.thumb-icon .ic { width: 26px; height: 26px; }

/* Círculo para marcar: al tocar se rellena de verde y sale el ✓ dibujándose */
.check {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2.5px solid var(--border);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background .25s, border-color .25s;
}
.check svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .3s .05s; }
.item.done .check { background: var(--done); border-color: var(--done); }
.item.just.done .check { animation: pop .35s; }   /* solo el que se acaba de tocar */
.item.done .check svg { stroke-dashoffset: 0; }
.item.done .item-text { color: var(--muted); text-decoration: line-through; }
.item.done .thumb img { opacity: .45; filter: grayscale(1); }
.item-main:active .check { transform: scale(.9); }
@keyframes pop { 0% { transform: scale(.7); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* Lista de solo lectura (Ninon, jefes, cocineros): sin círculo y más compacta */
.item.readonly .item-main { min-height: 0; }
.item.readonly .check { display: none; }
.item.readonly .thumb { width: 44px; height: 44px; border-radius: 12px; }
.item.readonly .item-text { font-size: 16px; }

/* ---------- Pan y basura: botones grandes por tipo ---------- */
.task-label { margin: 12px 0 8px; display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.task-label .ic { width: 16px; height: 16px; }
.task-none { margin: 4px 0; display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--muted); }
.task-none .ic { width: 18px; height: 18px; }
.trash-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.trash-chip {
  flex: 1 1 140px;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  background: var(--card);
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  transition: background .2s, border-color .2s, color .2s;
}
.trash-chip .ic { color: var(--pending); }
.trash-chip:active { transform: scale(.97); }
.trash-chip.done { background: var(--done-soft); border-color: transparent; color: var(--done); }
.trash-chip.done .ic { color: var(--done); }
.trash-chip.just.done .ic { animation: pop .35s; }
.trash-chip:disabled { opacity: .7; cursor: default; }
/* Opcional ("si hace falta"): borde discontinuo y en gris */
.trash-chip.optional:not(.done) { border-style: dashed; color: var(--muted); }
.trash-chip.optional:not(.done) .ic { color: var(--muted); }

/* ---------- Tira de días ---------- */
.day-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day-btn {
  min-height: 64px;
  padding: 6px 0 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  position: relative;
  transition: background .2s, color .2s;
}
.day-name { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.day-num { font-size: 19px; font-weight: 800; }
.day-btn.has::after {           /* punto: ese día toca algo */
  content: '';
  position: absolute;
  bottom: 6px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--brand);
}
.day-btn.selected { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.day-btn.selected .day-name { color: inherit; opacity: .7; }
.day-btn.selected.has::after { background: var(--on-ink); }
.day-hint { margin: 0 4px; }

/* "✓ Hecho hoy (n)" plegable */
.done-toggle {
  width: 100%;
  min-height: 50px;
  border-radius: 16px;
  background: var(--done-soft);
  color: var(--done);
  font-weight: 800;
  font-size: 15px;
}
.done-toggle::after { content: '  ▾'; }
.done-toggle.open::after { content: '  ▴'; }

/* ---------- Almacén y caducidades ---------- */
.stock-alert {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 15px;
  font-weight: 800;
  text-align: left;
}
.stock-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: left;
}
.stock-info { flex: 1; min-width: 0; }
.stock-name { display: block; font-size: 16px; font-weight: 800; word-break: break-word; }
.stock-low { display: inline-flex; align-items: center; gap: 4px; margin-top: 5px; font-size: 12px; font-weight: 800; color: var(--pending); background: var(--pending-soft); padding: 3px 9px; border-radius: 99px; }
.stock-badge { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 800; }
.stock-badge::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--done); }
.stock-soon .stock-badge { color: var(--pending); }
.stock-soon .stock-badge::before { background: var(--pending); }
.stock-expired .stock-badge { color: var(--danger); }
.stock-expired .stock-badge::before { background: var(--danger); }
.stock-expired { box-shadow: inset 0 0 0 2px var(--danger), var(--shadow); }
.stock-none .stock-badge { color: var(--muted); }
.stock-none .stock-badge::before { background: var(--border); }

/* ---------- Barra inferior: un solo botón grande ---------- */
.bottombar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 60%, transparent);
  display: flex;
  justify-content: center;
}
.btn-bar {
  width: 100%;
  max-width: 608px;
  min-height: 62px;
  border-radius: 20px;
  background: var(--ink);
  color: var(--on-ink);
  font-size: 19px;
  box-shadow: 0 10px 24px -8px rgba(10, 16, 40, .5);
}
.btn-bar .ic { width: 24px; height: 24px; }

/* ---------- Botones genéricos ---------- */
.btn {
  min-height: 56px;
  padding: 0 18px;
  border-radius: 16px;
  font-size: 17px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  transition: transform .1s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { cursor: default; }
.btn-blue { background: var(--brand); color: var(--on-brand); }
.btn-green { background: var(--done); color: #fff; }
.btn-ghost { background: var(--soft); color: var(--text); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-block { width: 100%; }
a.btn { text-decoration: none; }
.btn-order { background: var(--ink); color: var(--on-ink); }
.btn-order-link { background: var(--pending-soft); color: var(--pending); }
.btn-left { justify-content: flex-start; text-align: left; }
.btn-soft { background: var(--brand-soft); color: var(--brand); }

/* ---------- Hoja inferior ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--backdrop);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s;
}
.sheet-backdrop.open { opacity: 1; }
.sheet {
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  background: var(--bg);
  color: var(--text);
  border-radius: 26px 26px 0 0;
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform .26s cubic-bezier(.2, .8, .2, 1);
}
.sheet-backdrop.open .sheet { transform: none; }
.sheet { overscroll-behavior: contain; }
.sheet.dragging { transition: none; }
/* Asa para arrastrar: zona grande (todo el ancho) y siempre visible arriba */
.sheet-grab {
  position: sticky;
  top: -8px;
  z-index: 3;
  margin: -8px -16px 0;
  padding: 10px 0 12px;
  background: var(--bg);
  border-radius: 26px 26px 0 0;
  touch-action: none;
  cursor: grab;
}
.sheet-handle { width: 44px; height: 5px; margin: 0 auto; border-radius: 99px; background: var(--muted); opacity: .5; }
/* Con una hoja abierta, lo de detrás no se mueve */
html.sheet-open, html.sheet-open body { overflow: hidden; }
.sheet-title { margin: 4px 0 12px; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }

.field-label { display: block; margin: 16px 0 8px; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.input {
  width: 100%;
  padding: 14px;
  font: inherit;
  font-size: 18px; /* ≥16px evita el zoom automático en iPhone */
  color: var(--text);
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 14px;
}
.input:focus { outline: none; border-color: var(--brand); }
textarea.input { resize: vertical; min-height: 84px; }

.row { display: flex; gap: 8px; }
.row .input { flex: 1; min-width: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 48px;
  padding: 10px 16px;
  border-radius: 99px;
  border: 1.5px solid var(--border);
  background: var(--card);
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip:active { transform: scale(.96); }
.chip.selected { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.hint { margin: 6px 0 0; font-size: 15px; color: var(--muted); }

.lang-chips { display: grid; grid-template-columns: 1fr 1fr; }
.theme-chips { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.theme-chips .chip { justify-content: center; padding: 10px 8px; }

.checkline { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 16px; font-weight: 600; }
.checkline input { width: 24px; height: 24px; accent-color: var(--brand); }

.sheet-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }

/* Restaurante fijo (cocineros) en la hoja de pedido */
.fixed-rest { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; }
.fixed-rest .ic { color: var(--brand); }

/* ---------- Hoja de pedido ---------- */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.tab {
  min-height: 52px;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  background: var(--card);
  font-size: 17px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.tab.selected { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }

.search-box { position: relative; margin-top: 14px; display: block; }
.search-box .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-input { padding-left: 46px; }

.prod-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.prod-list > .cat-head, .prod-list > .hint, .prod-list > .field-label { grid-column: 1 / -1; }
.cat-head {
  margin: 10px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.cat-head .ic { width: 18px; height: 18px; color: var(--brand); }
.prod-list .cat-head:first-child { margin-top: 0; }

.prod {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  outline: 2px solid transparent;
  outline-offset: -2px;
  transition: outline-color .2s;
}
.prod.has-qty { outline-color: var(--brand); }
.prod .thumb { width: 100%; height: auto; aspect-ratio: 1; max-width: 100%; border-radius: 12px; border: 0; }
.prod .thumb img { padding: 8px; }
.prod .thumb-icon .ic { width: 40px; height: 40px; }
.prod-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.prod-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.prod-meta { font-size: 12px; color: var(--muted); line-height: 1.3; }

.stepper { display: flex; align-items: center; justify-content: space-between; background: var(--soft); border-radius: 14px; padding: 3px; }
.step {
  width: 42px; height: 42px;
  border-radius: 11px;
  background: var(--card);
  color: var(--text);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}
.step .ic { width: 20px; height: 20px; }
.step-plus { background: var(--brand); color: var(--on-brand); }
.step:active { transform: scale(.9); }
.step-num { min-width: 30px; text-align: center; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bump { animation: pop .3s; }

/* ✕ para borrar un producto añadido a mano */
.prod-del {
  position: absolute;
  top: 6px; right: 6px;
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--card);
  color: var(--muted);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}
.prod-del .ic { width: 16px; height: 16px; }

/* Botón guardar siempre visible al final de la hoja */
.sticky-actions {
  position: sticky;
  bottom: calc(-20px - env(safe-area-inset-bottom));
  background: var(--bg);
  padding: 10px 0 calc(20px + env(safe-area-inset-bottom));
  margin-bottom: calc(-20px - env(safe-area-inset-bottom));
  box-shadow: 0 -10px 12px -10px rgba(0, 0, 0, .25);
}

/* ---------- Resumen ---------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { padding: 14px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.stat-big { background: var(--done-soft); box-shadow: none; }
.stat-wide { grid-column: span 2; }
.stat-num { font-size: 34px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-num small { font-size: 18px; color: var(--muted); font-weight: 700; }
.stat-label { margin-top: 6px; font-size: 14px; font-weight: 700; color: var(--muted); }

.sum-list { list-style: none; margin: 0; padding: 0; }
.sum-list li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.sum-list b { display: block; }
.sum-meta { font-size: 14px; color: var(--muted); }
.tag { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 99px; margin-left: 6px; }
.tag-done { background: var(--done-soft); color: var(--done); }
.tag-pending { background: var(--pending-soft); color: var(--pending); }

/* ---------- "No había" en Aligro ---------- */
.item.has-miss { display: flex; align-items: center; gap: 6px; }
.item.has-miss .item-main { flex: 1; min-width: 0; }
.miss-btn {
  flex-shrink: 0;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}
.miss-btn.on { background: var(--danger); border-color: var(--danger); color: #fff; }
.item.missing .item-text { color: var(--danger); text-decoration: line-through; }
.item.missing .thumb img { opacity: .4; filter: grayscale(1); }
.item.missing .check { border-color: var(--danger); }
.miss-tag { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; padding: 2px 8px; border-radius: 99px; background: var(--danger-soft); color: var(--danger); font-size: 12px; font-weight: 800; }
.miss-tag .ic { width: 14px; height: 14px; }

/* ---------- Tarjeta "Activa los avisos" ---------- */
.push-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; background: var(--brand-soft); color: var(--text); text-align: left; width: 100%; }
.push-card > .ic { width: 28px; height: 28px; color: var(--brand); }
.push-card b { display: block; font-size: 15px; }
.push-card small { display: block; font-size: 13px; color: var(--muted); }
.push-card .btn { min-height: 40px; padding: 0 14px; font-size: 14px; flex-shrink: 0; }

/* ---------- Almacén: West Wing / Viva Voce ---------- */
.owner-head { margin: 6px 0 0; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.owner-head .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--brand); }
.owner-head.vv .dot { background: var(--gold); }
.stock-row.vv { box-shadow: inset 4px 0 0 var(--gold), var(--shadow); }

/* ---------- Pedir con foto ---------- */
.photo-add {
  width: 100%;
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1.5px dashed var(--border);
  background: var(--card);
  text-align: left;
}
.photo-add > .ic { width: 30px; height: 30px; color: var(--brand); }
.photo-add b { display: block; font-size: 16px; }
.photo-add small { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }
.photo-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.photo-row { display: flex; align-items: center; gap: 10px; }
.photo-row .input { flex: 1; min-width: 0; font-size: 16px; padding: 12px; }
.photo-row .thumb img { object-fit: cover; padding: 0; }
.photo-row .prod-del { position: static; flex-shrink: 0; }
.item.has-photo { display: flex; align-items: center; gap: 12px; }
.item.has-photo .item-main { flex: 1; min-width: 0; }
.thumb-photo { color: var(--brand); background: var(--brand-soft); }
.thumb-photo img { object-fit: cover; padding: 0; }
.photo-big { width: 100%; border-radius: 18px; background: var(--soft); min-height: 200px; }
.cat-top .ic { color: var(--gold); }

/* ---------- Estadísticas ---------- */
.stats-3 { grid-template-columns: repeat(3, 1fr); margin-top: 14px; }
.stats-3 .stat-num { font-size: 28px; }
.stat-spend { margin-top: 10px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--on-brand); box-shadow: var(--shadow); }
.stat-spend .stat-label { color: inherit; opacity: .85; }
.stat-bad { background: var(--danger-soft); color: var(--danger); box-shadow: none; }
.stat-card { margin-top: 10px; padding: 12px 14px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.stat-sub { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.35; }
.bar-row { display: flex; flex-direction: column; gap: 5px; }
.bar-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.bar-name { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-val { color: var(--muted); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-track { height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.bar-fill { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .7s cubic-bezier(.2, .8, .2, 1); }
.week-chart { margin-top: 10px; height: 150px; padding: 12px 10px 8px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; }
.week-col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.week-fill { width: 100%; max-width: 28px; height: 0; min-height: 2px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--brand-2), var(--brand)); transition: height .7s cubic-bezier(.2, .8, .2, 1); }
.week-n { font-size: 12px; font-weight: 800; }
.week-day { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: capitalize; }

/* ---------- Aviso temporal ---------- */
.toast {
  position: fixed;
  left: 16px; right: 16px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 60;
  max-width: 608px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 700;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  animation: toastIn .25s cubic-bezier(.2, .8, .2, 1);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Pantalla de entrada ---------- */
.login {
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 440px;
  margin: 0 auto;
  padding: calc(48px + env(safe-area-inset-top)) 20px calc(30px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}
.login-logo { width: 88px; height: 88px; margin: 0 auto; border-radius: 24px; box-shadow: 0 12px 28px -10px rgba(29, 58, 143, .6); }
.login-title { margin: 16px 0 4px; text-align: center; font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.login-hint { margin: 0 0 8px; text-align: center; color: var(--muted); font-size: 16px; }
.login-form .btn { margin-top: 20px; min-height: 58px; font-size: 18px; }
.login-error {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 700;
}
.login-langs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; padding-top: 28px; }

/* Quien prefiera menos movimiento en el móvil: sin animaciones */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
