/*
 * Estilos del panel web (v2): terminal de playa y panel administrativo. Sigue los patrones del
 * prototipo "Sistema-grifos": fondo blanco, tarjetas grises redondeadas, azul para la acción,
 * verde para confirmar, rojo para alertas. Sin frameworks: una sola hoja.
 */
:root {
  --fondo: #ffffff;
  --gris: #f3f4f6;
  --gris-2: #e5e7eb;
  --borde: #e5e7eb;
  --tinta: #0f172a;
  --texto: #111827;
  --suave: #6b7280;
  --azul: #2563eb;
  --azul-suave: #eff6ff;
  --verde: #16a34a;
  --verde-suave: #dcfce7;
  --rojo: #dc2626;
  --rojo-suave: #fef2f2;
  --ambar: #ca8a04;
  --ambar-suave: #fef9c3;
  --radio: 12px;
  --sombra: 0 1px 2px rgba(15, 23, 42, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--texto);
       background: var(--fondo); line-height: 1.45; font-size: 15px; -webkit-font-smoothing: antialiased; }
a { color: var(--azul); text-decoration: none; }
h1 { font-size: 1.75rem; font-weight: 500; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; font-weight: 600; margin: 0 0 .75rem; }
h3 { font-size: .95rem; font-weight: 600; margin: 0; }
.cifra { font-variant-numeric: tabular-nums; }
.suave { color: var(--suave); }
.titulo-seccion { font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
                  color: var(--suave); margin: 0 0 .5rem; }
.oculto { display: none !important; }

/* ---------- marca ---------- */
.marca { display: flex; align-items: center; gap: .6rem; color: var(--tinta); }
.marca-logo { width: 36px; height: 36px; border-radius: 9px; background: var(--azul); color: #fff;
              display: grid; place-items: center; font-weight: 700; }
.marca-nombre { font-weight: 700; font-size: 1.15rem; line-height: 1; }
.marca-sub { font-size: .65rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--suave); }

/* ---------- componentes ---------- */
.tarjeta { background: var(--gris); border: 1px solid var(--borde); border-radius: var(--radio); padding: 1rem 1.25rem; }
.tarjeta.blanca { background: #fff; }
.pastilla { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; padding: .15rem .6rem;
            font-size: .75rem; font-weight: 600; background: var(--gris); color: var(--suave); white-space: nowrap; }
.pastilla.oscura { background: var(--tinta); color: #fff; }
.pastilla.verde { background: var(--verde-suave); color: var(--verde); }
.pastilla.roja { background: var(--rojo-suave); color: var(--rojo); }
.pastilla.ambar { background: var(--ambar-suave); color: var(--ambar); }
.pastilla.azul { background: var(--azul-suave); color: var(--azul); }
.punto { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }
.boton { font: inherit; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
         cursor: pointer; border: 1px solid var(--azul); border-radius: 10px; padding: .55rem 1rem;
         background: var(--azul); color: #fff; }
.boton:disabled { opacity: .45; cursor: not-allowed; }
.boton.verde { background: var(--verde); border-color: var(--verde); }
.boton.secundario { background: #fff; color: var(--texto); border-color: var(--borde); }
.boton.peligro { background: #fff; color: var(--rojo); border-color: #fecaca; }
.boton.pequeno { padding: .25rem .65rem; font-size: .85rem; border-radius: 8px; }
.boton.ancho { width: 100%; }
.boton-enlace { background: none; border: 0; color: var(--suave); cursor: pointer; font: inherit; padding: 0; }
.mensaje { border-radius: 10px; padding: .65rem .9rem; margin-bottom: 1rem; border: 1px solid; font-size: .9rem; }
.mensaje.success { color: var(--verde); background: var(--verde-suave); border-color: #bbf7d0; }
.mensaje.error { color: var(--rojo); background: var(--rojo-suave); border-color: #fecaca; }
.mensaje.warning, .mensaje.info { color: var(--ambar); background: var(--ambar-suave); border-color: #fde68a; }
.aviso-bloqueo { background: var(--rojo-suave); border: 1px solid #fecaca; color: var(--rojo); border-radius: 10px;
                 padding: .75rem 1rem; font-weight: 600; margin-bottom: 1rem; }
label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: .3rem; }
input, select, textarea { font: inherit; padding: .55rem .7rem; border: 1px solid var(--borde); border-radius: 10px;
                          width: 100%; background: #fff; color: var(--texto); }
input:focus, select:focus { outline: 2px solid var(--azul-suave); border-color: var(--azul); }
.campo { margin-bottom: .9rem; }
.campo .error, .errorlist { color: var(--rojo); font-size: .82rem; margin: .25rem 0 0; padding: 0; list-style: none; }
.ayuda { color: var(--suave); font-size: .82rem; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .7rem .75rem; border-bottom: 1px solid var(--borde); vertical-align: middle; }
th { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--suave);
     background: var(--gris); }
td.numero, th.numero { text-align: right; font-variant-numeric: tabular-nums; }
.tabla { border: 1px solid var(--borde); border-radius: var(--radio); overflow: hidden; background: #fff; }
.tabla-desplazable { overflow-x: auto; }
.acciones { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.en-linea { display: inline; }
.rejilla { display: grid; gap: 1rem; }
.rejilla.dos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rejilla.tres { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rejilla.cuatro { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.barra { height: 6px; border-radius: 999px; background: var(--gris-2); overflow: hidden; }
.barra > span { display: block; height: 100%; border-radius: 999px; background: var(--azul); }
.color-0 { color: #eab308; } .color-1 { color: #2563eb; } .color-2 { color: #8b5cf6; } .color-3 { color: #0f172a; }
.color-4 { color: #16a34a; } .color-5 { color: #ea580c; }
.fondo-0 { background: #eab308 !important; } .fondo-1 { background: #2563eb !important; }
.fondo-2 { background: #8b5cf6 !important; } .fondo-3 { background: #0f172a !important; }
.fondo-4 { background: #16a34a !important; } .fondo-5 { background: #ea580c !important; }

/* ---------- acceso ---------- */
.pagina-acceso { min-height: 100vh; display: grid; place-items: center; background: var(--gris); padding: 1rem; }
.caja-acceso { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--borde); border-radius: 16px;
               padding: 2rem; box-shadow: var(--sombra); }
.caja-acceso .marca { margin-bottom: 1.5rem; }
.terminal-detectada { display: flex; gap: .5rem; align-items: center; background: var(--azul-suave);
                      color: var(--azul); border-radius: 10px; padding: .6rem .8rem; font-size: .85rem;
                      margin-bottom: 1rem; }

/* ---------- panel administrativo ---------- */
.panel { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.lateral { border-right: 1px solid var(--borde); padding: 1.25rem 1rem; display: flex; flex-direction: column;
           gap: 1.25rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.selector-estacion { background: var(--gris); border: 1px solid var(--borde); border-radius: var(--radio);
                     padding: .7rem .8rem; }
.selector-estacion select { background: transparent; border: 0; padding: 0; font-weight: 600; }
.menu-lateral { display: flex; flex-direction: column; gap: .15rem; }
.menu-lateral a { display: flex; align-items: center; gap: .65rem; color: var(--texto); padding: .55rem .75rem;
                  border-radius: 10px; font-weight: 500; }
.menu-lateral a:hover { background: var(--gris); }
.menu-lateral a.activo { background: var(--azul-suave); color: var(--azul); font-weight: 600;
                         box-shadow: inset 3px 0 0 var(--azul); }
.menu-lateral svg, .icono { width: 18px; height: 18px; flex: none; }
.lateral-pie { margin-top: auto; display: flex; flex-direction: column; gap: .75rem; font-size: .85rem; }
.persona { display: flex; align-items: center; gap: .6rem; border-top: 1px solid var(--borde); padding-top: .9rem; }
.iniciales { width: 36px; height: 36px; border-radius: 50%; background: var(--gris); display: grid;
             place-items: center; font-weight: 700; font-size: .8rem; flex: none; }
.area { display: flex; flex-direction: column; min-width: 0; }
.barra-superior { display: flex; align-items: center; gap: 1rem; padding: .9rem 1.75rem;
                  border-bottom: 1px solid var(--borde); }
.migas { color: var(--suave); font-size: .9rem; flex: 1; }
.migas strong { color: var(--texto); }
.contenido { padding: 1.5rem 1.75rem 2rem; display: flex; flex-direction: column; gap: 1.25rem; }
.encabezado { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.kpi { background: var(--gris); border: 1px solid var(--borde); border-radius: var(--radio); padding: 1rem 1.1rem; }
.kpi .valor { font-size: 1.85rem; font-weight: 700; letter-spacing: -.01em; margin: .25rem 0; }
.kpi .detalle { font-size: .8rem; color: var(--suave); }
.sube { color: var(--verde); } .baja { color: var(--rojo); }
.nivel { background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); padding: .9rem; }
.nivel .porcentaje { font-size: 1.25rem; font-weight: 500; }
.pie-actualizacion { display: flex; justify-content: space-between; font-size: .78rem; color: var(--suave); }

/* ---------- terminal de playa ---------- */
.terminal { min-height: 100vh; display: flex; flex-direction: column; }
.terminal-barra { display: flex; align-items: center; gap: 1.25rem; padding: .9rem 1.5rem;
                  border-bottom: 1px solid var(--borde); }
.terminal-barra .espacio { flex: 1; }
.terminal-persona { display: flex; align-items: center; gap: .6rem; font-size: .85rem; }
.terminal-persona strong { display: block; font-size: .9rem; }
.reloj { font-variant-numeric: tabular-nums; font-weight: 500; }
.terminal-cuerpo { display: grid; grid-template-columns: minmax(0, 1fr) 560px; gap: 1.5rem; padding: 1.5rem; }
.paso { margin-bottom: 1.1rem; }
.combustibles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.opcion { text-align: left; font: inherit; cursor: pointer; background: var(--gris); border: 1px solid var(--borde);
          border-radius: var(--radio); padding: .75rem 1rem; display: flex; align-items: center; gap: .7rem;
          color: var(--texto); }
.opcion small { display: block; color: var(--suave); font-size: .8rem; }
.opcion.elegida { background: var(--azul-suave); border: 2px solid var(--azul); padding: calc(.75rem - 1px) calc(1rem - 1px); }
.opcion:disabled { opacity: .5; cursor: not-allowed; }
.monto-y-teclado { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
.monto { background: var(--gris); border: 1px solid var(--borde); border-radius: var(--radio); padding: 1rem 1.25rem;
         display: flex; flex-direction: column; gap: .5rem; }
.monto-cifra { font-size: 2.9rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; min-height: 3.2rem; }
.conmutador { display: inline-flex; background: #fff; border: 1px solid var(--borde); border-radius: 10px; padding: 3px; }
.conmutador button { font: inherit; font-weight: 600; border: 0; background: none; padding: .3rem .8rem;
                     border-radius: 8px; cursor: pointer; color: var(--suave); }
.conmutador button.activo { background: var(--azul); color: #fff; }
.atajos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
.teclado { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; }
.tecla { font: inherit; font-size: 1.5rem; background: var(--gris); border: 1px solid var(--borde);
         border-radius: 10px; padding: .55rem 0; cursor: pointer; color: var(--texto); }
.tecla:active { background: var(--gris-2); }
.pagos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.pago { flex-direction: column; justify-content: center; text-align: center; gap: .35rem; min-height: 84px; }
.comprobante-opciones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin-bottom: .5rem; }
.documento { position: relative; }
.documento .estado-doc { position: absolute; right: .7rem; top: 50%; transform: translateY(-50%); font-size: .8rem; }
.generar { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.4rem;
           font-size: 1.1rem; border-radius: var(--radio); }
.generar .total { font-size: 1.35rem; font-weight: 500; }
.columna-lateral { display: flex; flex-direction: column; gap: 1rem; }
.surtidores { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.surtidor .cifra-grande { font-size: 1.75rem; font-weight: 400; margin: .35rem 0; }
.resumen-caja .cifra-grande { font-size: 1.9rem; font-weight: 500; }
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: grid; place-items: center; z-index: 10;
         padding: 1rem; }
.modal-caja { background: #fff; border-radius: 16px; padding: 1.5rem; width: 100%; max-width: 440px;
              box-shadow: 0 20px 50px rgba(15, 23, 42, .25); }

/* ---------- ticket (impresora térmica de 80 mm) ---------- */
.ticket { width: 72mm; margin: 0 auto; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11px;
          color: #000; padding: 4mm 0; }
.ticket h1 { font-size: 13px; font-weight: 700; text-align: center; margin: 0; }
.ticket .centro { text-align: center; }
.ticket hr { border: 0; border-top: 1px dashed #000; margin: 2mm 0; }
.ticket table td, .ticket table th { padding: .5mm 0; border: 0; background: none; font-size: 11px; color: #000;
                                     text-transform: none; letter-spacing: 0; }
.ticket .qr { display: flex; justify-content: center; margin: 2mm 0; }
@media print {
  body { background: #fff; }
  .no-imprimir { display: none !important; }
  @page { size: 80mm auto; margin: 0; }
}

@media (max-width: 1200px) {
  .terminal-cuerpo { grid-template-columns: 1fr; }
  .rejilla.cuatro { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .panel { grid-template-columns: 1fr; }
  .lateral { position: static; height: auto; }
  .rejilla.dos, .rejilla.tres, .rejilla.cuatro, .monto-y-teclado { grid-template-columns: 1fr; }
}

/* ---------- compatibilidad con las pantallas de inventario ---------- */
.etiqueta { display: inline-flex; border-radius: 999px; padding: .1rem .55rem; font-size: .75rem; font-weight: 600;
            background: var(--gris); color: var(--suave); }
.etiqueta.activo { background: var(--verde-suave); color: var(--verde); }
.etiqueta.inactivo { background: var(--rojo-suave); color: var(--rojo); }
.contenido > .tarjeta, .contenido form.tarjeta { background: #fff; }
