/* ── Botones ── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 320px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  background: var(--accent);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.3px;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 4px 20px var(--accent-glow);
  -webkit-user-select: none;
  user-select: none;
}
.btn:hover  { background: var(--accent-hover); box-shadow: 0 6px 28px var(--accent-glow); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; pointer-events: none; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-soft);
  box-shadow: none;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.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); }

/* ── 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;
}

/* ── Tab bar zona fallero ── */
.socio-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  background: var(--surface-2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 320px;
}

.socio-tab {
  flex: 1;
  padding: 10px 8px;
  border-radius: calc(var(--radius-lg) - 4px);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s;
  text-align: center;
}

.socio-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px var(--accent-glow);
}

/* ── 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; }

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