/* =====================================
   RESET
===================================== */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{
    font-family:Arial, sans-serif;
    background:#f8f5ef;
    color:#1f2937;
}

a{
    text-decoration:none;
    color:inherit;
}

/* =====================================
   LAYOUT GENERAL
===================================== */

.layout{
    display:flex;
    min-height:100vh;
}

.contenido{
    margin-left:250px;
    width:calc(100% - 250px);
    padding:35px;
}

.container{
    width:100%;
}

/* =====================================
   SIDEBAR
===================================== */

.sidebar{
    width:250px;
    background:linear-gradient(
        180deg,
        #d6d4d0 0%,
        #f0e8dc 100%
    ) !important;
    border-right:1px solid #b99f78;
    color:#1f2937;
    position:fixed;
    top:0;
    left:0;
    bottom:0;
    padding:25px 18px;
    overflow-y:auto;
}

.sidebar nav{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.sidebar nav a{
    padding:12px 14px;
    border-radius:10px;
    font-weight:bold;
    color:#1f2937;
    transition:.3s;
}

.sidebar nav a:hover{
    background:#8b6b43;
    color:white;
    transform:translateX(4px);
}

.sidebar .cerrar{
    background:#dc2626;
    color:white;
    margin-top:20px;
}

.logo-panel{
    text-align:center;
    margin-bottom:25px;
    padding-bottom:20px;
    border-bottom:1px solid rgba(0,0,0,.15);
}

.logo-panel img{
    width:200px;
    max-width:100%;
    height:auto;
}

.menu-titulo{
    margin-top:20px;
    margin-bottom:8px;
    padding:0 12px;
    font-size:11px;
    font-weight:700;
    letter-spacing:1px;
    color:#8a7b68;
    text-transform:uppercase;
}

/* =====================================
   TOPBAR
===================================== */

.topbar{
    background:white;
    border-radius:16px;
    padding:22px 26px;
    margin-bottom:25px;
    box-shadow:0 8px 24px rgba(0,0,0,.08);
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.usuario-box{
    text-align:right;
}

/* =====================================
   TARJETAS
===================================== */

.card,
.dashboard-card{
    background:white;
    border-radius:16px;
    padding:25px;
    box-shadow:0 8px 24px rgba(0,0,0,.08);
    transition:.3s;
}

.card:hover,
.dashboard-card:hover{
    transform:translateY(-3px);
    box-shadow:0 12px 30px rgba(0,0,0,.12);
}

.card h3,
.dashboard-card h3{
    margin-bottom:12px;
}

.card p,
.dashboard-card p{
    color:#4b5563;
}

.card-verde{
    border-left:6px solid #22c55e;
}

.card-roja{
    border-left:6px solid #ef4444;
}

/* =====================================
   DASHBOARD
===================================== */

.dashboard-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
    gap:20px;
}

.dashboard-card p{
    font-size:28px;
    font-weight:bold;
}

.dashboard-card-destacada{
    display:flex;
    flex-direction:column;

    border:2px solid #22c55e;
    box-shadow:0 0 12px rgba(34,197,94,.25);

    justify-content:center;
    align-items:center;
    text-align:center;
}

.dashboard-card-destacada h3{
    font-size:26px !important;
}

.dashboard-card-destacada p{
    font-size:52px !important;
    font-weight:bold !important;
}


/* =====================================
   AVISOS
===================================== */

.avisos-destacados{
    margin-bottom:30px;
}

.avisos-grid{
    display:flex;
    flex-wrap:wrap;
    gap:20px;
}

.aviso-card{
    width:360px;
    max-width:100%;

    background:#fff7ed;
    border-left:6px solid #f97316;
    border-radius:14px;
    padding:14px;
    box-shadow:0 8px 24px rgba(0,0,0,.08);
}

.aviso-card h3{
    margin-bottom:10px;
}

.aviso-card p{
    margin-bottom:10px;
}

.aviso-card small{
    color:#6b7280;
}

.aviso-imagen{
    width:100%;
    max-width:360px;
    height:auto;
    display:block;
    margin:0 auto 10px auto;
    border-radius:12px;
    box-shadow:0 6px 16px rgba(0,0,0,.10);
}


/* DISEÑO PC */

.encabezado-financiero-grid{
    display:grid;
    grid-template-columns:1fr 300px;
    gap:20px;
    align-items:center;
}

.encabezado-financiero .dashboard-card-destacada{
    width:300px;
    justify-self:end;
}


@media(max-width:768px){

    .aviso-imagen{
        width:100%;
        max-width:100%;
        height:auto;
    }

.encabezado-financiero-grid{
    grid-template-columns:1fr !important;
}

.encabezado-financiero .dashboard-card-destacada{
    width:100% !important;
    max-width:100% !important;
    margin-top:15px;
}

.encabezado-financiero{
    overflow:hidden;
}

.encabezado-financiero h1{
    font-size:26px !important;
    line-height:1.1;
}

.encabezado-financiero p{
    font-size:14px !important;
}

.encabezado-financiero input[type="month"]{
    width:100% !important;
}

.encabezado-financiero .btn{
    margin-top:8px;
}
}

/* =====================================
   FORMULARIOS
===================================== */

.formulario{
    background:white;
    border-radius:16px;
    padding:25px;
    box-shadow:0 8px 24px rgba(0,0,0,.08);
}

label{
    display:block;
    margin-top:14px;
    margin-bottom:6px;
    font-weight:bold;
    color:#374151;
}

input,
select,
textarea{
    width:100%;
    padding:10px;
    border:1px solid #d1d5db;
    border-radius:8px;
}

textarea{
    min-height:120px;
    resize:vertical;
}

/* =====================================
   BOTONES
===================================== */

.btn{
    display:inline-block;
    background:#2563eb;
    color:white;
    padding:10px 18px;
    border:none;
    border-radius:8px;
    font-weight:bold;
    cursor:pointer;
}

.btn:hover{
    background:#1d4ed8;
}

.btn-verde{
    background:#16a34a;
    color:white;
}

.btn-verde:hover{
    background:#15803d;
}

.btn-rojo{
    background:#dc2626;
    color:white;
}

.btn-rojo:hover{
    background:#b91c1c;
}

.btn-secundario{
    background:#6b7280;
    color:white;
}

/* =====================================
   TABLAS
===================================== */

table{
    width:100%;
    border-collapse:collapse;
    background:white;
    border-radius:12px;
}

th{
    background:#111827;
    color:white;
    padding:12px;
    text-align:left;
}

td{
    padding:12px;
    border-bottom:1px solid #e5e7eb;
}

tr:hover{
    background:#f9fafb;
}

.tabla-scroll{
    width:100%;
    max-height:70vh;
    overflow:auto;
    border-radius:12px;
    border:1px solid #e5e7eb;
}

.tabla-scroll table{
    min-width:1000px;
    border-collapse:separate;
    border-spacing:0;
}

.tabla-scroll thead th{
    position:sticky;
    top:0;
    z-index:20;
    background:#111827;
    color:white;
    box-shadow:0 2px 4px rgba(0,0,0,.15);
}

/* =====================================
   ALERTAS Y ESTATUS
===================================== */

.alerta-ok{
    background:#dcfce7;
    color:#166534;
    padding:12px;
    border-radius:8px;
    margin-bottom:15px;
}

.alerta-error{
    background:#fee2e2;
    color:#991b1b;
    padding:12px;
    border-radius:8px;
    margin-bottom:15px;
}

.mensaje-exito{
    background:#e8fff0;
    border-left:5px solid #28a745;
    padding:15px;
    border-radius:8px;
    color:#155724;
    font-weight:bold;
}

.estatus-pagado,
.estatus-disponible{
    color:#16a34a;
    font-weight:bold;
}

.estatus-pendiente,
.estatus-baja{
    color:#dc2626;
    font-weight:bold;
}

.estatus-asignado{
    color:#2563eb;
    font-weight:bold;
}

.alert-success{
    background:#dcfce7;
    color:#166534;
    border:1px solid #86efac;
    padding:12px 15px;
    border-radius:10px;
    margin-top:15px;
    margin-bottom:15px;
    font-weight:600;
}

/* =====================================
   EXTRAS
===================================== */

.input-moneda{
    display:flex;
    align-items:center;
    border:1px solid #d1d5db;
    border-radius:8px;
    overflow:hidden;
    background:white;
}

.input-moneda span{
    padding:10px 12px;
    background:#f3f4f6;
    font-weight:bold;
    color:#374151;
}

.input-moneda input{
    border:none;
    border-radius:0;
}

.archivo-personalizado{
    display:inline-block;
    background:#2563eb;
    color:white;
    padding:10px 18px;
    border-radius:8px;
    font-weight:bold;
    cursor:pointer;
    margin-top:8px;
}

.archivo-personalizado input{
    display:none;
}

.nombre-archivo{
    display:inline-block;
    margin-left:12px;
    color:#4b5563;
    font-size:14px;
}

.observacion-box{
    background:#f8f9fb;
    border-left:4px solid #2563eb;
    padding:12px 15px;
    border-radius:8px;
}

.observacion-box strong{
    display:block;
    margin-bottom:6px;
}

.observacion-box p{
    margin:0;
    color:#374151;
}

td .btn{
    margin:3px;
}

/* =====================================
   MENÚ RESPONSIVE CELULAR
===================================== */

.menu-toggle,
.menu-overlay{
    display:none;
}

@media (max-width:900px), (max-height:500px){

    .layout{
        display:block !important;
        min-height:100vh;
    }

    .sidebar{
        position:fixed !important;
        top:0 !important;
        left:-250px !important;
        width:250px !important;
        height:100vh !important;
        bottom:auto !important;
        z-index:1000 !important;
        transition:left .3s ease !important;
        overflow-y:auto !important;
        padding:25px 18px !important;
    }

    .sidebar.sidebar-abierto{
        left:0 !important;
    }

    .menu-toggle{
        display:flex !important;
        align-items:center !important;
        justify-content:center !important;
        position:fixed !important;

        top:90px !important;
        left:0 !important;

        width:14px !important;
        height:110px !important;

        z-index:99999 !important;

        background:rgba(17,24,39,.45) !important;
        backdrop-filter:blur(4px);

        color:white !important;
        border:none !important;
        border-radius:0 9px 9px 0 !important;

        font-size:18px !important;
        font-weight:bold !important;
        cursor:pointer !important;

        box-shadow:0 4px 12px rgba(0,0,0,.20) !important;
    }

    .menu-toggle.menu-toggle-abierto{
        left:250px !important;
    }

    .menu-overlay{
        display:none;
        position:fixed;
        inset:0;
        background:rgba(0,0,0,.25);
        z-index:900;
    }

    .menu-overlay.overlay-activo{
        display:block !important;
    }

    .contenido{
        margin-left:0 !important;
        width:100% !important;
        padding:12px !important;
    }

    .container{
        width:100% !important;
        max-width:100% !important;
        padding:0 !important;
    }

    .topbar{
        flex-direction:column;
        align-items:flex-start;
        gap:10px;
    }

    .card{
        width:100% !important;
        padding:18px !important;
    }

    .dashboard-grid{
        grid-template-columns:1fr 1fr !important;
        gap:10px !important;
    }

    .dashboard-card{
        padding:14px !important;
    }

    .dashboard-card h3{
        font-size:13px !important;
    }

    .dashboard-card p{
        font-size:18px !important;
    }

    .tabla-scroll{
        overflow-x:auto !important;
    }

    .tabla-scroll table{
        min-width:700px !important;
    }
    
    .aviso-card{
        width:100%;
        padding:10px !important;
    }
    
    .aviso-card h3{
        font-size:17px;
        margin-bottom:6px;
    }
    
    .aviso-card p{
        font-size:14px;
        line-height:1.35;
        margin-bottom:6px;
    }
    
    .aviso-card small{
        font-size:12px;
    }
    
    .aviso-imagen{
        width:100%;
        max-width:100%;
        height:auto;
        margin-bottom:6px;
    }
}



@media(max-width:480px){

    .dashboard-grid{
        grid-template-columns:1fr 1fr !important;
    }

    .btn{
        margin-bottom:6px;
    }
}

@media(max-width:768px){

    .tabla-vecino table{
        min-width:620px !important;
    }

    .tabla-vecino th,
    .tabla-vecino td{
        padding:10px 8px !important;
        font-size:13px !important;
        white-space:nowrap !important;
    }
}
.texto-rojo{
    color:#dc2626 !important;
    font-weight:700;
}

.texto-verde{
    color:#16a34a !important;
    font-weight:700;
}
.encabezado-financiero-grid{
    display:grid;
    grid-template-columns:1fr 300px;
    gap:20px;
    align-items:center;
}

/* =====================================
   CAMPANA NOTIFICACIONES
===================================== */

.campana-notificaciones{
    position:fixed;
    top:22px;
    right:28px;
    width:48px;
    height:48px;
    border-radius:50%;
    background:white;
    box-shadow:0 8px 24px rgba(0,0,0,.18);
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:24px;
    z-index:9999;
}

.campana-notificaciones span{
    position:absolute;
    top:-6px;
    right:-6px;
    min-width:22px;
    height:22px;
    padding:0 6px;
    border-radius:999px;
    background:#dc2626;
    color:white;
    font-size:12px;
    font-weight:bold;
    display:flex;
    align-items:center;
    justify-content:center;
    border:2px solid white;
}

.campana-notificaciones:hover{
    transform:scale(1.06);
}

@media(max-width:768px){
    .campana-notificaciones{
        top:18px;
        right:16px;
        width:44px;
        height:44px;
        font-size:22px;
    }
}
#btnInstalarApp {
    position: fixed;
    bottom: 90px;
    right: 20px;
    z-index: 9999;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 999px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    cursor: pointer;
}

#btnInstalarApp:hover {
    background: #1d4ed8;
}

/* ================================
   PWA - Tarjeta de instalación
================================ */

#pwaInstallCard {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99999;
    width: 360px;
    max-width: calc(100% - 32px);
}

.pwa-install-box {
    position: relative;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: #ffffff;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.25);
    border: 1px solid rgba(37, 99, 235, 0.12);
}

.pwa-install-icon {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 18px;
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.pwa-install-content h3 {
    margin: 0 0 6px 0;
    font-size: 18px;
    color: #111827;
}

.pwa-install-content p {
    margin: 0 0 14px 0;
    font-size: 14px;
    line-height: 1.45;
    color: #4b5563;
}

#btnInstalarApp {
    border: none;
    border-radius: 999px;
    background: #2563eb;
    color: #ffffff;
    padding: 11px 18px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

#btnInstalarApp:hover {
    background: #1d4ed8;
}

.pwa-install-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.pwa-install-close:hover {
    color: #111827;
}

@media (max-width: 768px) {
    #pwaInstallCard {
        left: 16px;
        right: 16px;
        bottom: 18px;
        width: auto;
    }

    .pwa-install-box {
        padding: 18px;
        border-radius: 18px;
    }
}
/* ===================================================
   SPLASH SCREEN V2
=================================================== */

#splash-screen{

    position:fixed;
    inset:0;

    z-index:999999;

    display:flex;
    justify-content:center;
    align-items:center;

    background:#ffffff;

    opacity:1;

    backdrop-filter:none;

    transition:.45s ease;

}

#splash-screen.hide{
    opacity:0;
    visibility:hidden;
}

.splash-box{

    width:420px;
    max-width:90%;

    text-align:center;

}

.splash-logo{

    width:240px;
    height:auto;

    margin-bottom:18px;

    animation:logoIntro .9s ease;
}

.splash-title{

    margin-top:18px;
    margin-bottom:0;

    font-size:36px;

    color:#2563eb;

    font-weight:700;

}

.splash-subtitle{

    margin-top:12px;

    color:#6b7280;

    font-size:16px;

}

.splash-progress{

    width:320px;

    max-width:100%;

    height:8px;

    margin:35px auto 15px;

    background:#e5e7eb;

    border-radius:20px;

    overflow:hidden;

}

.splash-progress-bar{

    width:35%;

    height:100%;

    border-radius:20px;

    background:#2563eb;

    animation:loading 1.2s infinite;

}

.splash-version{

    display:block;

    color:#9ca3af;

    margin-top:12px;

    font-size:13px;

    letter-spacing:1px;

}

@keyframes loading{

    0%{

        margin-left:-40%;

    }

    100%{

        margin-left:100%;

    }

}

@keyframes logoIntro{

    from{

        opacity:0;

        transform:scale(.85);

    }

    to{

        opacity:1;

        transform:scale(1);

    }

}

@media(max-width:768px){

    
       .splash-logo{
 width:150px;

    }

    .splash-title{

        font-size:28px;

    }

    .splash-community{

        font-size:20px;

    }

}
/* =========================================
   ACTUALIZACIÓN DISPONIBLE
========================================= */

#actualizacionPWA{

    position:fixed;

    bottom:20px;

    right:20px;

    background:#2563eb;

    color:#fff;

    padding:18px 24px;

    border-radius:14px;

    display:flex;

    gap:20px;

    align-items:center;

    box-shadow:0 8px 25px rgba(0,0,0,.18);

    z-index:999999;

    animation:slideUp .35s;

}

#actualizacionPWA button{

    background:#fff;

    color:#2563eb;

    border:none;

    padding:10px 18px;

    border-radius:8px;

    cursor:pointer;

    font-weight:bold;

}

@keyframes slideUp{

    from{

        opacity:0;

        transform:translateY(40px);

    }

    to{

        opacity:1;

        transform:translateY(0);

    }

}
/* ==========================
   ESTADO DE CONEXIÓN
========================== */

#estadoConexion {
    position: fixed;
    left: 50%;
    bottom: 85px;
    transform: translateX(-50%);
    z-index: 999999;
    padding: 14px 22px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(0,0,0,.18);
    display: none;
}

#estadoConexion.offline {
    background: #f97316;
    color: #ffffff;
}

#estadoConexion.online {
    background: #16a34a;
    color: #ffffff;
}

#estadoConexion{
    animation: aparecerConexion .35s ease;
}

@keyframes aparecerConexion{

    from{
        opacity:0;
        transform:translate(-50%,30px);
    }

    to{
        opacity:1;
        transform:translate(-50%,0);
    }

}

/* =====================================
   DOCUMENTOS
===================================== */

.documentos-grid{
    grid-template-columns:1fr;
}

@media(max-width:768px){

    .documentos-grid{
        grid-template-columns:1fr !important;
    }

}

.documento-card p{
    font-size:15px !important;
    font-weight:400 !important;
    line-height:1.6;
}

.documento-card h3{
    font-size:20px !important;
}

/* =====================================
   DOCUMENTOS
===================================== */

.documento-card{

    width:100%;

    background:#ffffff;

    border-radius:18px;

    padding:25px;

    box-shadow:0 10px 30px rgba(0,0,0,.08);

}

.documento-card h3{

    margin-bottom:15px;

    font-size:22px;

    color:#1f2937;

}

.documento-card p{

    font-size:16px;

    line-height:1.7;

    color:#4b5563;

    font-weight:400;

    margin-bottom:18px;

}

.documento-card .btn{

    display:inline-block;

    margin:10px 0 20px;

}

.nota-documento{

    background:#f8fafc;

    border-left:4px solid #2563eb;

    padding:15px;

    border-radius:10px;

    font-size:15px !important;

    line-height:1.7 !important;

    color:#4b5563 !important;

    margin-top:20px !important;

}

@media(max-width:768px){

    .documento-card{

        padding:20px;

    }

    .documento-card h3{

        font-size:20px;

    }

    .documento-card p{

        font-size:15px;

    }

}

/* =====================================
   FIX CELULAR HORIZONTAL
===================================== */

@media (orientation: landscape) and (max-width:1200px){

    .layout{
        display:block !important;
    }

    .sidebar{
        position:fixed !important;
        left:-250px !important;
        top:0 !important;
        width:250px !important;
        height:100vh !important;
        z-index:1000 !important;
    }

    .sidebar.sidebar-abierto{
        left:0 !important;
    }

    .menu-toggle{
        display:flex !important;
        left:0 !important;
    }

    .menu-toggle.menu-toggle-abierto{
        left:250px !important;
    }

    .contenido{
        margin-left:0 !important;
        width:100% !important;
        padding:12px !important;
    }

    .container{
        width:100% !important;
        max-width:100% !important;
        padding:0 !important;
    }

}

@media (max-width:768px){

    .encabezado-financiero .dashboard-card-destacada p.texto-verde,
    .encabezado-financiero .dashboard-card-destacada p.texto-rojo{
        font-size:44px !important;
        line-height:1.1 !important;
        letter-spacing:-1px !important;
        word-break:break-word !important;
    }

}


/* =====================================
   USUARIOS - RESPONSIVE
===================================== */

.usuarios-indicadores{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(150px, 1fr));
    gap:15px;
    margin-bottom:25px;
}

.usuarios-filtros{
    margin-bottom:20px;
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));
    gap:14px;
    align-items:end;
}

.usuarios-filtros label{
    margin-top:0;
}

.usuarios-filtros .acciones-filtros{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}

@media(max-width:768px){

    .usuarios-indicadores{
        grid-template-columns:1fr 1fr;
        gap:12px;
    }

    .usuarios-filtros{
        grid-template-columns:1fr;
    }

    .usuarios-filtros select,
    .usuarios-filtros input{
        width:100%;
    }

}

