/* ==========================================================================
   FORMATO DE CARACTERIZACIÓN DE FAMILIAS - CIUDAD CARIBIA
   EMERGENCIA LA GUAIRA | SISMO DEL 24 DE JUNIO DE 2026
   ESTILOS INSTITUCIONALES ULTRA PREMIUM
   ========================================================================== */

:root {
    --primary: #1e3a8a;
    --primary-hover: #172554;
    --primary-light: #2563eb;
    --primary-subtle: #eff6ff;
    
    --emergency: #b91c1c;
    --emergency-light: #fef2f2;
    --emergency-border: #fca5a5;
    
    --accent: #d97706;
    --accent-light: #fef3c7;
    --success: #059669;
    --success-light: #ecfdf5;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --border-card: #e2e8f0;
    --border-input: #cbd5e1;
    --border-focus: #2563eb;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 25px -5px rgb(0 0 0 / 0.08), 0 8px 10px -6px rgb(0 0 0 / 0.05);
    --shadow-glow: 0 0 0 4px rgba(37, 99, 235, 0.15);
    --shadow-error: 0 0 0 4px rgba(220, 38, 38, 0.15);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(145deg, #090e1a 0%, #0d1e3d 35%, #162447 70%, #1f1b2e 100%);
    background-attachment: fixed;
    background-size: cover;
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* ================= EFECTO AMBIENTAL DE ILUMINACIÓN SUPERIOR ================= */
.bg-gradient-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 700px;
    background: radial-gradient(circle at 50% -80px, rgba(37, 99, 235, 0.3) 0%, rgba(131, 24, 67, 0.18) 50%, transparent 80%);
    pointer-events: none;
    z-index: 0;
}

/* Orbes ambientales que se refractan a través del cristal (Glassmorphism) */
.glass-orb {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(90px);
}

.glass-orb-1 {
    width: 520px;
    height: 520px;
    top: 5%;
    left: -120px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.45) 0%, rgba(14, 165, 233, 0.25) 50%, transparent 80%);
    animation: floatOrb1 16s ease-in-out infinite alternate;
}

.glass-orb-2 {
    width: 580px;
    height: 580px;
    top: 25%;
    right: -140px;
    background: radial-gradient(circle, rgba(225, 29, 72, 0.35) 0%, rgba(168, 85, 247, 0.22) 55%, transparent 80%);
    animation: floatOrb2 20s ease-in-out infinite alternate-reverse;
}

.glass-orb-3 {
    width: 480px;
    height: 480px;
    top: 60%;
    left: -80px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.38) 0%, rgba(59, 130, 246, 0.18) 60%, transparent 80%);
    animation: floatOrb3 18s ease-in-out infinite alternate;
}

.glass-orb-4 {
    width: 520px;
    height: 520px;
    bottom: -100px;
    right: 5%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.28) 0%, rgba(6, 182, 212, 0.18) 55%, transparent 80%);
    animation: floatOrb4 22s ease-in-out infinite alternate-reverse;
}

@keyframes floatOrb1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, 50px) scale(1.12); }
}

@keyframes floatOrb2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-50px, 40px) scale(1.08); }
}

@keyframes floatOrb3 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, -30px) scale(1.1); }
}

@keyframes floatOrb4 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-40px, -40px) scale(1.15); }
}

.main-header {
    position: relative;
    z-index: 1;
    padding: 1.25rem 1.5rem 0.5rem;
    color: #ffffff;
}

.header-container {
    max-width: 1060px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.institutional-badge {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    max-width: 720px;
}

.tricolor-bar {
    width: 6px;
    height: 72px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
    margin-top: 4px;
}

.tri-yellow { flex: 1; background-color: #facc15; }
.tri-blue   { flex: 1; background-color: #2563eb; }
.tri-red    { flex: 1; background-color: #ef4444; }

.inst-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.republic-text {
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #cbd5e1;
}

.emergency-badge {
    display: inline-block;
    background: rgba(220, 38, 38, 0.35);
    border: 1px solid rgba(248, 113, 113, 0.4);
    color: #fecaca;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    width: fit-content;
    margin-bottom: 0.15rem;
}

.main-form-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
    color: #ffffff;
}

.inst-sub {
    font-size: 0.8rem;
    color: #93c5fd;
    font-weight: 500;
}

.header-right-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

@media (max-width: 640px) {
    .header-right-actions {
        align-items: flex-start;
        width: 100%;
    }
}

.nav-admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: var(--transition);
}

.nav-admin-btn:hover {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    color: #ffffff;
}

.nav-admin-btn svg {
    width: 16px;
    height: 16px;
    stroke: #38bdf8;
}

.badge-records-count {
    background: #2563eb;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-full);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.4);
}

.admin-user-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    color: #e2e8f0;
}

.admin-user-pill svg {
    width: 15px;
    height: 15px;
    stroke: #38bdf8;
}

.admin-user-pill strong {
    color: #ffffff;
}

.admin-action-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    line-height: 1;
}

.admin-action-pill:hover {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.45);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.admin-action-pill svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    flex-shrink: 0;
}

.admin-action-pill.csv svg {
    stroke: #38bdf8;
}

.admin-action-pill.logout svg {
    stroke: #fca5a5;
}

.admin-action-pill.logout:hover {
    background: rgba(239, 68, 68, 0.22);
    border-color: rgba(248, 113, 113, 0.45);
}

.footer-admin-link {
    color: #64748b;
    font-size: 0.74rem;
    text-decoration: none;
    transition: var(--transition);
}

.footer-admin-link:hover {
    color: #94a3b8;
    text-decoration: underline;
}

.draft-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    color: #f1f5f9;
    transition: var(--transition);
    margin-top: 0.5rem;
}

.draft-status-pill .save-icon {
    width: 15px;
    height: 15px;
    stroke: #34d399;
}

.draft-status-pill.saving .save-icon {
    animation: pulse 0.8s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ================= CONTENEDOR PRINCIPAL ================= */
.content-wrapper {
    position: relative;
    z-index: 1;
    max-width: 1060px;
    width: 100%;
    margin: 1rem auto 3rem;
    padding: 0 1rem;
    flex: 1;
}

.form-card {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.45), 
                inset 0 1px 2px rgba(255, 255, 255, 0.95),
                0 0 0 1px rgba(255, 255, 255, 0.5);
    border: none;
    overflow: hidden;
    padding: 2.25rem;
}

@media (max-width: 640px) {
    .form-card {
        padding: 1.25rem;
    }
}

.section-notice {
    background: rgba(239, 246, 255, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(191, 219, 254, 0.9);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.82rem;
    color: #1e40af;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.section-notice svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: #2563eb;
}

/* ================= NAVEGADOR DE SECCIONES (TABS / STEPPER CLIQUEABLE) ================= */
.sections-nav-wrapper {
    margin-bottom: 2.25rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.sections-nav-wrapper::-webkit-scrollbar {
    height: 6px;
}

.sections-nav-wrapper::-webkit-scrollbar-thumb {
    background: rgba(203, 213, 225, 0.6);
    border-radius: 4px;
}

.sections-nav {
    display: flex;
    gap: 0.65rem;
    min-width: max-content;
}

.nav-tab-btn {
    border: 1.5px solid rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    text-align: left;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.nav-tab-btn:hover {
    border-color: rgba(37, 99, 235, 0.5);
    background: rgba(239, 246, 255, 0.75);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.tab-badge {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(241, 245, 249, 0.85);
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.tab-info {
    display: flex;
    flex-direction: column;
}

.tab-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
    transition: var(--transition);
}

.tab-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
}

/* Estados del botón de sección */
.nav-tab-btn.active {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.92), rgba(37, 99, 235, 0.88));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-color: rgba(147, 197, 253, 0.7);
    box-shadow: 0 10px 25px rgba(30, 58, 138, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.nav-tab-btn.active .tab-badge {
    background: #ffffff;
    color: var(--primary);
}

.nav-tab-btn.active .tab-title {
    color: #ffffff;
}

.nav-tab-btn.active .tab-sub {
    color: #bfdbfe;
}

.nav-tab-btn.completed {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(240, 253, 244, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.nav-tab-btn.completed .tab-badge {
    background: var(--success);
    color: #ffffff;
}

.nav-tab-btn.completed .tab-title {
    color: #065f46;
}

.nav-tab-btn.locked {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ================= SECCIONES DEL FORMULARIO ================= */
.form-section {
    display: none;
    animation: fadeInSection 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.form-section.active {
    display: block;
}

@keyframes fadeInSection {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #f1f5f9;
}

.section-icon-box {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--primary-subtle);
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.section-icon-box svg {
    width: 24px;
    height: 24px;
}

.section-icon-box.success-box {
    background: var(--success-light);
    color: var(--success);
}

.section-tag {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--primary-light);
    text-transform: uppercase;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.25;
}

.section-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* ================= GRID DE CAMPOS ================= */
.grid-2-cols {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.grid-3-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

@media (max-width: 768px) {
    .grid-2-cols, .grid-3-cols {
        grid-template-columns: 1fr;
    }
}

.max-w-xs {
    max-width: 200px;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.mb-0 { margin-bottom: 0 !important; }
.mb-3 { margin-bottom: 0.75rem !important; }
.mt-3 { margin-top: 0.75rem !important; }

.form-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.45rem;
}

.form-label.text-base {
    font-size: 0.98rem;
    font-weight: 700;
}

.required-star {
    color: var(--danger);
    font-weight: 800;
    font-size: 1rem;
    line-height: 1;
}

.badge-auto {
    background: #e0e7ff;
    color: #4338ca;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-full);
    margin-left: auto;
    text-transform: uppercase;
}

/* ================= INPUTS ================= */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.flex-grow {
    flex: 1;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid rgba(203, 213, 225, 0.85);
    border-radius: var(--radius-md);
    transition: var(--transition);
    outline: none;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03), 0 2px 6px rgba(255, 255, 255, 0.5);
}

.form-control:focus {
    background-color: rgba(255, 255, 255, 0.94);
    border-color: var(--border-focus);
    box-shadow: var(--shadow-glow), 0 4px 14px rgba(37, 99, 235, 0.12);
}

.form-control.has-error {
    border-color: var(--danger) !important;
    background-color: rgba(254, 242, 242, 0.85);
}

.form-control.has-error:focus {
    box-shadow: var(--shadow-error) !important;
}

.form-control-readonly {
    background-color: rgba(241, 245, 249, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #334155;
    font-weight: 700;
    border-color: rgba(203, 213, 225, 0.75);
    cursor: not-allowed;
}

.text-uppercase {
    text-transform: uppercase;
}

.char-counter {
    position: absolute;
    right: 0.85rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-light);
    pointer-events: none;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.textarea-counter {
    bottom: 0.6rem;
    right: 0.85rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 75px;
    padding-bottom: 1.75rem;
}

.calendar-icon, .unit-tag {
    position: absolute;
    right: 0.85rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    pointer-events: none;
    display: flex;
    align-items: center;
}

.calendar-icon svg {
    width: 18px;
    height: 18px;
}

/* ================= MENSAJES DE ERROR ================= */
.error-msg {
    color: var(--danger);
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 0.35rem;
    display: none;
    align-items: center;
    gap: 0.35rem;
}

.error-msg.visible {
    display: flex;
    animation: shakeErr 0.25s ease-in-out;
}

.error-msg::before {
    content: "⚠";
    font-size: 0.85rem;
    line-height: 1;
}

@keyframes shakeErr {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

.helper-text {
    display: block;
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* ================= CONTROLES SEGMENTADOS ================= */
.cedula-input-group {
    display: flex;
    gap: 0.5rem;
}

.segmented-control {
    display: inline-flex;
    background: rgba(241, 245, 249, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1.5px solid rgba(203, 213, 225, 0.85);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.seg-btn {
    border: none;
    background: transparent;
    padding: 0.6rem 0.85rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.seg-btn.active {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.95), rgba(37, 99, 235, 0.9));
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.gender-segmented-control {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.gender-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    border: 1.5px solid rgba(203, 213, 225, 0.8);
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 2px 6px rgba(0, 0, 0, 0.02);
}

.gender-btn:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    background: rgba(239, 246, 255, 0.85);
    transform: translateY(-1px);
}

.gender-btn.active {
    background: rgba(239, 246, 255, 0.92);
    border-color: var(--primary-light);
    color: var(--primary);
    box-shadow: var(--shadow-glow), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Controles Binarios (Sí / No) */
.binary-segmented-control {
    display: inline-flex;
    background: rgba(241, 245, 249, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1.5px solid rgba(203, 213, 225, 0.85);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.binary-btn {
    border: none;
    background: transparent;
    padding: 0.45rem 1.25rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.binary-btn.active {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.95), rgba(37, 99, 235, 0.9));
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ================= TARJETAS CONDICIONALES ================= */
.conditional-card {
    background: rgba(248, 250, 252, 0.68);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.conditional-card:hover {
    border-color: rgba(148, 163, 184, 0.9);
    background: rgba(248, 250, 252, 0.85);
}

.conditional-main-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.conditional-subfield {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px dashed #cbd5e1;
    animation: fadeInSub 0.25s ease-out;
}

@keyframes fadeInSub {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================= RADIO CARDS PARA CANTIDAD DE PERSONAS (SECCIÓN 3) ================= */
.persons-selector-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 0.75rem;
}

@media (max-width: 768px) {
    .persons-selector-grid {
        grid-template-columns: 1fr;
    }
}

.person-option-card {
    position: relative;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 1.25rem;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.person-option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.person-card-content {
    display: flex;
    flex-direction: column;
}

.p-num {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

.p-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 0.25rem;
}

.p-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.person-option-card:hover {
    border-color: var(--primary-light);
    background: rgba(255, 255, 255, 0.85);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.person-option-card.selected,
.person-option-card:has(input[type="radio"]:checked) {
    border-color: var(--primary);
    background: rgba(239, 246, 255, 0.85);
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

/* ================= INTEGRANTES DINÁMICOS ================= */
.integrante-box {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1.5px solid rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.integrante-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1.5px solid #f1f5f9;
}

.integrante-badge {
    background: #dbeafe;
    color: #1e40af;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
}

/* ================= FOOTER DE SECCIÓN Y BOTONES ================= */
.section-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 2.25rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.6rem;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    text-decoration: none;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    border: 1.5px solid rgba(147, 197, 253, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #172554 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    color: var(--text-main);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.btn-success {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    border: 1.5px solid rgba(167, 243, 208, 0.4);
}

.btn-success:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(16, 185, 129, 0.45);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: rgba(239, 246, 255, 0.8);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Spinner dentro del botón */
.spinner-svg {
    width: 18px;
    height: 18px;
    animation: rotate 1.2s linear infinite;
}

.spinner-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 3;
}

.spinner-head {
    fill: none;
    stroke: #ffffff;
    stroke-width: 3;
    stroke-dasharray: 40;
    stroke-dashoffset: 10;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

/* ================= RESUMEN DE CARACTERIZACIÓN (SECCIÓN FINAL) ================= */
.summary-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1.5px solid rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.95);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.summary-block-header {
    background: rgba(248, 250, 252, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.85rem 1.25rem;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-block-header:first-child {
    border-top: none;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1.25rem;
}

@media (max-width: 640px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
}

.summary-item {
    display: flex;
    flex-direction: column;
}

.summary-item.span-full {
    grid-column: 1 / -1;
}

.s-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.s-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 0.15rem;
    word-break: break-word;
}

.warning-box {
    background: rgba(255, 251, 235, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(253, 230, 138, 0.9);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.82rem;
    color: #92400e;
    box-shadow: 0 4px 15px rgba(217, 119, 6, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.warning-box svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: #d97706;
}

/* ================= PANTALLA DE ÉXITO Y RECIBO ================= */
.success-screen {
    text-align: center;
    padding: 1.5rem 0.5rem;
    animation: fadeInSection 0.4s ease-out;
}

.success-icon-wrapper {
    margin-bottom: 1.25rem;
}

.success-circle-anim {
    width: 72px;
    height: 72px;
    background: rgba(236, 253, 245, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 3px solid var(--success);
    border-radius: 50%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--success);
    box-shadow: 0 0 0 8px rgba(5, 150, 105, 0.15);
}

.success-circle-anim svg {
    width: 38px;
    height: 38px;
}

.success-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--success);
}

.success-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0.5rem auto 1.75rem;
}

.receipt-card {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-md);
    max-width: 680px;
    margin: 0 auto 2rem;
    padding: 1.75rem;
    text-align: left;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.receipt-stamp {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    text-align: center;
}

.receipt-event {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--primary);
    text-align: center;
    margin-top: 0.15rem;
}

.receipt-code {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-light);
    text-align: center;
    margin: 0.35rem 0;
}

.receipt-date {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px dashed #cbd5e1;
}

.receipt-details {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.88rem;
}

.receipt-footer {
    margin-top: 1.25rem;
    padding-top: 0.85rem;
    border-top: 1px dashed #cbd5e1;
}

.security-seal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
}

.security-seal svg {
    width: 14px;
    height: 14px;
    stroke: var(--success);
}

.success-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ================= TOAST DE VALIDACIÓN ================= */
.toast-warning {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    padding: 0.85rem 1.4rem;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 90%;
}

.toast-warning.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.toast-warning svg {
    width: 20px;
    height: 20px;
    stroke: #fbbf24;
    flex-shrink: 0;
}

/* ================= FOOTER ================= */
.main-footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.78rem;
    color: #94a3b8;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(10, 15, 29, 0.85);
    backdrop-filter: blur(8px);
}

/* ================= PRINT ================= */
@media print {
    body { background: #ffffff; }
    .bg-gradient-header, .main-header, .sections-nav-wrapper, .section-notice, .success-actions, .main-footer, .section-footer, .table-toolbar, .stats-grid, .modal-footer {
        display: none !important;
    }
    .content-wrapper { margin: 0; padding: 0; max-width: 100%; }
    .form-card { box-shadow: none; border: none; padding: 0; }
    .receipt-card { border: 2px solid #000; box-shadow: none; max-width: 100%; }
}

/* ================= DASHBOARD DE REGISTROS (GLASSMORPHISM) ================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 540px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1.5px solid rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.95);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.08);
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon-wrapper svg {
    width: 24px;
    height: 24px;
}

.stat-icon-wrapper.blue {
    background: rgba(219, 234, 254, 0.85);
    color: #1d4ed8;
}

.stat-icon-wrapper.green {
    background: rgba(209, 250, 229, 0.85);
    color: #047857;
}

.stat-icon-wrapper.purple {
    background: rgba(243, 232, 255, 0.85);
    color: #7e22ce;
}

.stat-icon-wrapper.rose {
    background: rgba(255, 228, 230, 0.85);
    color: #be123c;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-main);
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 0.2rem;
}

/* Toolbar de Filtros */
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 280px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Tabla de Registros */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.records-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.records-table thead {
    background: rgba(241, 245, 249, 0.85);
    border-bottom: 1.5px solid rgba(203, 213, 225, 0.8);
}

.records-table th {
    padding: 0.85rem 1rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.78rem;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.records-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(241, 245, 249, 0.9);
    vertical-align: middle;
}

.records-table tbody tr {
    transition: var(--transition);
}

.records-table tbody tr:hover {
    background: rgba(239, 246, 255, 0.6);
}

.table-code {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.82rem;
    color: var(--primary-light);
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.table-date {
    font-size: 0.76rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.table-jefe-name {
    font-weight: 700;
    color: var(--text-main);
}

.table-jefe-sub {
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.table-cedula {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #1e40af;
    background: #dbeafe;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    font-size: 0.82rem;
}

.table-location {
    display: flex;
    flex-direction: column;
    font-size: 0.82rem;
}

.table-location strong {
    color: var(--text-main);
}

.table-location span {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.table-members-pill {
    display: inline-flex;
    align-items: center;
    background: rgba(241, 245, 249, 0.9);
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.78rem;
    color: var(--text-main);
    white-space: nowrap;
}

.badges-row {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.badge-tag {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.18rem 0.45rem;
    border-radius: var(--radius-full);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.badge-tag.rose {
    background: #ffe4e6;
    color: #be123c;
    border: 1px solid #fecdd3;
}

.badge-tag.purple {
    background: #f3e8ff;
    color: #7e22ce;
    border: 1px solid #e9d5ff;
}

.badge-tag.amber {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.row-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.btn-action-view, .btn-action-dl {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
}

.btn-action-view {
    background: rgba(239, 246, 255, 0.9);
    color: var(--primary-light);
    border-color: rgba(191, 219, 254, 0.8);
}

.btn-action-view:hover {
    background: var(--primary-light);
    color: #ffffff;
}

.btn-action-dl {
    background: rgba(240, 253, 244, 0.9);
    color: var(--success);
    border-color: rgba(167, 243, 208, 0.8);
}

.btn-action-dl:hover {
    background: var(--success);
    color: #ffffff;
}

.btn-action-view svg, .btn-action-dl svg {
    width: 14px;
    height: 14px;
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    stroke: #94a3b8;
    margin-bottom: 0.75rem;
}

.empty-state h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--text-main);
    margin-bottom: 0.35rem;
}

.empty-state p {
    font-size: 0.88rem;
    max-width: 450px;
    margin: 0 auto;
}

.table-footer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.25rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ================= MODAL DETALLE DE FAMILIA (GLASSMORPHISM) ================= */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 15, 29, 0.7);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-backdrop.active {
    display: flex;
    animation: fadeInModal 0.25s ease-out;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(28px) saturate(190%);
    -webkit-backdrop-filter: blur(28px) saturate(190%);
    border: 1.5px solid rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.95);
    width: 100%;
    max-width: 860px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: zoomModal 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zoomModal {
    from { transform: scale(0.95) translateY(10px); }
    to { transform: scale(1) translateY(0); }
}

.modal-header {
    padding: 1.5rem 1.75rem;
    background: rgba(248, 250, 252, 0.85);
    border-bottom: 1.5px solid rgba(226, 232, 240, 0.8);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.modal-tag {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--primary-light);
    letter-spacing: 0.06em;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-top: 0.2rem;
}

.modal-date {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close-btn:hover {
    color: var(--danger);
    transform: scale(1.1);
}

.modal-body {
    padding: 1.75rem;
    overflow-y: auto;
    flex: 1;
}

.modal-section-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 1px solid rgba(203, 213, 225, 0.6);
    padding-bottom: 0.4rem;
    margin-bottom: 0.85rem;
}

.modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.9rem 1.25rem;
    background: rgba(248, 250, 252, 0.7);
    padding: 1.1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

@media (max-width: 640px) {
    .modal-grid {
        grid-template-columns: 1fr;
    }
}

.m-item {
    display: flex;
    flex-direction: column;
}

.m-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.m-val {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: 0.15rem;
    word-break: break-word;
}

.modal-members-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.modal-members-table th {
    background: #1e293b;
    color: #ffffff;
    padding: 0.65rem 0.85rem;
    text-align: left;
    font-size: 0.75rem;
}

.modal-members-table td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-footer {
    padding: 1.25rem 1.75rem;
    background: rgba(248, 250, 252, 0.85);
    border-top: 1.5px solid rgba(226, 232, 240, 0.8);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ================= SELECTOR DE VISTAS (TABS DEL PANEL ADMINISTRATIVO) ================= */
.admin-view-switcher {
    display: flex;
    gap: 0.85rem;
    margin-bottom: 1.75rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.view-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.5rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    white-space: nowrap;
}

.view-tab-btn:hover {
    border-color: rgba(37, 99, 235, 0.5);
    background: rgba(239, 246, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
}

.view-tab-btn.active {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.95), rgba(37, 99, 235, 0.9));
    color: #ffffff;
    border-color: rgba(147, 197, 253, 0.7);
    box-shadow: 0 10px 25px rgba(30, 58, 138, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.35);
}

.view-tab-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    flex-shrink: 0;
}

.badge-tab-pill {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.18rem 0.55rem;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.view-tab-btn:not(.active) .badge-tab-pill {
    background: #e2e8f0;
    color: #475569;
}

.badge-tab-pill.count {
    background: #2563eb;
    color: #ffffff;
}

.view-tab-btn.active .badge-tab-pill.count {
    background: #ffffff;
    color: #1e3a8a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.view-tab-btn:not(.active) .badge-tab-pill.count {
    background: #2563eb;
    color: #ffffff;
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
    animation: fadeInSection 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ================= SECCIÓN DE GRÁFICAS Y PORCENTAJES ================= */
.charts-main-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 992px) {
    .charts-main-grid {
        grid-template-columns: 1fr;
    }
}

.chart-glass-card {
    background: rgba(255, 255, 255, 0.74);
    backdrop-filter: blur(22px) saturate(190%);
    -webkit-backdrop-filter: blur(22px) saturate(190%);
    border: 1.5px solid rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
}

.chart-glass-card.accent-card {
    border-color: rgba(254, 205, 211, 0.9);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 241, 242, 0.75));
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.chart-tag {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--primary-light);
    letter-spacing: 0.06em;
}

.chart-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.25;
    margin-top: 0.15rem;
}

.chart-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.chart-badge-pill {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.chart-badge-pill.blue {
    background: #dbeafe;
    color: #1e40af;
}

.chart-badge-pill.purple {
    background: #f3e8ff;
    color: #7e22ce;
}

.chart-badge-pill.rose {
    background: #ffe4e6;
    color: #be123c;
}

.chart-badge-pill.amber {
    background: #fef3c7;
    color: #b45309;
}

.chart-content-row {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.chart-canvas-wrapper {
    flex: 1;
    min-width: 220px;
    height: 250px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-stats-column {
    flex: 1.2;
    min-width: 240px;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

/* Cajas de Estadísticas de Género */
.gender-stat-box {
    background: rgba(248, 250, 252, 0.75);
    border: 1.5px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.gender-stat-box.female {
    border-left: 5px solid #ec4899;
}

.gender-stat-box.male {
    border-left: 5px solid #2563eb;
}

.g-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.g-icon {
    font-size: 1.25rem;
}

.g-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
    margin-left: 0.4rem;
    flex: 1;
}

.g-pct {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary);
}

.gender-stat-box.female .g-pct {
    color: #db2777;
}

.gender-stat-box.male .g-pct {
    color: #2563eb;
}

.meter-bar-track {
    height: 8px;
    background: rgba(226, 232, 240, 0.85);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 0.45rem 0;
}

.meter-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.meter-bar-fill.female {
    background: linear-gradient(90deg, #f43f5e, #ec4899);
}

.meter-bar-fill.male {
    background: linear-gradient(90deg, #1d4ed8, #3b82f6);
}

.meter-bar-fill.purple {
    background: linear-gradient(90deg, #7e22ce, #a855f7);
}

.meter-bar-fill.amber {
    background: linear-gradient(90deg, #d97706, #f59e0b);
}

.meter-bar-fill.green {
    background: linear-gradient(90deg, #059669, #10b981);
}

.meter-bar-fill.blue {
    background: linear-gradient(90deg, #0284c7, #38bdf8);
}

.g-count {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.household-head-info {
    background: rgba(241, 245, 249, 0.65);
    border: 1px dashed rgba(203, 213, 225, 0.9);
    border-radius: var(--radius-md);
    padding: 0.65rem 0.9rem;
    font-size: 0.76rem;
    color: var(--text-muted);
}

.hh-title {
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.2rem;
}

.hh-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.hh-row strong {
    color: var(--primary);
}

/* Vulnerabilidad / Discapacidad Box */
.vuln-stat-box {
    background: rgba(248, 250, 252, 0.75);
    border: 1.5px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.1rem;
}

.vuln-stat-box.female-vuln {
    border-left: 5px solid #ec4899;
}

.vuln-stat-box.male-vuln {
    border-left: 5px solid #3b82f6;
}

.v-label {
    font-weight: 700;
    font-size: 0.84rem;
    color: var(--text-main);
}

.v-val {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    margin-top: 0.1rem;
}

.v-sub {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.vuln-total-pill {
    background: rgba(243, 232, 255, 0.8);
    border: 1px solid rgba(233, 213, 255, 0.9);
    color: #6b21a8;
    border-radius: var(--radius-md);
    padding: 0.6rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
}

/* Fila Secundaria de Gráficas */
.charts-secondary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .charts-secondary-grid {
        grid-template-columns: 1fr;
    }
}

/* Módulo Gestantes */
.pregnant-card-body {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.big-indicator-row {
    display: flex;
    align-items: center;
    gap: 1.1rem;
}

.big-num {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    color: #e11d48;
}

.big-info {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    color: var(--text-main);
}

.trimester-breakdown {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
}

.tri-box {
    background: rgba(255, 255, 255, 0.7);
    border: 1.5px solid rgba(254, 205, 211, 0.8);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.5rem;
    text-align: center;
}

.tri-box.highlight {
    background: rgba(255, 241, 242, 0.9);
    border-color: #fda4af;
}

.tri-num {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: #be123c;
}

.tri-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    line-height: 1.2;
    margin-top: 0.15rem;
}

.maternal-notice {
    font-size: 0.76rem;
    color: #9f1239;
    background: rgba(255, 228, 230, 0.6);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.75rem;
}

/* Rangos Etarios */
.age-groups-list {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
}

.age-row {
    display: flex;
    flex-direction: column;
}

.age-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
}

.age-info strong {
    color: var(--primary);
}

/* Mascotas */
.pets-card-body {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.pet-circular-stat {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.pet-circle-fill {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.15), rgba(245, 158, 11, 0.25));
    border: 3px solid #f59e0b;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
}

.pet-pct {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 800;
    color: #b45309;
    line-height: 1;
}

.pet-desc {
    font-size: 0.68rem;
    font-weight: 700;
    color: #92400e;
    text-transform: uppercase;
}

.pet-details {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.84rem;
}

.p-line strong {
    color: #92400e;
}

.p-badge {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
    width: fit-content;
    margin-top: 0.2rem;
}

.pet-note {
    font-size: 0.76rem;
    color: var(--text-muted);
    border-top: 1px dashed rgba(203, 213, 225, 0.8);
    padding-top: 0.75rem;
}

/* ================= TARJETA DE FILTROS AVANZADOS (REDISTRIBUIDA PERFECTA) ================= */
.filters-panel-card {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1.5px solid rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.filters-grid {
    display: grid;
    grid-template-columns: 2.2fr 1.3fr 1.3fr auto;
    gap: 1.15rem;
    align-items: flex-end;
}

@media (max-width: 1024px) {
    .filters-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .filters-grid {
        grid-template-columns: 1fr;
    }
}

.filter-item {
    display: flex;
    flex-direction: column;
}

.filter-label {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
    letter-spacing: 0.04em;
}

.filter-label svg {
    width: 14px;
    height: 14px;
    stroke: var(--primary-light);
}

.filter-input-wrap,
.filter-select-wrap {
    position: relative;
    width: 100%;
}

.filter-input {
    width: 100%;
    height: 44px;
    padding: 0 2.25rem 0 1rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(203, 213, 225, 0.95);
    border-radius: var(--radius-md);
    outline: none;
    transition: var(--transition);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.filter-input:focus {
    background-color: #ffffff;
    border-color: var(--border-focus);
    box-shadow: var(--shadow-glow);
}

.btn-clear-search {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--text-light);
    cursor: pointer;
    display: none;
    transition: var(--transition);
}

.btn-clear-search:hover {
    color: var(--danger);
}

.filter-select {
    width: 100%;
    height: 44px;
    padding: 0 2.4rem 0 1rem;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1.5px solid rgba(203, 213, 225, 0.95);
    border-radius: var(--radius-md);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.filter-select:focus {
    background-color: #ffffff;
    border-color: var(--border-focus);
    box-shadow: var(--shadow-glow);
}

.select-chevron {
    position: absolute;
    right: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    stroke: #64748b;
    pointer-events: none;
}

.filter-buttons-wrap {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    height: 44px;
    padding: 0 1.15rem;
    font-size: 0.84rem;
    white-space: nowrap;
}

/* ========================================================================== */
/* MASTER RESPONSIVE SUITE (100% RESPONSIVE EN TODAS LAS RESOLUCIONES)       */
/* Dispositivos Móviles, Tablets, Laptops y Pantallas Ultra-Compactas         */
/* ========================================================================== */

/* Prevención global de desbordamiento horizontal */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Scroll suave para la barra de navegación de pestañas del stepper */
.sections-nav-wrapper {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* ================= BREAKPOINT TABLET / PANTALLAS MEDIANAS (<= 1024px) ================= */
@media (max-width: 1024px) {
    .content-wrapper {
        max-width: 100%;
        padding: 0 1rem;
    }

    .filters-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .filter-item.filter-search {
        grid-column: 1 / -1;
    }

    .filter-item.filter-actions-item {
        grid-column: 1 / -1;
    }

    .filter-item.filter-actions-item .filter-label {
        display: none;
    }

    .filter-buttons-wrap {
        width: 100%;
    }

    .filter-buttons-wrap .filter-btn {
        flex: 1;
        justify-content: center;
    }

    .charts-main-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .charts-secondary-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

/* ================= BREAKPOINT TABLET PEQUEÑA / MÓVIL HORIZONTAL (<= 768px) ================= */
@media (max-width: 768px) {
    /* Inputs a 16px para evitar auto-zoom destructivo en iOS Safari */
    input[type="text"],
    input[type="number"],
    input[type="tel"],
    select,
    textarea,
    .form-control,
    .filter-input,
    .filter-select {
        font-size: 16px !important;
    }

    .grid-2-cols,
    .grid-3-cols {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .header-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .institutional-badge {
        max-width: 100%;
    }

    .header-right-actions {
        width: 100%;
        align-items: stretch;
    }

    .header-right-actions > div {
        width: 100%;
        justify-content: flex-start;
    }

    /* Pestañas del Padrón y Estadísticas en modo móvil */
    .admin-view-switcher {
        flex-direction: column;
        width: 100%;
        gap: 0.6rem;
    }

    .view-tab-btn {
        width: 100%;
        justify-content: space-between;
        padding: 0.85rem 1.15rem;
        white-space: normal;
    }

    /* Stepper Formulario */
    .sections-nav-wrapper {
        margin-bottom: 1.5rem;
        padding-bottom: 0.6rem;
    }

    /* Acciones al pie de cada sección (Siguiente / Anterior) */
    .section-footer {
        flex-direction: column-reverse;
        gap: 0.75rem;
        margin-top: 1.75rem;
        padding-top: 1.25rem;
    }

    .section-footer .btn {
        width: 100%;
        justify-content: center;
    }

    .section-footer div:empty {
        display: none;
    }

    /* Opciones de cantidad de personas */
    .persons-selector-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    /* Tabla de Familias: toque suave con scroll horizontal */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius-md);
        box-shadow: inset -6px 0 10px -6px rgba(0, 0, 0, 0.15);
    }

    .records-table th,
    .records-table td {
        padding: 0.75rem 0.85rem;
    }

    /* Resumen de Métricas */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.85rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.74rem;
    }
}

/* ================= BREAKPOINT TELÉFONOS MÓVILES (<= 640px) ================= */
@media (max-width: 640px) {
    .content-wrapper {
        padding: 0 0.65rem;
        margin: 0.5rem auto 2rem;
    }

    .form-card {
        padding: 1.25rem 1rem;
        border-radius: var(--radius-md);
    }

    .main-form-title {
        font-size: 1.2rem;
    }

    .inst-sub {
        font-size: 0.76rem;
    }

    .tricolor-bar {
        height: 58px;
    }

    /* Acciones de Cabecera en Móvil */
    .header-right-actions > div {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        width: 100%;
    }

    .admin-user-pill {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: center;
    }

    .header-right-actions a.btn-primary {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: center;
        padding: 0.7rem 1rem !important;
    }

    .header-right-actions a.btn-success {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: center;
        padding: 0.7rem 1rem !important;
    }

    .admin-action-pill.csv,
    .admin-action-pill.logout {
        width: 100%;
        justify-content: center;
        padding: 0.6rem 0.85rem;
    }

    /* Filtros panel */
    .filters-panel-card {
        padding: 1rem;
    }

    .filters-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }

    .filter-buttons-wrap {
        display: flex;
        gap: 0.5rem;
        width: 100%;
    }

    .filter-btn {
        flex: 1;
        justify-content: center;
    }

    /* Gráficas: Columnas y lienzos */
    .chart-glass-card {
        padding: 1.25rem 1rem;
    }

    .chart-content-row {
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem;
    }

    .chart-canvas-wrapper {
        width: 100%;
        min-width: 100%;
        height: 220px;
    }

    .chart-stats-column {
        width: 100%;
        min-width: 100%;
    }

    .gender-stat-box {
        padding: 0.75rem 0.85rem;
    }

    /* Modal de detalle de familia en móvil */
    .modal-backdrop {
        padding: 0.4rem;
    }

    .modal-card {
        max-height: 95vh;
        border-radius: var(--radius-md);
    }

    .modal-header {
        padding: 1rem 1.15rem;
    }

    .modal-title {
        font-size: 1.18rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-grid {
        grid-template-columns: 1fr;
        padding: 0.85rem;
        gap: 0.65rem;
    }

    .modal-footer {
        flex-direction: column-reverse;
        padding: 0.85rem 1rem;
        gap: 0.5rem;
    }

    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    /* Recibo de comprobante en móvil */
    .receipt-card {
        padding: 1.15rem 0.85rem;
    }

    .receipt-code {
        font-size: 1.25rem;
        word-break: break-all;
    }

    .success-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.65rem;
    }

    .success-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Footer de tabla */
    .table-footer-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }
}

/* ================= BREAKPOINT TELÉFONOS COMPACTOS (<= 480px) ================= */
@media (max-width: 480px) {
    .content-wrapper {
        padding: 0 0.35rem;
    }

    .form-card {
        padding: 1rem 0.75rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }

    .stat-card {
        padding: 0.85rem 1rem;
    }

    .stat-icon-wrapper {
        width: 40px;
        height: 40px;
    }

    .stat-icon-wrapper svg {
        width: 20px;
        height: 20px;
    }

    .main-form-title {
        font-size: 1.08rem;
    }

    .republic-text {
        font-size: 0.68rem;
    }

    .emergency-badge {
        font-size: 0.62rem;
    }

    /* Módulo Gestantes */
    .trimester-breakdown {
        gap: 0.4rem;
    }

    .tri-box {
        padding: 0.6rem 0.25rem;
    }

    .tri-num {
        font-size: 1.15rem;
    }

    .tri-label {
        font-size: 0.65rem;
    }

    /* Módulo Mascotas */
    .pet-circular-stat {
        gap: 0.85rem;
    }

    .pet-circle-fill {
        width: 76px;
        height: 76px;
    }

    .pet-pct {
        font-size: 1.2rem;
    }

    /* Toast alerta */
    .toast-warning {
        left: 1rem;
        right: 1rem;
        transform: none;
        max-width: calc(100% - 2rem);
    }
}

/* ================= BREAKPOINT ULTRA COMPACTO (<= 360px) ================= */
@media (max-width: 360px) {
    .form-card {
        padding: 0.85rem 0.55rem;
    }

    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    .cedula-input-group {
        flex-direction: column;
    }

    .segmented-control {
        width: 100%;
        display: flex;
    }

    .seg-btn {
        flex: 1;
        text-align: center;
    }
}

/* ========================================================================= */
/* RECOMENDACIÓN A: PAGINACIÓN EN LA TABLA DEL PADRÓN                        */
/* ========================================================================= */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(226, 232, 240, 0.85);
}

.pagination-page-size {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
}

.pagination-select {
    padding: 0.4rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: var(--font-body);
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    outline: none;
}

.pagination-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.page-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-body);
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.page-nav-btn svg {
    width: 14px;
    height: 14px;
}

.page-nav-btn:hover:not(:disabled) {
    background: var(--primary-blue);
    color: #ffffff;
    border-color: var(--primary-blue);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.page-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f1f5f9;
}

.page-numbers-list {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.page-num-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.page-num-btn:hover:not(.active):not(.ellipsis) {
    background: rgba(219, 234, 254, 0.9);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.page-num-btn.active {
    background: linear-gradient(135deg, var(--primary-blue), #1d4ed8);
    color: #ffffff;
    border-color: var(--primary-blue);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.page-num-btn.ellipsis {
    border: none;
    background: transparent;
    cursor: default;
    color: var(--text-muted);
}

.pagination-info {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ========================================================================= */
/* RECOMENDACIÓN C: CONTROL Y REGISTRO DE AYUDAS HUMANITARIAS                */
/* ========================================================================= */
.aid-badges-cell {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    gap: 0.35rem;
    align-items: center;
}

.aid-pill-mini {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.22rem 0.5rem;
    border-radius: 9999px;
    white-space: nowrap;
    text-decoration: none;
    transition: var(--transition-fast);
}

.aid-pill-mini.done {
    background: rgba(220, 252, 231, 0.95);
    color: #15803d;
    border: 1px solid #86efac;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.15);
}

.aid-pill-mini.pending {
    background: rgba(241, 245, 249, 0.85);
    color: #94a3b8;
    border: 1px dashed #cbd5e1;
}

/* Tarjetas de Entrega en el Modal de Detalle */
.aid-checklist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.85rem;
    margin-top: 0.75rem;
}

.aid-check-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.75rem;
    transition: var(--transition-normal);
}

.aid-check-card.delivered {
    background: linear-gradient(135deg, rgba(240, 253, 244, 0.95), rgba(220, 252, 231, 0.8));
    border-color: #86efac;
    box-shadow: 0 4px 15px rgba(22, 163, 74, 0.12);
}

.aid-check-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.aid-check-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main);
}

.aid-status-badge {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 0.18rem 0.55rem;
    border-radius: 9999px;
    letter-spacing: 0.04em;
}

.aid-status-badge.delivered {
    background: #16a34a;
    color: #ffffff;
}

.aid-status-badge.pending {
    background: #94a3b8;
    color: #ffffff;
}

.aid-check-info {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.aid-check-info strong {
    color: var(--text-main);
}

.btn-toggle-aid {
    width: 100%;
    padding: 0.55rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.btn-toggle-aid.btn-mark-delivered {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}

.btn-toggle-aid.btn-mark-delivered:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(16, 185, 129, 0.35);
}

.btn-toggle-aid.btn-mark-pending {
    background: rgba(241, 245, 249, 0.9);
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.btn-toggle-aid.btn-mark-pending:hover {
    background: #fee2e2;
}

/* ========================================================================= */
/* RECOMENDACIÓN B: MODAL DE EDICIÓN DE FICHAS FAMILIARES                    */
/* ========================================================================= */
.modal-edit-card {
    max-width: 860px;
    max-height: 90vh;
    overflow-y: auto;
}

.edit-integrante-card {
    background: rgba(248, 250, 252, 0.85);
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 0.85rem;
    margin-bottom: 0.75rem;
}

.edit-integrante-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

