/* =========================================================
   SISTEMA DE ACREDITACIONES — ÁNGULO NORTE
   Diseño: negro / blanco / grises, acentos dorados, minimalista
   ========================================================= */

:root {
    --negro: #0b0b0d;
    --negro-suave: #16161a;
    --gris-oscuro: #1f2024;
    --gris-medio: #2c2d33;
    --gris-borde: #33343b;
    --gris-texto: #a3a4ad;
    --blanco: #f5f5f7;
    --blanco-puro: #ffffff;
    --oro: #d4af37;
    --oro-suave: #f0d585;
    --oro-oscuro: #a3841f;

    --verde: #2ecc71;
    --rojo: #e6543f;
    --amarillo: #e8b93a;
    --gris-badge: #6b6d78;

    --radio: 14px;
    --radio-sm: 8px;
    --sombra: 0 10px 30px rgba(0,0,0,0.35);
    --transicion: all .18s ease;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--negro);
    color: var(--blanco);
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--oro-suave); text-decoration: none; transition: var(--transicion); }
a:hover { color: var(--oro); }

h1, h2, h3, h4 { margin: 0 0 6px 0; font-weight: 600; letter-spacing: .2px; }

/* ---------- Animaciones ---------- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-16px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulseSuave {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212,175,55,0.35); }
    50% { box-shadow: 0 0 0 6px rgba(212,175,55,0); }
}
@keyframes girar {
    to { transform: rotate(360deg); }
}
@keyframes brilloLogo {
    0% { filter: drop-shadow(0 0 0 rgba(212,175,55,0)); }
    50% { filter: drop-shadow(0 0 10px rgba(212,175,55,0.35)); }
    100% { filter: drop-shadow(0 0 0 rgba(212,175,55,0)); }
}

.animar-entrada { animation: fadeInUp .45s ease both; }
.animar-fade { animation: fadeIn .3s ease both; }

/* Escalona la entrada de tarjetas y filas para un efecto elegante */
.stagger > * { animation: fadeInUp .45s ease both; }
.stagger > *:nth-child(1) { animation-delay: .02s; }
.stagger > *:nth-child(2) { animation-delay: .06s; }
.stagger > *:nth-child(3) { animation-delay: .10s; }
.stagger > *:nth-child(4) { animation-delay: .14s; }
.stagger > *:nth-child(5) { animation-delay: .18s; }
.stagger > *:nth-child(6) { animation-delay: .22s; }
.stagger > *:nth-child(n+7) { animation-delay: .26s; }

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--negro-suave), var(--negro) 70%);
    border-right: 1px solid var(--gris-borde);
    padding: 22px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    animation: slideInLeft .35s ease both;
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px 20px 8px;
    border-bottom: 1px solid var(--gris-borde);
    margin-bottom: 16px;
}
.sidebar-logo img {
    width: 42px; height: 42px; object-fit: contain;
    animation: brilloLogo 5s ease-in-out infinite;
}
.sidebar-logo .marca { font-size: .95rem; font-weight: 700; color: var(--blanco-puro); line-height: 1.15; }
.sidebar-logo .marca span { display: block; font-size: .68rem; font-weight: 400; color: var(--oro-suave); letter-spacing: .5px; text-transform: uppercase; }

.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 12px; margin-bottom: 4px;
    border-radius: var(--radio-sm);
    color: var(--gris-texto);
    font-size: .92rem;
    transition: var(--transicion);
}
.nav-item:hover { background: var(--gris-oscuro); color: var(--blanco-puro); transform: translateX(2px); }
.nav-item.activo { background: linear-gradient(90deg, rgba(212,175,55,.16), rgba(212,175,55,.02)); color: var(--oro-suave); border-left: 3px solid var(--oro); padding-left: 9px; }
.nav-item .icono { font-size: 1.05rem; width: 20px; text-align: center; }

.nav-separador { margin: 14px 6px 8px; font-size: .68rem; text-transform: uppercase; letter-spacing: 1px; color: #5c5d66; }

.app-main { flex: 1; padding: 28px 34px 60px; max-width: 1400px; }

.app-topbar {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 22px; flex-wrap: wrap; gap: 12px;
}
.app-topbar .subtitulo { color: var(--gris-texto); font-size: .88rem; margin-top: 2px; }

/* ---------- Tarjetas ---------- */
.card {
    background: var(--negro-suave);
    border: 1px solid var(--gris-borde);
    border-radius: var(--radio);
    padding: 20px;
    margin-bottom: 18px;
    transition: var(--transicion);
}
.card:hover { border-color: #46474f; }

.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card {
    background: var(--negro-suave); border: 1px solid var(--gris-borde); border-radius: var(--radio);
    padding: 18px; transition: var(--transicion); position: relative; overflow: hidden;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--sombra); border-color: var(--oro-oscuro); }
.stat-card .valor { font-size: 1.9rem; font-weight: 700; color: var(--blanco-puro); }
.stat-card .etiqueta { color: var(--gris-texto); font-size: .8rem; margin-top: 2px; }
.stat-card .icono-stat { position: absolute; right: 14px; top: 14px; font-size: 1.4rem; opacity: .18; }

.grid-eventos { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.evento-card {
    background: var(--negro-suave); border: 1px solid var(--gris-borde); border-radius: var(--radio);
    overflow: hidden; transition: var(--transicion);
}
.evento-card:hover { transform: translateY(-4px); box-shadow: var(--sombra); border-color: var(--oro-oscuro); }
.evento-card .portada { width: 100%; height: 140px; object-fit: cover; display: block; background: var(--gris-oscuro); }
.evento-card .cuerpo { padding: 14px 16px; }
.evento-card .meta { color: var(--gris-texto); font-size: .82rem; margin: 6px 0 10px; }

/* ---------- Formularios ---------- */
.campo { margin-bottom: 16px; }
.campo label { display: block; font-size: .85rem; color: var(--gris-texto); margin-bottom: 6px; }
.campo input, .campo select, .campo textarea {
    width: 100%; background: var(--gris-oscuro); border: 1px solid var(--gris-borde);
    color: var(--blanco-puro); border-radius: var(--radio-sm); padding: 10px 12px;
    font-size: .93rem; transition: var(--transicion); font-family: inherit;
}
.campo input:focus, .campo select:focus, .campo textarea:focus {
    outline: none; border-color: var(--oro); box-shadow: 0 0 0 3px rgba(212,175,55,0.15);
}
.campo .ayuda-campo { font-size: .76rem; color: #7c7d86; margin-top: 4px; }
.fila-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fila-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .fila-2, .fila-3 { grid-template-columns: 1fr; } }

/* ---------- Botones ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    border: none; border-radius: var(--radio-sm); padding: 10px 18px;
    font-size: .9rem; font-weight: 600; cursor: pointer; transition: var(--transicion);
}
.btn:active { transform: scale(.97); }
.btn-primario { background: linear-gradient(135deg, var(--oro), var(--oro-oscuro)); color: #17140a; }
.btn-primario:hover { filter: brightness(1.08); box-shadow: 0 6px 18px rgba(212,175,55,.3); }
.btn-secundario { background: var(--gris-medio); color: var(--blanco-puro); }
.btn-secundario:hover { background: #3a3b43; }
.btn-oro { background: rgba(212,175,55,0.12); color: var(--oro-suave); border: 1px solid rgba(212,175,55,.4); }
.btn-oro:hover { background: rgba(212,175,55,0.2); }
.btn-peligro { background: rgba(230,84,63,.15); color: #ff8a75; border: 1px solid rgba(230,84,63,.4); }
.btn-peligro:hover { background: rgba(230,84,63,.28); }
.btn-verde { background: rgba(46,204,113,.15); color: #6bdb96; border: 1px solid rgba(46,204,113,.4); }
.btn-verde:hover { background: rgba(46,204,113,.28); }
.btn-sm { padding: 6px 12px; font-size: .78rem; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.flex-gap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flex-entre { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---------- Tablas ---------- */
.tabla-wrap { overflow-x: auto; border-radius: var(--radio); border: 1px solid var(--gris-borde); }
table.tabla { width: 100%; border-collapse: collapse; font-size: .87rem; }
table.tabla th {
    text-align: left; padding: 12px 14px; background: var(--gris-oscuro);
    color: var(--gris-texto); font-weight: 600; text-transform: uppercase; font-size: .72rem; letter-spacing: .4px;
    border-bottom: 1px solid var(--gris-borde);
}
table.tabla td { padding: 12px 14px; border-bottom: 1px solid var(--gris-borde); color: var(--blanco); vertical-align: middle; }
table.tabla tbody tr { transition: var(--transicion); }
table.tabla tbody tr:hover { background: rgba(255,255,255,0.03); }
table.tabla tbody tr:last-child td { border-bottom: none; }

/* ---------- Badges de estado ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 11px; border-radius: 999px; font-size: .74rem; font-weight: 700;
    letter-spacing: .3px; text-transform: uppercase;
}
.badge-pendiente { background: rgba(232,185,58,.15); color: var(--amarillo); animation: pulseSuave 2.4s infinite; }
.badge-confirmado { background: rgba(46,204,113,.15); color: var(--verde); }
.badge-rechazado { background: rgba(230,84,63,.15); color: var(--rojo); }
.badge-baja { background: rgba(120,120,130,.25); color: #c7c8d1; }
.badge-info { background: rgba(120,170,230,.15); color: #8ab4e8; }
.badge-neutro { background: rgba(255,255,255,.08); color: var(--gris-texto); }
.badge-activo { background: rgba(46,204,113,.15); color: var(--verde); }
.badge-inactivo { background: rgba(120,120,130,.25); color: #c7c8d1; }

/* ---------- Alertas ---------- */
.alerta { padding: 12px 16px; border-radius: var(--radio-sm); margin-bottom: 16px; font-size: .88rem; animation: fadeInUp .3s ease both; }
.alerta-error { background: rgba(230,84,63,.12); border: 1px solid rgba(230,84,63,.35); color: #ff9d8b; }
.alerta-exito { background: rgba(46,204,113,.12); border: 1px solid rgba(46,204,113,.35); color: #7be3a4; }
.alerta-info { background: rgba(120,170,230,.12); border: 1px solid rgba(120,170,230,.35); color: #a7c8ef; }

/* ---------- Login ---------- */
.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 30% 20%, #1c1c22, var(--negro) 60%);
    padding: 20px;
}
.login-caja {
    width: 100%; max-width: 380px; background: var(--negro-suave);
    border: 1px solid var(--gris-borde); border-radius: var(--radio);
    padding: 34px 30px; box-shadow: var(--sombra); animation: fadeInUp .5s ease both;
    text-align: center;
}
.login-caja img { width: 78px; margin-bottom: 12px; animation: brilloLogo 4s ease-in-out infinite; }
.login-caja h1 { font-size: 1.2rem; color: var(--blanco-puro); }
.login-caja .subt { color: var(--gris-texto); font-size: .82rem; margin-bottom: 22px; }
.login-caja form { text-align: left; }

/* ---------- Control de acceso: pantalla grande, botones grandes ---------- */
.buscador-acceso input {
    font-size: 1.05rem; padding: 16px 18px;
}
.resultado-acceso {
    background: var(--negro-suave); border: 1px solid var(--gris-borde); border-radius: var(--radio);
    padding: 18px; margin-bottom: 14px; animation: fadeInUp .3s ease both;
}
.resultado-acceso .nombre-rep { font-size: 1.05rem; font-weight: 700; color: var(--blanco-puro); }
.resultado-acceso .nombre-medio { color: var(--oro-suave); font-size: .88rem; }
.acceso-estado-grande {
    font-size: .95rem; font-weight: 700; padding: 10px 14px; border-radius: var(--radio-sm);
    margin: 10px 0; display: inline-block;
}
.btn-acceso-grande { padding: 13px 20px; font-size: .95rem; }

/* ---------- Spinner ---------- */
.spinner {
    width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.25);
    border-top-color: var(--oro); border-radius: 50%; animation: girar .7s linear infinite;
    display: inline-block;
}

/* ---------- Modal ---------- */
.modal-fondo {
    position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center; z-index: 100;
    animation: fadeIn .2s ease both;
}
.modal-caja {
    background: var(--negro-suave); border: 1px solid var(--gris-borde); border-radius: var(--radio);
    padding: 24px; max-width: 460px; width: 92%; max-height: 88vh; overflow-y: auto;
    animation: fadeInUp .28s ease both; box-shadow: var(--sombra);
}

.texto-suave { color: var(--gris-texto); font-size: .87rem; }
.oculto { display: none !important; }

/* ---------- Barra de progreso de cupo ---------- */
.barra-cupo { height: 7px; border-radius: 99px; background: var(--gris-oscuro); overflow: hidden; margin-top: 6px; }
.barra-cupo .relleno { height: 100%; background: linear-gradient(90deg, var(--oro-oscuro), var(--oro)); border-radius: 99px; transition: width .4s ease; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: relative; display: flex; flex-wrap: wrap; align-items: center; padding: 12px; }
    .sidebar-logo { border-bottom: none; margin-bottom: 0; padding: 0 10px 0 0; }
    .nav-separador { display: none; }
    .app-main { padding: 20px; }
}

/* Impresión (para reportes / PDF vía navegador) */
@media print {
    .sidebar, .no-imprimir { display: none !important; }
    .app-main { padding: 0; }
    body { background: #fff; color: #000; }
    .card, table.tabla { border-color: #ccc !important; }
}
