﻿
/* =========================================
   HELIGREEN - LOGIN
   Sistema de Gestión Empresarial
========================================= */

:root {
    --hg-primary: #08733D;
    --hg-primary-dark: #075331;
    --hg-primary-light: #E8F3EB;
    --hg-accent: #76B82A;
    --hg-background: #F7FAF8;
    --hg-surface: #FFFFFF;
    --hg-text: #123F30;
    --hg-text-secondary: #68747A;
    --hg-border: #D5DDDA;
    --hg-radius: 24px;
    --hg-shadow: 0 18px 45px rgba(17, 62, 43, 0.13);
}

/* =========================================
   RESET
========================================= */

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
}

html {
    font-size: 16px;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--hg-text);
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font-family: inherit;
}

/* =========================================
   LOGIN GENERAL
========================================= */

.login-body {
    min-height: 100vh;
    overflow-x: hidden;
    background: linear-gradient(115deg, #F8FBF9 0%, #F1F7F9 100%);
}

.login-page {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    isolation: isolate;
}

/* =========================================
   FONDO SUPERIOR DECORATIVO
========================================= */

.background-pattern {
    position: absolute;
    z-index: -1;
    top: -150px;
    left: -100px;
    width: 750px;
    height: 330px;
    opacity: 0.55;
    pointer-events: none;
    background: repeating-radial-gradient( ellipse at 10% 0%, transparent 0, transparent 9px, rgba(104, 165, 123, 0.18) 10px, transparent 11px );
    transform: rotate(-8deg);
}

/* =========================================
   LAYOUT PRINCIPAL
========================================= */

.login-layout {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    min-height: 100vh;
    padding: 65px 5.7%;
}

/* =========================================
   MARCA
========================================= */

.brand-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 40px;
}

.brand-content {
    width: 100%;
    max-width: 690px;
    transform: translateY(-15px);
}

.brand-logo {
    display: block;
    width: 100%;
    max-width: 690px;
    height: auto;
    object-fit: contain;
    object-position: left center;
}

.brand-subtitle {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 42px;
    margin-left: 68px;
    color: #164735;
    font-size: clamp(21px, 2.2vw, 36px);
    font-weight: 400;
    white-space: nowrap;
}

.subtitle-line {
    display: block;
    width: 5px;
    height: 51px;
    flex-shrink: 0;
    background: var(--hg-accent);
}

/* =========================================
   SECCIÓN LOGIN
========================================= */

.login-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 25px;
}

.login-card {
    width: 100%;
    max-width: 720px;
    padding: 58px 58px 32px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(191, 204, 199, 0.65);
    border-radius: 28px;
    box-shadow: var(--hg-shadow);
}

/* =========================================
   ENCABEZADO
========================================= */

.login-header {
    margin-bottom: 39px;
    text-align: center;
}

    .login-header h1 {
        margin: 0;
        color: #104A36;
        font-size: clamp(34px, 3vw, 48px);
        font-weight: 750;
        line-height: 1.2;
        letter-spacing: -1.2px;
    }

    .login-header p {
        margin: 13px 0 0;
        color: #626D75;
        font-size: clamp(15px, 1.4vw, 22px);
        line-height: 1.5;
    }

/* =========================================
   FORMULARIO
========================================= */

.form-group {
    margin-bottom: 23px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 74px;
    border: 1.7px solid #CFD6D3;
    border-radius: 15px;
    background: #FFFFFF;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

    .input-wrapper:focus-within {
        border-color: var(--hg-primary);
        box-shadow: 0 0 0 4px rgba(8, 115, 61, 0.09);
    }

.input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    flex-shrink: 0;
    color: #66737A;
}

    .input-icon svg {
        width: 30px;
        height: 30px;
    }

.input-wrapper input {
    width: 100%;
    height: 100%;
    padding: 0 15px 0 0;
    border: none;
    outline: none;
    background: transparent;
    color: #273A34;
    font-size: 22px;
    font-weight: 400;
}

    .input-wrapper input::placeholder {
        color: #92999E;
        opacity: 1;
    }

/* =========================================
   MOSTRAR / OCULTAR CONTRASEÑA
========================================= */

.password-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 65px;
    height: 100%;
    flex-shrink: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: #657078;
    cursor: pointer;
}

    .password-toggle svg {
        width: 30px;
        height: 30px;
    }

    .password-toggle:hover {
        color: var(--hg-primary);
    }

/* =========================================
   OPCIONES
========================================= */

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin: 27px 0 34px;
}

.remember-option {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: #174B39;
    font-size: 19px;
    cursor: pointer;
    white-space: nowrap;
}

    .remember-option input {
        appearance: none;
        -webkit-appearance: none;
        display: grid;
        place-content: center;
        width: 32px;
        height: 32px;
        margin: 0;
        border: 2px solid #CBD3D0;
        border-radius: 7px;
        background: #FFFFFF;
        cursor: pointer;
    }

        .remember-option input:checked {
            border-color: var(--hg-primary);
            background: var(--hg-primary);
        }

            .remember-option input:checked::before {
                content: "✓";
                color: #FFFFFF;
                font-size: 22px;
                font-weight: 700;
            }

.forgot-password {
    color: #08713D;
    font-size: 19px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    white-space: nowrap;
}

    .forgot-password:hover {
        color: var(--hg-primary-dark);
    }

/* =========================================
   BOTÓN ENTRAR
========================================= */

.login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 17px;
    width: 100%;
    min-height: 76px;
    border: none;
    border-radius: 15px;
    background: linear-gradient( 105deg, #32952F 0%, #08713D 100% );
    color: #FFFFFF;
    font-size: 26px;
    font-weight: 650;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

    .login-button svg {
        width: 34px;
        height: 34px;
    }

    .login-button:hover {
        filter: brightness(1.06);
        box-shadow: 0 8px 20px rgba(8, 115, 61, 0.2);
    }

    .login-button:active {
        transform: scale(0.99);
    }

/* =========================================
   PIE DE TARJETA
========================================= */

.login-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 40px;
    padding-top: 31px;
    border-top: 1px solid #D9DEDC;
    color: #626D75;
    font-size: 19px;
    font-weight: 400;
}

.footer-separator {
    color: #7C8589;
    font-size: 20px;
}

/* =========================================
   ONDAS INFERIORES
========================================= */

.wave-container {
    position: absolute;
    z-index: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 37%;
    overflow: hidden;
    pointer-events: none;
}

.wave {
    position: absolute;
    right: -5%;
    bottom: -145px;
    left: -5%;
    width: 110%;
    height: 300px;
    border-radius: 50% 48% 0 0 / 35% 30% 0 0;
    transform: rotate(-2deg);
}

.wave-light {
    bottom: -85px;
    background: #DCEFE6;
    transform: rotate(5deg);
}

.wave-middle {
    bottom: -155px;
    background: #79BC31;
    transform: rotate(-4deg);
}

.wave-dark {
    bottom: -205px;
    background: #08743C;
    transform: rotate(2deg);
}

/* =========================================
   TABLETS
========================================= */

@media (max-width: 1200px) {

    .login-layout {
        grid-template-columns: 0.9fr 1.1fr;
        padding: 40px 3%;
    }

    .brand-section {
        padding: 25px;
    }

    .brand-subtitle {
        margin-left: 25px;
        gap: 15px;
        white-space: normal;
    }

    .login-card {
        padding: 45px 38px 28px;
    }

    .input-wrapper {
        height: 66px;
    }

        .input-wrapper input {
            font-size: 19px;
        }

    .login-options {
        flex-wrap: wrap;
    }

    .remember-option,
    .forgot-password {
        font-size: 16px;
    }
}

/* =========================================
   TABLETS VERTICALES Y MÓVILES
========================================= */

@media (max-width: 768px) {

    .login-page {
        min-height: 100vh;
        overflow-y: auto;
    }

    .login-layout {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        padding: 35px 22px 70px;
    }

    .brand-section {
        justify-content: center;
        width: 100%;
        padding: 15px 10px 30px;
    }

    .brand-content {
        max-width: 420px;
        transform: none;
        text-align: center;
    }

    .brand-logo {
        width: 100%;
        max-width: 380px;
        margin: 0 auto;
    }

    .brand-subtitle {
        justify-content: center;
        gap: 12px;
        margin: 20px auto 0;
        font-size: 19px;
        white-space: normal;
        text-align: left;
    }

    .subtitle-line {
        height: 38px;
    }

    .login-section {
        width: 100%;
        padding: 0;
        align-items: flex-start;
    }

    .login-card {
        width: 100%;
        max-width: 480px;
        margin: 0 auto;
        padding: 36px 28px 25px;
        border-radius: 22px;
    }

    .login-header {
        margin-bottom: 30px;
    }

        .login-header h1 {
            font-size: 34px;
        }

        .login-header p {
            font-size: 15px;
        }

    .input-wrapper {
        height: 60px;
        border-radius: 12px;
    }

    .input-icon {
        width: 60px;
    }

        .input-icon svg {
            width: 25px;
            height: 25px;
        }

    .input-wrapper input {
        font-size: 17px;
    }

    .password-toggle {
        width: 55px;
    }

        .password-toggle svg {
            width: 25px;
            height: 25px;
        }

    .login-options {
        margin: 22px 0 27px;
        gap: 15px;
    }

    .remember-option,
    .forgot-password {
        font-size: 14px;
    }

    .remember-option {
        gap: 9px;
    }

        .remember-option input {
            width: 25px;
            height: 25px;
        }

    .login-button {
        min-height: 60px;
        font-size: 21px;
    }

        .login-button svg {
            width: 27px;
            height: 27px;
        }

    .login-footer {
        margin-top: 28px;
        padding-top: 23px;
        font-size: 15px;
    }

    .wave-container {
        height: 20%;
    }

    .wave {
        height: 170px;
        bottom: -125px;
    }
}

/* =========================================
   MÓVILES PEQUEÑOS
========================================= */

@media (max-width: 420px) {

    .login-layout {
        padding: 25px 15px 55px;
    }

    .brand-section {
        padding-bottom: 23px;
    }

    .brand-logo {
        max-width: 310px;
    }

    .brand-subtitle {
        font-size: 16px;
    }

    .login-card {
        padding: 30px 20px 22px;
    }

    .login-header h1 {
        font-size: 30px;
    }

    .login-options {
        align-items: flex-start;
        flex-direction: column;
    }

    .forgot-password {
        margin-left: 34px;
    }

    .login-footer {
        gap: 9px;
        font-size: 13px;
    }
}

/* =========================================
   PANTALLAS DE POCA ALTURA
========================================= */

@media (min-width: 769px) and (max-height: 760px) {

    .login-layout {
        padding-top: 30px;
        padding-bottom: 30px;
    }

    .login-card {
        padding-top: 35px;
        padding-bottom: 25px;
    }

    .login-header {
        margin-bottom: 25px;
    }

    .input-wrapper {
        height: 62px;
    }

    .form-group {
        margin-bottom: 17px;
    }

    .login-options {
        margin-top: 20px;
        margin-bottom: 25px;
    }

    .login-button {
        min-height: 64px;
    }

    .login-footer {
        margin-top: 28px;
        padding-top: 23px;
    }
}

/* =========================================================
   HELIGREEN MVC - APLICACIÓN PRINCIPAL
   Sidebar verde, navegación y Dashboard
   ========================================================= */

/* Base de la aplicación */
.hg-app {
    min-height: 100vh;
    background: var(--hg-background);
    color: var(--hg-text);
}

    .hg-app button,
    .hg-app a {
        font-family: inherit;
    }

.app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    background: var(--hg-background);
}

/* =========================================================
   BARRA LATERAL
   ========================================================= */

.app-sidebar {
    position: fixed;
    z-index: 1000;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    width: 270px;
    min-width: 270px;
    height: 100vh;
    overflow: hidden;
    background: var(--hg-primary);
    color: #FFFFFF;
    box-shadow: 5px 0 24px rgba(15, 55, 37, 0.10);
    transition: width 0.25s ease, transform 0.25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 125px;
    padding: 16px 18px;
    background: var(--hg-primary-dark);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

    .sidebar-brand a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 90px;
    }

.sidebar-logo {
    display: block;
    width: 100%;
    max-width: 235px;
    max-height: 88px;
    object-fit: contain;
    object-position: center;
}

.sidebar-navigation {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 18px 12px 22px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.35) transparent;
}

    .sidebar-navigation::-webkit-scrollbar {
        width: 5px;
    }

    .sidebar-navigation::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,.30);
        border-radius: 10px;
    }

.nav-section-title {
    margin: 18px 12px 9px;
    color: rgba(255,255,255,.62);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.15px;
    text-transform: uppercase;
}

.nav-item,
.nav-group-title {
    position: relative;
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    min-height: 43px;
    padding: 10px 13px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: rgba(255,255,255,.88);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}

    .nav-item:hover,
    .nav-group:hover > .nav-group-title,
    .nav-group:focus-within > .nav-group-title {
        background: rgba(255,255,255,.12);
        color: #FFFFFF;
    }

    .nav-item.active {
        background: var(--hg-primary-dark);
        color: #FFFFFF;
        font-weight: 650;
        box-shadow: inset 3px 0 0 var(--hg-accent);
    }

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    min-width: 20px;
    color: rgba(255,255,255,.82);
    font-size: 17px;
    line-height: 1;
}

.nav-group {
    position: relative;
    margin: 2px 0;
}

.nav-group-title {
    user-select: none;
}

.nav-chevron {
    margin-left: auto;
    color: rgba(255,255,255,.65);
    font-size: 16px;
    transition: transform .2s ease;
}

.nav-group:hover .nav-chevron,
.nav-group:focus-within .nav-chevron {
    transform: rotate(180deg);
}

.nav-submenu {
    display: none;
    margin: 2px 0 8px 32px;
    padding: 5px 0 5px 10px;
    border-left: 1px solid rgba(255,255,255,.24);
}

.nav-group:hover .nav-submenu,
.nav-group:focus-within .nav-submenu {
    display: block;
}

.nav-submenu a {
    display: block;
    padding: 8px 10px;
    border-radius: 5px;
    color: rgba(255,255,255,.78);
    font-size: 12px;
    line-height: 1.35;
    text-decoration: none;
    transition: background .18s ease, color .18s ease;
}

    .nav-submenu a:hover,
    .nav-submenu a:focus {
        outline: none;
        background: rgba(255,255,255,.13);
        color: #FFFFFF;
    }

.sidebar-user {
    flex-shrink: 0;
    padding: 15px 14px 17px;
    border-top: 1px solid rgba(255,255,255,.16);
    background: rgba(0,0,0,.08);
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 3px 4px 13px;
}

.sidebar-user-avatar,
.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 37px;
    height: 37px;
    min-width: 37px;
    border-radius: 50%;
    background: var(--hg-accent);
    color: #FFFFFF;
    font-size: 15px;
    font-weight: 700;
}

.sidebar-user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 3px;
}

    .sidebar-user-details strong {
        overflow: hidden;
        color: #FFFFFF;
        font-size: 12px;
        font-weight: 650;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sidebar-user-details small {
        color: rgba(255,255,255,.65);
        font-size: 11px;
    }

.sidebar-user form {
    margin: 0;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-height: 39px;
    padding: 8px 11px;
    border: 1px solid rgba(255,255,255,.17);
    border-radius: 6px;
    background: transparent;
    color: rgba(255,255,255,.88);
    font-size: 12px;
    text-align: left;
    cursor: pointer;
    transition: background .18s ease;
}

    .sidebar-logout:hover {
        background: rgba(255,255,255,.12);
        color: #FFFFFF;
    }

/* =========================================================
   ÁREA DE TRABAJO Y ENCABEZADO
   ========================================================= */

.app-workspace {
    display: flex;
    flex-direction: column;
    width: calc(100% - 270px);
    min-width: 0;
    min-height: 100vh;
    margin-left: 270px;
    transition: margin-left .25s ease, width .25s ease;
}

.app-header {
    position: sticky;
    z-index: 500;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 76px;
    padding: 0 32px;
    border-bottom: 1px solid var(--hg-border);
    background: rgba(255,255,255,.97);
    box-shadow: 0 2px 12px rgba(25,55,40,.035);
}

.header-left,
.header-actions,
.header-user {
    display: flex;
    align-items: center;
}

.header-left {
    gap: 22px;
}

.header-actions {
    gap: 22px;
}

.sidebar-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    padding: 8px;
    border: 1px solid var(--hg-border);
    border-radius: 8px;
    background: #FFFFFF;
    cursor: pointer;
}

    .sidebar-toggle span {
        display: block;
        width: 17px;
        height: 2px;
        border-radius: 2px;
        background: var(--hg-primary);
    }

.header-company {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.company-label {
    color: var(--hg-text-secondary);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
}

.company-name {
    color: var(--hg-text);
    font-size: 14px;
    font-weight: 650;
}

.header-user {
    gap: 10px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    background: var(--hg-primary-light);
    color: var(--hg-primary);
}

.user-information {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

    .user-information strong {
        color: var(--hg-text);
        font-size: 12px;
        font-weight: 650;
    }

    .user-information span {
        color: var(--hg-text-secondary);
        font-size: 11px;
    }

/* =========================================================
   CONTENIDO PRINCIPAL Y FOOTER
   ========================================================= */

.app-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.main-content {
    flex: 1;
    width: 100%;
    max-width: 1700px;
    margin: 0 auto;
    padding: 30px 34px 38px;
}

.app-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    min-height: 48px;
    padding: 10px 34px;
    border-top: 1px solid var(--hg-border);
    background: #FFFFFF;
    color: var(--hg-text-secondary);
    font-size: 11px;
}

/* =========================================================
   DASHBOARD - ENCABEZADOS
   ========================================================= */

.dashboard-page {
    width: 100%;
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 25px;
}

.page-eyebrow {
    color: var(--hg-primary);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 1.4px;
}

.page-heading h1 {
    margin: 7px 0 5px;
    color: #193B2D;
    font-size: clamp(25px, 2.3vw, 32px);
    font-weight: 750;
    letter-spacing: -.7px;
}

.page-heading p {
    margin: 0;
    color: var(--hg-text-secondary);
    font-size: 13px;
}

.dashboard-date {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 11px 16px;
    border: 1px solid var(--hg-border);
    border-radius: 9px;
    background: #FFFFFF;
    text-align: right;
}

    .dashboard-date span {
        color: var(--hg-text-secondary);
        font-size: 9px;
        font-weight: 700;
        letter-spacing: 1px;
    }

    .dashboard-date strong {
        color: var(--hg-text);
        font-size: 13px;
    }

/* =========================================================
   PANEL DE BIENVENIDA
   ========================================================= */

.welcome-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 180px;
    margin-bottom: 30px;
    padding: 30px 36px;
    overflow: hidden;
    border-radius: 13px;
    background: linear-gradient(110deg, #08733D 0%, #168348 68%, #76B82A 100%);
    box-shadow: 0 10px 25px rgba(8,115,61,.13);
}

.welcome-content {
    position: relative;
    z-index: 2;
    max-width: 650px;
}

.welcome-label {
    color: rgba(255,255,255,.76);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 1.4px;
}

.welcome-content h2 {
    margin: 11px 0 8px;
    color: #FFFFFF;
    font-size: clamp(23px, 2.2vw, 30px);
    font-weight: 700;
}

.welcome-content p {
    max-width: 570px;
    margin: 0;
    color: rgba(255,255,255,.88);
    font-size: 13px;
    line-height: 1.7;
}

.welcome-decoration {
    position: absolute;
    right: 35px;
    bottom: -43px;
    color: rgba(255,255,255,.12);
    font-size: 170px;
    font-weight: 800;
    letter-spacing: -15px;
    line-height: 1;
    user-select: none;
}

/* =========================================================
   INDICADORES KPI
   ========================================================= */

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 16px;
}

    .section-heading h2 {
        margin: 0 0 4px;
        color: var(--hg-text);
        font-size: 17px;
        font-weight: 700;
    }

    .section-heading p {
        margin: 0;
        color: var(--hg-text-secondary);
        font-size: 11px;
    }

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 27px;
}

.dashboard-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    min-height: 112px;
    padding: 19px;
    border: 1px solid #E9EFEB;
    border-radius: 11px;
    background: #FFFFFF;
    box-shadow: 0 3px 12px rgba(25,55,40,.035);
    transition: transform .2s ease, box-shadow .2s ease;
}

    .dashboard-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(25,55,40,.08);
    }

.dashboard-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 43px;
    height: 43px;
    min-width: 43px;
    border-radius: 10px;
    font-size: 20px;
}

    .dashboard-card-icon.green {
        background: #E5F3EA;
        color: #08733D;
    }

    .dashboard-card-icon.lime {
        background: #F0F6E5;
        color: #689D21;
    }

    .dashboard-card-icon.blue {
        background: #E9F1F7;
        color: #477A9B;
    }

    .dashboard-card-icon.orange {
        background: #FBF0E5;
        color: #C17B35;
    }

.dashboard-card-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 4px;
}

    .dashboard-card-info > span {
        color: var(--hg-text-secondary);
        font-size: 11px;
        font-weight: 600;
    }

    .dashboard-card-info strong {
        color: var(--hg-text);
        font-size: 25px;
        font-weight: 750;
        line-height: 1.1;
    }

    .dashboard-card-info small {
        overflow: hidden;
        color: #929C96;
        font-size: 9px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

/* =========================================================
   PANELES INFERIORES
   ========================================================= */

.dashboard-bottom {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, .85fr);
    gap: 17px;
}

.dashboard-panel {
    min-width: 0;
    padding: 21px;
    border: 1px solid #E9EFEB;
    border-radius: 11px;
    background: #FFFFFF;
    box-shadow: 0 3px 12px rgba(25,55,40,.035);
}

.panel-heading {
    margin-bottom: 19px;
}

    .panel-heading h3 {
        margin: 0 0 5px;
        color: var(--hg-text);
        font-size: 14px;
        font-weight: 700;
    }

    .panel-heading p {
        margin: 0;
        color: var(--hg-text-secondary);
        font-size: 10px;
    }

.quick-access-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.quick-access-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    min-height: 100px;
    padding: 13px 11px;
    border: 1px solid #E8EFEB;
    border-radius: 8px;
    background: #FBFDFC;
    color: var(--hg-text);
    text-decoration: none;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

    .quick-access-item:hover {
        transform: translateY(-2px);
        border-color: #A9CEB5;
        background: var(--hg-primary-light);
    }

    .quick-access-item > span {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
        margin-bottom: 9px;
        border-radius: 7px;
        background: #E5F3EA;
        color: var(--hg-primary);
        font-size: 16px;
    }

    .quick-access-item strong {
        overflow: hidden;
        max-width: 100%;
        font-size: 10px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .quick-access-item small {
        margin-top: 4px;
        color: var(--hg-text-secondary);
        font-size: 9px;
    }

.system-information {
    display: flex;
    flex-direction: column;
}

    .system-information > div {
        display: grid;
        grid-template-columns: 9px minmax(65px, 1fr) minmax(0, 1.2fr);
        align-items: center;
        gap: 9px;
        min-height: 43px;
        border-bottom: 1px solid #EEF2EF;
    }

        .system-information > div:last-child {
            border-bottom: 0;
        }

        .system-information > div > span:not(.system-status-dot) {
            color: var(--hg-text-secondary);
            font-size: 10px;
        }

    .system-information strong {
        overflow: hidden;
        color: var(--hg-text);
        font-size: 10px;
        font-weight: 650;
        text-align: right;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.system-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #58AD69;
    box-shadow: 0 0 0 3px rgba(88,173,105,.12);
}

/* =========================================================
   SIDEBAR COLAPSADO
   Se activa agregando .sidebar-collapsed al body
   ========================================================= */

body.sidebar-collapsed .app-sidebar {
    width: 78px;
    min-width: 78px;
}

body.sidebar-collapsed .app-workspace {
    width: calc(100% - 78px);
    margin-left: 78px;
}

body.sidebar-collapsed .sidebar-brand {
    padding-right: 10px;
    padding-left: 10px;
}

body.sidebar-collapsed .sidebar-logo {
    max-width: 53px;
}

body.sidebar-collapsed .nav-section-title,
body.sidebar-collapsed .nav-item span:not(.nav-icon),
body.sidebar-collapsed .nav-group-title span:not(.nav-icon),
body.sidebar-collapsed .nav-submenu,
body.sidebar-collapsed .sidebar-user-details,
body.sidebar-collapsed .sidebar-logout span:last-child {
    display: none;
}

body.sidebar-collapsed .nav-item,
body.sidebar-collapsed .nav-group-title {
    justify-content: center;
    padding-right: 8px;
    padding-left: 8px;
}

body.sidebar-collapsed .nav-icon {
    font-size: 19px;
}

body.sidebar-collapsed .sidebar-user-info {
    justify-content: center;
}

body.sidebar-collapsed .sidebar-logout {
    justify-content: center;
}

/* =========================================================
   RESPONSIVE - TABLETS
   ========================================================= */

@media (max-width: 1100px) {
    .app-sidebar {
        width: 245px;
        min-width: 245px;
    }

    .app-workspace {
        width: calc(100% - 245px);
        margin-left: 245px;
    }

    .main-content {
        padding-right: 24px;
        padding-left: 24px;
    }

    .dashboard-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-bottom {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   RESPONSIVE - MÓVILES
   ========================================================= */

@media (max-width: 760px) {
    .app-sidebar {
        width: 270px;
        min-width: 270px;
        transform: translateX(-100%);
        box-shadow: 8px 0 30px rgba(0,0,0,.16);
    }

    body.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    .app-workspace,
    body.sidebar-collapsed .app-workspace {
        width: 100%;
        margin-left: 0;
    }

    body.sidebar-collapsed .app-sidebar {
        width: 270px;
        min-width: 270px;
    }

    body.sidebar-collapsed .sidebar-brand {
        padding-right: 24px;
        padding-left: 24px;
    }

    body.sidebar-collapsed .sidebar-logo {
        max-width: 215px;
    }

    body.sidebar-collapsed .nav-section-title,
    body.sidebar-collapsed .nav-item span:not(.nav-icon),
    body.sidebar-collapsed .nav-group-title span:not(.nav-icon),
    body.sidebar-collapsed .nav-submenu,
    body.sidebar-collapsed .sidebar-user-details,
    body.sidebar-collapsed .sidebar-logout span:last-child {
        display: initial;
    }

    body.sidebar-collapsed .nav-section-title {
        display: block;
    }

    body.sidebar-collapsed .nav-submenu {
        display: none;
    }

    body.sidebar-collapsed .nav-group:hover .nav-submenu,
    body.sidebar-collapsed .nav-group:focus-within .nav-submenu {
        display: block;
    }

    body.sidebar-collapsed .nav-item,
    body.sidebar-collapsed .nav-group-title {
        justify-content: flex-start;
        padding: 10px 13px;
    }

    body.sidebar-collapsed .sidebar-user-info {
        justify-content: flex-start;
    }

    body.sidebar-collapsed .sidebar-logout {
        justify-content: flex-start;
    }

    .app-header {
        min-height: 66px;
        padding: 0 16px;
    }

    .header-left {
        gap: 12px;
    }

    .company-name {
        font-size: 12px;
    }

    .user-information {
        display: none;
    }

    .main-content {
        padding: 23px 16px 28px;
    }

    .page-heading {
        align-items: flex-start;
    }

    .dashboard-date {
        padding: 9px 11px;
    }

    .welcome-panel {
        min-height: 165px;
        padding: 24px;
    }

    .welcome-decoration {
        right: 15px;
        font-size: 115px;
    }

    .quick-access-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .app-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
        padding: 12px 16px;
    }
}

@media (max-width: 480px) {
    .dashboard-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .dashboard-card {
        min-height: 90px;
    }

    .page-heading {
        flex-direction: column;
    }

    .dashboard-date {
        align-self: flex-start;
        text-align: left;
    }

    .welcome-panel {
        min-height: 185px;
        padding: 22px 19px;
    }

    .welcome-content p {
        max-width: 90%;
        font-size: 12px;
    }

    .dashboard-panel {
        padding: 16px;
    }

    .system-information > div {
        grid-template-columns: 9px minmax(55px, 1fr) minmax(0, 1.3fr);
    }
}

/* Accesibilidad: movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    .app-sidebar,
    .app-workspace,
    .nav-item,
    .nav-group-title,
    .nav-chevron,
    .dashboard-card,
    .quick-access-item {
        transition: none;
    }
}



/* =========================================================
   HELIGREEN - NAVEGACION RESPONSIVE
   Ajuste integral de escritorio, tablet y móvil
========================================================= */

/* Fondo oscuro detrás del menú móvil */
body.sidebar-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(9, 28, 19, 0.55);
    backdrop-filter: blur(2px);
}

/* El menú siempre queda por encima del fondo */
.app-sidebar {
    z-index: 1000;
}

/* Botón de menú */
.sidebar-toggle {
    flex-shrink: 0;
    cursor: pointer;
}

    .sidebar-toggle:hover {
        background: var(--hg-primary-light);
        border-color: var(--hg-primary);
    }

    .sidebar-toggle:focus-visible {
        outline: 3px solid rgba(118, 184, 42, 0.35);
        outline-offset: 2px;
    }

/* Submenús con apertura controlada */
.nav-group.is-open > .nav-submenu {
    display: block;
}

.nav-group.is-open > .nav-group-title .nav-chevron {
    transform: rotate(180deg);
}

/* =========================================================
   TABLET Y MÓVIL
========================================================= */

@media (max-width: 900px) {

    .app-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(290px, 86vw);
        min-width: 0;
        height: 100dvh;
        transform: translateX(-105%);
        transition: transform 0.28s ease;
        z-index: 1000;
    }

    body.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    /* El contenido ocupa todo el ancho */
    .app-workspace,
    body.sidebar-collapsed .app-workspace {
        width: 100%;
        margin-left: 0;
    }

    /* En dispositivos táctiles no se utiliza el modo contraído */
    body.sidebar-collapsed .app-sidebar {
        width: min(290px, 86vw);
        min-width: 0;
    }

    body.sidebar-collapsed .sidebar-brand {
        padding-right: 18px;
        padding-left: 18px;
    }

    body.sidebar-collapsed .sidebar-logo {
        max-width: 235px;
    }

    body.sidebar-collapsed .nav-section-title {
        display: block;
    }

    body.sidebar-collapsed .nav-item span:not(.nav-icon),
    body.sidebar-collapsed .nav-group-title span:not(.nav-icon),
    body.sidebar-collapsed .sidebar-user-details,
    body.sidebar-collapsed .sidebar-logout span:last-child {
        display: initial;
    }

    body.sidebar-collapsed .nav-item,
    body.sidebar-collapsed .nav-group-title {
        justify-content: flex-start;
        padding: 10px 13px;
    }

    body.sidebar-collapsed .sidebar-user-info,
    body.sidebar-collapsed .sidebar-logout {
        justify-content: flex-start;
    }

    /* Submenús: no depender de hover */
    .nav-group:hover > .nav-submenu {
        display: none;
    }

    .nav-group.is-open > .nav-submenu {
        display: block;
    }

    .nav-group:focus-within > .nav-submenu {
        display: block;
    }

    .app-header {
        min-height: 66px;
        padding: 0 18px;
    }

    .header-left {
        gap: 13px;
    }

    .main-content {
        padding: 23px 20px 28px;
    }

    .app-footer {
        padding: 12px 20px;
    }
}

/* =========================================================
   MÓVILES PEQUEÑOS
========================================================= */

@media (max-width: 480px) {

    .app-header {
        min-height: 62px;
        padding: 0 13px;
    }

    .company-label {
        font-size: 8px;
    }

    .company-name {
        font-size: 11px;
    }

    .header-user {
        gap: 0;
    }

    .main-content {
        padding: 19px 13px 25px;
    }

    .app-footer {
        padding: 12px 13px;
        font-size: 10px;
    }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
    .app-sidebar {
        transition: none;
    }
}

