/* =========================
   RESET & BASE
========================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f0f2f5;
  min-height: 100vh;
}

.fondo-estatico {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url('/Rifa-JC-hogar/fondo1.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

/* =========================
   LAYOUT PRINCIPAL
========================= */
.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

.panel {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

/* =========================
   GRILLA DE NÚMEROS
========================= */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 10px;
}

/* --- Botón base --- */
.grid button {
  width: 100%;
  aspect-ratio: 1;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
  color: #1f2937;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.grid button:active {
  transform: scale(0.93);
}

/* --- Estado: libre (gris) --- */
.grid button.libre {
  background-color: #d1d5db;
  color: #374151;
}

.grid button.libre:hover {
  background-color: #b0b7c3;
}

/* --- Estado: pendiente (amarillo) --- */
.grid button.pendiente {
  background-color: #fbbf24;
  color: #78350f;
  cursor: not-allowed;
}

.grid button.pendiente:hover {
  filter: brightness(0.95);
}

/* --- Estado: confirmado (rojo) --- */
.grid button.confirmado {
  background-color: #ef4444;
  color: #ffffff;
  cursor: not-allowed;
}

.grid button.confirmado:hover {
  filter: brightness(0.95);
}

/* =========================
   MODAL DE INFORMACIÓN
========================= */

/* Fondo oscuro */
.modal-info-pro {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 16px;
  backdrop-filter: blur(3px);
}

/* Cuando está visible */
.modal-info-pro.mostrar {
  display: flex;
}

/* Tarjeta del modal */
.modal-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 420px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: modalEntrada 0.2s ease;
}

@keyframes modalEntrada {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Botón X cerrar */
.btn-cerrar-pro {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #f3f4f6;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 14px;
  cursor: pointer;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.btn-cerrar-pro:hover {
  background: #e5e7eb;
  color: #111827;
}

/* Header del modal */
.modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.icono-info-grande {
  flex-shrink: 0;
}

.icono-modal-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.modal-header h2 {
  font-size: 18px;
  color: #111827;
  font-weight: 700;
}

.subtitulo-modal {
  font-size: 13px;
  color: #6b7280;
  margin-top: 2px;
}

/* Body del modal */
.modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #f9fafb;
  border-radius: 10px;
}

.info-label {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}

.info-value {
  font-size: 14px;
  color: #111827;
  font-weight: 700;
}

.aviso-extra {
  padding: 12px 14px;
  background: #fef9c3;
  border-left: 4px solid #fbbf24;
  border-radius: 8px;
  font-size: 13px;
  color: #78350f;
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Footer del modal */
.modal-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-whatsapp-pro {
  display: block;
  text-align: center;
  padding: 12px;
  background: #22c55e;
  color: white;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  font-size: 15px;
  transition: background 0.2s;
}

.btn-whatsapp-pro:hover {
  background: #16a34a;
}

.btn-cerrar-secundario {
  padding: 11px;
  background: #f3f4f6;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-cerrar-secundario:hover {
  background: #e5e7eb;
}

/* =========================
   BOTÓN FLOTANTE INFO
========================= */
.btn-info-flotante {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #2563eb;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  z-index: 900;
}

.btn-info-flotante:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.icono-info-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  filter: invert(1) brightness(2);
}

/* =========================
   PANEL ADMIN
========================= */
.admin-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px;
  margin-top: 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.admin-card h2 {
  margin-bottom: 16px;
  color: #1f2937;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 6px;
  font-weight: 600;
  color: #374151;
}

.form-group input,
.form-group textarea {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #2563eb;
}

.full-width {
  grid-column: 1 / -1;
}

.btn-primary {
  margin-top: 16px;
  padding: 12px 18px;
  border: none;
  border-radius: 12px;
  background: #2563eb;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.tabla-container {
  overflow-x: auto;
  margin-top: 10px;
}

.tabla-container table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.tabla-container th,
.tabla-container td {
  padding: 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.tabla-container th {
  background: #f3f4f6;
  color: #111827;
}

/* Badges de estado en tabla admin */
.estado-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.estado-badge.libre {
  background: #d1d5db;
  color: #374151;
}

.estado-badge.pendiente {
  background: #fbbf24;
  color: #78350f;
}

.estado-badge.confirmado {
  background: #ef4444;
  color: #ffffff;
}

/* Botones admin en tabla */
.btn-confirmar {
  padding: 6px 12px;
  background: #22c55e;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 6px;
  transition: background 0.15s;
}

.btn-confirmar:hover {
  background: #16a34a;
}

.btn-cancelar {
  padding: 6px 12px;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-cancelar:hover {
  background: #dc2626;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 8px;
  }

  .grid button {
    font-size: 13px;
  }
}
/* =========================
   ADMIN: SECCIONES Y TÍTULOS
========================= */
.panel h1 {
  font-size: 22px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 4px;
}

.panel .subtitulo {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 24px;
}

.admin-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}

.admin-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.admin-section h2 {
  font-size: 16px;
  font-weight: 700;
  color: #374151;
  margin-bottom: 14px;
}

.acciones-superiores {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* =========================
   BOTÓN GUARDAR (ADMIN)
========================= */
.btn-guardar {
  margin-top: 16px;
  padding: 12px 18px;
  border: none;
  border-radius: 12px;
  background: #2563eb;
  color: white;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-guardar:hover {
  background: #1d4ed8;
}

/* =========================
   BOTÓN DESCARGAR CSV
========================= */
.btn-descargar {
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  background: #0ea5e9;
  color: white;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-descargar:hover {
  background: #0284c7;
}

/* =========================
   BANNER DE PRESENTACIÓN (index)
========================= */
.banner-presentacion {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}

.banner-presentacion.cerrando {
  animation: fadeOut 0.28s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.banner-inner {
  position: relative;
  max-width: 520px;
  width: 100%;
  animation: bannerEntrada 0.3s ease;
}

@keyframes bannerEntrada {
  from { opacity: 0; transform: scale(0.94) translateY(16px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

.banner-img {
  width: 100%;
  border-radius: 16px;
  display: block;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  object-fit: contain;
  max-height: 80vh;
}

.banner-cerrar {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  border: none;
  font-size: 15px;
  cursor: pointer;
  color: #374151;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: background 0.15s, transform 0.15s;
}

.banner-cerrar:hover {
  background: #f3f4f6;
  transform: scale(1.08);
}

/* =========================
   UPLOADER DE IMAGEN (admin)
========================= */
.admin-hint {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 14px;
}

.upload-area {
  border: 2px dashed #d1d5db;
  border-radius: 14px;
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: #f9fafb;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-area.drag-over {
  border-color: #2563eb;
  background: #eff6ff;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #6b7280;
  font-size: 14px;
}

.upload-icon {
  font-size: 32px;
  line-height: 1;
}

.upload-hint {
  font-size: 12px;
  color: #9ca3af;
}

.preview-actual {
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.preview-actual img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 4px 14px rgba(0,0,0,0.1);
}

.preview-label {
  font-size: 12px;
  color: #9ca3af;
}

.upload-acciones {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.btn-secondary {
  padding: 10px 16px;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  background: #ffffff;
  color: #374151;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-secondary:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.upload-status {
  display: none;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}

.upload-status.visible {
  display: block;
}

.upload-status.status-ok {
  background: #dcfce7;
  color: #166534;
}

.upload-status.status-error {
  background: #fee2e2;
  color: #991b1b;
}

.upload-status.status-info {
  background: #eff6ff;
  color: #1d4ed8;
}

/* =========================
   LOGIN ADMIN
========================= */
.login-overlay {
  position: fixed;
  inset: 0;
  background: #f0f2f5;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.login-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 36px 28px 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.10);
}

.login-titulo {
  font-size: 20px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 6px;
  text-align: center;
}

.login-subtitulo {
  font-size: 13px;
  color: #6b7280;
  text-align: center;
  margin-bottom: 24px;
}

.password-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
}

.password-wrapper input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
}

.password-wrapper input:focus {
  border-color: #2563eb;
}

.btn-ver-pass {
  padding: 10px 12px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s;
  flex-shrink: 0;
}

.btn-ver-pass:hover {
  background: #e5e7eb;
}

.login-error {
  color: #dc2626;
  font-size: 13px;
  margin-top: 10px;
  text-align: center;
  font-weight: 500;
}

/* =========================
   BOTÓN BLOQUEAR / DESBLOQUEAR
========================= */
.btn-bloquear {
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  background: #dc2626;
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
}

.btn-bloquear:hover {
  background: #b91c1c;
  transform: scale(1.02);
}

.btn-desbloquear {
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  background: #16a34a;
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.35);
}

.btn-desbloquear:hover {
  background: #15803d;
  transform: scale(1.02);
}

/* Botones bloqueados globalmente en index */
.grid button.bloqueado-global {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.3);
}

/* =========================
   BOTONES BLOQUEAR / DESBLOQUEAR
========================= */
.btn-bloquear {
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  background: #ef4444;
  color: white;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-bloquear:hover {
  background: #dc2626;
}

.btn-desbloquear {
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  background: #22c55e;
  color: white;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-desbloquear:hover {
  background: #16a34a;
}