:root {
  --cp: #003087;
  --cs: #009ee3;
  --ca: #10b981;
  --fondo: #f5f7fa;
  --card: #ffffff;
  --texto: #1e293b;
  --suave: #64748b;
  --borde: #e2e8f0;
  --error: #ef4444;
  --alerta: #f59e0b;
  --radio: 14px;
  --sombra: 0 4px 24px rgba(0,0,0,.10);
  --sombra2: 0 8px 32px rgba(0,0,0,.16);
  --fuente: 'Segoe UI', system-ui, -apple-system, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

/* Fondo con COLORES ORIGINALES (sin overlay, opacity, blur, brightness ni degradados) */
body {
  font-family: var(--fuente); color: var(--texto); min-height: 100vh; line-height: 1.6;
  background-image: url('FONDO.png');
  background-size: cover; background-position: center;
  background-attachment: fixed; background-repeat: no-repeat;
}

/* Párrafos justificados (SOLO párrafos de contenido) */
p.parrafo, .intro-text, .conf-cuerpo, .texto-just { text-align: justify; }

/* Badge modo */
.modo-badge { position: fixed; top: 12px; right: 12px; padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: .5px; z-index: 9999; }
.badge-prod { background: #d1fae5; color: #065f46; border: 1px solid #34d399; }

/* Layout */
.page-wrapper { max-width: 600px; margin: 0 auto; padding: 24px 16px 40px; display: flex; flex-direction: column; gap: 20px; }
.page-wide { max-width: 1180px; margin: 0 auto; padding: 20px 16px 40px; }

/* Header */
.event-header { text-align: center; padding: 12px 0 4px; }
#logo-container img, .event-logo { max-height: 180px; max-width: 90%; margin: 0 auto 8px; object-fit: contain; display: block; }
.event-header h1 { font-size: 1.55rem; font-weight: 700; color: var(--cp); line-height: 1.2; text-shadow: 0 1px 2px rgba(255,255,255,.6); }
.event-header p { font-size: .9rem; color: #334155; margin-top: 4px; }

/* Card */
.card { background: var(--card); border-radius: var(--radio); padding: 28px 24px; box-shadow: var(--sombra); }
.card h2 { font-size: 1.15rem; font-weight: 700; color: var(--cp); margin-bottom: 18px; padding-bottom: 12px; border-bottom: 2px solid var(--fondo); }

/* Formulario */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-size: .78rem; font-weight: 700; color: var(--suave); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .4px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--borde); border-radius: 8px;
  font-size: .94rem; font-family: var(--fuente); color: var(--texto); background: var(--card);
  transition: border-color .2s, box-shadow .2s; outline: none;
}
.form-group textarea { resize: vertical; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--cs); box-shadow: 0 0 0 3px rgba(0,158,227,.12);
}
.char-counter { display: block; text-align: right; font-size: .72rem; color: var(--suave); margin-top: 4px; }
.intro-text { font-size: .88rem; color: #334155; background: var(--fondo); border-left: 4px solid var(--cs); border-radius: 8px; padding: 12px 14px; margin-bottom: 18px; line-height: 1.55; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 22px; border-radius: 8px; border: none; font-size: .92rem; font-weight: 600; font-family: var(--fuente); cursor: pointer; transition: background .2s, transform .1s, box-shadow .2s; text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { width: 100%; background: var(--cp); color: #fff; margin-top: 8px; }
.btn-primary:hover:not(:disabled) { background: var(--cs); box-shadow: var(--sombra2); }
.btn-secondary { background: var(--fondo); color: var(--cp); border: 1.5px solid var(--borde); }
.btn-secondary:hover { background: var(--borde); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { opacity: .85; }
.btn-outline { background: transparent; color: var(--cp); border: 1.5px solid var(--cp); }
.btn-outline:hover { background: var(--cp); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: .8rem; }
.btn-block { width: 100%; }

/* Mensajes */
.msg { padding: 11px 15px; border-radius: 8px; font-size: .88rem; margin-bottom: 12px; }
.msg-error { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--error); }
.msg-exito { background: #d1fae5; color: #065f46; border-left: 4px solid var(--ca); }
.msg-alerta { background: #fef3c7; color: #92400e; border-left: 4px solid var(--alerta); }
.msg-info { background: #e0f2fe; color: #075985; border-left: 4px solid var(--cs); }

/* Confirmación */
.confirmacion-card { text-align: center; }
.success-icon { width: 62px; height: 62px; background: var(--ca); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; margin: 0 auto 14px; }
.confirmacion-card h2 { border: none; margin-bottom: 14px; }
.info-registro { background: var(--fondo); border-radius: 10px; padding: 14px 16px; margin: 14px 0; text-align: left; }
.info-item { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--borde); }
.info-item:last-child { border-bottom: none; }
.info-label { font-size: .75rem; font-weight: 700; color: var(--suave); text-transform: uppercase; letter-spacing: .4px; }
.info-valor { font-weight: 500; font-size: .9rem; }
.info-valor.folio { font-family: monospace; font-size: 1rem; font-weight: 700; color: var(--cp); letter-spacing: 1px; }

/* Acceso / Scanner */
#reader { border-radius: 10px; overflow: hidden; }
.checkin-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
@media (max-width: 480px) { .checkin-meta { grid-template-columns: 1fr; } }
.resultado { padding: 20px; border-radius: 10px; text-align: center; margin-top: 16px; animation: fadeIn .3s ease; }
.resultado.autorizado { background: #d1fae5; border: 2px solid var(--ca); }
.resultado.duplicado { background: #fef3c7; border: 2px solid var(--alerta); }
.resultado.denegado { background: #fee2e2; border: 2px solid var(--error); }
.resultado h3 { font-size: 1.1rem; margin-bottom: 8px; }
.resultado .folio-badge { font-family: monospace; font-size: 1rem; font-weight: 700; background: rgba(0,0,0,.06); padding: 2px 10px; border-radius: 6px; display: inline-block; margin: 6px 0; }

/* Nav */
.nav-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; background: rgba(255,255,255,.75); padding: 8px 12px; border-radius: 12px; }
.nav-bar a, .nav-bar button.navlink { padding: 7px 15px; border-radius: 8px; font-size: .82rem; font-weight: 600; text-decoration: none; background: var(--fondo); color: var(--cp); border: 1.5px solid var(--borde); cursor: pointer; transition: all .2s; }
.nav-bar a:hover, .nav-bar a.activo { background: var(--cp); color: #fff; border-color: var(--cp); }
.nav-brand { font-weight: 700; font-size: .95rem; color: var(--cp); margin-right: auto; text-decoration: none; }

/* Footer + secciones públicas */
.event-footer { text-align: center; padding: 6px; }
.event-footer p { font-size: .8rem; color: #334155; }

/* Botón Área de Exhibición */
.seccion-portal { background: rgba(255,255,255,.9); border-radius: var(--radio); padding: 20px; box-shadow: var(--sombra); text-align: center; }
.btn-exhibicion { background: var(--cp); color: #fff; font-size: .95rem; padding: 14px 26px; border-radius: 10px; display: inline-flex; align-items: center; gap: 8px; }
.btn-exhibicion:hover:not(:disabled) { background: var(--cs); }
.btn-exhibicion.proximamente { background: #94a3b8; cursor: not-allowed; }

/* Carrusel de patrocinadores */
.patro-seccion { background: rgba(255,255,255,.92); border-radius: var(--radio); padding: 22px 16px; box-shadow: var(--sombra); }
.patro-seccion h3 { text-align: center; color: var(--cp); font-size: 1.05rem; letter-spacing: 2px; margin-bottom: 16px; }
.carrusel { position: relative; overflow: hidden; }
.carrusel-track { display: flex; transition: transform .6s ease; }
.carrusel-item { flex: 0 0 33.333%; padding: 10px 12px; display: flex; align-items: center; justify-content: center; }
.carrusel-item a, .carrusel-item .logo-box { display: flex; align-items: center; justify-content: center; width: 100%; height: 90px; }
.carrusel-item img { max-width: 100%; max-height: 90px; object-fit: contain; }
.carrusel-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,48,135,.85); color: #fff; border: none; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; z-index: 3; }
.carrusel-nav.prev { left: 4px; } .carrusel-nav.next { right: 4px; }
.carrusel-nav:hover { background: var(--cs); }
@media (max-width: 640px) { .carrusel-item { flex: 0 0 50%; } .carrusel-item img { max-height: 70px; } }

/* Dashboard */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--card); border-radius: var(--radio); padding: 18px; text-align: center; box-shadow: var(--sombra); border-top: 4px solid var(--cp); }
.stat-card.s { border-top-color: var(--cs); } .stat-card.a { border-top-color: var(--ca); } .stat-card.w { border-top-color: var(--alerta); }
.stat-num { font-size: 2.1rem; font-weight: 700; color: var(--cp); line-height: 1; }
.stat-card.s .stat-num { color: var(--cs); } .stat-card.a .stat-num { color: var(--ca); } .stat-card.w .stat-num { color: var(--alerta); }
.stat-lbl { font-size: .74rem; color: var(--suave); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; margin-top: 4px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { padding: 9px 16px; border-radius: 10px 10px 0 0; font-size: .85rem; font-weight: 700; background: rgba(255,255,255,.7); color: var(--cp); border: 1.5px solid var(--borde); border-bottom: none; cursor: pointer; }
.tab.activo { background: var(--cp); color: #fff; border-color: var(--cp); }
.panel { display: none; } .panel.activo { display: block; }

.filtros-bar { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.filtros-bar input, .filtros-bar select { flex: 1; min-width: 150px; padding: 9px 13px; border: 1.5px solid var(--borde); border-radius: 8px; font-size: .85rem; font-family: var(--fuente); outline: none; background: var(--card); color: var(--texto); }
.filtros-bar input:focus, .filtros-bar select:focus { border-color: var(--cs); }

.tabla-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--borde); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
thead th { background: var(--cp); color: #fff; padding: 10px 13px; text-align: left; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }
tbody tr:nth-child(even) { background: var(--fondo); }
tbody tr:hover { background: #e0f2fe; }
tbody td { padding: 9px 13px; border-bottom: 1px solid var(--borde); white-space: nowrap; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: .72rem; font-weight: 700; }
.badge-si { background: #d1fae5; color: #065f46; } .badge-no { background: #fee2e2; color: #991b1b; }
.estado-PENDIENTE { background: #fef3c7; color: #92400e; }
.estado-EN_REVISION { background: #e0f2fe; color: #075985; }
.estado-APROBADO { background: #d1fae5; color: #065f46; }
.estado-LISTA_ESPERA { background: #ede9fe; color: #5b21b6; }
.estado-RECHAZADO { background: #fee2e2; color: #991b1b; }
.estado-CONFIRMADO { background: #ccfbf1; color: #115e59; }
.estado-ASISTIO { background: #d1fae5; color: #065f46; }
.estado-NO_ASISTIO { background: #f1f5f9; color: #475569; }

.acciones-cel { white-space: nowrap; }
.btn-mini { border: 1px solid var(--borde); background: var(--card); border-radius: 6px; padding: 3px 8px; margin: 0 1px; cursor: pointer; font-size: .82rem; line-height: 1; transition: background .15s, transform .1s; }
.btn-mini:hover { background: var(--fondo); } .btn-mini:active { transform: scale(.92); }
.btn-mini.ok { border-color: #34d399; color: #065f46; } .btn-mini.warn { border-color: #c4b5fd; color: #5b21b6; } .btn-mini.bad { border-color: #fca5a5; color: #991b1b; }

.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 14px; }
.admin-tool { background: var(--card); border-radius: var(--radio); padding: 18px; box-shadow: var(--sombra); border-left: 4px solid var(--alerta); }
.admin-tool h4 { font-size: .88rem; font-weight: 700; margin-bottom: 5px; } .admin-tool p { font-size: .78rem; color: var(--suave); margin-bottom: 10px; }
.admin-tool input { width: 100%; padding: 7px 11px; border: 1.5px solid var(--borde); border-radius: 6px; font-size: .88rem; margin-bottom: 8px; font-family: var(--fuente); outline: none; }

/* Tarjetas admin (patrocinadores/documentos/plantillas/config) */
.panel-card { background: #fff; border-radius: var(--radio); padding: 20px; box-shadow: var(--sombra); margin-bottom: 16px; }
.panel-card h3 { color: var(--cp); font-size: 1.05rem; margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
.mini-label { font-size: .74rem; font-weight: 700; color: var(--suave); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; display: block; }
.inp { width: 100%; padding: 10px 13px; border: 1.5px solid var(--borde); border-radius: 8px; font-size: .9rem; font-family: var(--fuente); outline: none; background: #fff; color: var(--texto); }
.inp:focus { border-color: var(--cs); }
textarea.inp { resize: vertical; min-height: 80px; }

.patro-card { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--borde); border-radius: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.patro-logo { width: 120px; height: 60px; display: flex; align-items: center; justify-content: center; background: var(--fondo); border-radius: 8px; }
.patro-logo img { max-width: 100%; max-height: 60px; object-fit: contain; }
.patro-info { flex: 1; min-width: 160px; } .patro-info b { color: var(--cp); }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center; z-index: 10000; padding: 16px; }
.modal-box { background: var(--card); border-radius: var(--radio); max-width: 640px; width: 100%; max-height: 90vh; overflow: auto; box-shadow: var(--sombra2); animation: fadeIn .25s ease; }
.modal-box.ancho { max-width: 900px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 2px solid var(--fondo); position: sticky; top: 0; background: var(--card); z-index: 2; }
.modal-head h3 { color: var(--cp); font-size: 1.05rem; }
.modal-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--suave); }
.modal-body { padding: 20px; }
.det-item { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--borde); }
.det-item:last-child { border-bottom: none; }
.det-item .info-valor { text-align: right; max-width: 60%; word-break: break-word; }

/* Vista previa de plantilla */
.preview-wrap { border: 1px solid var(--borde); border-radius: 10px; overflow: hidden; background: var(--fondo); }
.preview-toolbar { display: flex; gap: 8px; padding: 8px; background: #fff; border-bottom: 1px solid var(--borde); }
.preview-frame { width: 100%; border: none; background: #fff; transition: max-width .3s; margin: 0 auto; display: block; }
.preview-frame.movil { max-width: 380px; }

/* Login */
.login-wrap { max-width: 400px; margin: 8vh auto; }

/* Animaciones */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeIn .3s ease; }

/* Print */
@media print { .modo-badge, .nav-bar, .btn { display: none !important; } body { background: #fff; } .card { box-shadow: none; border: 1px solid #ddd; } }

/* Responsive */
@media (max-width: 480px) { .event-header h1 { font-size: 1.25rem; } .card { padding: 18px 14px; } }
