* { box-sizing: border-box; font-family: 'Segoe UI', Arial, sans-serif; }
body { margin: 0; background: #f4f5f7; color: #222; }
/*.navbar { display: flex; justify-content: space-between; align-items: center; padding: 15px 30px; background: #1a3c6e; color: #fff; }
.navbar .logo { font-weight: bold; font-size: 20px; }
.navbar nav a { color: #fff; margin-left: 15px; text-decoration: none; }
.navbar nav a:hover { text-decoration: underline; }*/
.container { max-width: 960px; margin: 30px auto; padding: 20px; background: #fff; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
h1, h2, h3 { color: #1a3c6e; }
form { display: flex; flex-direction: column; gap: 12px; max-width: 500px; }
label { font-weight: 600; margin-bottom: 4px; }
input, select, textarea, button { padding: 8px 10px; border-radius: 5px; border: 1px solid #ccc; font-size: 14px; }
button { background: #1a3c6e; color: #fff; border: none; cursor: pointer; padding: 10px; }
button:hover { background: #14305a; }
button:disabled { background: #999; cursor: not-allowed; }
.error { color: #b00020; font-weight: 600; }
table { width: 100%; border-collapse: collapse; margin-top: 15px; }
th, td { border: 1px solid #ddd; padding: 8px; text-align: left; font-size: 14px; }
th { background: #f0f2f5; }
.badge { padding: 3px 8px; border-radius: 4px; font-size: 12px; color: #fff; }
.badge.pendiente { background: #b8860b; }
.badge.aprobado { background: #1a7a3c; }
.badge.rechazado { background: #b00020; }
.badge.en_revision { background: #555; }
.progress-bar { background: #e0e0e0; border-radius: 10px; overflow: hidden; height: 20px; margin: 10px 0; }
.progress-bar-fill { background: #1a7a3c; height: 100%; text-align: center; color: #fff; font-size: 12px; line-height: 20px; }
section { margin-bottom: 35px; }
.grid-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-top: 15px; }
.kpi-card { padding: 18px; border-radius: 10px; color: #fff; text-align: center; }
.kpi-card .kpi-value { font-size: 32px; font-weight: 700; }
.kpi-card .kpi-label { font-size: 13px; margin-top: 4px; opacity: 0.9; }
.kpi-warning { background: #b8860b; }
.kpi-success { background: #1a7a3c; }
.kpi-info { background: #1a3c6e; }

.donut-wrapper { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.donut-legend { list-style: none; padding: 0; margin: 0; }
.donut-legend li { margin-bottom: 8px; font-size: 14px; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; }
.dot-pendiente { background: #b8860b; }
.dot-en_revision { background: #555555; }
.dot-aprobado { background: #1a7a3c; }
.dot-rechazado { background: #b00020; }

.modulos-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-top: 15px; }
.modulo-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 25px 10px; background: #f0f2f5; border-radius: 10px; text-decoration: none; color: #1a3c6e; font-weight: 600; transition: background 0.2s, transform 0.2s; }
.modulo-btn:hover { background: #dfe6f0; transform: translateY(-3px); }
.modulo-icon { font-size: 28px; }
.kpi-grid-2 { grid-template-columns: repeat(2, 1fr); max-width: 500px; }
.kpi-danger { background: #b00020; }
.texto-bloqueado { font-size: 13px; color: #666; font-style: italic; }
/* ===== Layout con sidebar ===== */
.layout-wrapper { display: flex; min-height: 100vh; }
.layout-wrapper.sin-sidebar .main-area { width: 100%; }

.sidebar {
    width: 260px;
    min-height: 100vh;
    background: linear-gradient(180deg, #1a3c6e 0%, #123058 100%);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
.sidebar-bubbles { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
.bubble {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
}
.b1 { width: 220px; height: 220px; top: -60px; left: -80px; }
.b2 { width: 140px; height: 140px; top: 120px; left: 160px; background: rgba(255,255,255,0.04); }
.b3 { width: 180px; height: 180px; top: 320px; left: -60px; }
.b4 { width: 100px; height: 100px; top: 480px; left: 140px; background: rgba(255,255,255,0.05); }
.b5 { width: 260px; height: 260px; bottom: -100px; left: -100px; }
.b6 { width: 130px; height: 130px; bottom: 60px; left: 150px; background: rgba(255,255,255,0.04); }

.sidebar-content { position: relative; z-index: 1; padding: 25px 0; display: flex; flex-direction: column; height: 100%; }
.sidebar-logo { color: #fff; font-size: 20px; font-weight: 700; padding: 0 25px 25px 25px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 12px;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 12px 25px;
    font-size: 15px;
    transition: background 0.2s, color 0.2s;
}
.sidebar-nav a .icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-nav a.active { background: rgba(255,255,255,0.15); color: #fff; border-left: 3px solid #fff; }

/* ===== Topbar ===== */
.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 30px; background: #fff; border-bottom: 1px solid #e5e7eb;
}
.topbar-logo { font-weight: bold; color: #1a3c6e; font-size: 18px; }
.topbar-nav { display: flex; gap: 6px; }
.topbar-nav a {
    display: flex; align-items: center; gap: 6px;
    color: #1a3c6e; text-decoration: none;
    padding: 8px 14px; border-radius: 6px; font-size: 14px; font-weight: 600;
}
.topbar-nav a:hover { background: #f0f2f5; }

.container { max-width: 1100px; margin: 30px auto; padding: 20px; background: #fff; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); flex: 1; width: 100%; box-sizing: border-box; }
/* ===== Animacion de burbujas flotantes ===== */
.bubble {
    animation: flotar 8s ease-in-out infinite;
}
.b1 { animation-duration: 9s; animation-delay: 0s; }
.b2 { animation-duration: 7s; animation-delay: 1s; }
.b3 { animation-duration: 10s; animation-delay: 2s; }
.b4 { animation-duration: 6.5s; animation-delay: 0.5s; }
.b5 { animation-duration: 11s; animation-delay: 1.5s; }
.b6 { animation-duration: 8.5s; animation-delay: 2.5s; }

/* ===== Formulario de registro por tarjetas ===== */
.form-ancho { max-width: 100%; }
.form-card {
    background: #f8f9fb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px 25px;
    margin-bottom: 20px;
}
.form-card h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 17px;
    color: #1a3c6e;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 10px;
}
.form-card h3 .icon { font-size: 18px; }
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.form-grid-2 label { font-weight: 600; margin-bottom: 4px; display: block; font-size: 13px; color: #444; }
.form-grid-2 input, .form-grid-2 select { width: 100%; }
.btn-submit-ancho {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
}

#campoNombreGrupo, #campoOtroGrupo { margin-top: 12px; }
#campoNombreGrupo label, #campoOtroGrupo label { font-weight: 600; margin-bottom: 4px; display: block; font-size: 13px; color: #444; }
/* ===== Iconos Bootstrap Icons ===== */
.sidebar-nav a .icon { font-size: 17px; width: 20px; text-align: center; }
.topbar-nav a .icon { font-size: 15px; }
.menu-toggle i { font-size: 20px; }
.form-card h3 .icon { font-size: 17px; }
.modulo-icon { font-size: 26px; color: #1a3c6e; }

/* ===== Codigo de peregrino (solo visible para admin) ===== */
.codigo-peregrino {
    font-family: 'Courier New', monospace;
    background: #eef1f7;
    color: #1a3c6e;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
}


@media (max-width: 640px) {
    .form-grid-2 { grid-template-columns: 1fr; }
}



@keyframes flotar {
    0%   { transform: translate(0, 0) scale(1); }
    25%  { transform: translate(12px, -18px) scale(1.04); }
    50%  { transform: translate(-8px, -30px) scale(0.97); }
    75%  { transform: translate(-14px, -10px) scale(1.02); }
    100% { transform: translate(0, 0) scale(1); }
}


@media (max-width: 700px) {
    .kpi-grid, .modulos-grid { grid-template-columns: repeat(2, 1fr); }
    .donut-wrapper { flex-direction: column; }
}
/* ===== Responsive del sidebar ===== */

/* Tablets: sidebar colapsado a iconos */
@media (max-width: 1024px) and (min-width: 641px) {
    .sidebar { width: 80px; }
    .sidebar-logo { display: none; }
    .sidebar-nav a span:not(.icon) { display: none; }
    .sidebar-nav a { justify-content: center; padding: 14px 0; }
    .sidebar-nav a.active { border-left: none; border-top: 3px solid #fff; }
}

/* Moviles: sidebar oculto por defecto, se despliega con boton hamburguesa */
@media (max-width: 640px) {
    .layout-wrapper { flex-direction: column; }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: transparent;
        border: none;
        font-size: 22px;
        cursor: pointer;
        color: #1a3c6e;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 240px;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 4px 0 12px rgba(0,0,0,0.2);
    }
    .sidebar.abierto { transform: translateX(0); }

    .sidebar-logo { display: block; }
    .sidebar-nav a span:not(.icon) { display: inline; }
    .sidebar-nav a { justify-content: flex-start; padding: 12px 25px; }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 999;
    }
    .sidebar-overlay.visible { display: block; }

    .main-area { width: 100%; }
    .topbar { padding: 12px 15px; }
    .topbar-nav a span:not(.icon) { display: none; }
    .container { margin: 15px; padding: 15px; }
    .kpi-grid, .modulos-grid { grid-template-columns: repeat(2, 1fr); }
    .donut-wrapper { flex-direction: column; }
}

@media (min-width: 641px) {
    .menu-toggle { display: none; }
    .sidebar-overlay { display: none !important; }
}

.alerta-info {
    background: #eef5ff;
    border: 1px solid #cfe0ff;
    color: #1a3c6e;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.barra-progreso {
    width: 100%;
    height: 16px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin: 10px 0;
}

.barra-progreso-fill {
    height: 100%;
    background: #1a3c6e;
    border-radius: 999px;
    transition: width 0.3s ease;
}

pre {
    white-space: pre-wrap;
    word-break: break-word;
    background: #f8f9fb;
    padding: 8px;
    border-radius: 6px;
    font-size: 12px;
}