/* ==========================================================================
   GESEL 27 - Hoja de estilos del sistema
   Complementa Bootstrap 5 con la disposicion tipo AdminLTE.
   ========================================================================== */

:root {
    --gesel-sidebar-ancho: 250px;
    --gesel-sidebar-oscuro: #212a35;
    --gesel-sidebar-medio: #2b3648;
    --gesel-sidebar-texto: #c2c7d0;
    --gesel-primario: #c2185b;
    --gesel-primario-oscuro: #8e1245;
    --gesel-fondo: #f4f6f9;
    --gesel-borde: #dee2e6;
    --gesel-sombra: 0 0 1px rgba(0, 0, 0, .125), 0 1px 3px rgba(0, 0, 0, .2);
}

body {
    background-color: var(--gesel-fondo);
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    font-size: .9rem;
}

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */
.pagina-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #212a35 0%, #3a2a3d 55%, #8e1245 100%);
    padding: 1.5rem;
}

.tarjeta-login {
    width: 100%;
    max-width: 420px;
    border: 0;
    border-radius: .75rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, .35);
}

.tarjeta-login .marca {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: .04em;
}

.tarjeta-login .marca span {
    color: var(--gesel-primario);
}

.tarjeta-login .subtitulo {
    font-size: .85rem;
    color: #6c757d;
}

/* --------------------------------------------------------------------------
   Estructura del panel
   -------------------------------------------------------------------------- */
.envoltura-panel {
    min-height: 100vh;
}

.barra-lateral {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--gesel-sidebar-ancho);
    background-color: var(--gesel-sidebar-oscuro);
    color: var(--gesel-sidebar-texto);
    display: flex;
    flex-direction: column;
    transition: margin-left .25s ease-in-out;
    z-index: 1038;
}

.barra-lateral .marca {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: 1rem 1rem .9rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    color: #fff;
    font-weight: 600;
    font-size: 1.15rem;
    text-decoration: none;
}

.barra-lateral .marca .logo {
    width: 34px;
    height: 34px;
    border-radius: .5rem;
    background: var(--gesel-primario);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .95rem;
}

.barra-lateral .entidad {
    padding: .65rem 1rem;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #8d97a5;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.menu-lateral {
    flex: 1;
    overflow-y: auto;
    padding: .5rem 0;
}

.menu-lateral .titulo-grupo {
    padding: .75rem 1rem .35rem;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #7d8899;
}

.menu-lateral .enlace {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .6rem 1rem;
    color: var(--gesel-sidebar-texto);
    text-decoration: none;
    border-left: 3px solid transparent;
    font-size: .875rem;
}

.menu-lateral .enlace:hover {
    background-color: var(--gesel-sidebar-medio);
    color: #fff;
}

.menu-lateral .enlace.activo {
    background-color: var(--gesel-sidebar-medio);
    color: #fff;
    border-left-color: var(--gesel-primario);
}

.menu-lateral .enlace.deshabilitado {
    color: #6c7787;
    cursor: not-allowed;
}

.menu-lateral .enlace .bi {
    font-size: 1.05rem;
    width: 1.25rem;
    text-align: center;
}

.menu-lateral .insignia-pronto {
    font-size: .6rem;
    background-color: rgba(255, 255, 255, .12);
    color: #aab3c0;
    padding: .1rem .35rem;
    border-radius: .25rem;
    margin-left: auto;
}

.pie-lateral {
    padding: .75rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, .08);
    font-size: .75rem;
    color: #8d97a5;
}

.contenido-principal {
    margin-left: var(--gesel-sidebar-ancho);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left .25s ease-in-out;
}

body.menu-contraido .barra-lateral {
    margin-left: calc(var(--gesel-sidebar-ancho) * -1);
}

body.menu-contraido .contenido-principal {
    margin-left: 0;
}

@media (max-width: 991.98px) {
    .barra-lateral {
        margin-left: calc(var(--gesel-sidebar-ancho) * -1);
    }

    .contenido-principal {
        margin-left: 0;
    }

    body.menu-desplegado .barra-lateral {
        margin-left: 0;
        box-shadow: 0 0 2rem rgba(0, 0, 0, .5);
    }
}

/* --------------------------------------------------------------------------
   Barra superior y contenido
   -------------------------------------------------------------------------- */
.barra-superior {
    background-color: #fff;
    border-bottom: 1px solid var(--gesel-borde);
    padding: .55rem 1rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.barra-superior .titulo-seccion {
    font-size: .95rem;
    font-weight: 600;
    margin: 0;
}

.barra-superior .migas {
    font-size: .75rem;
    margin: 0;
}

.contenido {
    padding: 1rem;
    flex: 1;
}

.tarjeta {
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: .35rem;
    box-shadow: var(--gesel-sombra);
}

.tarjeta-cabecera {
    padding: .65rem .9rem;
    border-bottom: 1px solid var(--gesel-borde);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.tarjeta-cuerpo {
    padding: .9rem;
}

.tarjeta-estadistica {
    border-top: 3px solid var(--gesel-primario);
}

.tarjeta-estadistica .valor {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.1;
}

.tarjeta-estadistica .etiqueta {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6c757d;
}

.tarjeta-estadistica.acento-azul { border-top-color: #0d6efd; }
.tarjeta-estadistica.acento-verde { border-top-color: #198754; }
.tarjeta-estadistica.acento-naranja { border-top-color: #fd7e14; }
.tarjeta-estadistica.acento-morado { border-top-color: #6f42c1; }

/* --------------------------------------------------------------------------
   Modulo de territorio
   -------------------------------------------------------------------------- */
#mapa-territorio {
    height: 620px;
    width: 100%;
    border-radius: .35rem;
    background-color: #e9ecef;
}

@media (max-width: 991.98px) {
    #mapa-territorio { height: 460px; }
}

.leyenda-mapa {
    background: rgba(255, 255, 255, .94);
    padding: .5rem .65rem;
    border-radius: .35rem;
    box-shadow: 0 1px 5px rgba(0, 0, 0, .4);
    font-size: .72rem;
    line-height: 1.4;
    max-width: 210px;
}

.leyenda-mapa .escala {
    height: .55rem;
    border-radius: .15rem;
    margin: .3rem 0 .2rem;
}

.etiqueta-seccion {
    background: transparent;
    border: 0;
    color: #343a40;
    font-size: .6rem;
    font-weight: 600;
    text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff;
    white-space: nowrap;
}

.tabla-secciones {
    font-size: .8rem;
}

.tabla-secciones thead th {
    position: sticky;
    top: 0;
    background-color: #f8f9fa;
    z-index: 2;
}

.contenedor-tabla {
    max-height: 380px;
    overflow: auto;
}

.ficha-dato {
    display: flex;
    justify-content: space-between;
    padding: .35rem 0;
    border-bottom: 1px dashed var(--gesel-borde);
    font-size: .82rem;
}

.ficha-dato:last-child { border-bottom: 0; }

.ficha-dato .clave { color: #6c757d; }

.ficha-dato .valor { font-weight: 600; }

.panel-filtros .form-label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6c757d;
    margin-bottom: .25rem;
}

.cursor-puntero { cursor: pointer; }

.fila-seleccionada {
    background-color: #fce4ec !important;
}

.esperando {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, .65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    border-radius: .35rem;
}

/* --------------------------------------------------------------------------
   v2: marca en la barra superior de paginas sueltas
   -------------------------------------------------------------------------- */
.marca-superior {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-weight: 700;
    font-size: .95rem;
    text-decoration: none;
    color: #212a35;
    white-space: nowrap;
}

.marca-superior .logo {
    background: var(--gesel-primario);
    color: #fff;
    border-radius: .35rem;
    padding: .15rem .45rem;
    font-size: .72rem;
    letter-spacing: .04em;
}

.marca-superior small {
    font-size: .65rem;
    color: #64748b;
    font-weight: 600;
}
