/* ============================================================
   pantalla.css — Pantalla Pública (TV / Kiosk)
   Diseñada para resolución 1080p+, legible a 3-4 metros
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0D0D0B;
  --bg-2:        #161614;
  --bg-3:        #1F1F1C;
  --border:      #2A2A26;
  --text:        #F0EFE8;
  --text-2:      #A8A89F;
  --text-3:      #5A5A54;
  --accent:      #4A9FD4;
  --accent-glow: rgba(74, 159, 212, 0.15);
  --green:       #3DBF7A;
  --green-glow:  rgba(61, 191, 122, 0.15);
  --amber:       #E09B2A;
  --amber-glow:  rgba(224, 155, 42, 0.15);
  --red:         #E85A4A;
  --header-h:    80px;
  --footer-h:    56px;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
}

/* ── HEADER ─────────────────────────────────────────────────── */
.header {
  height: var(--header-h);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 40px;
  gap: 24px;
}

.header-left  { display: flex; align-items: center; gap: 16px; flex: 1; }
.header-center { flex: 1; text-align: center; }
.header-right { display: flex; align-items: center; gap: 24px; flex: 1; justify-content: flex-end; }

.header-logo {
  width: 48px; height: 48px;
  background: var(--accent);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 24px; color: #fff; font-weight: 500;
  flex-shrink: 0;
}

.header-empresa {
  font-size: 22px; font-weight: 600;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.header-mensaje {
  font-size: 16px; color: var(--text-2);
  font-style: italic;
}

.header-reloj {
  font-family: 'DM Mono', monospace;
  font-size: 28px; font-weight: 300;
  color: var(--text);
  letter-spacing: .04em;
}

/* ── WS INDICATOR ───────────────────────────────────────────── */
.ws-indicator {
  display: flex; align-items: center; gap: 8px;
}

.ws-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s infinite;
}

.ws-dot.offline {
  background: var(--red);
  box-shadow: 0 0 8px var(--red);
  animation: none;
}

.ws-label {
  font-size: 13px; color: var(--text-3);
  font-family: 'DM Mono', monospace;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}

/* ── MAIN ───────────────────────────────────────────────────── */
.main {
  display: flex;
  height: calc(100vh - var(--header-h) - var(--footer-h));
}

/* ── COLUMNA IZQUIERDA ──────────────────────────────────────── */
.col-actual {
  flex: 0 0 58%;
  display: flex; flex-direction: column;
  padding: 32px 40px;
  gap: 24px;
}

.actual-label {
  font-size: 13px; font-weight: 700;
  color: var(--text-3); letter-spacing: .14em;
  font-family: 'DM Mono', monospace;
}

.actual-card {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px;
  position: relative;
  overflow: hidden;
  transition: all .4s ease;
}

.actual-card.llamando {
  border-color: var(--accent);
  box-shadow: 0 0 40px var(--accent-glow), inset 0 0 40px var(--accent-glow);
}

.actual-card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, var(--accent-glow) 0%, transparent 70%);
  opacity: 0; transition: opacity .4s ease;
}

.actual-card.llamando::before { opacity: 1; }

.actual-codigo {
  font-family: 'DM Mono', monospace;
  font-size: 120px; font-weight: 300;
  color: var(--text);
  line-height: 1;
  letter-spacing: -.02em;
  transition: all .3s ease;
}

.actual-modulo {
  font-size: 32px; font-weight: 500;
  color: var(--accent);
  margin-top: 16px;
  transition: all .3s ease;
}

.actual-servicio {
  font-size: 18px; color: var(--text-3);
  margin-top: 8px;
  font-family: 'DM Mono', monospace;
}

/* ── HISTORIAL ──────────────────────────────────────────────── */
.historial-section {
  flex: 0 0 auto;
}

.historial-label {
  font-size: 11px; font-weight: 700;
  color: var(--text-3); letter-spacing: .14em;
  font-family: 'DM Mono', monospace;
  margin-bottom: 10px;
}

.historial-list {
  display: flex; gap: 10px;
  flex-wrap: wrap;
}

.historial-empty {
  color: var(--text-3); font-size: 14px;
  font-family: 'DM Mono', monospace;
}

.historial-item {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  display: flex; align-items: center; gap: 10px;
}

.hist-codigo {
  font-family: 'DM Mono', monospace;
  font-size: 18px; font-weight: 500;
  color: var(--text-2);
}

.hist-modulo {
  font-size: 14px; color: var(--text-3);
}

/* ── SEPARADOR ──────────────────────────────────────────────── */
.separador {
  width: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* ── COLUMNA DERECHA ─────────────────────────────────────────── */
.col-espera {
  flex: 1;
  display: flex; flex-direction: column;
  padding: 32px 40px;
  gap: 16px;
}

.espera-label {
  font-size: 13px; font-weight: 700;
  color: var(--text-3); letter-spacing: .14em;
  font-family: 'DM Mono', monospace;
}

.espera-list {
  flex: 1;
  display: flex; flex-direction: column;
  gap: 12px;
}

.espera-empty {
  color: var(--text-3);
  font-size: 18px;
  font-family: 'DM Mono', monospace;
  padding: 20px 0;
}

.espera-item {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  display: flex; align-items: center; gap: 20px;
  transition: all .3s ease;
}

.espera-item:first-child {
  border-color: var(--amber);
  background: var(--bg-3);
}

.espera-pos {
  font-family: 'DM Mono', monospace;
  font-size: 16px; color: var(--text-3);
  width: 28px; text-align: center; flex-shrink: 0;
}

.espera-item:first-child .espera-pos {
  color: var(--amber);
  font-weight: 600;
}

.espera-codigo {
  font-family: 'DM Mono', monospace;
  font-size: 36px; font-weight: 400;
  color: var(--text);
  flex: 0 0 auto;
  min-width: 130px;
}

.espera-item:first-child .espera-codigo {
  color: var(--amber);
  font-size: 42px;
}

.espera-info {
  flex: 1;
}

.espera-servicio {
  font-size: 16px; color: var(--text-2);
  font-weight: 500;
}

.espera-prioridad {
  font-size: 12px; color: var(--text-3);
  font-family: 'DM Mono', monospace;
  margin-top: 2px;
}

.badge-preferencial { color: var(--amber); }
.badge-vip          { color: var(--accent); }

.espera-hora {
  font-size: 14px; color: var(--text-3);
  font-family: 'DM Mono', monospace;
  flex-shrink: 0;
}

.espera-total {
  font-size: 14px; color: var(--text-3);
  font-family: 'DM Mono', monospace;
  text-align: right;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ── FOOTER / TICKER ─────────────────────────────────────────── */
.footer {
  height: var(--footer-h);
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  overflow: hidden;
  display: flex; align-items: center;
}

.ticker-wrapper {
  width: 100%; overflow: hidden;
  padding: 0 40px;
}

.ticker-content {
  font-size: 18px; color: var(--text-2);
  white-space: nowrap;
  animation: ticker 30s linear infinite;
  display: inline-block;
}

@keyframes ticker {
  0%   { transform: translateX(100vw); }
  100% { transform: translateX(-100%); }
}

/* ── OVERLAY DE LLAMADO ──────────────────────────────────────── */
.llamado-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center; justify-content: center;
}

.llamado-overlay.show {
  display: flex;
  animation: fadeIn .2s ease;
}

.llamado-card {
  text-align: center;
  animation: scaleIn .3s ease;
}

.llamado-label {
  font-size: 18px; font-weight: 700;
  color: var(--text-3); letter-spacing: .2em;
  font-family: 'DM Mono', monospace;
  margin-bottom: 16px;
}

.llamado-codigo {
  font-family: 'DM Mono', monospace;
  font-size: 180px; font-weight: 300;
  color: var(--accent);
  line-height: 1;
  text-shadow: 0 0 60px var(--accent-glow);
  letter-spacing: -.02em;
}

.llamado-modulo {
  font-size: 40px; font-weight: 500;
  color: var(--text-2);
  margin-top: 16px;
}

@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }