/* ========================================================= */
/* HUMIDI-TEC - IDENTIDAD GLOBAL                             */
/* ========================================================= */

:root {
    --green-950: #043d27;
    --green-900: #075333;
    --green-800: #08653d;
    --green-700: #087443;
    --green-600: #129056;
    --green-500: #24ad69;
    --green-400: #4ac486;
    --green-100: #dcf4e7;
    --green-50: #eef9f3;

    --blue-600: #307cc2;
    --blue-500: #4595d8;
    --blue-100: #ddecfb;
    --blue-50: #eef6fd;

    --teal-600: #168a86;
    --teal-50: #eaf8f7;

    --background: #f3f7f5;
    --surface: #ffffff;

    --text-primary: #17382d;
    --text-secondary: #64766d;
    --text-muted: #8a9891;

    --border: #dce8e1;
    --border-soft: #e9efeb;

    --header-height: 92px;
    --sidebar-width: 245px;

    --shadow-small:
        0 4px 14px rgba(22, 73, 49, 0.05);

    --shadow-medium:
        0 10px 28px rgba(18, 72, 46, 0.09);
}


/* ========================================================= */
/* RESET                                                     */
/* ========================================================= */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;

    font-size: 16px;
}

body {
    margin: 0;

    min-height: 100vh;

    font-family:
        "Segoe UI",
        Arial,
        Helvetica,
        sans-serif;

    color:
        var(--text-primary);

    background:
        var(--background);
}

a {
    text-decoration: none;
}


/* ========================================================= */
/* CONTENEDOR GENERAL                                        */
/* ========================================================= */

.system-shell {
    width: 100%;

    min-height: 100vh;

    overflow-x: hidden;
}


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

.system-header {
    position: sticky;

    top: 0;

    z-index: 1000;

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

    display: flex;
    align-items: center;

    padding:
        0
        30px;

    overflow: hidden;

    background:
        radial-gradient(
            circle at 74% 18%,
            rgba(100, 225, 164, 0.12),
            transparent 24%
        ),
        radial-gradient(
            circle at 94% 85%,
            rgba(74, 193, 210, 0.08),
            transparent 18%
        ),
        linear-gradient(
            110deg,
            #043d27 0%,
            #075333 33%,
            #08653d 65%,
            #087443 100%
        );

    box-shadow:
        0 4px 16px rgba(5, 68, 40, 0.16);
}


/* ========================================================= */
/* DECORACIÓN HEADER                                         */
/* ========================================================= */

.header-decoration-circle {
    position: absolute;

    pointer-events: none;

    border-radius: 50%;
}


/* CÍRCULO GRANDE */

.circle-one {
    width: 290px;
    height: 290px;

    right: 260px;
    top: -225px;

    border:
        1px solid rgba(255, 255, 255, 0.11);
}


/* CÍRCULO MEDIANO */

.circle-two {
    width: 190px;
    height: 190px;

    right: 55px;
    bottom: -145px;

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

    border:
        1px solid rgba(255, 255, 255, 0.07);
}


/* CÍRCULO PEQUEÑO */

.circle-three {
    width: 95px;
    height: 95px;

    right: 190px;
    bottom: -72px;

    border:
        1px solid rgba(102, 221, 177, 0.12);
}


/* LÍNEA INFERIOR */

.header-decoration-line {
    position: absolute;

    left: 0;
    bottom: 0;

    width: 100%;
    height: 4px;

    background:
        linear-gradient(
            90deg,
            #55d492 0%,
            #3fca92 30%,
            #38c3a2 62%,
            #54b6e8 100%
        );
}


/* ========================================================= */
/* MARCA                                                     */
/* ========================================================= */

.header-brand {
    position: relative;

    z-index: 2;

    display: flex;
    align-items: center;
}

.brand-link {
    min-width: 0;

    display: flex;
    align-items: center;

    gap: 14px;

    color: inherit;
}

.brand-link:hover {
    color: inherit;
}


/* ========================================================= */
/* LOGO                                                      */
/* ========================================================= */

.brand-logo-container {
    width: 60px;
    height: 60px;

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

    flex-shrink: 0;

    overflow: hidden;

    padding: 5px;

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

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

    border-radius: 15px;

    box-shadow:
        0 7px 18px rgba(1, 44, 25, 0.17);
}

.brand-logo {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: contain;

    border-radius: 10px;
}


/* ========================================================= */
/* TEXTO DE MARCA                                            */
/* ========================================================= */

.brand-information {
    min-width: 0;

    display: flex;
    flex-direction: column;
}

.brand-information strong {
    overflow: hidden;

    font-size: 28px;
    font-weight: 850;

    line-height: 1.05;

    letter-spacing: 0.3px;

    color: #ffffff;

    white-space: nowrap;
    text-overflow: ellipsis;
}

.brand-subtitle {
    margin-top: 5px;

    font-size: 11px;
    font-weight: 550;

    color:
        rgba(255, 255, 255, 0.82);
}


/* ========================================================= */
/* LAYOUT PRINCIPAL                                          */
/* ========================================================= */

.system-layout {
    width: 100%;

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

    display: grid;

    grid-template-columns:
        var(--sidebar-width)
        minmax(0, 1fr);

    align-items: stretch;

    background:
        var(--background);
}


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

.sidebar {
    width: 100%;

    min-height: 100%;

    align-self: stretch;

    position: relative;

    display: flex;
    flex-direction: column;

    padding: 0;

    overflow: visible;

    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #fbfdfc 100%
        );

    border-right:
        1px solid var(--border);
}


/*
    Compatible tanto con el layout actual
    que usa .sidebar-main como con la nueva
    estructura .sidebar-inner.
*/

.sidebar-main,
.sidebar-inner {
    width: 100%;

    position: sticky;

    top:
        calc(var(--header-height) + 18px);

    display: flex;
    flex-direction: column;

    gap: 20px;

    padding:
        18px
        14px
        28px;
}


/* ========================================================= */
/* GRUPOS DEL SIDEBAR                                        */
/* ========================================================= */

.sidebar-group {
    width: 100%;
}


/*
    Para el futuro grupo:
    SISTEMA
    CUENTA
*/

.sidebar-account-group {
    width: 100%;

    margin-top: 2px;

    padding-top: 18px;

    border-top:
        1px solid var(--border-soft);
}


/* ========================================================= */
/* SIDEBAR - TÍTULOS                                         */
/* ========================================================= */

.sidebar-heading {
    padding:
        0
        9px;

    margin-bottom: 9px;
}

.sidebar-heading span {
    display: block;

    font-size: 9px;
    font-weight: 850;
    letter-spacing: 1.6px;

    color:
        #7f8e86;
}


/* ========================================================= */
/* NAVEGACIÓN                                                */
/* ========================================================= */

.sidebar-navigation {
    width: 100%;

    display: flex;
    flex-direction: column;

    gap: 5px;
}


/* ========================================================= */
/* ELEMENTOS DEL SIDEBAR                                     */
/* ========================================================= */

.sidebar-item {
    position: relative;

    width: 100%;

    min-height: 46px;

    display: flex;
    align-items: center;

    gap: 10px;

    padding:
        6px
        9px;

    color:
        #52645b;

    background:
        transparent;

    border:
        1px solid transparent;

    border-radius:
        12px;

    text-decoration: none;

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

.sidebar-item:hover {
    color:
        var(--green-700);

    background:
        #f0f8f4;

    border-color:
        #dfede5;

    transform:
        translateX(2px);
}


/* ========================================================= */
/* ICONOS SIDEBAR                                            */
/* ========================================================= */

.sidebar-item-icon {
    width: 34px;
    height: 34px;

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

    flex:
        0
        0
        34px;

    color:
        var(--green-700);

    background:
        var(--green-50);

    border-radius:
        10px;

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

.sidebar-item-icon svg {
    width: 18px;
    height: 18px;

    display: block;
}


/* ========================================================= */
/* TEXTO SIDEBAR                                             */
/* ========================================================= */

.sidebar-item-text {
    min-width: 0;

    font-size: 13px;
    font-weight: 650;
    line-height: 1.2;

    color: inherit;

    white-space: nowrap;
}


/* ========================================================= */
/* SIDEBAR ACTIVO                                            */
/* ========================================================= */

.sidebar-item.active {
    color:
        #ffffff;

    background:
        linear-gradient(
            135deg,
            var(--green-900),
            var(--green-700)
        );

    border-color:
        transparent;

    box-shadow:
        0 8px 18px rgba(8, 101, 61, 0.19);

    transform:
        none;
}

.sidebar-item.active::before {
    content: "";

    position: absolute;

    left: -14px;
    top: 50%;

    width: 4px;
    height: 27px;

    transform:
        translateY(-50%);

    background:
        #48c889;

    border-radius:
        0 5px 5px 0;
}

.sidebar-item.active
.sidebar-item-icon {
    color:
        #ffffff;

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


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

.main-content {
    min-width: 0;

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

    background:
        radial-gradient(
            circle at top right,
            rgba(45, 173, 105, 0.035),
            transparent 32%
        ),
        var(--background);
}

.content-wrapper {
    width: 100%;

    padding:
        22px
        28px
        40px;
}


/* ========================================================= */
/* TABLET                                                    */
/* ========================================================= */

@media (max-width: 1050px) {

    :root {
        --header-height: 84px;
        --sidebar-width: 86px;
    }


    /* HEADER */

    .system-header {
        height:
            var(--header-height);

        padding:
            0
            20px;
    }


    .brand-logo-container {
        width: 54px;
        height: 54px;
    }


    .brand-information strong {
        font-size: 24px;
    }


    .brand-subtitle {
        font-size: 10px;
    }


    .circle-one {
        right: 120px;
    }


    .circle-two {
        right: -20px;
    }


    /* SIDEBAR */

    .sidebar-main,
    .sidebar-inner {
        top:
            calc(var(--header-height) + 18px);

        gap: 12px;

        padding:
            18px
            10px
            24px;
    }


    .sidebar-heading {
        display: none;
    }


    .sidebar-account-group {
        margin-top: 3px;

        padding-top: 12px;
    }


    .sidebar-item {
        justify-content: center;

        padding:
            7px;
    }


    .sidebar-item-text {
        display: none;
    }


    .sidebar-item.active::before {
        left: -10px;
    }


    /* CONTENIDO */

    .content-wrapper {
        padding:
            24px
            24px
            44px;
    }

}


/* ========================================================= */
/* MÓVIL                                                     */
/* ========================================================= */

@media (max-width: 700px) {

    :root {
        --header-height: 76px;
    }


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

    .system-header {
        height:
            var(--header-height);

        padding:
            0
            14px;
    }


    .brand-link {
        gap: 10px;
    }


    .brand-logo-container {
        width: 50px;
        height: 50px;

        border-radius:
            12px;
    }


    .brand-information strong {
        font-size: 20px;
    }


    .brand-subtitle {
        display: none;
    }


    .circle-one {
        width: 210px;
        height: 210px;

        right: -20px;
        top: -175px;
    }


    .circle-two,
    .circle-three {
        display: none;
    }


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

    .system-layout {
        display: flex;
        flex-direction: column;

        min-height: auto;
    }


    /* ===================================================== */
    /* SIDEBAR EN MÓVIL                                     */
    /* ===================================================== */

    .sidebar {
        width: 100%;

        min-height: auto;

        position: static;

        display: block;

        background:
            #ffffff;

        border-right:
            none;

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


    .sidebar-main,
    .sidebar-inner {
        width: 100%;

        position: static;

        display: block;

        padding:
            8px
            10px;

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

        white-space: nowrap;

        scrollbar-width: thin;
    }


    /*
        En móvil no mostramos los encabezados
        SISTEMA / CUENTA.
    */

    .sidebar-heading {
        display: none;
    }


    /*
        Los grupos quedan seguidos horizontalmente.
    */

    .sidebar-group {
        width: auto;

        display: inline-block;

        vertical-align: top;
    }


    .sidebar-account-group {
        width: auto;

        display: inline-block;

        margin: 0;
        padding: 0;

        border: none;

        vertical-align: top;
    }


    .sidebar-navigation {
        width: auto;

        display: inline-flex;
        flex-direction: row;

        gap: 5px;

        overflow: visible;

        vertical-align: top;
    }


    .sidebar-item {
        width: auto;

        min-width: 53px;
        min-height: 48px;

        flex-shrink: 0;

        justify-content: center;

        padding:
            7px
            9px;
    }


    .sidebar-item-text {
        display: none;
    }


    .sidebar-item.active::before {
        display: none;
    }


    .sidebar-item-icon {
        width: 34px;
        height: 34px;

        flex:
            0
            0
            34px;
    }


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

    .main-content {
        width: 100%;

        min-height: auto;
    }


    .content-wrapper {
        padding:
            20px
            15px
            36px;
    }

}


/* ========================================================= */
/* PANTALLAS MUY PEQUEÑAS                                    */
/* ========================================================= */

@media (max-width: 430px) {

    .system-header {
        padding:
            0
            11px;
    }


    .brand-logo-container {
        width: 46px;
        height: 46px;

        padding: 4px;
    }


    .brand-information strong {
        font-size: 18px;
    }


    .content-wrapper {
        padding:
            18px
            12px
            32px;
    }

}


/* ========================================================= */
/* ACCESIBILIDAD                                             */
/* ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .sidebar-item {
        transition: none;
    }


    .sidebar-item:hover {
        transform: none;
    }

}


/* =========================================================
   HUMIDI-TEC
   SELECT / DROPDOWN PERSONALIZADO GLOBAL
========================================================= */

.ht-select {
    position: relative;

    width: 100%;

    font-family:
        Arial,
        Helvetica,
        sans-serif;
}


/* SELECT REAL
   Se conserva para no romper JS, formularios ni backend
========================================================= */

.ht-select-native {
    position: absolute !important;

    width: 100% !important;
    height: 100% !important;

    inset: 0 !important;

    opacity: 0 !important;

    pointer-events: none !important;

    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;

    border: 0 !important;
    background: transparent !important;

    margin: 0 !important;
    padding: 0 !important;

    z-index: -1 !important;
}

.ht-select-native::-ms-expand {
    display: none !important;
}

/* =========================================================
   BOTÓN PRINCIPAL
========================================================= */

.ht-select-trigger {
    width: 100%;
    min-height: 42px;

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

    gap: 12px;

    padding: 0 14px;

    color: var(--text-primary, #17382d);

    background:
        #ffffff;

    border:
        1px solid
        #9fcdb3;

    border-radius:
        10px;

    font: inherit;
    font-size: 13px;
    font-weight: 700;

    text-align: left;

    cursor: pointer;

    outline: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background-color 0.15s ease;
}


.ht-select-trigger:hover {
    border-color:
        var(--green-600, #129056);

    background:
        #fbfefc;
}


.ht-select.is-open
.ht-select-trigger {
    border-color:
        var(--green-600, #129056);

    box-shadow:
        0 0 0 3px
        rgba(18, 144, 86, 0.13);
}


/* =========================================================
   TEXTO
========================================================= */

.ht-select-value {
    min-width: 0;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}


/* =========================================================
   FLECHA
========================================================= */

.ht-select-arrow {
    width: 22px;
    height: 22px;

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

    flex: 0 0 22px;

    color:
        var(--green-800, #08653d);

    background:
        transparent;

    border:
        none;

    border-radius:
        50%;

    transition:
        transform 0.22s ease,
        color 0.22s ease,
        background-color 0.22s ease;
}


.ht-select-arrow svg {
    width: 14px;
    height: 14px;

    display: block;
}


.ht-select.is-open
.ht-select-arrow {
    transform:
        rotate(180deg);

    color:
        var(--green-600, #129056);

    background:
        rgba(18, 144, 86, 0.08);
}
.ht-select.is-open
.ht-select-trigger:hover
.ht-select-arrow {
    transform:
        rotate(180deg)
        translateY(-1px);
}

/* =========================================================
   MENÚ ABIERTO
========================================================= */

.ht-select-menu {
    position: absolute;

    top:
        calc(100% + 6px);

    left: 0;
    right: 0;

    z-index: 5000;

    max-height: 260px;

    padding: 6px;

    overflow-y: auto;

    background:
        #ffffff;

    border:
        1px solid
        #cfe1d7;

    border-radius:
        10px;

    box-shadow:
        0 12px 30px
        rgba(21, 68, 47, 0.14);
}


.ht-select-menu[hidden] {
    display: none !important;
}


/* =========================================================
   OPCIONES
========================================================= */

.ht-select-option {
    width: 100%;
    min-height: 36px;

    display: flex;
    align-items: center;

    padding: 8px 11px;

    color:
        var(--text-primary, #17382d);

    background:
        transparent;

    border:
        0;

    border-radius:
        7px;

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

    text-align: left;

    cursor: pointer;

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


.ht-select-option:hover,
.ht-select-option:focus-visible {
    color:
        var(--green-900, #075333);

    background:
        var(--green-50, #eef9f3);

    outline: none;
}


/* OPCIÓN SELECCIONADA */

.ht-select-option.is-selected {
    color:
        #ffffff;

    background:
        var(--green-700, #087443);

    font-weight: 800;
}


.ht-select-option.is-selected:hover {
    color:
        #ffffff;

    background:
        var(--green-800, #08653d);
}


/* =========================================================
   DESHABILITADO
========================================================= */

.ht-select.is-disabled
.ht-select-trigger {
    color:
        var(--text-muted, #8a9891);

    background:
        #f2f5f3;

    border-color:
        #dde5e0;

    cursor:
        not-allowed;

    opacity:
        0.75;
}


.ht-select-option:disabled {
    opacity:
        0.45;

    cursor:
        not-allowed;
}


/* =========================================================
   SCROLL DEL MENÚ
========================================================= */

.ht-select-menu::-webkit-scrollbar {
    width: 7px;
}


.ht-select-menu::-webkit-scrollbar-track {
    background:
        transparent;
}


.ht-select-menu::-webkit-scrollbar-thumb {
    background:
        #c4d8cc;

    border-radius:
        10px;
}


.ht-select-menu::-webkit-scrollbar-thumb:hover {
    background:
        #9fbdac;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (
    max-width: 700px
) {

    .ht-select-trigger {
        min-height: 44px;

        font-size: 14px;
    }


    .ht-select-option {
        min-height: 40px;

        font-size: 14px;
    }
}

/* =========================================================
   OCULTAR FLECHAS ANTIGUAS DE SELECTS PERSONALIZADOS
========================================================= */

.riego-select-wrap > .riego-select-icon {
    display: none !important;
}