/* ── Botones (Rediseñados - Opción A: Vidrio Neón Glassmorphic) ── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 320px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  
  /* Relleno semi-translúcido premium */
  background: rgba(16, 30, 46, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  
  /* Borde neon cian-azul brillante */
  border: 1px solid rgba(74, 216, 247, 0.45);
  
  color: #eff4fc;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
  
  /* Transiciones extremadamente suaves */
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.1s ease;
  
  /* Resplandor exterior neon y bisel interior premium */
  box-shadow: 0 4px 24px rgba(51, 161, 255, 0.18), inset 0 1px 1px rgba(255, 255, 255, 0.12);
  
  -webkit-user-select: none;
  user-select: none;
}
/* Efecto hover elegante exclusivo para ordenadores (evita atascarse en móviles) */
@media (hover: hover) {
  .btn:hover {
    background: rgba(16, 30, 46, 0.85);
    border-color: rgba(74, 216, 247, 0.85);
    box-shadow: 0 6px 28px rgba(74, 216, 247, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  }
}

/* Respuesta táctil instantánea, sutil y elegante para móviles y clicks */
.btn:active {
  transform: scale(0.985); /* Escala súper discreta que simula un botón real de alta gama */
  background: rgba(22, 37, 58, 0.75); /* Apenas un matiz más profundo */
  border-color: rgba(74, 216, 247, 0.65); /* Pequeño destello cian refinado */
  box-shadow: 0 4px 20px rgba(51, 161, 255, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.15); /* Incremento leve de iluminación interna */
  -webkit-tap-highlight-color: transparent;
}

.btn:disabled {
  opacity: 0.3;
  pointer-events: none;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text);
}

.btn-danger-ghost {
  color: var(--error);
  border-color: var(--error-border);
}
.btn-danger-ghost:hover { background: var(--error-bg); }

.btn-sm {
  padding: 11px 18px;
  font-size: 14px;
  max-width: 220px;
  border-radius: var(--radius);
}

.btn-icon {
  width: 44px; height: 44px;
  padding: 0;
  max-width: 44px;
  border-radius: 50%;
  background: var(--surface-2);
  box-shadow: none;
  color: var(--text-muted);
  font-size: 20px;
}

/* Grupo de botones modo toggle */
.toggle-group {
  display: flex;
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 4px;
  gap: 4px;
  width: 100%;
  max-width: 320px;
}
.toggle-btn {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s;
}
.toggle-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px var(--accent-glow);
}

/* ── Inputs ── */
.input-group {
  width: 100%;
  max-width: 320px;
  margin-bottom: 14px;
}
.input-group .label { display: block; }

.input {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}
.input::placeholder { color: var(--text-dim); }
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.input.error { border-color: var(--error); box-shadow: 0 0 0 3px var(--error-bg); }

/* Wrapper para inputs de contraseña con toggle ojo */
.input-pw-wrap {
  position: relative;
  width: 100%;
}
.input-pw-wrap .input { padding-right: 46px; }
.btn-show-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--text-dim);
  padding: 4px;
  line-height: 1;
  transition: color 0.15s;
}
.btn-show-pw:hover { color: var(--text-muted); }
.btn-show-pw.pw-showing::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.5px;
  height: 18px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
  border-radius: 1px;
  opacity: 0.8;
  pointer-events: none;
}

/* ── Cards / glass panels ── */
.card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.glass-card {
  background: rgba(16, 30, 46, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 360px;
}

/* ── Mensaje de resultado (admin scanner) ── */
.result-panel {
  width: 100%;
  max-width: 360px;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border-radius: var(--radius-lg);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  border: 1px solid var(--border-soft);
  background: var(--surface-2);
  color: var(--text-muted);
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.result-panel.ok {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}
.result-panel.err {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error);
}

/* ── Mensajes de error inline ── */
.msg-error {
  font-size: 13px;
  color: var(--error);
  margin-top: 8px;
  min-height: 18px;
  text-align: center;
  width: 100%;
  max-width: 320px;
}

/* ── Listas ── */
.list {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.list-item {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text-muted);
}
.list-item strong { color: var(--text); }

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-blue  { background: rgba(51,111,182,0.15); color: var(--accent); }
.badge-green { background: var(--success-bg); color: var(--success); }
.badge-red   { background: var(--error-bg); color: var(--error); }

/* ── Stats card ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 480px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
}
.stat-num  { font-size: 32px; font-weight: 800; color: var(--accent); line-height: 1; }
.stat-lbl  { font-size: 11px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ── Divider ── */
.divider {
  width: 100%;
  max-width: 320px;
  height: 1px;
  background: var(--border-soft);
  margin: 20px 0;
}

/* ── Spinner ── */
.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--border-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── QR container ── */
.qr-container {
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  position: relative;
  display: inline-block;
  user-select: none;
  -webkit-user-select: none;
}
#qr-canvas { display: block; }
.qr-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 8px;
  pointer-events: none;
  font-size: 9px;
  color: rgba(0,0,0,0.12);
  font-family: monospace;
  letter-spacing: 0.5px;
  user-select: none;
}

/* ── Timer ring ── */
.qr-timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
}
.timer-ring {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--prog, 100%), var(--surface-2) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.timer-ring::after {
  content: '';
  position: absolute;
  inset: 5px;
  background: var(--surface);
  border-radius: 50%;
}
.timer-secs {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  z-index: 1;
  position: relative;
}

/* ── Menú de acciones fallero ── */
.action-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

/* ── Sección con título ── */
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 12px;
  width: 100%;
  max-width: 480px;
}

/* ── SuperAdmin navegación (estilo Settings iOS) ── */
.sa-nav {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.sa-nav-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 17px 18px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.15s;
  text-align: left;
}
.sa-nav-btn:last-child { border-bottom: none; }
.sa-nav-btn:hover,
.sa-nav-btn:active { background: var(--surface-2); }

.sa-nav-label { flex: 1; }

.sa-nav-arrow {
  color: var(--text-dim);
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
}

/* Sub-panel: cabecera con botón volver */
.sa-sub-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  max-width: 480px;
  margin-bottom: 24px;
}

.sa-sub-header h2 {
  text-align: center;
  margin-bottom: 0;
}

.sa-back-btn {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  padding: 4px 0;
  justify-self: start;
}
.sa-back-btn:hover { color: var(--accent-hover); }

/* ── Presencia en tiempo real (admin) ── */
.presencia-admin {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 24px 20px 20px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 320px;
}

.presencia-live {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse-live 2s ease-in-out infinite;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.75); }
}

.presencia-num {
  font-size: 56px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -2px;
}

.presencia-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-top: 2px;
}

.presencia-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
}

/* Aforo superado */
.presencia-admin.aforo-superado {
  border-color: var(--error-border);
  background: var(--error-bg);
}
.presencia-admin.aforo-superado .presencia-num { color: var(--error); }
.presencia-admin.aforo-superado .presencia-live { background: var(--error); }

.stat-card.aforo-superado {
  border-color: var(--error-border);
  background: var(--error-bg);
}
.stat-card.aforo-superado .stat-num { color: var(--error); }

/* ── Tab bar zona fallero (fija en la parte inferior) ── */
.socio-tabs {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: rgba(10, 14, 23, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-soft);
  padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
  z-index: 100;
  max-width: none;
  border-radius: 0;
  gap: 0;
}

.socio-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  transition: color 0.2s;
  letter-spacing: 0.2px;
  text-align: center;
}

.socio-tab.active {
  color: var(--accent);
  background: transparent;
  box-shadow: none;
}

/* ── Mi Área — perfil fallero ── */
.mi-area-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 8px 0 0;
}

.mi-area-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -1px;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.mi-area-nombre {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}


/* ── File input ── */
.file-input-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.file-input-label:hover { border-color: var(--accent); color: var(--accent); }
input[type="file"] { display: none; }

/* ── Cabecera de agrupación por día ── */
.dia-header {
  width: 100%;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 6px 4px 4px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 4px;
}

/* ── Fila de anunciante en config SA ── */
.anunciante-row {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.anunciante-row .anunciante-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 2px;
}

/* ── Modal de confirmación ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  width: 100%;
  max-width: 340px;
  animation: screenIn 0.2s ease;
}

.modal-titulo {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  text-align: center;
}

.modal-mensaje {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ── Toasts ── */
.toast-container {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 300;
  pointer-events: none;
}

.toast {
  padding: 12px 22px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  color: var(--text);
  white-space: nowrap;
  animation: screenIn 0.2s ease;
}
.toast.error   { background: var(--error-bg);   border-color: var(--error-border);   color: var(--error); }
.toast.success { background: var(--success-bg); border-color: var(--success-border); color: var(--success); }

/* ── QR alto contraste (uso en exteriores) ── */
.qr-container.qr-alto-contraste {
  padding: 24px;
  box-shadow: 0 0 0 10px #fff, 0 0 40px rgba(255,255,255,0.3);
}

/* ── QR timer urgencia (últimos 30s) ── */
.timer-ring.timer-urgente {
  background: conic-gradient(var(--error) var(--prog, 100%), var(--surface-2) 0);
  transition: background 0.5s ease;
}
.timer-ring.timer-urgente .timer-secs { color: var(--error); }

/* ── Módulo 1: Tarjeta de evento (zona fallero) ── */
.evento-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.evento-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.evento-card-nombre {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.evento-card-fecha {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: capitalize;
}

.evento-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.evento-card-limite {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
}

.evento-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

/* ── Botones de acción en lista SA (editar / borrar / ver) ── */
.btn-sa-action {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  cursor: pointer;
}
.btn-sa-action:hover { background: var(--border); }
.btn-sa-action-danger:hover { background: var(--error-bg); border-color: var(--error-border); }

/* Responsive max width para desktop */
@media (min-width: 640px) {
  .screen { padding: 36px 24px 48px; }
  h1 { font-size: 30px; }
}

/* ── Módulo 2: Numpad de barra ── */
.barra-key {
  height: 72px;
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.12s, transform 0.08s;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-user-select: none;
  user-select: none;
}
.barra-key:active { background: var(--border); transform: scale(0.94); }

.barra-key-del {
  color: var(--text-muted);
  font-size: 20px;
}

.barra-key-ok {
  background: var(--success);
  border-color: var(--success-border);
  color: #fff;
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.25);
}
.barra-key-ok:active { background: #16a34a; }

/* ── SuperAdmin: layout escritorio ── */
@media (min-width: 900px) {

  /* Zona SA: layout dos columnas */
  #zona-superadmin {
    flex-direction: row;
    align-items: flex-start;
    padding: 0;
    gap: 0;
  }

  /* ── Sidebar ── */
  .sa-sidebar {
    width: 260px;
    flex-shrink: 0;
    min-height: calc(100vh - var(--topbar-h));
    background: var(--surface);
    border-right: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    padding: 28px 16px 24px;
    position: sticky;
    top: var(--topbar-h);
    gap: 0;
  }

  .sa-sidebar-top {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-soft);
  }

  .sa-sidebar-falla {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin: 0;
  }

  .sa-sidebar-stats {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-soft);
  }

  .sa-sidebar-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    padding: 8px 4px;
    border: 1px solid var(--border-soft);
  }

  .sa-sidebar-stat.aforo-superado { border-color: var(--error-border); background: var(--error-bg); }
  .sa-sidebar-stat.aforo-superado .sa-sidebar-stat-num { color: var(--error); }

  .sa-sidebar-stat-num {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
  }

  .sa-sidebar-stat-lbl {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 3px;
  }

  .sa-sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .sa-sidebar-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    text-align: left;
    transition: background 0.15s, color 0.15s;
  }

  .sa-sidebar-icon {
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
  }

  .sa-sidebar-btn:hover { background: var(--surface-2); color: var(--text); }

  .sa-sidebar-btn.sa-active {
    background: var(--accent-glow);
    color: var(--accent);
    font-weight: 600;
  }

  .sa-sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border-soft);
  }

  /* ── Área de contenido ── */
  .sa-content {
    flex: 1;
    min-width: 0;
    padding: 32px 40px 48px;
  }

  /* Ancho máximo de elementos de contenido en escritorio */
  .sa-content .sa-nav,
  .sa-content .sa-sub-header,
  .sa-content .input-group,
  .sa-content .list,
  .sa-content .card,
  .sa-content .stat-grid,
  .sa-content .divider,
  .sa-content .result-panel { max-width: 680px !important; }

  /* Ajuste del sub-header en escritorio */
  .sa-content .sa-sub-header { margin-bottom: 28px; }

  /* Ocultar navegación y logout del sa-main en escritorio (están en el sidebar) */
  .sa-mobile-nav { display: none; }

  /* Ocultar botones Volver que van al menú principal (reemplazados por el sidebar) */
  .sa-back-to-main { display: none !important; }

  /* sa-main en escritorio: sólo título y stats */
  #sa-main { padding-top: 8px; }
}

/* Sidebar oculto en móvil */
@media (max-width: 899px) {
  .sa-sidebar { display: none; }
  .sa-content { width: 100%; }
}

/* ── Dashboard SA ─────────────────────────────────────────────────────────── */

.dashboard-wrap {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 48px;
}

.dashboard-refresh-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 4px;
}

.dashboard-last-update {
  font-size: 12px;
  color: var(--text-muted);
}

.dashboard-block {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 20px 24px;
}

.dashboard-block-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 0 0 16px;
}

/* Aforo hero */
.dashboard-aforo-hero {
  text-align: center;
}

.aforo-total {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 8px;
}

.aforo-num {
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -2px;
}

.aforo-lbl {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 6px;
}

.aforo-desglose {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary, #aaa);
  margin-top: 4px;
}

.aforo-item {
  display: flex;
  gap: 4px;
}

.aforo-item span:first-child {
  font-weight: 700;
  color: var(--text-primary, #fff);
}

.aforo-sep { color: var(--text-muted); }

/* Stats grid (economía y movimiento) */
.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}

.dashboard-stat {
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(255,255,255,0.05);
}

.dashboard-stat-num {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.dashboard-stat-lbl {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.dashboard-stat.dashboard-stat-accent .dashboard-stat-num {
  color: #4ade80;
}

.dashboard-alert {
  margin: 12px 0 0;
  font-size: 13px;
  color: #fb923c;
}

/* Próximo evento */
.dashboard-evento-card {
  font-size: 15px;
  line-height: 1.7;
}

.dashboard-evento-card strong {
  font-size: 18px;
  display: block;
  margin-bottom: 2px;
}

.dashboard-evento-progress {
  margin-top: 10px;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
}

.dashboard-evento-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* Actividad reciente */
.dashboard-activity {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dashboard-activity li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  min-width: 0;
}

.dash-activity-icon { font-size: 14px; flex-shrink: 0; }

.dash-activity-persona {
  font-weight: 600;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.dash-activity-accion {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 700;
  flex-shrink: 0;
}

.dash-activity-accion.entrada {
  background: rgba(74, 222, 128, 0.12);
  color: #4ade80;
}

.dash-activity-accion.salida {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
}

.dash-activity-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.dashboard-activity-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 16px;
  font-size: 13px;
}

/* ── Dashboard: Bloque Gráficas ────────────────────────────────────────────── */
.dash-graf-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 18px;
}

.dash-graf-control-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash-graf-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.dash-graf-input,
.dash-graf-select {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 8px;
  color: var(--text-primary, #f1f5f9);
  padding: 8px 10px;
  font-size: 14px;
  min-width: 110px;
  cursor: pointer;
}

.dash-graf-input:focus,
.dash-graf-select:focus {
  outline: none;
  border-color: var(--accent, #6366f1);
}

.dash-graf-canvas-wrap {
  position: relative;
  height: 220px;
  margin-bottom: 4px;
}

.dash-graf-subtitle {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary, #94a3b8);
  margin: 18px 0 10px;
  letter-spacing: .02em;
}

.dash-graf-empty-msg {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 24px 0 8px;
  opacity: 0.7;
}

/* Botón "Ver gráficas" */
.btn.btn-accent {
  background: var(--accent, #6366f1);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s;
}

.btn.btn-accent:hover  { opacity: .85; }
.btn.btn-accent:active { opacity: .7; }
.btn.btn-accent:disabled { opacity: .45; cursor: default; }

/* ── Dashboard: Selector de fecha ─────────────────────────────────────────── */
.dash-fecha-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.dash-fecha-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.dash-fecha-input {
  background: var(--surface-raised, var(--surface));
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  padding: 5px 10px;
  font-family: inherit;
  cursor: pointer;
}
.dash-fecha-input:focus { outline: none; border-color: var(--accent, #6366f1); }
