/* =====================================================================
   DULCES RAÍCES · Punto de venta (web sin npm)
   Paleta cálida (café, naranja, rosa) sobre fondo crema. Para tablet.
   ===================================================================== */
:root {
  /* Marca */
  --cafe: #6f4a2e;
  --cafe-oscuro: #573a24;
  --cafe-bg: #f3ebe2;
  --naranja: #d9994b;
  --naranja-oscuro: #bd7f33;
  --naranja-bg: #fbeed6;
  --rosa: #d385ac;
  --rosa-oscuro: #bd6b95;
  --rosa-bg: #fbe7f0;

  /* Neutros (crema) */
  --bg: #faf5ee;
  --surface: #ffffff;
  --surface-2: #fbf7f1;
  --line: #ece2d5;
  --line-fuerte: #ddccb9;

  /* Texto */
  --ink: #2c2018;
  --ink-soft: #5b4a3c;
  --muted: #9a897a;

  /* Estado */
  --ok: #4f7a37;
  --ok-bg: #eef4e7;
  --danger: #b23b3b;
  --danger-bg: #fbeceb;

  --radio: 14px;
  --radio-sm: 10px;
  --sombra: 0 1px 3px rgba(90, 60, 30, 0.05);
  --sombra-card: 0 2px 4px rgba(90, 60, 30, 0.04), 0 10px 24px rgba(90, 60, 30, 0.07);
  /* Serif cálida para encabezados (todas de sistema, nada externo) */
  --display: Georgia, 'Iowan Old Style', 'Palatino Linotype', 'Times New Roman', serif;

  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}
* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body {
  background:
    radial-gradient(1100px 520px at 84% -14%, rgba(217, 153, 75, 0.08), transparent 60%),
    radial-gradient(900px 520px at -5% 0%, rgba(211, 133, 172, 0.05), transparent 55%),
    var(--bg);
}

/* Barras de scroll finas y temáticas (en toda la app) */
* { scrollbar-width: thin; scrollbar-color: var(--line-fuerte) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: var(--line-fuerte); border-radius: 999px;
  border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
/* Los inputs SIEMPRE con el color de texto del tema (si no, salen negros y en
   modo oscuro se pierden sobre el fondo oscuro). */
input, textarea, select { font-family: inherit; color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--muted); }
button, .tab, .producto-card, .chip { -webkit-tap-highlight-color: transparent; user-select: none; }

/* --------------------------- Botones --------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px; border-radius: var(--radio);
  font-size: 1rem; font-weight: 600;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: translateY(0) scale(0.985); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.btn-primario { background: var(--cafe); color: #fff; box-shadow: 0 3px 10px rgba(111, 74, 46, 0.22); }
.btn-primario:hover:not(:disabled) { background: var(--cafe-oscuro); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(111, 74, 46, 0.28); }
.btn-exito { background: var(--ok); color: #fff; box-shadow: 0 3px 10px rgba(79, 122, 55, 0.22); }
.btn-exito:hover:not(:disabled) { background: #446a2f; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(79, 122, 55, 0.28); }
.btn-secundario { background: var(--surface); color: var(--ink); border: 1px solid var(--line-fuerte); }
.btn-secundario:hover:not(:disabled) { border-color: var(--cafe); }
.btn-bloque { width: 100%; }

/* --------------------------- Campos --------------------------- */
.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo > span { font-size: 0.85rem; font-weight: 500; color: var(--muted); }
.campo input, .campo select {
  font-family: inherit; font-size: 1.05rem; padding: 12px 14px;
  border: 1px solid var(--line-fuerte); border-radius: var(--radio-sm);
  background: var(--surface); color: var(--ink); min-height: 48px;
  width: 100%; min-width: 0;
}
.campo input:focus, .campo select:focus { outline: none; border-color: var(--cafe); }

/* --------------------------- Modal --------------------------- */
.modal-fondo {
  position: fixed; inset: 0; background: rgba(40, 25, 12, 0.34);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100;
}
.modal {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 12px 40px rgba(60, 35, 10, 0.18);
  width: 100%; max-width: 460px; max-height: 90vh;
  overflow-x: hidden; overflow-y: auto; padding: 24px;
}
.modal h2 { font-size: 1.3rem; margin-bottom: 16px; }

/* Mini-menú de opción (ej. café Normal / Descafeinado) */
.modal-opcion { max-width: 380px; text-align: center; }
.modal-opcion h2 { margin-bottom: 4px; }
.opcion-sub { color: var(--muted); margin: 0 0 18px; font-size: 0.95rem; }
.opcion-btns { display: flex; flex-direction: column; gap: 10px; }
.opcion-btns .btn { min-height: 58px; font-size: 1.05rem; }
.opcion-btns .btn small { font-weight: 500; opacity: 0.85; font-size: 0.82rem; }
/* Elegir a cuál producto va un extra: lista con scroll si son muchos */
.extra-destinos { max-height: 54vh; overflow-y: auto; padding: 2px; }
.extra-destinos .extra-suelto { border-style: dashed; margin-top: 4px; }

/* --------------------------- Chips / filtros --------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--line-fuerte); font-weight: 600; font-size: 0.92rem;
  color: var(--ink-soft); white-space: nowrap;
  transition: transform 0.1s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.chip:hover { border-color: var(--cafe); box-shadow: var(--sombra); }
.chip:active { transform: scale(0.96); }
.chip.activo { background: var(--cafe); border-color: var(--cafe); color: #fff; }
.chip-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.chip.activo .chip-dot { background: rgba(255, 255, 255, 0.85) !important; }

.badge-modo {
  display: inline-flex; align-items: center; gap: 7px; font-size: 0.78rem; font-weight: 600;
  color: #fbeed6; padding: 5px 11px; border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px; background: rgba(255, 255, 255, 0.14);
}
.badge-modo::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--naranja); }

.vacio {
  text-align: center; color: var(--muted); padding: 44px 20px; font-size: 1rem;
  grid-column: 1 / -1;
}

/* =====================================================================
   ARMAZÓN (cabecera + pestañas + contenido)
   ===================================================================== */
.app { height: 100%; display: flex; flex-direction: column; }
.cabecera {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 26px;
  background: linear-gradient(135deg, #7c5536, var(--cafe) 48%, var(--cafe-oscuro));
  border-bottom: 1px solid var(--cafe-oscuro);
  box-shadow: 0 2px 12px rgba(60, 35, 10, 0.14);
}
.marca { display: flex; align-items: baseline; gap: 12px; }
.marca h1 { font-size: 1.75rem; font-style: italic; color: #fdf6ec; line-height: 1; }
.marca-sub {
  font-family: system-ui, sans-serif; font-size: 0.8rem; color: var(--naranja); font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
}
.cabecera-derecha { display: flex; align-items: center; gap: 12px; }

.pestanas {
  display: flex; gap: 4px; padding: 0 16px; background: var(--surface);
  border-bottom: 1px solid var(--line); overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch;
}
.pestanas::-webkit-scrollbar { display: none; }
.tab {
  padding: 14px 18px; font-size: 0.98rem; font-weight: 500; color: var(--muted);
  white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px;
  flex-shrink: 0;
}
.tab:hover { color: var(--cafe); }
.tab.activa { color: var(--cafe); font-weight: 700; border-bottom-color: var(--cafe); }
.tab-badge {
  display: inline-grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px; background: var(--cafe); color: #fff; font-size: 0.72rem; font-weight: 800;
  margin-left: 5px; vertical-align: middle; line-height: 1;
}

.contenido { flex: 1; min-height: 0; overflow: hidden; background: var(--bg); padding: 20px; }

/* Placeholder de pantallas aún no hechas */
.proximamente {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; text-align: center; color: var(--muted);
}
.proximamente .pc-emoji { font-size: 2.6rem; }
.proximamente h2 { color: var(--ink); font-size: 1.3rem; }
.proximamente p { max-width: 360px; margin: 0; }

/* =====================================================================
   PANTALLA VENDER
   ===================================================================== */
.vender { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 20px; }
.vender-productos { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.vender-filtros { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.vender-buscar {
  font-family: inherit; font-size: 1rem; padding: 12px 16px;
  border: 1px solid var(--line-fuerte); border-radius: var(--radio-sm); background: var(--surface);
}
.vender-buscar:focus { outline: none; border-color: var(--cafe); }
.vender-categorias { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }

.vender-subfam { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.vender-subfam:empty { display: none; }
.chip.mini { padding: 6px 12px; font-size: 0.82rem; }

.grid-productos {
  flex: 1; min-height: 0; overflow-y: auto; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 200px)); gap: 10px;
  align-content: start; align-items: start; justify-content: center; padding: 3px 2px;
}

/* ---- Ficha compacta (producto y promoción). Menos alto = menos scroll ---- */
.tile {
  position: relative; background: var(--surface);
  border: 1px solid var(--line); border-left: 3px solid var(--acento, var(--line-fuerte));
  border-radius: var(--radio-sm); padding: 10px 12px;
  display: block; text-align: left; width: 100%; box-sizing: border-box;
  height: 196px; box-shadow: var(--sombra); cursor: pointer; /* altura FIJA: la grid no puede encimar filas */
  transition: border-color 0.14s ease, transform 0.12s ease, box-shadow 0.16s ease;
}
.tile:hover { box-shadow: var(--sombra-card); transform: translateY(-2px); }
.tile:active { transform: translateY(0) scale(0.98); }
.tile.agotado { opacity: 0.5; cursor: default; }
.tile.agotado:hover { transform: none; box-shadow: var(--sombra); }
.tile.en-carrito { border-color: var(--cafe); box-shadow: 0 0 0 2px var(--cafe-bg); }
/* Apilado en flujo NORMAL (block): imagen, nombre y precio uno debajo de otro.
   Nada de flex vertical (los <button> lo colapsan). Solo el precio+stock usa
   flex en fila, que sí funciona. Así el nombre y el precio siempre aparecen. */
.tile-inner { display: block; }
.tile-body { display: block; min-width: 0; }
.tile-img { display: block; width: 100%; height: 76px; border-radius: 10px; overflow: hidden; margin-bottom: 8px; }
.tile-img .prod-img { display: block; width: 100%; height: 76px; border-radius: 10px; object-fit: cover; }
.tile-img .prod-img-vacia {
  display: flex; align-items: center; justify-content: center;
  background: var(--acento-bg, var(--surface-2)); border: none; color: var(--acento, var(--muted));
}
.tile-img .prod-img-vacia .piv-inicial { font-size: 2.1rem; font-weight: 800; opacity: 0.85; }
.tile-tag {
  display: inline-block; max-width: 100%; border-radius: 999px; padding: 3px 9px;
  background: var(--surface-2); font-size: 0.64rem; font-weight: 700; letter-spacing: 0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 8px;
}
.tile-nom {
  display: block; overflow: hidden; height: 2.44em; /* reserva 2 líneas exactas: todas las fichas miden igual */
  font-weight: 600; font-size: 0.94rem; line-height: 1.22; color: var(--ink); margin: 1px 0 3px;
}
.tile-desc {
  display: block; overflow: hidden; max-height: 2.4em;
  font-size: 0.76rem; color: var(--ink-soft); line-height: 1.2; margin-bottom: 3px;
}
.tile-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.tile-precio { font-weight: 800; font-size: 1.1rem; color: var(--ink); }
.tile-stock {
  display: inline-block; background: var(--surface-2); border-radius: 999px; padding: 2px 8px;
  font-size: 0.66rem; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.tile-stock.agotado { color: var(--danger); background: var(--danger-bg); }
.tile-stock.disponible { color: var(--naranja-oscuro); background: var(--naranja-bg); }
.tile-badge {
  position: absolute; top: -8px; right: -8px; min-width: 23px; height: 23px; padding: 0 6px;
  border-radius: 999px; background: var(--cafe); color: #fff; font-size: 0.8rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
}
.tile-thumb { position: absolute; top: 8px; right: 8px; }
.tile-thumb .prod-img { width: 34px; height: 34px; border-radius: 8px; }
.tile.boli .tile-tag { font-weight: 800; }
.tile-promo { background: var(--naranja-bg); }
.tile-promo .tile-nom { font-weight: 700; }
.pt-stock.disponible { color: var(--muted); font-weight: 500; font-size: 0.82rem; }

/* =====================================================================
   PULIDO FINAL · sombras suaves y foco cálido (menos "tech", más café)
   ===================================================================== */
.vender-carrito, .panel, .productos-tabla, .promo-item, .venta-card,
.resumen-card, .cad-fila, .kiosko-pedido { box-shadow: var(--sombra); }
.vender-buscar:focus, .campo input:focus, .campo select:focus {
  box-shadow: 0 0 0 3px rgba(111, 74, 46, 0.10);
}
/* Encabezados de sección un poco más presentes */
.promos-barra h2, .productos-barra h2, .ventas-barra h2, .cad-barra h2,
.reporte-barra h2, .panel h2, .carrito-cabecera h2 { font-size: 1.3rem; }
/* La marca del ticket también en serif cálida */
.tk-negocio { font-family: var(--display); }

/* =====================================================================
   MODO OSCURO (noche) · colores cálidos, no negro frío
   ===================================================================== */
:root[data-theme="dark"] {
  --bg: #191410;
  --surface: #242019;
  --surface-2: #2d2820;
  --line: #3a342c;
  --line-fuerte: #4b443a;
  --ink: #f1e9dd;
  --ink-soft: #cdbfab;
  --muted: #9c8e7c;
  --cafe: #b0824f;
  --cafe-oscuro: #966b3c;
  --cafe-bg: #2f2820;
  --naranja: #e0a75e;
  --naranja-oscuro: #cf9143;
  --naranja-bg: #37301f;
  --rosa: #db8fb2;
  --rosa-oscuro: #c672a0;
  --rosa-bg: #35242c;
  --ok: #79ad57;
  --ok-bg: #263019;
  --danger: #e07b7b;
  --danger-bg: #382220;
  --sombra: 0 1px 3px rgba(0, 0, 0, 0.35);
  --sombra-card: 0 2px 6px rgba(0, 0, 0, 0.30), 0 12px 28px rgba(0, 0, 0, 0.45);
}
:root[data-theme="dark"] body {
  background:
    radial-gradient(1100px 520px at 84% -14%, rgba(217, 153, 75, 0.10), transparent 60%),
    radial-gradient(900px 520px at -5% 0%, rgba(211, 133, 172, 0.06), transparent 55%),
    var(--bg);
}
/* Fondos pastel que van en estilo en línea: se neutralizan en oscuro */
:root[data-theme="dark"] .paquete-card { background: var(--surface-2) !important; }
:root[data-theme="dark"] .tile.boli { background: var(--surface) !important; }
:root[data-theme="dark"] .tile-promo { background: var(--surface-2); }

/* =====================================================================
   TEMPORADAS · acento en el encabezado + partículas sutiles
   ===================================================================== */
.cabecera { position: relative; }
.cabecera::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  opacity: 0; transition: opacity 0.3s ease; pointer-events: none;
}
[data-temporada="halloween"] .cabecera::before { opacity: 1; background: linear-gradient(90deg, #e07b1a, #6a3fb0, #e07b1a); }
[data-temporada="navidad"] .cabecera::before { opacity: 1; background: linear-gradient(90deg, #c62828, #2e7d32, #c62828); }
[data-temporada="ano-nuevo"] .cabecera::before { opacity: 1; background: linear-gradient(90deg, #d4af37, #fff3c4, #d4af37); }
[data-temporada="san-valentin"] .cabecera::before { opacity: 1; background: linear-gradient(90deg, #e84a8a, #ff9ec4, #e84a8a); }
[data-temporada="patrio"] .cabecera::before { opacity: 1; background: linear-gradient(90deg, #0a7d3b 33%, #f4f4f4 33% 66%, #d1112a 66%); }
[data-temporada="verano"] .cabecera::before { opacity: 1; background: linear-gradient(90deg, #f7b733, #4fc3f7, #f7b733); }

/* Banner de ambiente QA (imposible de confundir) */
.qa-banner {
  background: repeating-linear-gradient(45deg, #f4b400, #f4b400 14px, #d99a00 14px, #d99a00 28px);
  color: #1c1206; font-weight: 800; text-align: center; padding: 7px 12px;
  font-size: 0.88rem; letter-spacing: 0.02em; flex-shrink: 0;
  border-bottom: 1px solid #b98600;
}

/* Botones del encabezado (noche / ajustes) */
.btn-ajustes {
  width: 42px; height: 42px; border-radius: 11px; font-size: 1.15rem; line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.12); color: #fdf6ec;
  display: grid; place-items: center; flex-shrink: 0;
}
.btn-ajustes:hover { background: rgba(255, 255, 255, 0.2); }

/* Campana de avisos (órdenes listas para entregar) */
.btn-campana {
  position: relative; width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.12); color: #fdf6ec;
  display: grid; place-items: center;
}
.btn-campana:hover { background: rgba(255, 255, 255, 0.2); }
.btn-campana svg { width: 20px; height: 20px; display: block; }
.btn-campana.tiene { background: var(--naranja); border-color: var(--naranja); color: #3a2410; animation: campana-tin 1.4s ease-in-out infinite; }
.campana-num {
  position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px;
  background: var(--danger); color: #fff; border-radius: 10px; font-size: 0.72rem; font-weight: 800;
  display: none; align-items: center; justify-content: center; line-height: 1; box-shadow: 0 0 0 2px var(--cafe);
}
.btn-campana.tiene .campana-num { display: flex; }
@keyframes campana-tin {
  0%, 100% { transform: rotate(0); } 20% { transform: rotate(-11deg); }
  40% { transform: rotate(9deg); } 60% { transform: rotate(-6deg); } 80% { transform: rotate(3deg); }
}

/* Panel de la campana */
.modal-campana { max-width: 440px; }
.modal-campana h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.modal-campana h2 svg { width: 22px; height: 22px; }
.campana-lista { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; margin-bottom: 14px; }
.campana-fila {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--surface-2); border: 1px solid var(--line); border-left: 5px solid var(--ok); border-radius: var(--radio-sm);
}
.cf-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cf-tit { font-weight: 700; color: var(--ink); }
.cf-meta { font-size: 0.82rem; color: var(--muted); }
.cf-entregar { flex-shrink: 0; padding: 0 16px; min-height: 44px; }
.campana-vacia { text-align: center; color: var(--muted); padding: 28px 12px; margin-bottom: 12px; }

/* Aviso emergente (toast) */
.dr-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 24px);
  display: flex; align-items: center; gap: 10px; z-index: 200; cursor: pointer;
  background: var(--ok); color: #fff; padding: 13px 20px; border-radius: 999px; font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); opacity: 0; transition: opacity 0.3s ease, transform 0.3s ease;
  max-width: 90vw;
}
.dr-toast.visible { opacity: 1; transform: translate(-50%, 0); }
.dr-toast svg { width: 20px; height: 20px; flex-shrink: 0; }

/* Ventana de Ajustes */
.modal-ajustes { max-width: 400px; }
.modal-ajustes .aj-fila { margin-bottom: 4px; }
.modal-ajustes .campo { margin-top: 12px; }

/* Tarjeta de paquete */
.paquete-card {
  border: 1.5px solid; border-radius: var(--radio); padding: 15px; display: flex;
  flex-direction: column; gap: 6px; text-align: left; min-height: 168px; width: 100%;
  box-shadow: var(--sombra);
  transition: transform 0.14s ease, box-shadow 0.18s ease;
}
.paquete-card:hover { box-shadow: var(--sombra-card); transform: translateY(-2px); }
.paquete-card:active { transform: translateY(0) scale(0.98); }
.pk-badge { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.pk-nombre { font-weight: 700; font-size: 1.05rem; line-height: 1.2; color: var(--ink); }
.pk-desc { font-size: 0.84rem; color: var(--ink-soft); line-height: 1.25; }
.pk-precio { margin-top: auto; font-weight: 800; font-size: 1.4rem; }

/* Imagen de producto con respaldo */
.prod-img { display: block; object-fit: cover; background: var(--surface-2); }
.prod-img-vacia {
  display: grid; place-items: center; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--muted);
}
.piv-inicial { font-size: 1.5rem; font-weight: 700; }

/* Carrito */
.vender-carrito {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio);
  display: flex; flex-direction: column; min-height: 0;
}
.carrito-cabecera {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 12px; border-bottom: 1px solid var(--line);
}
.carrito-cabecera h2 { font-size: 1.1rem; color: var(--ink); }
.carrito-vaciar { color: var(--muted); font-weight: 500; font-size: 0.88rem; padding: 6px 8px; border-radius: 8px; }
.carrito-vaciar:hover { color: var(--danger); }
.carrito-lista { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 14px; }
.carrito-vacio { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); text-align: center; padding: 24px; }
.cv-icono { font-size: 2.2rem; opacity: 0.65; }
.carrito-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 8px; border-radius: 10px; border-bottom: 1px solid var(--line);
  transition: background 0.12s ease;
}
.carrito-item:hover { background: var(--surface-2); }
.carrito-item:last-child { border-bottom: none; }
.carrito-item .ci-img { width: 42px; height: 42px; border-radius: 8px; flex-shrink: 0; }
.ci-cuerpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ci-linea1 { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ci-nombre { font-weight: 600; font-size: 0.92rem; line-height: 1.25; }
.ci-extra-de { display: block; font-weight: 600; font-size: 0.74rem; color: var(--rosa-oscuro); margin-top: 2px; }
.ci-linea2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ci-precio { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.ci-controles { display: flex; align-items: center; gap: 4px; }
.ci-btn {
  width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line-fuerte);
  background: var(--surface); font-size: 1.2rem; font-weight: 700; color: var(--cafe);
  display: grid; place-items: center; flex-shrink: 0;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.ci-btn:hover { border-color: var(--cafe); background: var(--cafe-bg); }
.ci-btn:active { transform: scale(0.92); }
.ci-cant { min-width: 24px; text-align: center; font-weight: 700; font-size: 1rem; color: var(--ink); }
.ci-subtotal { font-weight: 800; text-align: right; white-space: nowrap; color: var(--cafe-oscuro); }
.ci-quitar { color: var(--muted); font-size: 0.9rem; padding: 0 2px; flex-shrink: 0; line-height: 1; }
.ci-quitar:hover { color: var(--danger); }
.carrito-pie { padding: 16px 18px; border-top: 1px solid var(--line); }
.carrito-total { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.carrito-total span { font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; font-size: 0.8rem; }
.carrito-total strong { font-size: 1.8rem; font-weight: 800; color: var(--cafe); }
.carrito-cobrar { min-height: 58px; font-size: 1.1rem; }
.carrito-botones { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.carrito-botones .btn { min-height: 56px; padding: 0 8px; }
.carrito-cuenta { font-size: 0.95rem; }
.carrito-cabecera.mesa { align-items: center; }
.carrito-cabecera.mesa h2 { font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-salir-mesa {
  padding: 8px 12px; border-radius: 8px; font-size: 0.82rem; font-weight: 700; flex-shrink: 0;
  color: var(--cafe); border: 1px solid var(--line-fuerte); background: var(--surface); white-space: nowrap;
}
.btn-salir-mesa:hover { border-color: var(--cafe); background: var(--cafe-bg); }

/* ---- Letrero grande cuando atiendes una MESA (imposible confundirse) ---- */
.vender-root { height: 100%; display: flex; flex-direction: column; gap: 14px; }
.vender-root > .vender { height: auto; flex: 1; min-height: 0; }
.mesa-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-shrink: 0;
  background: linear-gradient(135deg, #2f9f74, #1f7a58); color: #fff;
  border-radius: var(--radio); padding: 12px 18px; box-shadow: 0 4px 14px rgba(31, 122, 88, 0.28);
}
.mesa-bar-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mesa-bar-icono { font-size: 1.7rem; flex-shrink: 0; }
.mesa-bar-txt { min-width: 0; display: flex; flex-direction: column; }
.mesa-bar-txt .mb-tit { font-weight: 800; font-size: 1.15rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mesa-bar-txt .mb-sub { font-size: 0.82rem; opacity: 0.92; }
.mesa-bar-salir {
  padding: 10px 16px; border-radius: 10px; font-weight: 700; font-size: 0.9rem; white-space: nowrap;
  background: rgba(255, 255, 255, 0.95); color: #1f7a58; flex-shrink: 0;
}
.mesa-bar-salir:hover { background: #fff; }
/* Refuerzo: el carrito se enmarca en verde cuando hay mesa */
.vender-root.en-mesa .vender-carrito { border-color: #2f9f74; box-shadow: 0 0 0 2px rgba(47, 159, 116, 0.30); }
.carrito-cabecera.mesa { background: rgba(47, 159, 116, 0.10); border-radius: var(--radio) var(--radio) 0 0; }
.carrito-cabecera.mesa h2 { color: #1f7a58; }

/* =====================================================================
   PANTALLA PEDIDOS a domicilio
   ===================================================================== */
.pedidos { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.pedidos-barra { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.pedidos-barra h2 { font-size: 1.2rem; color: var(--ink); }
.pedidos-acciones { display: flex; gap: 8px; }

/* ---- Picker: elegir productos por familia / subfamilia ---- */
.picker { display: flex; flex-direction: column; gap: 8px; }
.picker-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.picker-chips:empty { display: none; }
.picker-chips[data-fila="sub"] { padding-left: 2px; }
.picker-chip {
  flex: 0 0 auto; border: 1px solid var(--line-fuerte); background: var(--surface);
  color: var(--ink-soft); border-radius: 999px; padding: 7px 14px; font-size: 0.9rem;
  font-weight: 600; white-space: nowrap; cursor: pointer;
}
.picker-chips[data-fila="sub"] .picker-chip { font-size: 0.84rem; padding: 5px 12px; background: var(--surface-2); }
.picker-chip.activo { background: var(--cafe); border-color: var(--cafe); color: #fff; }
.picker-buscar {
  width: 100%; border: 1px solid var(--line-fuerte); border-radius: var(--radio-sm);
  padding: 10px 12px; font-size: 0.95rem; background: var(--surface); color: var(--ink);
}
.picker-lista {
  max-height: 340px; overflow-y: auto; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; padding: 8px 4px;
}
/* En el picker (pedidos/paquetes) las fichas NO llevan foto: su propia altura
   compacta, no la de 206px del POS. Fija para que la grid no encime filas. */
.picker-lista .tile { height: 116px; }
.picker-lista .tile .tile-img { display: none; }
/* La insignia de cantidad va DENTRO de la ficha (no en -8px), para que no se
   salga del modal ni se recorte en la columna de la derecha. */
.picker-lista .tile .tile-badge { top: 6px; right: 6px; }
.picker-lista .tile.en-carrito .tile-tag { max-width: calc(100% - 30px); }
.picker-vacio { grid-column: 1 / -1; color: var(--muted); text-align: center; padding: 18px; }
.pedidos-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; align-content: start; }
.pedido-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio); padding: 16px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--sombra); }
.pedido-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pedido-codigo { font-family: var(--display); font-weight: 800; font-size: 1.15rem; color: var(--cafe); }
.pedido-total { font-weight: 800; font-size: 1.15rem; color: var(--naranja-oscuro); white-space: nowrap; }
.pedido-estado { font-size: 0.78rem; font-weight: 700; color: var(--naranja-oscuro); }
.pedido-cliente { font-weight: 600; color: var(--ink); }
.pedido-meta { font-size: 0.8rem; color: var(--muted); }
.pedido-acciones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

/* Nuevo pedido (filas con cantidad) */
.modal-nuevo-pedido { max-width: 560px; }
.np-fila { display: grid; grid-template-columns: 1.6fr 70px 72px 78px 30px; gap: 8px; align-items: center; }
.np-nombre { font-weight: 600; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-cant { font-family: inherit; font-size: 1rem; padding: 8px; border: 1px solid var(--line-fuerte); border-radius: 8px; background: var(--surface); min-height: 42px; text-align: right; width: 100%; }
.np-cant:focus { outline: none; border-color: var(--cafe); }
.np-precio { color: var(--muted); font-size: 0.85rem; text-align: right; }
.np-sub { font-weight: 700; text-align: right; font-size: 0.92rem; }
@media (max-width: 520px) { .np-fila { grid-template-columns: 1fr 1fr; } .np-nombre { grid-column: 1 / -1; } }

/* Modal ver / compartir pedido */
.modal-pedido { max-width: 460px; }
.pedido-img { margin-bottom: 14px; border-radius: var(--radio); overflow: hidden; box-shadow: var(--sombra); }
.pd-canvas { width: 100%; height: auto; display: block; }
.pedido-share { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; margin-bottom: 12px; }
.pedido-share .btn { min-height: 50px; }
@media (max-width: 460px) { .pedido-share { grid-template-columns: 1fr; } }

@media (max-width: 900px) {
  .vender { grid-template-columns: 1fr; grid-template-rows: 1fr auto; overflow-y: auto; }
  .vender-carrito { max-height: 50vh; }
}

/* =====================================================================
   VENTANA DE COBRO
   ===================================================================== */
.modal-cobro { max-width: 420px; }
.cobro-total {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radio);
  padding: 18px; margin-bottom: 18px;
}
.cobro-total span { font-weight: 500; color: var(--muted); font-size: 0.9rem; }
.cobro-total strong { font-size: 2.4rem; font-weight: 700; color: var(--ink); line-height: 1; }
.cobro-metodos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.cobro-metodos.tres { grid-template-columns: repeat(3, 1fr); }
.cobro-metodo {
  min-height: 54px; border-radius: var(--radio-sm); border: 1px solid var(--line-fuerte);
  background: var(--surface); font-size: 1.02rem; font-weight: 500; color: var(--muted);
  padding: 6px 4px; line-height: 1.15;
}
.cobro-metodos.tres .cobro-metodo { font-size: 0.92rem; }
.cobro-metodo.activo { border-color: var(--cafe); color: var(--cafe); font-weight: 700; }
.cobro-efectivo { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.cobro-rapidos { display: flex; flex-wrap: wrap; gap: 8px; }
.cobro-cambio {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--ok-bg); border-radius: var(--radio-sm); padding: 12px 18px;
}
.cobro-cambio span { font-weight: 500; color: var(--ok); }
.cobro-cambio strong { font-size: 1.6rem; font-weight: 700; color: var(--ok); }
.cobro-cambio.falta { background: var(--danger-bg); }
.cobro-cambio.falta span, .cobro-cambio.falta strong { color: var(--danger); }
.cobro-acciones { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }

/* Selector de canal (Mostrador / Uber / DiDi / Rappi) */
.cobro-canales { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 16px; }
.cobro-canal {
  min-height: 46px; border-radius: var(--radio-sm); border: 1px solid var(--line-fuerte);
  background: var(--surface); font-size: 0.82rem; font-weight: 600; color: var(--muted); padding: 4px 2px;
}
.cobro-canal.activo { border-color: var(--cafe); color: var(--cafe); font-weight: 700; background: var(--cafe-bg); }
@media (max-width: 420px) { .cobro-canales { grid-template-columns: repeat(2, 1fr); } }

/* Vista de delivery (prepagado) */
.cobro-delivery { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radio); padding: 14px 16px; margin-bottom: 16px; }
.cd-fila { display: flex; align-items: center; justify-content: space-between; font-size: 0.95rem; color: var(--ink-soft); padding: 3px 0; }
.cd-fila strong { color: var(--danger); }
.cd-fila.neto { border-top: 1px solid var(--line-fuerte); margin-top: 6px; padding-top: 8px; color: var(--ink); }
.cd-fila.neto strong { color: var(--ok); font-size: 1.3rem; }
.cd-nota { margin: 8px 0 0; font-size: 0.82rem; color: var(--muted); }

/* =====================================================================
   PANTALLA MESAS / CUENTAS ABIERTAS
   ===================================================================== */
.mesas { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.mesas-barra { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.mesas-barra h2 { font-size: 1.3rem; color: var(--ink); }
.mesas-grid {
  flex: 1; min-height: 0; overflow-y: auto; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; align-content: start;
}
.mesa-card {
  background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--cafe);
  border-radius: var(--radio); padding: 16px; display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--sombra);
}
.mesa-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mesa-nombre { font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.mesa-total { font-weight: 800; font-size: 1.25rem; color: var(--cafe-oscuro); white-space: nowrap; }
.mesa-meta { font-size: 0.82rem; color: var(--muted); }
.mesa-acciones { display: flex; gap: 8px; margin-top: 4px; }
.mesa-abrir { flex: 1; min-height: 44px; }

/* Carrito en modo mesa */
.carrito-cabecera.mesa { background: var(--cafe-bg); }
.carrito-cabecera.mesa h2 { color: var(--cafe-oscuro); }
.carrito-cabecera.mesa .carrito-vaciar { color: var(--cafe); font-weight: 700; }
.carrito-cabecera.mesa .carrito-vaciar:hover { color: var(--cafe-oscuro); }

/* Badge de mesa en el cobro */
.cobro-mesa-badge {
  background: var(--cafe-bg); color: var(--cafe-oscuro); font-weight: 700;
  border-radius: var(--radio-sm); padding: 10px 14px; margin-bottom: 16px; text-align: center;
}

.modal-cobro.exito { text-align: center; }
.exito-check {
  width: 60px; height: 60px; margin: 0 auto 12px; display: grid; place-items: center;
  border-radius: 50%; background: var(--ok-bg); color: var(--ok); font-size: 2rem; font-weight: 700;
}
.modal-cobro.exito h2 { margin-bottom: 16px; }
.exito-cambio { background: var(--ok-bg); border-radius: var(--radio); padding: 16px; margin-bottom: 18px; }
.exito-cambio span { display: block; font-weight: 500; color: var(--ok); font-size: 0.9rem; }
.exito-cambio strong { font-size: 2.4rem; font-weight: 700; color: var(--ok); }
.ticket-preview { margin: 6px 0 18px; max-height: 38vh; overflow-y: auto; }

/* =====================================================================
   TICKET / RECIBO (imprimible)
   ===================================================================== */
.ticket-print {
  width: 280px; margin: 0 auto; background: #fff; color: #111;
  font-family: 'Courier New', ui-monospace, monospace; font-size: 12.5px; line-height: 1.4;
  padding: 14px 16px; border: 1px dashed var(--line-fuerte); border-radius: 8px;
}
.tk-encabezado { text-align: center; margin-bottom: 6px; }
.tk-negocio { display: block; font-size: 17px; font-weight: 700; letter-spacing: 0.02em; }
.tk-sub { font-size: 11px; }
.tk-meta { text-align: center; font-size: 11px; }
.tk-folio { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.tk-consumo { text-align: center; font-size: 12px; font-weight: 700; margin-top: 4px; }
.tk-linea { border-top: 1px dashed #999; margin: 8px 0; }
.tk-item { display: flex; gap: 6px; margin-bottom: 3px; }
.tk-cant { flex-shrink: 0; }
.tk-nombre { flex: 1; word-break: break-word; }
.tk-precio { flex-shrink: 0; }
.tk-total { display: flex; justify-content: space-between; font-size: 15px; font-weight: 700; }
.tk-pago { margin-top: 6px; font-size: 12px; }
.tk-pago > div { display: flex; justify-content: space-between; }
.tk-metodo { margin-top: 6px; text-align: center; }
.tk-pie { text-align: center; margin-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.tk-pie span { font-size: 11px; }

@media print {
  body * { visibility: hidden !important; }
  .ticket-print, .ticket-print * { visibility: visible !important; }
  .ticket-print {
    position: absolute; left: 0; top: 0; width: 80mm;
    border: none; border-radius: 0; padding: 4mm; margin: 0;
  }
}

/* =====================================================================
   PIEZAS COMPARTIDAS (botón kiosko, interruptor, botones chicos, paneles)
   ===================================================================== */
.btn-kiosko {
  padding: 9px 16px; border-radius: var(--radio-sm);
  border: 1px solid var(--naranja); background: var(--naranja);
  color: #4a2f16; font-weight: 700; font-size: 0.92rem;
}
.btn-kiosko:hover { background: var(--naranja-oscuro); border-color: var(--naranja-oscuro); }

/* Interruptor (switch) para mostrar/ocultar */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-pista {
  width: 44px; height: 26px; border-radius: 999px; background: var(--line-fuerte);
  position: relative; flex-shrink: 0; transition: background 0.18s ease;
}
.switch-pista::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.18s ease;
}
.switch input:checked + .switch-pista { background: var(--ok); }
.switch input:checked + .switch-pista::after { transform: translateX(18px); }
.switch-texto { font-size: 0.92rem; font-weight: 600; color: var(--ink-soft); }

/* Botón chico de acción (Editar / Borrar / Ver ticket) */
.mini-btn {
  padding: 8px 12px; border-radius: 8px; font-size: 0.88rem; font-weight: 500;
  color: var(--ink-soft); border: 1px solid var(--line-fuerte); background: var(--surface);
}
.mini-btn:hover { border-color: var(--cafe); }
.mini-btn.peligro { color: var(--danger); border-color: #eccfca; }
.mini-btn.peligro:hover { background: var(--danger-bg); }

/* Panel reutilizable (Entradas / Merma) */
.dos-columnas { height: 100%; display: grid; grid-template-columns: minmax(320px, 430px) 1fr; gap: 20px; overflow-y: auto; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio);
  padding: 22px; display: flex; flex-direction: column; min-height: 0;
}
.panel h2 { font-size: 1.2rem; color: var(--ink); }
.panel-sub { margin: 6px 0 18px; color: var(--muted); font-size: 0.9rem; }
.form-vertical { display: flex; flex-direction: column; gap: 14px; }
.linea-stock { margin: -4px 0 0; font-size: 0.9rem; color: var(--muted); }
.linea-stock strong { color: var(--ink); }
.fila-doble { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fila-doble > * { min-width: 0; }
.campo-ayuda { margin: -4px 0 2px; font-size: 0.8rem; color: var(--muted); }
@media (max-width: 460px) { .fila-doble { grid-template-columns: 1fr; } }

.aviso { border-radius: var(--radio-sm); padding: 12px 14px; font-weight: 500; font-size: 0.92rem; }
.aviso.ok { background: var(--ok-bg); color: var(--ok); }
.aviso.error { background: var(--danger-bg); color: var(--danger); }
.merma-aviso-stock {
  margin: -6px 0 0; font-size: 0.85rem; font-weight: 500; color: var(--naranja-oscuro);
  background: var(--naranja-bg); border-radius: var(--radio-sm); padding: 9px 12px;
}

/* Historial (Entradas / Merma) */
.panel-historial { overflow: hidden; }
.lista-historial { flex: 1; min-height: 0; overflow-y: auto; margin-top: 8px; }
.hist-fila {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 4px; border-bottom: 1px solid var(--line);
}
.hist-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hist-nombre { font-weight: 600; }
.hist-meta { font-size: 0.8rem; color: var(--muted); }
.hist-cant { font-weight: 800; font-size: 1.1rem; white-space: nowrap; }
.hist-cant.mas { color: var(--ok); }
.hist-cant.menos { color: var(--danger); }
.ef-fechas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.ef-fecha {
  font-size: 0.74rem; font-weight: 600; color: var(--ink-soft);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px;
}
.ef-fecha.cad { color: var(--naranja-oscuro); background: var(--naranja-bg); border-color: #f0d79f; }
.mf-motivo {
  align-self: flex-start; font-size: 0.74rem; font-weight: 700; color: var(--rosa-oscuro);
  background: var(--rosa-bg); border: 1px solid #f2d3e3; border-radius: 999px; padding: 2px 9px; margin-top: 2px;
}

@media (max-width: 820px) { .dos-columnas { grid-template-columns: 1fr; } }

/* =====================================================================
   PANTALLA PROMOCIONES
   ===================================================================== */
.promos { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.promos-barra { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.promos-barra h2 { font-size: 1.2rem; color: var(--ink); }
.promos-grid {
  flex: 1; min-height: 0; overflow-y: auto; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; align-content: start;
}
.promo-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio);
  padding: 16px; display: flex; flex-direction: column; gap: 9px;
}
.promo-item.oculto { background: var(--surface-2); border-style: dashed; opacity: 0.72; }
.promo-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.promo-nombre { font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.promo-precio { font-weight: 800; font-size: 1.25rem; color: var(--naranja-oscuro); white-space: nowrap; }
.promo-desc { margin: 0; font-size: 0.88rem; color: var(--muted); }
.promo-incluye { display: flex; flex-direction: column; gap: 5px; }
.promo-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px;
  font-size: 0.85rem; font-weight: 500; color: var(--ink-soft);
}
.promo-chip-nom { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.promo-chip-precio { display: inline-flex; align-items: baseline; gap: 6px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.promo-chip-precio s { color: var(--muted); font-weight: 500; }
.promo-ahorro {
  align-self: flex-start; font-size: 0.78rem; font-weight: 700; color: var(--ok);
  background: var(--ok-bg); border-radius: 999px; padding: 3px 10px;
}
.promo-pie {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line);
}
.promo-acciones { display: flex; gap: 8px; }

/* Editor de paquete */
.modal-paquete { max-width: 560px; }
.form-paquete { display: flex; flex-direction: column; gap: 14px; }
.pq-visible { align-self: flex-start; }
.pq-editor {
  display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line);
  border-radius: var(--radio); padding: 12px; background: var(--surface-2);
}
.comp-titulo { font-size: 0.85rem; font-weight: 700; color: var(--ink-soft); }
.der { text-align: right; }
.pq-cabecera, .pq-fila {
  display: grid; grid-template-columns: 1.6fr 56px 68px 82px 78px 32px; gap: 8px; align-items: center;
}
.pq-cabecera {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--muted); padding: 0 2px;
}
.pq-nombre { font-weight: 600; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pq-cant, .pq-precio {
  font-family: inherit; font-size: 0.95rem; padding: 8px; border: 1px solid var(--line-fuerte);
  border-radius: 8px; background: var(--surface); min-height: 40px; width: 100%;
}
.pq-cant:focus, .pq-precio:focus { outline: none; border-color: var(--cafe); }
.pq-normal { color: var(--muted); font-size: 0.9rem; }
.pq-subtotal { font-weight: 700; color: var(--ink); font-size: 0.92rem; }
.pq-vacio { margin: 6px 2px; color: var(--muted); font-size: 0.9rem; }
.pq-agregar {
  font-family: inherit; font-size: 0.95rem; font-weight: 600; color: var(--cafe);
  padding: 10px 12px; border: 1px dashed var(--line-fuerte); border-radius: 8px; background: var(--surface); margin-top: 4px;
}
.pq-agregar:focus { outline: none; border-color: var(--cafe); }
.comp-quitar { width: 32px; height: 32px; border-radius: 8px; color: var(--muted); justify-self: center; }
.comp-quitar:hover { color: var(--danger); background: var(--danger-bg); }
.pq-total {
  display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line);
  border-radius: var(--radio); padding: 14px 16px; background: var(--cafe-bg);
}
.pq-total-fila { display: flex; align-items: center; justify-content: space-between; font-size: 0.92rem; color: var(--ink-soft); }
.pq-total-fila s { color: var(--muted); }
.pq-total-fila.ahorro { color: var(--ok); font-weight: 700; }
.pq-total-fila.grande { font-size: 1.1rem; color: var(--ink); padding-top: 6px; border-top: 1px solid var(--line-fuerte); }
.pq-total-fila.grande strong { font-size: 1.4rem; color: var(--cafe-oscuro); }

@media (max-width: 540px) {
  .pq-cabecera { display: none; }
  .pq-fila {
    grid-template-columns: 1fr 1fr; gap: 6px 8px; padding: 10px;
    border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  }
  .pq-nombre { grid-column: 1 / -1; }
  .comp-quitar { justify-self: end; }
}

/* =====================================================================
   PANTALLA PRODUCTOS
   ===================================================================== */
.productos { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.productos-barra { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.productos-barra h2 { font-size: 1.2rem; color: var(--ink); }
.productos-acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.recarga-lista { margin: 4px 0 10px; padding-left: 20px; color: var(--ink); line-height: 1.7; }
.productos-tabla {
  flex: 1; min-height: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radio); display: flex; flex-direction: column; overflow: hidden;
}
.pt-cabecera, .pt-fila {
  display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.4fr) 100px 100px 150px;
  align-items: center; gap: 12px; padding: 12px 18px;
}
.pt-cabecera {
  border-bottom: 1px solid var(--line); font-size: 0.78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted);
}
.pt-cuerpo { flex: 1; min-height: 0; overflow-y: auto; }
.pt-fila { border-bottom: 1px solid var(--line); }
.pt-fila:last-child { border-bottom: none; }
.pt-fila:hover { background: var(--surface-2); }
.pt-nombre { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.pt-fila .pt-img { width: 40px; height: 40px; border-radius: 8px; flex-shrink: 0; }
.pt-cat { color: var(--ink-soft); font-size: 0.9rem; display: flex; flex-direction: column; gap: 2px; }
.pt-subfam { font-size: 0.75rem; color: var(--muted); }
.pt-precio { font-weight: 700; color: var(--ink); }
.pt-stock { font-weight: 600; }
.pt-stock.bajo { color: var(--danger); }
.pt-acciones { display: flex; gap: 6px; justify-content: flex-end; }

.form-producto { display: flex; flex-direction: column; gap: 14px; }
.fila-imagen { display: flex; gap: 12px; align-items: flex-start; }
.fila-imagen .fp-preview { width: 64px; height: 64px; border-radius: 10px; flex-shrink: 0; object-fit: cover; }
.crece { flex: 1; min-width: 0; }
.fp-botones { display: flex; gap: 8px; margin: 4px 0 8px; flex-wrap: wrap; }
.fp-subir { cursor: pointer; display: inline-flex; align-items: center; }
.fp-estado { display: block; margin-top: 6px; font-size: 0.82rem; color: var(--ok); font-weight: 600; }

@media (max-width: 700px) {
  .pt-cabecera, .pt-fila { padding: 10px 12px; gap: 8px; font-size: 0.92rem; }
}

/* =====================================================================
   PANTALLA VENTAS DEL DÍA
   ===================================================================== */
.ventas { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.ventas-barra { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ventas-barra h2 { font-size: 1.2rem; color: var(--ink); }
.ventas-resumen { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 16px; }
.resumen-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 4px;
}
.resumen-card.destacada { background: var(--cafe); border-color: var(--cafe-oscuro); }
.rc-etiqueta { font-size: 0.8rem; font-weight: 500; color: var(--muted); }
.resumen-card.destacada .rc-etiqueta { color: #e7d3bf; }
.rc-valor { font-size: 1.6rem; font-weight: 700; color: var(--ink); line-height: 1.1; }
.rc-valor.chico { font-size: 1.15rem; }
.resumen-card.destacada .rc-valor { color: #fff; }
.ventas-lista { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.venta-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio); padding: 14px 16px; }
.venta-card.cancelada { opacity: 0.6; }
.venta-cab { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.venta-folio { font-weight: 700; color: var(--cafe); }
.venta-hora { color: var(--muted); font-size: 0.9rem; }
.venta-metodo, .venta-origen {
  font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--ink-soft); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px;
}
.venta-anulada {
  font-size: 0.74rem; font-weight: 700; color: var(--danger); background: var(--danger-bg);
  border-radius: 999px; padding: 2px 9px;
}
.venta-total { margin-left: auto; font-size: 1.2rem; font-weight: 700; color: var(--ink); }
.venta-card.cancelada .venta-total { text-decoration: line-through; }
.venta-items { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.vi { font-size: 0.82rem; color: var(--ink-soft); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.venta-acciones { display: flex; gap: 8px; }
.modal-ticket { max-width: 340px; }
.modal-ticket .cobro-acciones { margin-top: 16px; }

/* =====================================================================
   MODO KIOSKO (pantalla completa)
   ===================================================================== */
.kiosko { height: 100%; display: flex; flex-direction: column; background: var(--bg); }
.kiosko-cab {
  display: flex; align-items: center; justify-content: space-between; padding: 18px 26px;
  background: var(--cafe); color: #fdf6ec;
}
.kiosko-cab h1 { font-size: 1.7rem; color: #fdf6ec; }
.kiosko-cab p { margin: 4px 0 0; color: var(--naranja); font-weight: 600; }
.kiosko-salir {
  padding: 10px 18px; border-radius: var(--radio-sm); border: 1px solid rgba(255,255,255,0.4);
  color: #fdf6ec; font-weight: 600;
}
.kiosko-salir:hover { background: rgba(255,255,255,0.12); }
.kiosko-cuerpo { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 360px; gap: 20px; padding: 20px; }
.kiosko-productos { display: flex; flex-direction: column; min-height: 0; }
.kiosko-categorias { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 12px; }
.chip-grande { padding: 12px 20px; font-size: 1.05rem; }
.kiosko-grid {
  flex: 1; min-height: 0; overflow-y: auto; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 220px)); gap: 16px; align-content: start; align-items: start; justify-content: center;
}
.kiosko-pedido {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio);
  display: flex; flex-direction: column; min-height: 0; padding: 18px;
}
.kiosko-pedido h2 { font-size: 1.25rem; color: var(--ink); margin-bottom: 8px; }
.kiosko-lista { flex: 1; min-height: 0; overflow-y: auto; }
.kp-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.kp-info { display: flex; flex-direction: column; min-width: 0; }
.kp-nombre { font-weight: 600; }
.kp-precio { font-size: 0.8rem; color: var(--muted); }
.kp-controles { display: flex; align-items: center; gap: 6px; }
.kiosko-pie { padding-top: 14px; border-top: 1px solid var(--line); }
.kiosko-finalizar { min-height: 60px; font-size: 1.15rem; }

.kiosko-confirm { height: 100%; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.kc-caja {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 34px; text-align: center; max-width: 420px; width: 100%;
}
.kc-check {
  width: 66px; height: 66px; margin: 0 auto 14px; display: grid; place-items: center;
  border-radius: 50%; background: var(--ok-bg); color: var(--ok); font-size: 2.2rem; font-weight: 700;
}
.kc-caja h1 { font-size: 1.6rem; color: var(--ink); }
.kc-instruccion { color: var(--muted); margin: 10px 0 6px; }
.kc-numero { font-size: 3.4rem; font-weight: 800; color: var(--cafe); margin: 6px 0 14px; }
.kc-ticket { max-height: 34vh; overflow-y: auto; margin-bottom: 18px; }
.kc-botones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

@media (max-width: 820px) {
  .kiosko-cuerpo { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .kiosko-pedido { max-height: 46vh; }
}

/* =====================================================================
   PAQUETES: renglón "a elegir", aviso sin stock y selector de piezas
   ===================================================================== */
.pq-add-fila { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
@media (max-width: 460px) { .pq-add-fila { grid-template-columns: 1fr; } }

.pq-grupo-tag {
  display: inline-block; font-size: 0.68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.03em; color: var(--rosa-oscuro); background: var(--rosa-bg);
  border: 1px solid #f2d3e3; border-radius: 999px; padding: 1px 7px; margin-right: 4px;
}
.promo-sinstock {
  font-size: 0.8rem; font-weight: 600; color: var(--naranja-oscuro);
  background: var(--naranja-bg); border-radius: 8px; padding: 6px 10px;
}

/* Mini-selector de piezas al vender un paquete "a elegir" */
.modal-selector { max-width: 460px; }
.sel-fijos {
  margin: 0 0 14px; font-size: 0.88rem; color: var(--ink-soft);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px;
}
.sel-linea {
  border: 1px solid var(--line); border-radius: var(--radio); padding: 12px 14px;
  margin-bottom: 12px; background: var(--surface-2);
}
.sel-linea-cab { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.sel-linea-tit { font-weight: 700; color: var(--ink); font-size: 0.98rem; }
.sel-contador {
  font-size: 0.78rem; font-weight: 700; color: var(--naranja-oscuro);
  background: var(--naranja-bg); border-radius: 999px; padding: 2px 10px; white-space: nowrap;
}
.sel-contador.ok { color: var(--ok); background: var(--ok-bg); }
.sel-fila {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 2px; border-bottom: 1px solid var(--line);
}
.sel-fila:last-child { border-bottom: none; }
.sel-nom { display: flex; flex-direction: column; font-weight: 600; font-size: 0.92rem; }
.sel-stock { font-size: 0.74rem; font-weight: 500; color: var(--muted); }
.sel-controles { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.modal-selector .cobro-acciones { margin-top: 4px; }

/* =====================================================================
   COMBO · desplegable con buscador (combo.js)
   ===================================================================== */
.combo-campo {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-width: 0; min-height: 48px; padding: 12px 14px;
  border: 1px solid var(--line-fuerte); border-radius: var(--radio-sm);
  background: var(--surface); color: var(--ink); font-size: 1.05rem; text-align: left;
}
.combo-campo:hover { border-color: var(--cafe); }
.combo-campo:focus-visible { outline: none; border-color: var(--cafe); box-shadow: 0 0 0 3px rgba(111, 74, 46, 0.12); }
.combo-campo-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-campo-txt.ph { color: var(--muted); }
.combo-flecha { color: var(--muted); font-size: 0.9rem; flex-shrink: 0; }

.combo-panel {
  position: fixed; z-index: 200; background: var(--surface);
  border: 1px solid var(--line-fuerte); border-radius: var(--radio);
  box-shadow: 0 12px 34px rgba(60, 35, 10, 0.20);
  max-height: 300px; display: flex; flex-direction: column; overflow: hidden;
}
.combo-buscar {
  font-family: inherit; font-size: 1rem; padding: 12px 14px; border: none;
  border-bottom: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  outline: none; width: 100%; flex-shrink: 0;
}
.combo-lista { flex: 1; min-height: 0; overflow-y: auto; padding: 6px; -webkit-overflow-scrolling: touch; }
.combo-op {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 12px; border-radius: 8px; cursor: pointer;
}
.combo-op:hover { background: var(--cafe-bg); }
.combo-op-lbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.combo-op-sub { flex-shrink: 0; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.combo-nuevo .combo-op-lbl { color: var(--cafe); font-weight: 600; }
.combo-nuevo .combo-op-sub {
  color: var(--naranja-oscuro); background: var(--naranja-bg);
  border-radius: 999px; padding: 1px 8px; font-size: 0.7rem; text-transform: uppercase;
}
.combo-vacio { padding: 16px 12px; text-align: center; color: var(--muted); font-size: 0.92rem; }

/* =====================================================================
   DINERO: costo, propina, merma valorada, reportes
   ===================================================================== */
/* Fila de 3 columnas (Precio / Costo / Stock) */
.fila-triple { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.fila-triple > * { min-width: 0; }
@media (max-width: 520px) { .fila-triple { grid-template-columns: 1fr 1fr; } }

/* Costo en la tabla de productos */
.pt-costo { display: block; font-size: 0.72rem; font-weight: 500; color: var(--muted); }

/* Merma: valor a costo en el formulario y en el historial */
.merma-valor { margin: -6px 0 0; font-size: 0.9rem; color: var(--ink-soft); }
.merma-valor strong { color: var(--danger); }
.merma-total {
  display: flex; align-items: baseline; gap: 8px; margin-top: 6px; padding: 10px 12px;
  background: var(--danger-bg); border-radius: var(--radio-sm);
}
.merma-total span { color: var(--danger); font-weight: 600; font-size: 0.9rem; }
.merma-total strong { color: var(--danger); font-size: 1.3rem; font-weight: 800; margin-left: auto; }
.merma-total-pz { margin-left: 0 !important; color: var(--muted) !important; font-weight: 500 !important; }
.hist-der { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.hist-montos { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.hist-acciones { display: flex; gap: 6px; }
.hist-acciones .mini-btn { padding: 5px 9px; font-size: 0.8rem; }
.hist-dinero { font-size: 0.82rem; font-weight: 700; color: var(--danger); }

/* Cobro: propina */
.cobro-total small { display: block; margin-top: 4px; font-size: 0.82rem; color: var(--muted); font-weight: 500; }
.cobro-propina {
  display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--radio); background: var(--surface-2);
}
.cobro-propina-tit { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.cobro-propina-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.cobro-propina-otro { display: flex; align-items: center; gap: 8px; }
.cobro-propina-otro span { font-size: 0.9rem; color: var(--muted); font-weight: 600; }
.cobro-propina-otro input {
  flex: 1; min-width: 0; font-family: inherit; font-size: 1rem; padding: 10px 12px;
  border: 1px solid var(--line-fuerte); border-radius: var(--radio-sm); background: var(--surface); min-height: 44px;
}
.cobro-propina-otro input:focus { outline: none; border-color: var(--cafe); }

/* Ticket: desglose venta/propina */
.tk-sub2 { display: flex; justify-content: space-between; font-size: 12px; }

/* Ventas del día: propina en la tarjeta */
.venta-propina { display: block; font-size: 0.72rem; font-weight: 600; color: var(--naranja-oscuro); }

/* =====================================================================
   REPORTES (admin)
   ===================================================================== */
.reporte { height: 100%; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.reporte-barra { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.reporte-barra h2 { font-size: 1.2rem; color: var(--ink); }
.reporte-tabs { display: flex; gap: 8px; }
.reporte-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px;
}
.reporte-grid.chico { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.rc-sub { font-size: 0.76rem; color: var(--muted); margin-top: 2px; }
.resumen-card.destacada .rc-sub { color: #e7d3bf; }
.resumen-card.rosa .rc-valor { color: var(--rosa-oscuro); }
.resumen-card.negativa .rc-valor { color: var(--danger); }
.reporte-sub-tit { font-size: 1rem; color: var(--ink-soft); margin: 4px 0 10px; }
.reporte-nota {
  margin: 8px 0 0; font-size: 0.85rem; color: var(--ink-soft); line-height: 1.5;
  background: var(--cafe-bg); border-radius: var(--radio); padding: 12px 14px;
}

/* Candado de Reportes (PIN) */
.rep-lock { height: 100%; display: grid; place-items: center; padding: 24px; }
.rep-lock-caja {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 34px; text-align: center; max-width: 380px; width: 100%;
}
.rep-lock-icono { font-size: 2.4rem; }
.rep-lock-caja h2 { margin-top: 8px; font-size: 1.4rem; color: var(--ink); }
.rep-lock-caja > p { color: var(--muted); margin: 8px 0 18px; }
.rep-lock-form { display: flex; flex-direction: column; gap: 10px; }
.rep-lock-form input {
  font-family: inherit; font-size: 1.3rem; text-align: center; letter-spacing: 0.3em;
  padding: 14px; border: 1px solid var(--line-fuerte); border-radius: var(--radio-sm); background: var(--surface-2);
}
.rep-lock-form input:focus { outline: none; border-color: var(--cafe); }
.rep-lock-error { color: var(--danger); font-weight: 600; font-size: 0.9rem; margin: 12px 0 0; }
.rep-lock-nota { color: var(--muted); font-size: 0.78rem; margin: 16px 0 0; }

/* Ventana de PIN de administrador (Admin.pedir) */
.modal-admin { max-width: 360px; text-align: center; }
.modal-admin .rep-lock-icono { font-size: 2.2rem; }
.modal-admin h2 { margin: 6px 0 4px; }
.modal-admin-sub { color: var(--muted); margin: 0 0 16px; }
.modal-admin .rep-lock-form { text-align: left; }
.modal-admin .cobro-acciones { margin-top: 4px; }

/* =====================================================================
   PANTALLA CADUCIDAD (alertas)
   ===================================================================== */
.caducidad { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.cad-barra { margin-bottom: 14px; }
.cad-barra h2 { font-size: 1.2rem; color: var(--ink); }
.cad-sub { display: block; margin-top: 4px; font-size: 0.85rem; color: var(--muted); }
.cad-lista { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.cad-fila {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-left-width: 5px;
  border-radius: var(--radio); padding: 14px 16px;
}
.cad-fila.nivel-rojo { border-left-color: var(--danger); }
.cad-fila.nivel-naranja { border-left-color: var(--naranja); }
.cad-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cad-nombre { font-weight: 700; color: var(--ink); }
.cad-dias { font-weight: 700; font-size: 0.9rem; }
.cad-fila.nivel-rojo .cad-dias { color: var(--danger); }
.cad-fila.nivel-naranja .cad-dias { color: var(--naranja-oscuro); }
.cad-meta { font-size: 0.8rem; color: var(--muted); }
.cad-acciones { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.btn-promo {
  padding: 9px 14px; border-radius: 8px; background: var(--cafe); color: #fff;
  font-weight: 700; font-size: 0.85rem; white-space: nowrap;
}
.btn-promo:hover { background: var(--cafe-oscuro); }
.cad-vacio {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; text-align: center; color: var(--muted);
}
.cad-vacio-emoji { font-size: 2.6rem; }
.cad-vacio p { margin: 0; color: var(--ink); font-weight: 600; font-size: 1.1rem; }

@media (max-width: 560px) {
  .cad-fila { flex-direction: column; align-items: stretch; }
  .cad-acciones { justify-content: flex-end; }
}

/* =====================================================================
   FASE B · Login con roles (auth.js), chip de usuario y pantalla Usuarios
   ===================================================================== */
.auth-fondo { height: 100%; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.auth-caja {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radio); padding: 28px 26px; box-shadow: var(--sombra-card); text-align: center;
}
.auth-marca h1 { font-family: var(--display); font-style: italic; font-size: 1.9rem; color: var(--cafe); line-height: 1; }
.auth-marca span { display: block; font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.auth-tit { font-size: 1.25rem; color: var(--ink); margin: 20px 0 16px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.auth-form .campo span { font-size: 0.85rem; }
.auth-error { color: var(--danger); font-size: 0.86rem; font-weight: 600; margin: 2px 0 0; }
.auth-cambia { margin-top: 16px; font-size: 0.9rem; color: var(--muted); }
.auth-cambia a { color: var(--cafe); font-weight: 700; text-decoration: none; }
.auth-cambia a:hover { text-decoration: underline; }
.auth-icono { font-size: 2.6rem; display: block; margin: 6px 0; }
.auth-msg { color: var(--ink-soft); line-height: 1.5; margin: 8px 0 18px; }
.btn-bloque { width: 100%; }

/* Chip de usuario + salir en el encabezado café */
.usuario-chip { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.15; margin-left: 8px; }
.uc-nombre { font-size: 0.85rem; font-weight: 700; color: #fdf6ec; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-rol { font-size: 0.66rem; color: rgba(253, 246, 236, 0.72); text-transform: uppercase; letter-spacing: 0.04em; }
.btn-salir-sesion {
  margin-left: 6px; padding: 8px 13px; border-radius: 10px; font-size: 0.82rem; font-weight: 700;
  color: #fdf6ec; background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.22);
}
.btn-salir-sesion:hover { background: rgba(255, 255, 255, 0.24); }

/* Pantalla Usuarios */
.us-lista { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.us-fila {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio);
  padding: 12px 16px; box-shadow: var(--sombra);
}
.us-fila.inactivo { opacity: 0.72; border-style: dashed; }
.us-info { flex: 1; min-width: 160px; display: flex; flex-direction: column; }
.us-nombre { font-weight: 700; color: var(--ink); }
.us-yo { color: var(--cafe); font-weight: 700; font-size: 0.85rem; }
.us-correo { font-size: 0.82rem; color: var(--muted); }
.us-rol {
  min-height: 40px; border: 1px solid var(--line-fuerte); border-radius: var(--radio-sm);
  background: var(--surface); color: var(--ink); padding: 0 10px; font-family: inherit; font-size: 0.92rem;
}
.us-estado.ok { color: var(--ok); font-weight: 700; font-size: 0.88rem; }

/* =====================================================================
   Aviso de zoom (escritorio/tablet) + base de la barra de carrito móvil
   ===================================================================== */
.zoom-tip {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  background: var(--cafe-bg); color: var(--cafe-oscuro); font-size: 0.85rem; padding: 7px 14px;
}
.zoom-tip-x { color: var(--cafe); font-size: 1rem; font-weight: 800; padding: 2px 8px; margin-left: auto; flex-shrink: 0; }
.zoom-tip-x:hover { color: var(--cafe-oscuro); }
.cart-movil, .cart-backdrop, .carrito-cerrar { display: none; }

/* =====================================================================
   COBRO · ¿Aquí o para llevar? (toggle en venta mostrador)
   ===================================================================== */
.cobro-consumo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.cc-op {
  min-height: 50px; border-radius: var(--radio-sm); border: 1px solid var(--line-fuerte);
  background: var(--surface); font-size: 1rem; font-weight: 500; color: var(--muted); padding: 6px 4px;
}
.cc-op.activo { border-color: var(--cafe); color: var(--cafe); font-weight: 700; background: var(--cafe-bg); }

/* Botón "Enviar a cocina" del carrito de mesa: separado del de cobrar */
.carrito-cocina { margin-bottom: 8px; }

/* =====================================================================
   COCINA (comandas) — vista de preparación
   ===================================================================== */
.cocina { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.cocina-barra {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.cocina-barra h2 { font-size: 1.25rem; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.cocina-num {
  display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 8px;
  background: var(--cafe); color: #fff; border-radius: 13px; font-size: 0.9rem; font-weight: 700;
}
.cocina-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px; align-content: start; overflow-y: auto; padding-bottom: 20px;
}
.cocina-vacio {
  grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--muted); padding: 60px 20px; text-align: center; font-size: 1.05rem;
}
.cocina-vacio strong { color: var(--ink); font-size: 1.2rem; }

.cmd-card {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-left: 5px solid var(--cafe); border-radius: var(--radio);
  box-shadow: var(--sombra-card); overflow: hidden;
  max-height: 100%; /* la tarjeta nunca pasa del alto visible: sus productos scrollean adentro */
}
.cmd-card.atencion { border-left-color: var(--naranja); }
.cmd-card.urgente { border-left-color: var(--danger); }
.cmd-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 12px 14px 6px;
}
.cmd-origen { font-weight: 700; color: var(--ink); font-size: 1.05rem; line-height: 1.2; }
.cmd-min { font-size: 0.82rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.cmd-card.atencion .cmd-min { color: var(--naranja-oscuro); }
.cmd-card.urgente .cmd-min { color: var(--danger); font-weight: 700; }
.cmd-sub {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 0 14px 10px;
  font-size: 0.8rem; color: var(--muted);
}
.cmd-consumo { font-weight: 700; padding: 2px 9px; border-radius: 999px; font-size: 0.78rem; }
.cmd-consumo.aqui { background: var(--ok-bg); color: var(--ok); }
.cmd-consumo.llevar { background: var(--naranja-bg); color: var(--naranja-oscuro); }
.cmd-quien { }
.cmd-progreso { margin-left: auto; font-weight: 700; color: var(--ink-soft); }

.cmd-items {
  display: flex; flex-direction: column; border-top: 1px solid var(--line);
  flex: 1 1 auto; min-height: 0; overflow-y: auto; /* scroll interno cuando son muchos productos */
}
/* Aviso sutil de que hay más productos abajo (sombra en el borde inferior) */
.cmd-items { scrollbar-width: thin; }
.cmd-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 11px 14px; border: none; border-bottom: 1px solid var(--line);
  background: transparent; color: var(--ink); font-size: 1rem; line-height: 1.25;
}
.cmd-item:last-child { border-bottom: none; }
.cmd-check {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line-fuerte);
  display: grid; place-items: center; color: #fff; font-size: 0.9rem; font-weight: 800;
}
.cmd-cant { flex-shrink: 0; font-weight: 800; color: var(--cafe); min-width: 26px; }
.cmd-nom { flex: 1; min-width: 0; }
.cmd-tag {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
  background: var(--rosa-bg); color: var(--rosa-oscuro); font-size: 0.74rem; font-weight: 700;
  vertical-align: middle;
}
/* Extra anidado bajo su producto (chispas, shot, jarabe…) */
.cmd-item.es-extra { padding-left: 30px; background: var(--surface-2); font-size: 0.92rem; }
.cmd-item.es-extra .cmd-cant { color: var(--rosa-oscuro); min-width: 20px; }
.cmd-item.es-extra .cmd-nom { color: var(--ink-soft); }
.cmd-item.hecho { background: var(--ok-bg); }
.cmd-item.hecho .cmd-check { background: var(--ok); border-color: var(--ok); }
.cmd-item.hecho .cmd-nom { text-decoration: line-through; color: var(--muted); }
.cmd-item.hecho .cmd-cant { color: var(--muted); }
.cmd-listo-todo { margin: 0; border-radius: 0; flex-shrink: 0; }

/* =====================================================================
   MÓVIL (teléfono ≤ 640px) — experiencia optimizada
   ===================================================================== */
@media (max-width: 640px) {
  /* Encabezado compacto */
  .cabecera { padding: 10px 14px; gap: 8px; }
  .marca h1 { font-size: 1.35rem; }
  .marca-sub { display: none; }
  .cabecera-derecha { gap: 6px; }
  .btn-kiosko, .badge-modo { display: none; }
  .usuario-chip .uc-rol { display: none; }
  .usuario-chip .uc-nombre { max-width: 78px; font-size: 0.78rem; }
  .btn-salir-sesion { padding: 8px 10px; }
  .btn-ajustes, .btn-campana { width: 38px; height: 38px; }

  /* Pestañas: scroll horizontal, tocables */
  .pestanas { overflow-x: auto; gap: 4px; padding: 0 10px; -webkit-overflow-scrolling: touch; }
  .tab { flex: 0 0 auto; padding: 12px 14px; font-size: 0.95rem; }
  .contenido { padding: 12px; }

  /* Vender: productos a pantalla completa */
  .vender { display: flex; flex-direction: column; height: 100%; }
  .vender-productos { flex: 1; min-height: 0; }
  .grid-productos {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); justify-content: stretch;
    padding-bottom: 80px; /* aire para la barra fija de abajo */
  }

  /* Carrito = HOJA deslizable desde abajo */
  .vender-carrito {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 70;
    max-height: 82vh; border-radius: 20px 20px 0 0; border: none;
    box-shadow: 0 -10px 34px rgba(60, 35, 10, 0.28);
    transform: translateY(103%); transition: transform 0.28s ease;
  }
  .vender-root.carrito-abierto .vender-carrito { transform: translateY(0); }
  .carrito-cabecera { padding: 16px 16px 12px; }
  .carrito-cerrar {
    display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
    border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 1rem; flex-shrink: 0; margin-left: 8px;
  }

  /* Fondo oscuro al abrir la hoja */
  .cart-backdrop {
    display: block; position: fixed; inset: 0; z-index: 65; background: rgba(0, 0, 0, 0.42);
    opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
  }
  .vender-root.carrito-abierto .cart-backdrop { opacity: 1; pointer-events: auto; }

  /* Barra fija inferior: total + Cobrar */
  .cart-movil {
    display: flex; align-items: center; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 18px rgba(60, 35, 10, 0.10);
  }
  .cm-ver { flex: 1; min-width: 0; text-align: left; font-weight: 600; color: var(--ink); font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cm-ver strong { color: var(--cafe); }
  .cm-total { font-weight: 800; font-size: 1.2rem; color: var(--cafe); white-space: nowrap; }
  .cm-cobrar {
    background: var(--ok); color: #fff; font-weight: 800; font-size: 1rem;
    padding: 0 20px; min-height: 48px; border-radius: 12px; white-space: nowrap;
  }
  .cm-cobrar:disabled { opacity: 0.45; }

  /* Otras secciones a una columna + barras que envuelven */
  .mesas-grid, .pedidos-grid, .dos-columnas { grid-template-columns: 1fr; }
  .promos-barra, .productos-barra, .pedidos-barra, .mesas-barra, .ventas-barra, .reporte-barra { flex-wrap: wrap; }
  .us-fila { gap: 8px; }
  .us-rol { flex: 1; min-width: 120px; }
  .modal { max-width: 100%; }

  /* Mesa: en móvil muestra el nombre COMPLETO (envuelve, no lo corta) */
  .mesa-bar { padding: 10px 12px; }
  .mesa-bar-txt .mb-tit { white-space: normal; font-size: 1.05rem; }
  .mesa-bar-txt .mb-sub { display: none; }
  .mesa-bar-salir { padding: 9px 12px; font-size: 0.82rem; }

  /* Botones que NO se corten en móvil */
  .carrito-botones { grid-template-columns: 1fr 1fr; }
  .carrito-botones .btn, .cobro-acciones .btn { min-width: 0; padding: 0 10px; }
  .cobro-acciones { flex-wrap: wrap; gap: 8px; }
  .cobro-acciones .btn { flex: 1 1 130px; }
  .cobro-metodo { font-size: 0.9rem; padding: 0 4px; }

  /* Cocina: una columna, renglones grandes para tocar con el pulgar */
  .cocina-grid { grid-template-columns: 1fr; }
  .cmd-item { padding: 15px 14px; font-size: 1.05rem; }
  .cmd-check { width: 28px; height: 28px; }

  /* Cuando hay un modal abierto (p. ej. cobro), oculta la barra fija del
     carrito para que no tape los botones del modal. */
  body:has(.modal-fondo) .cart-movil { display: none; }
}
