/* Gestor de Colas 2.0 — estilos compartidos */
:root {
  --bg: #EBF2F7;
  --card: #FFFFFF;
  --line: #CBD5E1;
  --line-soft: #E2E8F0;
  --ink: #0F172A;
  --muted: #64748B;
  --navy: #003B71;
  --ed: #002D62;
  --ed-2: #FFB81C;
  --cg: #4D8C1F;
  --cg-2: #78BE20;
  --general: #0066CC;
  --pref: #C62828;
  --ok: #059669;
  --warn: #D97706;
  --bad: #DC2626;
  --virtual: #6D28D9;
  --radius: 10px;
  --shadow: 0 4px 16px rgba(0, 59, 113, .08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: "Segoe UI", -apple-system, Roboto, Arial, sans-serif; background: var(--bg); color: var(--ink); font-size: 15px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--navy); }
.oculto { display: none !important; }

/* Barra superior */
.barra { background: #fff; border-bottom: 2px solid #005596; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.barra .marca { display: flex; align-items: center; gap: 12px; }
.barra h1 { font-size: 1.05rem; color: var(--navy); font-weight: 800; }
.barra .usuario { display: flex; align-items: center; gap: 10px; font-size: .88rem; color: var(--muted); }
.logo-ed { background: var(--ed); padding: 5px 12px; border-radius: 6px; display: inline-flex; align-items: center; }
.logo-ed img { height: 24px; display: block; }
.logo-cg { background: #fff; border: 1px solid var(--line); padding: 3px 10px; border-radius: 6px; display: inline-flex; align-items: center; }
.logo-cg img { height: 28px; display: block; }

/* Estado de conexión */
.conexion { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; background: #ECFDF5; color: #065F46; }
.conexion::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.conexion.caida { background: #FEF2F2; color: #991B1B; }
.conexion.caida::before { background: var(--bad); }

/* Tarjetas y disposición */
.contenedor { max-width: 1280px; margin: 0 auto; padding: 18px 20px 40px; }
.tarjeta { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.tarjeta h2 { font-size: 1rem; color: var(--navy); margin-bottom: 10px; }
.tarjeta h3 { font-size: .92rem; color: var(--navy); margin: 12px 0 8px; }
.rejilla { display: grid; gap: 16px; }
.dos { grid-template-columns: 1.4fr 1fr; }
@media (max-width: 960px) { .dos { grid-template-columns: 1fr; } }
.fila { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.espacio { flex: 1; }
.texto-suave { color: var(--muted); font-size: .85rem; }

/* Botones */
.btn { border: 1px solid transparent; border-radius: 8px; padding: 9px 16px; font-weight: 700; font-size: .9rem; display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: #F1F5F9; border-color: var(--line); color: #334155; transition: filter .15s; }
.btn:hover:not(:disabled) { filter: brightness(.96); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primario { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-verde { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn-rojo { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn-ambar { background: var(--warn); color: #fff; border-color: var(--warn); }
.btn-morado { background: var(--virtual); color: #fff; border-color: var(--virtual); }
.btn-wa { background: #25D366; color: #fff; border-color: #1DA851; }
.btn-chico { padding: 5px 10px; font-size: .8rem; }
.btn-grande { padding: 14px 22px; font-size: 1.05rem; }

/* Formularios */
label { display: block; font-size: .82rem; font-weight: 700; color: #334155; margin-bottom: 4px; }
.campo { margin-bottom: 12px; }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #005596; box-shadow: 0 0 0 3px rgba(0, 85, 150, .12); }
textarea { min-height: 70px; resize: vertical; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: .88rem; font-weight: 600; margin-bottom: 8px; }
.check input { margin-top: 3px; width: 17px; height: 17px; }
.dos-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 640px) { .dos-col { grid-template-columns: 1fr; } }

/* Insignias */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 12px; font-size: .76rem; font-weight: 800; background: #E2E8F0; color: #334155; white-space: nowrap; }
.chip-ed { background: var(--ed); color: var(--ed-2); }
.chip-cg { background: var(--cg-2); color: #fff; }
.chip-pref { background: #FEE2E2; color: var(--pref); }
.chip-gen { background: #E0F2FE; color: #0369A1; }
.chip-ok { background: #D1FAE5; color: #065F46; }
.chip-warn { background: #FEF3C7; color: #92400E; }
.chip-bad { background: #FEE2E2; color: #991B1B; }
.chip-vir { background: #EDE9FE; color: var(--virtual); }

/* Tablas */
.tabla { width: 100%; border-collapse: collapse; font-size: .86rem; }
.tabla th { text-align: left; background: #F1F5F9; color: var(--navy); padding: 8px 10px; border-bottom: 2px solid var(--line); font-weight: 800; white-space: nowrap; }
.tabla td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tabla-scroll { overflow-x: auto; }

/* Modal */
.modal-fondo { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal-cab { padding: 14px 18px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; }
.modal-cab h3 { font-size: 1rem; color: var(--navy); }
.modal-cuerpo { padding: 16px 18px; }
.modal-pie { padding: 12px 18px; border-top: 1px solid var(--line-soft); display: flex; justify-content: flex-end; gap: 8px; }
.cerrar-x { background: none; border: none; font-size: 1.4rem; line-height: 1; color: var(--muted); }

/* Avisos */
#avisos { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 80; max-width: 380px; }
.aviso { background: #0F172A; color: #fff; padding: 11px 14px; border-radius: 10px; font-size: .88rem; box-shadow: 0 8px 20px rgba(0,0,0,.2); animation: entra .2s ease-out; }
.aviso.error { background: #991B1B; }
.aviso.ok { background: #065F46; }
@keyframes entra { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Ingreso */
.ingreso { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.ingreso .tarjeta { width: 100%; max-width: 400px; padding: 28px; }
.ingreso .logos { display: flex; gap: 12px; justify-content: center; margin-bottom: 18px; }

/* Utilidades de codigo de ticket */
.codigo { font-family: "Segoe UI", Consolas, monospace; font-weight: 900; letter-spacing: .5px; }
.vacio { color: var(--muted); text-align: center; padding: 22px; font-size: .9rem; }
.pulso { animation: pulso 1.6s infinite; }
@keyframes pulso { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
