/*
 * Autor: IA (Claude) | Fecha: 11/07/2026 | Módulo: General (UI compartida)
 * Hoja de estilos del Ecosistema Digital Greñitas.
 * Diseño limpio, alto contraste y botones grandes (uso táctil en mostrador).
 */
:root {
  --primario: #7B3FF2;
  --primario-osc: #5B21C9;
  --acento: #FF8A00;
  --exito: #2E9E5B;
  --peligro: #D93636;
  --alerta: #E6A700;
  --fondo: #F4F2FB;
  --tarjeta: #FFFFFF;
  --texto: #221A38;
  --texto-suave: #6B6285;
  --borde: #E3DEF3;
  --radio: 14px;
  --sombra: 0 2px 10px rgba(46, 26, 96, .08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--fondo); color: var(--texto); font-size: 16px;
}
h1, h2, h3 { font-weight: 700; }
a { color: var(--primario); text-decoration: none; }

/* ---------- Estructura general ---------- */
.barra-superior {
  display: flex; align-items: center; gap: 14px;
  background: var(--primario); color: #fff; padding: 10px 18px;
  position: sticky; top: 0; z-index: 50; box-shadow: var(--sombra);
}
.barra-superior .logo { font-size: 20px; font-weight: 800; letter-spacing: .5px; }
.barra-superior .espacio { flex: 1; }
.barra-superior .usuario { font-size: 14px; opacity: .9; }

.contenedor { max-width: 1280px; margin: 0 auto; padding: 18px; }
.fila { display: flex; gap: 16px; flex-wrap: wrap; }
.columna { flex: 1; min-width: 280px; }

.tarjeta {
  background: var(--tarjeta); border-radius: var(--radio);
  box-shadow: var(--sombra); padding: 18px; margin-bottom: 16px;
}
.tarjeta h2 { font-size: 18px; margin-bottom: 12px; color: var(--primario-osc); }

/* ---------- Navegación por pestañas ---------- */
.pestanas { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.pestanas button {
  border: none; background: var(--tarjeta); color: var(--texto);
  padding: 12px 18px; border-radius: 999px; font-size: 15px; font-weight: 600;
  cursor: pointer; box-shadow: var(--sombra);
}
.pestanas button.activa { background: var(--primario); color: #fff; }

/* ---------- Botones ---------- */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: var(--radio); cursor: pointer;
  background: var(--primario); color: #fff;
  font-size: 16px; font-weight: 700; padding: 12px 20px;
  transition: transform .05s ease, opacity .15s;
}
.boton:active { transform: scale(.97); }
.boton:disabled { opacity: .5; cursor: not-allowed; }
.boton.secundario { background: #EDE8FA; color: var(--primario-osc); }
.boton.exito { background: var(--exito); }
.boton.peligro { background: var(--peligro); }
.boton.alerta { background: var(--alerta); }
.boton.grande { font-size: 20px; padding: 18px 26px; }
.boton.chico { font-size: 13px; padding: 7px 12px; border-radius: 9px; }

/* ---------- Formularios ---------- */
label.campo { display: block; margin-bottom: 12px; font-size: 14px; font-weight: 600; color: var(--texto-suave); }
label.campo input, label.campo select, label.campo textarea {
  display: block; width: 100%; margin-top: 5px;
  border: 2px solid var(--borde); border-radius: 10px;
  padding: 11px 12px; font-size: 16px; background: #fff; color: var(--texto);
}
label.campo input:focus, label.campo select:focus, label.campo textarea:focus {
  outline: none; border-color: var(--primario);
}

/* ---------- Tablas ---------- */
.tabla-envoltura { overflow-x: auto; }
table.tabla { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.tabla th {
  text-align: left; padding: 10px; color: var(--texto-suave);
  border-bottom: 2px solid var(--borde); font-size: 13px; text-transform: uppercase;
}
table.tabla td { padding: 10px; border-bottom: 1px solid var(--borde); }
table.tabla tr:hover td { background: #FAF8FF; }

/* ---------- Insignias y semáforos ---------- */
.insignia {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700;
}
.insignia.gris    { background: #E9E9EF; color: #555; }
.insignia.amarillo{ background: #FFF3C4; color: #8a6d00; }
.insignia.naranja { background: #FFE0B2; color: #b35c00; }
.insignia.verde   { background: #D3F2DE; color: #1a7a42; }
.insignia.rojo    { background: #FBD9D9; color: #a31212; }
.insignia.morado  { background: #EDE8FA; color: var(--primario-osc); }

/* ---------- Matriz táctil POS / botones de servicio ---------- */
.matriz { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.boton-servicio {
  border: none; border-radius: var(--radio); cursor: pointer;
  color: #fff; padding: 18px 10px; text-align: center;
  font-size: 15px; font-weight: 700; min-height: 96px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  box-shadow: var(--sombra);
}
.boton-servicio .icono { font-size: 30px; }
.boton-servicio small { font-weight: 600; opacity: .95; }
.boton-servicio:active { transform: scale(.96); }

/* ---------- Sillas del turnomático ---------- */
.silla {
  border-radius: var(--radio); padding: 16px; text-align: center;
  color: #fff; font-weight: 700; min-height: 110px;
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
}
.silla.libre    { background: var(--exito); }
.silla.ocupada  { background: var(--peligro); }
.silla.limpieza { background: var(--alerta); }

/* ---------- Avisos / notificaciones ---------- */
#avisos-flotantes { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.aviso-flotante {
  background: var(--texto); color: #fff; border-radius: 12px;
  padding: 13px 18px; box-shadow: var(--sombra); font-size: 15px; max-width: 340px;
  animation: aparecer .2s ease;
}
.aviso-flotante.exito { background: var(--exito); }
.aviso-flotante.error { background: var(--peligro); }
@keyframes aparecer { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

/* ---------- Ventana modal ---------- */
.modal-fondo {
  position: fixed; inset: 0; background: rgba(20, 8, 50, .55);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px;
}
.modal {
  background: #fff; border-radius: var(--radio); padding: 22px;
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
}
.modal h3 { margin-bottom: 14px; color: var(--primario-osc); }
.oculto { display: none !important; }

/* ---------- Login ---------- */
.login-envoltura { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: linear-gradient(140deg, var(--primario) 0%, var(--acento) 100%); }
.login-caja { background: #fff; border-radius: 20px; padding: 34px; width: 100%; max-width: 400px; box-shadow: 0 18px 50px rgba(0,0,0,.25); }
.login-caja h1 { text-align: center; color: var(--primario); margin-bottom: 4px; }
.login-caja p.sub { text-align: center; color: var(--texto-suave); margin-bottom: 22px; font-size: 14px; }

/* ---------- Estadísticas rápidas ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--tarjeta); border-radius: var(--radio); box-shadow: var(--sombra); padding: 16px; }
.kpi .valor { font-size: 28px; font-weight: 800; color: var(--primario-osc); }
.kpi .nombre { font-size: 13px; color: var(--texto-suave); font-weight: 600; }

@media (max-width: 640px) {
  .contenedor { padding: 10px; }
  .boton.grande { font-size: 17px; padding: 14px 18px; }
}
