/* ============================================================
   LA SANTIAGUERA — Estilos del Panel de Administración
   ============================================================ */

:root {
  --cafe-oscuro: #2b211c;
  --cafe-medio: #3a2d26;
  --cafe-claro: #4a3a31;
  --dorado: #a5772e;
  --dorado-fuerte: #8f6423;
  --fondo: #faf7f2;
  --tinta: #292524;
  --gris: #78716c;
  --linea: rgba(0, 0, 0, 0.08);
  --verde: #16a34a;
  --rojo: #dc2626;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* regla de oro: lo marcado como oculto, SIEMPRE se oculta */
[hidden] { display: none !important; }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--fondo);
  color: var(--tinta);
  -webkit-font-smoothing: antialiased;
}

.serif { font-family: "Playfair Display", Georgia, serif; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--tinta);
  background: #fff;
  border: 1px solid var(--linea);
  border-radius: 9px;
  padding: 9px 12px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--dorado); }

.panel { display: flex; min-height: 100svh; }

/* ===== Lateral ===== */
.lateral {
  width: 232px;
  flex-shrink: 0;
  background: var(--cafe-oscuro);
  color: #e9e2da;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100svh;
  overflow-y: auto;
}

.marca { padding: 22px 18px 16px; }
.marca h1 { font-size: 19px; color: #fff; }
.marca p { font-size: 11.5px; color: #b8aca2; margin-top: 3px; }

.menu { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }

.item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13.5px;
  color: #cfc4ba;
  transition: background 0.15s, color 0.15s;
}
.item:hover { background: var(--cafe-medio); color: #fff; }
.item.activo { background: var(--cafe-claro); color: #fff; font-weight: 600; }
.item .ic { width: 20px; text-align: center; }

.cuenta { margin-top: auto; padding: 12px 10px 16px; border-top: 1px solid rgba(255,255,255,0.08); }
.usuario { display: flex; gap: 10px; align-items: center; padding: 8px 12px 12px; }
.usuario .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--cafe-claro);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.usuario b { font-size: 12.5px; color: #fff; display: block; }
.usuario small { font-size: 10px; color: #b8aca2; word-break: break-all; }

/* ===== Contenido ===== */
.contenido { flex: 1; min-width: 0; }

/* barra superior móvil + hamburguesa + cajón (ocultos en escritorio) */
.topbar-movil, .lateral-velo { display: none; }
.hamburguesa {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: rgba(255, 255, 255, 0.1);
}
.hamburguesa span { display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; }
.topbar-titulo { font-family: "Playfair Display", Georgia, serif; font-weight: 700; font-size: 18px; }

.barra-titulo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--linea);
  background: #fff;
}
.barra-titulo h2 { font-size: 21px; }

.insignia {
  background: #efe8dc;
  color: #6b5d4f;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
}

.seccion { display: none; padding-bottom: 60px; }
.seccion.visible { display: block; }
.seccion > *:not(.barra-titulo) { margin-left: 28px; margin-right: 28px; }

/* Pestañas */
.pestanas {
  display: flex;
  gap: 22px;
  margin-top: 18px;
  border-bottom: 1px solid var(--linea);
}
.pestana {
  padding: 9px 2px;
  font-size: 14px;
  color: var(--gris);
  border-bottom: 2px solid transparent;
}
.pestana.activa { color: var(--tinta); font-weight: 600; border-bottom-color: var(--dorado); }

.pestanas.chicas { gap: 16px; border: none; margin-top: 8px; }

.panel-pestana { display: none; margin-top: 18px; }
.panel-pestana.visible { display: block; }

/* Herramientas */
.fila-herramientas {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.fila-herramientas input[type="text"] { width: min(320px, 100%); }
.fila-herramientas.envuelta { justify-content: flex-start; }

.btn-primario {
  background: var(--dorado);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
  transition: background 0.15s;
}
.btn-primario:hover { background: var(--dorado-fuerte); }

.btn-suave {
  background: #fff;
  border: 1px solid var(--linea);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 15px;
  border-radius: 10px;
}
.btn-suave:hover { background: #f3ede4; }
.btn-suave.peligro { color: var(--rojo); }
.btn-suave:disabled, .btn-ancho:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-ancho {
  display: block;
  width: 100%;
  background: var(--dorado);
  color: #fff;
  font-weight: 600;
  padding: 12px;
  border-radius: 10px;
  margin-top: 10px;
}

.fila-botones { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }

.rotulo-campo { display: block; font-size: 12.5px; font-weight: 600; color: #57534e; margin-top: 12px; }
.rotulo-campo input { width: 100%; margin-top: 5px; font-weight: 400; }

.texto-suave { font-size: 13px; color: var(--gris); }
.subtitulo { font-size: 16px; font-weight: 700; margin-top: 22px; }
.nota { font-size: 12.5px; color: var(--gris); margin: 12px 0; }

/* ===== Lista de productos ===== */
.lista-productos { margin-top: 16px; border-top: 1px solid var(--linea); }

.fila-producto {
  display: grid;
  grid-template-columns: 48px minmax(130px, 1fr) minmax(110px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px 4px;
  border-bottom: 1px solid var(--linea);
}
.fila-producto .miniatura {
  width: 44px; height: 44px;
  border-radius: 9px;
  object-fit: cover;
  background: #efe8dc;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  overflow: visible;
  position: relative;
}
.fila-producto .miniatura img { border-radius: 9px; }

/* botón para traer la foto desde la app de imágenes */
.btn-foto {
  position: absolute;
  right: -7px;
  bottom: -7px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--linea);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  font-size: 11px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.15s;
}
.btn-foto:hover { transform: scale(1.18) rotate(90deg); }
.fila-producto .miniatura img { width: 100%; height: 100%; object-fit: cover; }
.fila-producto select { font-size: 12.5px; padding: 7px 8px; }
.fila-producto .datos b {
  font-size: 12.5px;
  font-weight: 500;
  color: #453f39;        /* gris oscuro (un poco más oscuro que antes, sin llegar a negro) */
  display: block;
  line-height: 1.35;     /* nombre completo, puede ir en 2 líneas */
}
.fila-producto .datos small { font-size: 11px; color: var(--gris); font-family: ui-monospace, monospace; }
.fila-producto .lado-derecho { display: flex; align-items: center; gap: 12px; }
/* imagen con el precio debajo, en una sola columna */
.miniatura-precio { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fila-producto .precio { font-weight: 700; font-size: 12.5px; color: #9a6a1f; text-align: center; }
.fila-producto .acciones { display: flex; gap: 8px; }
.fila-producto .acciones button {
  font-size: 15px;
  opacity: 0.65;
  padding: 4px;
}
.fila-producto .acciones button:hover { opacity: 1; }

/* Interruptor */
.interruptor { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.interruptor input { display: none; }
.interruptor span {
  width: 40px; height: 22px;
  background: #d6cfc5;
  border-radius: 999px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.interruptor span::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.interruptor input:checked + span { background: var(--dorado); }
.interruptor input:checked + span::after { left: 20px; }

/* ===== Categorías / filas / pasillos ===== */
.tarjeta-fila {
  background: #fff;
  border: 1px solid var(--linea);
  border-radius: 13px;
  padding: 14px 16px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.tarjeta-fila .cuerpo { flex: 1; min-width: 0; }
.tarjeta-fila b { font-size: 14.5px; }
.tarjeta-fila small { display: block; font-size: 12px; color: var(--gris); margin-top: 2px; }
.tarjeta-fila .acciones { display: flex; gap: 10px; align-items: center; }
.tarjeta-fila .acciones button { font-size: 15px; opacity: 0.65; }
.tarjeta-fila .acciones button:hover { opacity: 1; }

.mini-productos { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.mini-productos .bolita {
  position: relative;
  width: 52px;
  text-align: center;
  font-size: 9px;
  color: var(--gris);
}
.mini-productos .bolita .quitar-bolita {
  position: absolute;
  top: -4px;
  right: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #dc2626;
  color: #fff;
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  z-index: 2;
  transition: transform 0.15s ease, background 0.15s ease;
}
.mini-productos .bolita .quitar-bolita:hover { transform: scale(1.15); background: #b91c1c; }

/* ===== Menú inferior del admin + su selector ===== */
.menu-inferior-admin { display: none; }
.selector-menu-admin { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.selector-menu-admin .fila-slot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.selector-menu-admin .fila-slot > span { font-size: 13px; color: var(--gris); min-width: 72px; }
.selector-menu-admin select { flex: 1; }

/* ===== Juegos (admin) ===== */
.jadm-cargando { color: var(--gris); padding: 20px 0; }
.jadm-bloque { background: #fff; border: 1px solid #ece4d6; border-radius: 14px; padding: 16px; margin-bottom: 16px; }
.jadm-bloque h3 { font-size: 15px; font-weight: 700; color: #7f1d1d; margin-bottom: 12px; }
.jadm-bloque-tit { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.jadm-ayuda { font-size: 12.5px; margin: -4px 0 12px; }
.jadm-check { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 500; padding: 6px 0; cursor: pointer; }
.jadm-check input { width: 18px; height: 18px; }
.jadm-campo { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--gris); margin-top: 10px; }
.jadm-campo select { font-size: 14px; padding: 8px 10px; border-radius: 9px; border: 1.5px solid #e2d4bd; }

.jadm-slot { display: grid; grid-template-columns: 26px 1fr 1fr; gap: 8px; align-items: center; margin-bottom: 8px; }
.jadm-slot-n { width: 24px; height: 24px; border-radius: 7px; background: #b91c1c; color: #fff; font-weight: 800; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.jadm-slot select, .jadm-slot input { width: 100%; font-size: 13px; padding: 7px 9px; border-radius: 9px; border: 1.5px solid #e2d4bd; background: #fff; }
.jadm-slot-vacio { font-size: 12px; color: #9a8574; }

.jadm-preg { border: 1px solid #ece4d6; border-radius: 12px; padding: 12px 13px; margin-top: 10px; background: #fff; }
.jadm-preg.pend { border-color: #f0d28a; background: #fffdf5; }
.jadm-preg-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.jadm-preg-estado { font-size: 11.5px; font-weight: 700; color: #7a5a10; }
.jadm-preg.aprob .jadm-preg-estado { color: #166534; }
.jadm-preg-acc { display: flex; gap: 6px; }
.mini-accion { font-size: 12px; font-weight: 600; color: #444; background: #f2ede3; border: none; border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.mini-accion:hover { background: #e7dfd0; }
.mini-accion.peligro { color: #b91c1c; }
.jadm-preg-q { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.jadm-preg-ops { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 3px; }
.jadm-preg-ops li { font-size: 13px; color: var(--gris); padding-left: 4px; }
.jadm-preg-ops li.correcta { color: #166534; font-weight: 600; }

.jadm-editor { border: 1.5px solid #b91c1c; border-radius: 12px; padding: 14px; margin: 10px 0; background: #fff; }
.jadm-editor h4 { font-size: 14px; font-weight: 700; color: #7f1d1d; margin-bottom: 10px; }
.jadm-editor textarea, .jadm-ed-opt { width: 100%; font-family: inherit; font-size: 13.5px; padding: 8px 10px; border: 1.5px solid #e2d4bd; border-radius: 9px; }
.jadm-ed-op { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.jadm-ed-op input[type=radio] { width: 18px; height: 18px; flex: none; }
.jadm-ed-acc { display: flex; gap: 8px; margin-top: 8px; }

/* ===== Recetario ===== */
.rec-ingredientes { font-size: 12.5px; color: var(--gris); margin-top: 4px; line-height: 1.4; }
.jadm-editor input[type="text"], .jadm-editor .rec-ed-ing, .jadm-editor .rec-ed-pasos {
  width: 100%; font-family: inherit; font-size: 13.5px; padding: 9px 11px; margin-bottom: 8px;
  border: 1.5px solid #e2d4bd; border-radius: 9px;
}
.jadm-editor input[type="text"]:focus, .jadm-editor textarea:focus { border-color: var(--dorado-2, #f59e0b); outline: none; }

/* selector de rol en Usuarios (solo lo ve el dueño) */
.sel-rol { font-size: 12.5px; padding: 6px 8px; border-radius: 8px; border: 1.5px solid #e2d4bd; background: #fff; color: #2a1a12; }
.sel-rol:focus { border-color: var(--dorado-2, #f59e0b); outline: none; }

/* ===== Agentes ===== */
.ag-solo-super { font-size: 12.5px; font-weight: 700; color: #7a5a10; background: #fbeecb; border-radius: 10px; padding: 9px 13px; margin-bottom: 14px; }
.ag-card { background: #fff; border: 1px solid #e7dccb; border-radius: 16px; margin-bottom: 16px; overflow: hidden; transition: opacity .2s; }
.ag-card.apagado { opacity: .6; }
.ag-card-cab { display: flex; align-items: center; gap: 13px; padding: 14px 16px; border-bottom: 1px solid #f0e8da; }
.ag-card-ico { width: 44px; height: 44px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 22px; color: #fff; background: linear-gradient(135deg, #b91c1c, #7f1d1d); }
.ag-card-tit { flex: 1; }
.ag-card-tit b { font-size: 15.5px; font-weight: 700; display: block; }
.ag-card-tit small { font-size: 12.5px; color: var(--gris); }
.ag-estado { font-size: 11px; font-weight: 700; color: #166534; background: #e5f2e9; padding: 3px 9px; border-radius: 999px; }
.ag-card.apagado .ag-estado { color: #8a5a10; background: #fbeecb; }
.ag-habs { padding: 4px 16px 12px; }
.ag-hab { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid #f4eee2; }
.ag-hab:last-child { border-bottom: none; }
.ag-hab-ico { width: 28px; text-align: center; font-size: 17px; flex: none; }
.ag-hab-txt { flex: 1; }
.ag-hab-txt b { font-size: 14px; font-weight: 600; display: block; }
.ag-hab-txt small { font-size: 12px; color: var(--gris); }
.ag-fija { font-size: 11px; font-weight: 700; color: #166534; background: #e5f2e9; padding: 4px 9px; border-radius: 999px; }
.ag-num { width: 60px; font-size: 13px; padding: 7px 8px; border: 1.5px solid #e2d4bd; border-radius: 8px; text-align: center; font-family: inherit; }
.ag-num:focus { border-color: var(--dorado-2, #f59e0b); outline: none; }

/* ===== Escáner de código de barras ===== */
.boton-camara { flex: none; width: 44px; height: 44px; border-radius: 12px; border: none; cursor: pointer; background: #b91c1c; color: #fff; display: flex; align-items: center; justify-content: center; transition: filter .12s, transform .1s; }
.boton-camara:hover { filter: brightness(1.08); }
.boton-camara:active { transform: scale(.96); }
.boton-camara svg { width: 22px; height: 22px; }

.velo-escaner { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, .72); display: flex; align-items: center; justify-content: center; padding: 18px; }
.velo-escaner[hidden] { display: none; }
.escaner-caja { width: 100%; max-width: 420px; background: #141010; border-radius: 18px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
.escaner-cab { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; color: #fff; }
.escaner-cab b { font-size: 15px; font-weight: 700; }
.escaner-cab button { background: rgba(255, 255, 255, .15); color: #fff; border: none; width: 36px; height: 36px; border-radius: 50%; font-size: 16px; cursor: pointer; }
.escaner-video-caja { position: relative; background: #000; aspect-ratio: 4 / 3; overflow: hidden; }
.escaner-video-caja video { width: 100%; height: 100%; object-fit: cover; display: block; }
.escaner-mira { position: absolute; top: 50%; left: 8%; right: 8%; height: 2px; transform: translateY(-50%); background: #ef4444; box-shadow: 0 0 12px #ef4444; }
.escaner-estado { color: #e8e0d5; font-size: 13px; text-align: center; padding: 12px 14px; }

@media (max-width: 820px) {
  .menu-inferior-admin {
    display: flex; justify-content: space-around; align-items: center;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
    background: rgba(23, 19, 16, 0.94);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .menu-inferior-admin:empty { display: none; }
  .opcion-admin {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    font-size: 9.5px; font-weight: 500; color: rgba(255, 255, 255, 0.6);
    padding: 5px 2px; max-width: 92px;
  }
  .opcion-admin .ic { font-size: 24px; line-height: 1; }
  .opcion-admin.activo { color: var(--dorado); }
  .opcion-admin.fija { color: rgba(255, 214, 150, 0.9); } /* Ir a la tienda: siempre a la derecha */
  .panel { padding-bottom: 64px; }
}

/* tabla de ventas (Clover POS) */
.tabla-ventas {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.tabla-ventas th {
  text-align: left;
  padding: 10px 12px;
  color: var(--gris);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid rgba(0, 0, 0, 0.08);
}
.tabla-ventas td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  vertical-align: top;
}
.tabla-ventas tr:hover td { background: rgba(0, 0, 0, 0.02); }
.tabla-ventas .col-fecha { white-space: nowrap; color: var(--gris); }
.tabla-ventas .col-total { text-align: right; font-weight: 700; white-space: nowrap; }

/* botón de impuesto por producto */
.btn-tax {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.02em;
}
.btn-tax:hover { border-color: #16a34a; color: #16a34a; }
.btn-tax.activo {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.3);
}
.mini-productos .bolita .circ {
  width: 46px; height: 46px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  margin: 0 auto 3px;
  background: #efe8dc;
  display: flex; align-items: center; justify-content: center;
}
.mini-productos .bolita img { width: 100%; height: 100%; object-fit: cover; }
.mini-productos .bolita.mas .circ { font-size: 18px; color: var(--dorado); cursor: pointer; }

.etiqueta-modo {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eee;
  color: #555;
}
.etiqueta-modo.auto { background: #fef3c7; color: #92400e; }
.etiqueta-modo.activa { background: #dcfce7; color: #166534; }

.pos-campo { width: 64px; text-align: center; }

.rejilla-pasillos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.rejilla-pasillos .tarjeta-fila { margin-top: 0; align-items: flex-start; }

/* ===== Ajustes ===== */
.tarjeta-ajuste {
  background: #fff;
  border: 1px solid var(--linea);
  border-radius: 13px;
  padding: 16px 18px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 620px;
}
.tarjeta-ajuste p { font-size: 12.5px; color: var(--gris); margin-top: 3px; }

.tarjeta-bloque {
  background: #fff;
  border: 1px solid var(--linea);
  border-radius: 13px;
  padding: 18px;
  margin-top: 16px;
  max-width: 720px;
}
.tarjeta-bloque > p { margin: 6px 0 10px; }
.tarjeta-bloque code { background: #f3ede4; padding: 1px 6px; border-radius: 5px; font-size: 12px; }

.consejo {
  background: #fef9e7;
  border: 1px solid #f3e3b3;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  margin: 12px 0;
  max-width: 720px;
}
.consejo code { background: #f6ecd2; padding: 1px 6px; border-radius: 5px; color: #92400e; }

#prompt-ia {
  width: 100%;
  max-width: 720px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.55;
}

/* ===== Estantería ===== */
.boton-estante {
  background: #fff;
  border: 1px solid var(--linea);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
}
.boton-estante.activo { background: var(--dorado); color: #fff; border-color: var(--dorado); }

.nivel-estante { margin-top: 14px; display: flex; align-items: center; gap: 10px; }
.nivel-estante .rotulo { font-size: 12px; font-weight: 700; color: var(--gris); width: 42px; flex-shrink: 0; }
.celdas {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  flex: 1;
}
.celda {
  flex-shrink: 0;
  min-width: 96px;
  background: #fff;
  border: 1px solid var(--linea);
  border-radius: 10px;
  padding: 10px 8px;
  font-size: 10.5px;
  font-family: ui-monospace, monospace;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
}
.celda:hover { border-color: var(--dorado); }
.celda.vacia { color: #b8aca2; font-size: 16px; }
.celda .nom { display: block; font-family: "Inter", sans-serif; font-size: 10px; color: var(--gris); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }

/* ===== Vacíos ===== */
.vacio { text-align: center; padding: 70px 20px; }
.vacio .icono { font-size: 42px; opacity: 0.5; }
.vacio p { margin-top: 10px; font-size: 15px; color: var(--gris); }

/* ===== Ventanas ===== */
.velo {
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 10, 0.55);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.velo.visible { display: flex; }

.ventana {
  background: #fff;
  border-radius: 16px;
  padding: 24px 26px;
  width: 100%;
  max-width: 660px;
  max-height: 92svh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,0.35);
}
.ventana.chica { max-width: 420px; }
.ventana .cerrar {
  position: absolute;
  top: 14px; right: 16px;
  font-size: 16px;
  color: var(--gris);
}
.titulo-ventana { font-size: 18px; font-weight: 700; margin-bottom: 16px; }

.ventana form label { display: block; font-size: 12.5px; font-weight: 600; color: #57534e; margin-top: 12px; }
.ventana form label input, .ventana form label select, .ventana form label textarea { width: 100%; margin-top: 5px; font-weight: 400; }
.malla-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .malla-3 { grid-template-columns: 1fr; } }

.fila-interruptores { display: flex; gap: 24px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.interruptor.etiquetado { font-weight: 500; }
#previa-imagen { width: 52px; height: 52px; border-radius: 9px; object-fit: cover; border: 1px solid var(--linea); }

.pie-ventana { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.lista-selector { margin-top: 12px; max-height: 320px; overflow-y: auto; }
.lista-selector button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 8px;
  border-radius: 9px;
  font-size: 13px;
}
.lista-selector button:hover { background: #f3ede4; }
.lista-selector img { width: 34px; height: 34px; border-radius: 7px; object-fit: cover; }

/* Puerta de entrada */
.portal-acceso {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: linear-gradient(to bottom right, #7f1d1d, #b91c1c, #ef4444);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.caja-acceso {
  background: #fff;
  border-radius: 18px;
  padding: 34px 30px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}
.caja-acceso h1 { font-size: 26px; }
.caja-acceso > p { color: var(--gris); font-size: 13px; margin-top: 4px; }
.caja-acceso form { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.caja-acceso input { text-align: center; }
.caja-acceso a { display: inline-block; margin-top: 16px; font-size: 13px; color: var(--gris); }
.caja-acceso a:hover { text-decoration: underline; }
.error-acceso { margin-top: 12px; font-size: 13px; color: var(--rojo); }

/* campo de contraseña con ojito */
.campo-clave { position: relative; }
.campo-clave input { width: 100%; padding-right: 44px; box-sizing: border-box; }
.ver-clave {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  opacity: 0.6;
  cursor: pointer;
  border: none;
  background: none;
  padding: 4px;
}
.ver-clave:hover { opacity: 1; }

/* Aviso */
.aviso {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(90px);
  background: rgba(28, 25, 23, 0.95);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  transition: transform 0.3s ease;
  z-index: 200;
}
.aviso.visible { transform: translateX(-50%) translateY(0); }

/* móvil */
@media (max-width: 820px) {
  /* barra superior con hamburguesa */
  .topbar-movil {
    display: flex; align-items: center; gap: 10px;
    position: fixed; top: 0; left: 0; right: 0; height: 54px;
    background: var(--cafe-oscuro); color: #fff; padding: 0 12px;
    z-index: 60; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  }
  /* el lateral se vuelve un cajón que entra desde la izquierda */
  .lateral {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 250px; height: 100svh;
    transform: translateX(-102%);
    transition: transform 0.26s ease;
    z-index: 80;
    box-shadow: 6px 0 30px rgba(0, 0, 0, 0.35);
  }
  body.cajon-abierto .lateral { transform: translateX(0); }
  .lateral-velo {
    display: block; position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.5); z-index: 70;
    opacity: 0; pointer-events: none; transition: opacity 0.26s;
  }
  body.cajon-abierto .lateral-velo { opacity: 1; pointer-events: auto; }

  /* el contenido ocupa todo el ancho, bajo la barra superior */
  .panel { padding-top: 54px; }
  /* el título de la sección ya sale arriba, junto a la hamburguesa:
     lo ocultamos aquí para no repetirlo y ganar espacio */
  .barra-titulo { padding: 0; border-bottom: none; }
  .barra-titulo h2 { display: none; }
  .barra-titulo .insignia { margin: 10px 16px 2px; }
  .seccion > *:not(.barra-titulo) { margin-left: 14px; margin-right: 14px; }
  .fila-herramientas { gap: 10px; }
  /* fila de producto COMPACTA en móvil (más productos por pantalla) */
  .fila-producto {
    grid-template-columns: 42px 1fr auto;
    gap: 4px 8px;
    padding: 8px 4px;
  }
  .fila-producto .miniatura-precio { grid-row: 1 / span 2; align-self: start; }
  .fila-producto .miniatura { width: 38px; height: 38px; }
  .fila-producto .precio { font-size: 11px; }
  .fila-producto .datos { grid-column: 2 / span 2; grid-row: 1; }
  .fila-producto .datos small { font-size: 10px; }
  .fila-producto select { grid-column: 2; grid-row: 2; padding: 5px 6px; font-size: 12px; }
  .fila-producto .lado-derecho { grid-column: 3; grid-row: 2; gap: 8px; }
  .fila-producto .btn-tax { padding: 3px 7px; font-size: 10px; }
}
