/* =========================================================
   ESTRUCTURA GLOBAL PARA EL SISTEMA

   nsLayoutInicio.php
        nsHeader.php
        nsSidebar.php
        ns-content
            ns-content-inner
   nsLayoutFin.php

   turquesa
   #007fa4

   ========================================================= */


/* =========================================================
   VARIABLES GENERALES
   ========================================================= */

:root {

    /* -----------------------------------------------------
       COLORES PRINCIPALES
       ----------------------------------------------------- */

    --ns-estructura-primary: #3b82f6;
    --ns-estructura-primary-hover: #2563eb;
    --ns-estructura-primary-light: rgba(59, 130, 246, 0.12);

    --ns-estructura-dark: #111827;
    --ns-estructura-dark-secondary: #172033;
    --ns-estructura-dark-hover: #1f2937;

    --ns-estructura-white: #ffffff;

    --ns-estructura-light: #f8fafc;
    --ns-estructura-light-secondary: #f1f5f9;

    --ns-estructura-text: #ffffff;
    --ns-estructura-text-muted: #b6bac0;

    --ns-estructura-border: #e2e8f0;

    --ns-estructura-turquesa: #188db1;
    --ns-estructura-turquesa-border: #83ddf7;

    /* -----------------------------------------------------
       SIDEBAR
       ----------------------------------------------------- */

    --ns-estructura-sidebar-text: #e5e7eb;
    --ns-estructura-sidebar-text-muted: #9ca3af;

    --ns-estructura-sidebar-border: rgba(255, 255, 255, 0.08);

    --ns-estructura-sidebar-hover: rgba(255, 255, 255, 0.06);

    --ns-estructura-sidebar-active: rgba(0, 247, 255, 0.16);
    --ns-estructura-sidebar-active-border: #2377ff;

    --ns-estructura-sidebar-width: 250px;

    /* -----------------------------------------------------
       MEDIDAS
       ----------------------------------------------------- */

    --ns-estructura-header-height: 64px;

    --ns-estructura-radius-sm: 6px;
    --ns-estructura-radius: 15px;
    --ns-estructura-radius-lg: 12px;

    /* -----------------------------------------------------
       SOMBRAS
       ----------------------------------------------------- */

    --ns-estructura-shadow-sm:
        0 2px 6px rgba(15, 23, 42, 0.08);

    --ns-estructura-shadow:
        0 5px 15px rgba(15, 23, 42, 0.10);

    --ns-estructura-shadow-lg:
        0 10px 30px rgba(15, 23, 42, 0.14);

    /* -----------------------------------------------------
       TRANSICIONES
       ----------------------------------------------------- */

    --ns-estructura-transition: 0.2s ease;
}


/* =========================================================
   LAYOUT GENERAL
   ========================================================= */

.ns-layout {

    width: 100%;
    min-height: 100vh;

    box-sizing: border-box;

    background: var(--ns-estructura-light);

    /* color: var(--ns-estructura-bla); */
}


/* =========================================================
   HEADER GENERAL
   ========================================================= */

.ns-header {

    position: fixed;

    top: 0;
    left: 0;

    z-index: 1000;

    width: 100%;
    height: var(--ns-estructura-header-height);

    display: flex;
    align-items: center;

    box-sizing: border-box;

    padding: 0 18px;

    background: var(--ns-estructura-dark);

    color: var(--ns-estructura-text);

    border-bottom: 1px solid var(--ns-estructura-border);

    box-shadow: var(--ns-estructura-shadow-sm);
}


/* =========================================================
   HEADER - IZQUIERDA
   ========================================================= */

.ns-header-left {

    display: flex;
    align-items: center;

    flex-shrink: 0;

    height: 100%;
}


/* =========================================================
   BOTON MENU MOVIL
   ========================================================= */

#ns-btn-menu {

    display: none;

    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    width: 40px;
    height: 40px;

    margin-right: 10px;

    padding: 0;

    border: none;
    border-radius: var(--ns-estructura-radius);

    background: var(--ns-estructura-dark);

    color: var(--ns-estructura-white);

    font-size: 17px;

    cursor: pointer;

    box-shadow:
        0 4px 10px rgba(15, 23, 42, 0.16);

    transition:
        background var(--ns-estructura-transition),
        transform 0.15s ease;
}


#ns-btn-menu:hover {

    background: var(--ns-estructura-dark-hover);

    transform: translateY(-1px);
}


/* =========================================================
   HEADER - LOGO
   ========================================================= */

.ns-header-logo {

    display: flex;
    align-items: center;
    justify-content: center;

    height: 100%;

    min-width: 50px;
}


.ns-header-logo img {

    display: block;

    max-width: 130px;
    max-height: 130px;

    width: auto;
    height: auto;

    object-fit: contain;
}


/* =========================================================
   HEADER - CENTRO
   ========================================================= */

.ns-header-center {

    flex: 1;

    display: flex;
    flex-direction: column;

    justify-content: center;
    align-items: center;

    min-width: 0;

    padding: 0 25px;
}

.ns-header-left {


    display: flex;
    flex-direction: column;

    justify-content: left;
    align-items: start;

    min-width: 0;

    padding: 0 25px;
}


.ns-header-system-name {

    color: var(--ns-estructura-text);

    font-size: 22px;
    font-weight: 600;

    line-height: 20px;

    white-space: nowrap;

    overflow: hidden;
    text-overflow: ellipsis;
}


.ns-header-module {

    color: var(--ns-estructura-text-muted);

    font-size: 12px;

    line-height: 17px;

    white-space: nowrap;

    overflow: hidden;
    text-overflow: ellipsis;
}


/* =========================================================
   HEADER - DERECHA
   ========================================================= */

.ns-header-right {

    display: flex;
    align-items: center;

    flex-shrink: 0;

    height: 100%;
}


/* =========================================================
   HEADER - USUARIO
   ========================================================= */

.ns-header-user {

    display: flex;
    align-items: center;

    gap: 10px;
    border-right: 1px;
    border-right: solid #83ddf7;
    padding: 4px;
}


.ns-header-user-data {

    display: flex;
    flex-direction: column;

    justify-content: center;

    min-width: 0;

    text-align: right;
}


.ns-header-user-name {

    color: var(--ns-estructura-text);

    font-size: 13px;
    font-weight: 600;

    line-height: 18px;

    white-space: nowrap;
}


.ns-header-user-description {

    color: var(--ns-estructura-text-muted);

    font-size: 11px;

    line-height: 16px;

    white-space: nowrap;
}


/* =========================================================
   HEADER - FOTO USUARIO
   ========================================================= */

.ns-header-user-photo {

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    width: 40px;
    height: 40px;

    border-radius: 50%;

    background: var(--ns-estructura-light-secondary);

    border: 1px solid var(--ns-estructura-border);

    overflow: hidden;
}


.ns-header-user-photo img {

    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}


/* =========================================================
   CONTENEDOR PRINCIPAL
   ========================================================= */

.ns-main {

    display: flex;

    width: 100%;
    min-height: 100vh;

    padding-top: var(--ns-estructura-header-height);

    box-sizing: border-box;
}


/* =========================================================
   SIDEBAR GENERAL
   ========================================================= */

.ns-sidebar {

    width: var(--ns-estructura-sidebar-width);
    min-width: var(--ns-estructura-sidebar-width);

    height:
        calc(100vh - var(--ns-estructura-header-height));

    display: flex;
    flex-direction: column;

    box-sizing: border-box;

    background: var(--ns-estructura-dark);

    color: var(--ns-estructura-sidebar-text);

    border-right:
        1px solid var(--ns-estructura-sidebar-border);

    box-shadow:
        8px 0 30px rgba(0, 0, 0, 0.12);

    overflow: hidden;
    /* border-radius: 0 var(--ns-estructura-radius) var(--ns-estructura-radius) 0; */
}


/* =========================================================
   SIDEBAR - CABECERA
   ========================================================= */

.ns-sidebar-header {

    flex-shrink: 0;

    display: flex;
    align-items: center;

    min-height: 75px;

    padding: 18px 20px;

    box-sizing: border-box;

    background: var(--ns-estructura-dark);

    border-bottom:
        1px solid var(--ns-estructura-sidebar-border);
}


/* =========================================================
   SIDEBAR - TITULO
   ========================================================= */

.ns-sidebar-title {

    flex: 1;

    color: var(--ns-estructura-sidebar-text);

    font-size: 18px;
    font-weight: 600;

    letter-spacing: 0.02em;
}


/* =========================================================
   SIDEBAR - BOTON CERRAR
   ========================================================= */

.ns-sidebar-close {

    display: none;

    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    width: 38px;
    height: 38px;

    margin-left: 10px;

    padding: 0;

    border: none;
    border-radius: var(--ns-estructura-radius);

    background: rgba(255, 255, 255, 0.07);

    color: #d1d5db;

    font-size: 17px;

    cursor: pointer;

    transition:
        background var(--ns-estructura-transition),
        color var(--ns-estructura-transition);
}


.ns-sidebar-close:hover {

    background: rgba(239, 68, 68, 0.15);

    color: #f87171;
}


/* =========================================================
   SIDEBAR - CUERPO
   ========================================================= */

.ns-sidebar-body {

    flex: 1;

    min-height: 0;

    overflow-y: auto;
    overflow-x: hidden;

    padding: 12px 12px 20px;

    box-sizing: border-box;
}


/* =========================================================
   SIDEBAR - SCROLLBAR
   ========================================================= */

.ns-sidebar-body::-webkit-scrollbar {

    width: 6px;
}


.ns-sidebar-body::-webkit-scrollbar-track {

    background: transparent;
}


.ns-sidebar-body::-webkit-scrollbar-thumb {

    background: rgba(255, 255, 255, 0.12);

    border-radius: 10px;
}


.ns-sidebar-body::-webkit-scrollbar-thumb:hover {

    background: rgba(255, 255, 255, 0.20);
}


/* =========================================================
   SIDEBAR - ITEM
   ========================================================= */

.ns-sidebar-item {

    position: relative;

    display: flex;
    align-items: center;

    width: 100%;
    min-height: 32px;

    margin-bottom: 3px;

    padding: 0px 10px;

    box-sizing: border-box;

    border-radius: var(--ns-estructura-radius);

    color: var(--ns-estructura-sidebar-text);

    text-decoration: none;

    transition:
        background 0.18s ease,
        color 0.18s ease,
        transform 0.15s ease;
}


/* =========================================================
   SIDEBAR - HOVER
   ========================================================= */

.ns-sidebar-item:hover {

    background: var(--ns-estructura-sidebar-hover);

    color: var(--ns-estructura-white);

    text-decoration: none;

    transform: translateX(2px);
}


/* =========================================================
   SIDEBAR - ICONO
   ========================================================= */

.ns-sidebar-icon {

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    width: 30px;
    height: 30px;

    color: #64748b;

    font-size: 14px;

    text-align: center;
}


/* =========================================================
   SIDEBAR - NOMBRE
   ========================================================= */

.ns-sidebar-item-name {

    flex: 1;

    padding-left: 7px;

    color: inherit;

    font-size: 13px;

    line-height: 18px;
}


/* =========================================================
   SIDEBAR - ITEM ACTIVO
   ========================================================= */

.ns-sidebar-item-active {

    background: var(--ns-estructura-turquesa);

    box-shadow:
        inset 3px 0 0 var(--ns-estructura-turquesa-border);
}


/* =========================================================
   SIDEBAR - ACTIVO ICONO
   ========================================================= */

.ns-sidebar-item-active .ns-sidebar-icon {

    color: var(--ns-estructura-white);
}


/* =========================================================
   SIDEBAR - ACTIVO TEXTO
   ========================================================= */

.ns-sidebar-item-active .ns-sidebar-item-name {

    color: var(--ns-estructura-white);

    font-weight: 500;
}


/* =========================================================
   SIDEBAR - ACTIVO HOVER
   ========================================================= */

.ns-sidebar-item-active:hover {

    background: var(--ns-estructura-sidebar-active);

    transform: none;
}


/* =========================================================
   CONTENIDO
   ========================================================= */

.ns-content {

    flex: 1;

    min-width: 0;
    min-height: 0;

    height: calc(100vh - var(--ns-estructura-header-height));

    overflow: auto;

    box-sizing: border-box;
}

/* =========================================================
   CONTENIDO INTERNO
   ========================================================= */

.ns-content-inner {

    background: #f1eded;
    width: 100%;
    height: 100%;
    max-width: 1600px;

    min-width: 0;

    margin: 0 auto;

    padding: 20px;

    box-sizing: border-box;
}


/* =========================================================
   RESPONSIVE - TABLET
   ========================================================= */

@media (max-width: 900px) {

    .ns-padding-bordes {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* -----------------------------------------------------
       HEADER
       ----------------------------------------------------- */

    #ns-btn-menu {

        display: flex;
    }


    .ns-header {

        padding: 0 15px;
    }


    /* -----------------------------------------------------
       SIDEBAR
       ----------------------------------------------------- */

    .ns-sidebar {

        position: fixed;

        top: var(--ns-estructura-header-height);
        left: 0;

        z-index: 1100;

        width: var(--ns-estructura-sidebar-width);
        min-width: var(--ns-estructura-sidebar-width);

        height:
            calc(100vh - var(--ns-estructura-header-height));

        min-height: 0;

        transform: translateX(-100%);

        transition:
            transform 0.25s ease;

        box-shadow:
            8px 0 30px rgba(0, 0, 0, 0.20);

    }


    .ns-sidebar.ns-sidebar-open {

        transform: translateX(0);
    }


    .ns-sidebar-close {

        display: flex;
    }


    /* -----------------------------------------------------
       CONTENIDO
       ----------------------------------------------------- */

    .ns-content {

        width: 100%;
    }
}


/* =========================================================
   RESPONSIVE - PANTALLAS MEDIANAS
   ========================================================= */

@media (max-width: 700px) {

    .ns-padding-bordes {
        padding-left: 10px;
        padding-right: 10px;
    }


    .ns-sidebar-item-name {
        font-size: 18px;
    }

    .ns-header {

        padding: 0 12px;
    }


    .ns-header-center {

        padding: 0 12px;
    }


    .ns-header-system-name {

        font-size: 14px;
    }


    .ns-header-module {

        font-size: 11px;
    }


    .ns-header-user-description {

        display: none;
    }


    .ns-header-user-data {

        margin-right: 5px;
    }


    .ns-content-inner {

        padding: 15px;
    }
}


/* =========================================================
   RESPONSIVE - TELEFONOS
   ========================================================= */

@media (max-width: 500px) {

    .ns-padding-bordes {
        padding-left: 10px;
        padding-right: 10px;
    }


    :root {

        --ns-estructura-header-height: 58px;

        --ns-estructura-sidebar-width: 285px;
    }


    /* -----------------------------------------------------
       HEADER
       ----------------------------------------------------- */

    .ns-header {

        height: var(--ns-estructura-header-height);

        padding: 0 10px;
    }


    #ns-btn-menu {

        width: 38px;
        height: 38px;

        margin-right: 8px;
    }


    .ns-header-logo img {

        max-width: 110px;
        max-height: 50px;
    }


    .ns-header-center {
        padding: 0 10px;
    }

    .ns-header-user {
        display: none;
    }


    .ns-header-user-data {

        display: none;
    }


    .ns-header-user-photo {

        display: none;
    }


    /* -----------------------------------------------------
       SIDEBAR
       ----------------------------------------------------- */

    .ns-sidebar {
        z-index: 99999;
        top: var(--ns-estructura-header-height);
        width: 100%;
        min-width: 100%;
        height:
            calc(100vh - var(--ns-estructura-header-height));
    }


    .ns-sidebar-header {

        min-height: 68px;

        padding: 15px 16px;
    }


    .ns-sidebar-body {

        padding-left: 9px;
        padding-right: 9px;
    }


    /* -----------------------------------------------------
       CONTENIDO
       ----------------------------------------------------- */

    .ns-content {

        min-height:
            calc(100vh - var(--ns-estructura-header-height));
    }


    .ns-content-inner {

        padding: 12px;
    }

    /* -----------------------------------------------------
       ACTIONS PARA SALIR
       ----------------------------------------------------- */

    .ns-header-user-actions {
        gap: 2px;
        margin-left: 6px;
    }

    .ns-header-user-action {
        padding: 7px;
    }

    .ns-header-user-action span {
        display: none;
    }
}


/* =========================================================
   SIDEBAR - BUSCADOR
   ========================================================= */

.ns-sidebar-search {

    width: 100%;

    margin-bottom: 12px;

    box-sizing: border-box;
}


/* =========================================================
   SIDEBAR - CONTENEDOR INPUT
   ========================================================= */

.ns-sidebar-search-input {

    position: relative;

    display: flex;
    align-items: center;

    width: 100%;
    height: 32px;

    box-sizing: border-box;

    background: rgba(255, 255, 255, 0.06);

    border: 1px solid rgba(255, 255, 255, 0.08);

    border-radius: var(--ns-estructura-radius);

    transition:
        border-color 0.18s ease,
        background 0.18s ease;
}


/* =========================================================
   SIDEBAR - ICONO BUSCADOR
   ========================================================= */

.ns-sidebar-search-icon {

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    width: 38px;

    color: #ffffff;

    font-size: 13px;
}


/* =========================================================
   SIDEBAR - INPUT
   ========================================================= */

.ns-sidebar-search-input input {

    width: 100%;
    height: 100%;

    padding: 0 10px 0 0;

    box-sizing: border-box;

    border: none;
    outline: none;

    background: transparent;

    color: var(--ns-estructura-sidebar-text);

    font-size: 13px;
}


/* =========================================================
   SIDEBAR - PLACEHOLDER
   ========================================================= */

.ns-sidebar-search-input input::placeholder {

    color: var(--ns-estructura-sidebar-text-muted);

    opacity: 1;
}


/* =========================================================
   SIDEBAR - FOCUS
   ========================================================= */

.ns-sidebar-search-input:focus-within {

    background: rgba(255, 255, 255, 0.08);

    border-color: rgba(59, 130, 246, 0.55);
}


/* =========================================================
   SIDEBAR - CATEGORIA
   ========================================================= */

.ns-sidebar-category {

    width: 100%;

    margin-top: 16px;
    margin-bottom: 6px;

    padding: 6px 10px 5px;

    box-sizing: border-box;

    color: var(--ns-estructura-sidebar-text-muted);

    font-size: 10px;
    font-weight: 600;

    letter-spacing: 0.08em;

    text-transform: uppercase;
}


/* Primera categoría */

.ns-sidebar-category:first-child {

    margin-top: 2px;
}



/*  */


/* =====================================================
   ACCIONES DEL USUARIO - HEADER
   ===================================================== */

.ns-header-user-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 14px;
}


.ns-header-user-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    padding: 7px 10px;

    border-radius: var(--ns-radius);

    color: var(--ns-estructura-header-text);
    text-decoration: none;

    font-size: 13px;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}


.ns-header-user-action i {
    font-size: 14px;
}


.ns-header-user-action:hover {
    background: var(--ns-estructura-hover);
    color: var(--ns-estructura-primary);
}


/* Salir */

.ns-header-user-action-exit {
    color: var(--ns-estructura-muted);
}


.ns-header-user-action-exit:hover {
    background: var(--ns-estructura-hover);
    color: var(--ns-estructura-error);
}