/* Variables de diseño */
:root {
    --primary-color: #0026e3; 
    --primary-hover: #001bb3;
    --bg-app: #F4F6FA;
    --white: #FFFFFF;
    --text-main: #1A1D23;
    --text-muted: #8E94A3;
    --input-bg: #F9F9FB;
    --border-color: #E8EBF2;
    --success-color: #28a745;
}

/* Reset general */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-app);
    background: linear-gradient(180deg, #FDFDFD 0%, #E2E6F2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- LOGIN (index.php) --- */
.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    animation: fadeIn 0.8s ease-out;
}

.login-card {
    background: var(--white);
    padding: 40px 35px;
    border-radius: 35px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.logo-container-img {
    margin: 0 auto 5px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-logo {
    width: 100px;
    height: 75px;
    object-fit: contain;
}

h1 {
    font-size: 28px;
    color: var(--text-main);
    font-weight: 800;
    margin-bottom: 5px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 30px;
    font-weight: 500;
}

.input-group {
    text-align: left;
    margin-bottom: 22px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.forgot-link {
    font-size: 12px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 16px;
    color: #A0A6B5;
    font-size: 16px;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 15px 14px 45px;
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    background: var(--input-bg);
    outline: none;
    transition: all 0.3s ease;
    font-size: 14px;
    color: var(--text-main);
}

.input-wrapper input:focus {
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(0, 38, 227, 0.05);
}

.eye-icon {
    left: auto !important;
    right: 16px;
    cursor: pointer;
    transition: 0.2s;
}

.eye-icon:hover { color: var(--primary-color); }

.options-row {
    text-align: left;
    margin-bottom: 25px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.checkbox-container input {
    margin-right: 10px;
    accent-color: var(--primary-color);
    width: 18px;
    height: 18px;
}

.btn-login {
    width: 100%;
    padding: 18px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 16px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 38, 227, 0.3);
}

.btn-login:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 38, 227, 0.4);
}

.spacer-small { margin-bottom: 15px; }

.btn-request {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 1.5px solid var(--border-color);
    border-radius: 16px;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    transition: 0.3s;
}

.btn-request:hover {
    background: #f8f9fa;
    border-color: #d1d5db;
}

.login-footer { margin-top: 30px; text-align: center; }
.copyright { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.heart { color: #FF4D4D; margin: 0 2px; }

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

/* --- DASHBOARD CORE --- */

.bg-dashboard {
    background: #F8F9FD;
    align-items: flex-start;
    padding-top: 0;
}

.dashboard-wrapper {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding-bottom: 110px;
    min-height: 100vh;
    position: relative;
}

.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

.mini-logo { width: 35px; height: auto; }

.user-profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 6px 12px;
    border-radius: 50px;
    border: 1.5px solid var(--border-color);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.avatar-img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.dots-trigger { font-size: 14px; color: var(--text-muted); }

/* Sidebar Mejorada */
/* --- CORRECCIÓN DE SUPERPOSICIÓN (Z-INDEX) --- */
.side-modal {
    position: fixed;
    inset: 0;
    z-index: 9999; /* Asegura que esté por encima de cualquier otro elemento */
    visibility: hidden;
    pointer-events: none;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Empuja el contenido al fondo para el efecto 'bottom sheet' */
}

.side-modal.active {
    visibility: visible;
    pointer-events: auto;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 10, 50, 0.6); /* Oscurece el fondo para dar foco al modal */
    backdrop-filter: blur(4px); /* Difumina el fondo para evitar distracciones */
    z-index: -1;
}

.modal-content { position: absolute; left: -280px; top: 0; bottom: 0; width: 280px; background: white; padding: 40px 25px; transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: 10px 0 30px rgba(0,0,0,0.05); }
.side-modal.active .modal-content { left: 0; }

.close-sidebar { position: absolute; top: 20px; right: 20px; background: #f0f3ff; border: none; width: 35px; height: 35px; border-radius: 50%; color: var(--primary-color); font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.modal-header { text-align: center; margin-bottom: 30px; }
.modal-logo { width: 60px; margin-bottom: 15px; }
.brand-info h3 { font-size: 18px; color: var(--primary-color); font-weight: 800; }
.brand-info p { font-size: 12px; color: var(--text-muted); }

.modal-nav a { display: flex; align-items: center; gap: 15px; padding: 14px; text-decoration: none; color: var(--text-main); font-weight: 600; border-radius: 12px; transition: 0.2s; margin-bottom: 5px; }
.modal-nav a.active { background: #F0F3FF; color: var(--primary-color); }
.nav-divider { border: 0; border-top: 1px solid #F0F2F8; margin: 15px 0; }
.logout { color: #FF4D4D !important; }

/* Metrics & Tareas */
.metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; padding: 0 20px 25px; }
.metric-card { padding: 20px; border-radius: 25px; box-shadow: 0 10px 20px rgba(0,0,0,0.03); }
.main-blue { background: var(--primary-color); color: white; }
.secondary-white { background: white; color: var(--text-main); border: 1.5px solid var(--border-color); }

.metric-header { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; margin-bottom: 12px; opacity: 0.9; }
.metric-body h2 { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.text-success { color: var(--success-color); }

.progress-mini { height: 4px; background: rgba(255,255,255,0.2); border-radius: 10px; margin-bottom: 8px; }
.secondary-white .progress-mini { background: #F0F2F8; }
.fill { height: 100%; background: white; border-radius: 10px; }
.secondary-white .fill { background: var(--primary-color); }
.pct { font-size: 10px; font-weight: 700; opacity: 0.8; }

/* Filtros Desplegables */
.filters-container { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 20px 20px; }
.custom-filter-select { background: white; border: 1.5px solid var(--border-color); border-radius: 15px; padding: 12px; font-size: 13px; font-weight: 700; color: var(--text-main); outline: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238E94A3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
.filter-blue { background-color: var(--primary-color); color: white; border-color: var(--primary-color); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); }

/* Campaign Card PRO */
.actions-section { padding: 0 20px; }
.section-title { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.badge-count { background: #EBF0FF; color: var(--primary-color); padding: 3px 10px; border-radius: 10px; font-size: 12px; font-weight: 800; }

.campaign-card-pro { background: white; border-radius: 30px; padding: 25px; border: 1.5px solid var(--border-color); margin-bottom: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.02); }
.card-header-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px; position: relative; }
.title-group h4 { font-size: 17px; font-weight: 800; margin-bottom: 8px; }

.meta-info-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.meta-item { font-size: 11px; font-weight: 700; color: var(--text-muted); }
.status-pill { background: #EBF0FF; color: var(--primary-color); padding: 4px 10px; border-radius: 8px; }
.category-pill { background: #F0F3FF; color: #5C6AC4; padding: 4px 10px; border-radius: 8px; }

.btn-card-dots { background: none; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; padding: 5px; }

.progress-container { margin: 15px 0; }
.progress-labels { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; }
.main-progress-bar { height: 10px; background: #F0F2F8; border-radius: 10px; overflow: hidden; }
.main-progress-bar .fill { background: var(--primary-color); }

.card-footer-row { display: flex; justify-content: space-between; align-items: center; padding-top: 15px; border-top: 1px solid #F8FAFF; }
.team-group { display: flex; align-items: center; }
.team-group img { width: 30px; height: 30px; border-radius: 50%; border: 2px solid white; margin-left: -10px; }
.team-group img:first-child { margin-left: 0; }
.team-more { width: 30px; height: 30px; border-radius: 50%; background: #F0F2F8; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin-left: -10px; border: 2px solid white; color: var(--text-muted); }

.btn-ver-pro { background: var(--primary-color); color: white; border: none; padding: 10px 25px; border-radius: 12px; font-weight: 700; font-size: 13px; cursor: pointer; }

/* Dropdowns Cards */
.card-dropdown-content { position: absolute; right: 0; top: 40px; background: white; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); width: 170px; display: none; z-index: 100; padding: 8px; border: 1px solid var(--border-color); }
.card-dropdown-content.show { display: block; animation: fadeIn 0.2s ease; }
.card-dropdown-content a { display: flex; align-items: center; gap: 10px; padding: 10px; text-decoration: none; color: var(--text-main); font-size: 13px; font-weight: 600; border-radius: 10px; }
.card-dropdown-content a:hover { background: #F5F7FF; }
.dropdown-divider { height: 1px; background: var(--border-color); margin: 5px 0; }
.text-danger { color: #FF3B30 !important; }

/* Bottom Nav */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: white; display: flex; justify-content: space-around; padding: 15px 10px 35px; border-top: 1.5px solid var(--border-color); z-index: 1000; }
.nav-link { text-decoration: none; text-align: center; color: #B0B5C1; display: flex; flex-direction: column; gap: 5px; transition: 0.3s; }
.nav-link i { font-size: 22px; }
.nav-link span { font-size: 11px; font-weight: 700; }
.nav-link.active { color: var(--primary-color); }

/* --- BOTÓN VER TÁCTICO --- */
.btn-ver-minimal {
    background: rgba(0, 38, 227, 0.08);
    color: var(--primary-color);
    border: 1px solid rgba(0, 38, 227, 0.1);
    padding: 8px 22px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* --- ESTILOS VALIDACIÓN DATOS (AGENDA) --- */
.page-header-row { display: flex; align-items: center; gap: 15px; padding: 10px 20px 10px; }
.btn-back { background: white; border: 1.5px solid var(--border-color); width: 40px; height: 40px; border-radius: 12px; cursor: pointer; color: var(--text-main); }

.agenda-container { padding: 0 20px; }
.neighbor-card { 
    background: white; border-radius: 20px; padding: 15px; margin-bottom: 12px; 
    border: 1.5px solid var(--border-color); display: flex; justify-content: space-between; align-items: center;
}

.neighbor-info { display: flex; align-items: center; gap: 15px; }
.neighbor-avatar { width: 45px; height: 45px; background: #F0F3FF; color: var(--primary-color); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 18px; }

/* --- ESTILO TEXTO AGENDA --- */
.neighbor-details { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 0; }
.first-name { font-size: 11px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.last-name { font-size: 13px !important; font-weight: 700; color: var(--text-main); margin-top: 1px !important; }

.neighbor-actions-dual { display: flex; gap: 8px; }
.btn-mini-action { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; text-decoration: none; font-size: 14px; }
.btn-mini-action.call { background: #E8F5E9; color: #2E7D32; }
.btn-mini-action.wa { background: #E3F2FD; color: #1565C0; }

/* --- TABS VALIDACIÓN --- */
.tabs-container { display: flex; background: #E8EBF2; margin: 0 20px 20px; padding: 5px; border-radius: 15px; gap: 5px; }
.tab-btn { flex: 1; border: none; padding: 10px; border-radius: 12px; font-size: 13px; font-weight: 700; color: var(--text-muted); background: transparent; cursor: pointer; transition: 0.3s; }
.tab-btn.active { background: white; color: var(--primary-color); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.tab-icon-btn { flex: 0 0 50px; font-size: 16px; }

.tab-content { display: none; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }
.section-subtitle { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin-bottom: 15px; display: flex; align-items: center; gap: 10px; }

.neighbor-avatar.state-pending { background: #EBF0FF; color: var(--primary-color); }
.neighbor-avatar.state-process { background: #FFF4E5; color: #FF9500; }
.fa-spin-slow { animation: fa-spin 3s infinite linear; }

/* Instrucciones */
.info-instructions { background: white; padding: 20px; border-radius: 20px; border: 1.5px solid var(--border-color); }
.info-instructions h4 { color: var(--primary-color); margin-bottom: 15px; display: flex; align-items: center; gap: 10px; }
.info-list { list-style: none; padding: 0 !important; }
.info-list li { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 13px; font-weight: 500; border-bottom: 1px solid #F8F9FD; padding-bottom: 8px; }

/* --- MODAL COMPACTO TÁCTICO --- */
/* --- AJUSTE DE ALTURA PARA PANTALLAS PEQUEÑAS --- */
.compact-modal {
    width: 100%;
    max-height: 90vh; /* No permite que el modal exceda el alto de la pantalla */
    overflow-y: auto; /* Permite scroll interno si el contenido es muy largo */
    background: white;
    border-radius: 30px 30px 0 0;
    padding: 20px 20px 30px !important;
    position: relative;
    box-shadow: 0 -10px 25px rgba(0,0,0,0.1);
}
.modal-compact-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #F0F2F8; padding-bottom: 10px; margin-bottom: 10px; }

.modal-label { font-size: 10px; font-weight: 800; color: var(--primary-color); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; display: block; }
.modal-first-name { font-size: 17px; font-weight: 800; color: var(--text-main); line-height: 1.1; }
.modal-last-name { font-size: 14px; font-weight: 500; color: var(--text-muted); margin-top: 2px; }

.user-meta-grid { display: grid; grid-template-columns: 1fr; gap: 1px; margin-top: 8px; }
.user-meta-grid span { font-size: 10px; color: var(--text-muted); font-weight: 600; display: flex; align-items: center; gap: 8px; }

.header-actions { display: flex; gap: 8px; }
.btn-action-round { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; text-decoration: none; color: white; font-size: 14px; }
.btn-action-round.call { background: #2E7D32; }
.btn-action-round.wa { background: #25D366; }

.validation-body-compact { margin-top: 0px; }
.check-row-tactical { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.compact-check { flex: 1; background: #F8F9FD; border: 1px solid #E8EBF2; padding: 8px 5px; border-radius: 10px; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 5px; }

.status-radio-compact { display: flex; justify-content: space-around; gap: 10px; margin-bottom: 12px; }
.s-radio { flex: 1; cursor: pointer; }
.s-radio input { display: none; }
.r-box { height: 45px; border-radius: 12px; border: 1.5px solid #F0F2F8; display: flex; align-items: center; justify-content: center; font-size: 16px; }

.s-radio input:checked + .r-box.p { background: #EBF0FF; border-color: var(--primary-color); color: var(--primary-color); }
.s-radio input:checked + .r-box.pr { background: #FFF4E5; border-color: #FF9500; color: #FF9500; }
.s-radio input:checked + .r-box.f { background: #E8F5E9; border-color: #2E7D32; color: #2E7D32; }
.s-radio input:checked + .r-box.c { background: #FFEBEB; border-color: #FF3B30; color: #FF3B30; }

.compact-textarea { width: 100%; border: 1.5px solid #F0F2F8; border-radius: 12px; padding: 10px; height: 50px; font-size: 13px; margin-bottom: 12px; outline: none; }
.btn-login-compact { width: 100%; padding: 14px; background: var(--primary-color); color: white; border: none; border-radius: 12px; font-weight: 700; font-size: 14px; }

.filter-segments {
    display: flex;
    gap: 10px;
    padding: 0 20px;
    margin-bottom: 20px;
}

.segment-btn {
    flex: 1;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid #ddd;
    background: white;
    font-size: 0.9em;
    font-weight: 600;
    color: #666;
    cursor: pointer;
}

.segment-btn.active {
    background: #0026e3;
    color: white;
    border-color: #0026e3;
}

.user-profile-trigger img {
    display: block;
    width: 40px;
    height: 40px;
    object-fit: cover; /* Esto evita que la imagen se estire */
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.user-profile-trigger img:hover {
    transform: scale(1.05);
}

/* Contenedor del avatar en la cabecera */
.avatar-container {
    width: 32px; /* Tamaño reducido para elegancia */
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 1.5px solid #e0e0e0; /* Un borde fino gris suave */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.avatar-img-mini {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* El icono de los tres puntos más sutil */
.dots-trigger {
    font-size: 0.85rem;
    color: #999;
    margin-left: 4px;
}

.user-profile-trigger {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px;
    border-radius: 20px;
    transition: background 0.2s;
}

.user-profile-trigger:active {
    background: #f0f0f0; /* Feedback táctil al tocarlo */
}

/* Cabecera general */
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: transparent; /* Ahora se funde con el fondo de la página */
    box-query: none; /* Quitamos la sombra para que no se vea el corte */
}

/* Cápsula del usuario resaltada */
.header-user-capsule {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    background: #ffffff; /* La cápsula sí es blanca para destacar */
    border: 1px solid rgba(0, 0, 0, 0.05); /* Borde casi invisible */
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03); /* Sombra muy suave para flotabilidad */
    transition: all 0.3s ease;
}

/* El anillo de la foto dentro de la cápsula */
.avatar-ring {
    width: 32px;
    height: 32px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.nav-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Icono sutil */
.nav-chevron {
    font-size: 0.7rem;
    color: #0026e3;
    opacity: 0.6;
}