﻿
:root {
    /* fondos */
    --bg-app: #f5f7f6;
    --bg-surface: #ffffff;
    --bg-soft: #eef3f2;
    --bg-soft-2: #e6ecea;
    /* colores marca Valora+ */
    --brand-blue: #2E4F86;
    --brand-teal: #2DB7A3;
    --brand-orange: #F2663A;
    /* color principal UI */
    --primary: #2DB7A3;
    --primary-dark: #2E4F86;
    --primary-light: #8FE0D3;
    /* compatibilidad con variables existentes */
    --green-700: #2DB7A3;
    --green-600: #2DB7A3;
    --green-500: #2DB7A3;
    --green-400: #F2663A;
    --green-100: rgba(45,183,163,.15);
    /* texto */
    --text-900: #0F2E2F;
    --text-700: #4c6664;
    --text-500: #7f9492;
    /* l�neas */
    --line: #E6ECEA;
    /* sombras */
    --shadow: 0 10px 28px rgba(0,0,0,.08);
    --shadow-soft: 0 6px 18px rgba(0,0,0,.06);
    /* layout */
    --sidebar-width: 270px;
    --sidebar-collapsed: 84px;
    --header-height: 64px;
    /* radios */
    --radius-xl: 20px;
    --radius-lg: 14px;
    --radius-md: 10px;
    --radius-sm: 8px;
    --transition: .22s ease;
}

* {
    box-sizing: border-box;

}

html, body, form {
    min-height: 100%;
    margin: 0;
    padding: 0
}

body {
    font-family: 'Inter','Segoe UI',Tahoma,Arial,sans-serif;
    background: var(--bg-app);
    color: var(--text-900);
    font-size: 13px;
    line-height: 1.5;
    
}

a {
    color: var(--brand-teal);
    text-decoration: none
}

    a:hover, a:focus {
        color: var(--brand-teal);
        text-decoration: none
    }

/* APP */
.app-layout {
    min-height: 100vh;
    background: var(--bg-app)
}

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg,#ffffff 0%,#eef3f2 100%);
    border-right: 1px solid var(--line);
    box-shadow: 6px 0 22px rgba(31,77,52,.05);
    padding: 16px 14px;
    z-index: 1050;
    transition: width var(--transition),padding var(--transition),transform var(--transition);
    overflow-x: visible;
    overflow-y: auto
}

.sidebar-top {
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0
}

.brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg,rgba(45,183,163,.15),#eef3f2);
    border: 1px solid #E6ECEA;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0
}

    .brand-logo img {
        width: 26px;
        height: 26px;
        object-fit: contain
    }

.brand-copy {
    min-width: 0
}

.brand-title {
    margin: 0;
    font-size: 16px;
    line-height: 1.1;
    font-weight: 800;
    color: var(--text-900)
}

.brand-subtitle {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.35;
    color: var(--text-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.sidebar-toggle, .header-menu-button {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--brand-teal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition)
}

    .sidebar-toggle:hover, .header-menu-button:hover {
        background: rgba(45,183,163,.15);
        border-color: #E6ECEA
    }

    .sidebar-toggle svg, .header-menu-button svg, .sidebar-icon svg, .user-chip-avatar svg {
        width: 18px;
        height: 18px
    }

.sidebar-section-title {
    margin: 14px 8px 10px;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-500);
    letter-spacing: .12em;
    text-transform: uppercase
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px
}

.sidebar-link, .sidebar-group-toggle {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 12px;
    color: var(--text-700);
    transition: all var(--transition);
    cursor: pointer;
    background: transparent;
    border: 0;
    text-align: left
}

    .sidebar-link:hover, .sidebar-link:focus, .sidebar-group-toggle:hover, .sidebar-group-toggle:focus {
        background: #eef3f2;
        color: var(--brand-teal)
    }

    .sidebar-link.active, .sidebar-group.open > .sidebar-group-toggle {
        background: rgba(45,183,163,.15);
        color: var(--brand-teal);
        font-weight: 700
    }

        .sidebar-link.active::before, .sidebar-group.open > .sidebar-group-toggle::before {
            content: "";
            position: absolute;
            left: 6px;
            top: 10px;
            bottom: 10px;
            width: 3px;
            border-radius: 4px;
            background: var(--brand-teal)
        }

.sidebar-icon {
    width: 22px;
    height: 22px;
    min-width: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0
}

.sidebar-text {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.sidebar-caret {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition);
    color: var(--text-500)
}

.sidebar-group.open > .sidebar-group-toggle .sidebar-caret {
    transform: rotate(90deg);
    color: var(--brand-teal)
}

.sidebar-submenu {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height .24s ease,opacity .18s ease,padding .24s ease,margin .24s ease;
    margin: 0 0 0 10px;
    padding: 0
}

.sidebar-group.open > .sidebar-submenu {
    max-height: 420px;
    opacity: 1;
    padding-top: 4px
}

.sidebar-submenu .sidebar-link {
    min-height: 38px;
    padding-left: 24px;
    color: var(--text-700);
    font-size: 13px
}

    .sidebar-submenu .sidebar-link::before {
        content: "";
        width: 6px;
        height: 1px;
        background: #a8bdaa;
        margin-right: 8px;
        flex-shrink: 0
    }

    .sidebar-submenu .sidebar-link.active::before {
        background: var(--brand-teal)
    }

.sidebar-divider {
    height: 1px;
    background: var(--line);
    margin: 16px 0
}

.app-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition);
    display: flex;
    flex-direction: column;
}

.app-header {
    height: var(--header-height);
    padding: 10px 22px;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 1000
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 12px
}

.header-page-title .eyebrow {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-500);
    margin-bottom: 2px
}

.header-page-title h1 {
    margin: 0;
    font-size: 22px;
    line-height: 1.1;
    font-weight: 700;
    color: var(--text-900)
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 6px 12px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-soft)
}

.user-chip-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: rgba(45,183,163,.15);
    color: var(--brand-teal);
    display: inline-flex;
    align-items: center;
    justify-content: center
}

.user-chip-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15
}

.user-chip-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-500);
    font-weight: 700
}

.user-chip-name {
    font-size: 13px;
    color: var(--text-900);
    font-weight: 700
}

.logout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid #E6ECEA;
    background: linear-gradient(180deg,#ffffff 0%,#f5f7f6 100%);
    color: var(--brand-teal);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition)
}

    .logout-button:hover, .logout-button:focus {
        background: rgba(45,183,163,.15)
    }

/* CONTENT */
.page-content {
    padding: 20px;
    padding-top: 24px;
}

.page-panel, .card, .kpi-card, .mini-stat-card, .news-card {
    background: var(--bg-surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft)
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.panel-kicker {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-500);
}

.panel-header h3, .panel-header h4 {
    margin: 4px 0 0;
    font-size: 20px;
    line-height: 1.2;
    font-weight: 800;
    color: var(--text-900)
}

.panel-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(45,183,163,.15);
    color: var(--brand-teal);
    font-size: 11px;
    font-weight: 700
}

.btn-primary {
    background: linear-gradient(135deg,var(--brand-teal),var(--brand-orange));
    border-color: var(--brand-teal);
    border-radius: 12px;
    font-weight: 700;
    padding: 10px 16px
}

    .btn-primary:hover, .btn-primary:focus {
        background: linear-gradient(135deg,var(--brand-teal),var(--brand-orange));
        border-color: var(--brand-teal)
    }

.form-control {
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid #E6ECEA;
    box-shadow: none
}

    .form-control:focus {
        border-color: var(--brand-teal);
        box-shadow: 0 0 0 .2rem rgba(93,163,79,.15)
    }

.table thead {
    background: rgba(45,183,163,.15)
}

    .table thead th {
        color: var(--brand-teal);
        border-bottom: 0
    }

/* HOME */
.home-hero {
    background: linear-gradient(135deg,#ffffff 0%,#eef3f2 55%,rgba(45,183,163,.15) 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 28px;
    margin-bottom: 18px
}

.home-hero-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 20px;
    align-items: stretch
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #E6ECEA;
    color: var(--brand-teal);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 16px
}

.home-hero h2 {
    margin: 0 0 12px;
    font-size: 34px;
    line-height: 1.1;
    font-weight: 800;
    color: var(--text-900)
}

.home-hero p {
    margin: 0;
    font-size: 15px;
    line-height: 1.75;
    color: var(--text-700)
}

.hero-side-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: center
}

    .hero-side-card h3 {
        margin: 0 0 10px;
        font-size: 18px;
        font-weight: 800;
        color: var(--brand-teal)
    }

    .hero-side-card p {
        margin: 0;
        font-size: 14px
    }

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 16px;
    margin-bottom: 18px
}

.kpi-card {
    padding: 18px;
    transition: transform var(--transition),box-shadow var(--transition)
}

    .kpi-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow)
    }

.kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px
}

.kpi-label {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-500);
    text-transform: uppercase;
    letter-spacing: .06em
}

.kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(45,183,163,.15);
    color: var(--brand-teal);
    display: inline-flex;
    align-items: center;
    justify-content: center
}

    .kpi-icon svg {
        width: 18px;
        height: 18px
    }

.kpi-value {
    margin-top: 12px;
    font-size: 28px;
    line-height: 1.1;
    font-weight: 800;
    color: var(--text-900)
}

.kpi-meta {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 600
}

    .kpi-meta.positive {
        color: var(--brand-teal)
    }

    .kpi-meta.neutral {
        color: var(--text-700)
    }

.rep-grid {
    display: grid;
    grid-template-columns: 1.45fr .95fr;
    gap: 18px;
    margin-bottom: 18px
}

.rep-chart-card, .progress-card {
    padding: 18px
}

.rep-chart {
    height: 260px;
    display: grid;
    grid-template-columns: repeat(6,1fr);
    gap: 14px;
    align-items: end
}

.rep-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    height: 100%
}

.rep-bar-label {
    order: 2;
    font-size: 12px;
    color: var(--text-500)
}

.rep-bar-track {
    order: 1;
    height: 210px;
    width: 100%;
    max-width: 38px;
    border-radius: 999px;
    background: #eef3f2;
    position: relative;
    overflow: hidden
}

    .rep-bar-track span {
        position: absolute;
        inset: auto 0 0 0;
        background: linear-gradient(180deg,var(--brand-blue),var(--brand-teal));
        border-radius: 999px;
        animation: growBar .7s ease
    }

@keyframes growBar {
    from {
        height: 0
    }
}

.progress-list {
    display: flex;
    flex-direction: column;
    gap: 16px
}

.progress-item {
    display: flex;
    flex-direction: column;
    gap: 8px
}

.progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-700)
}

.progress-track {
    height: 10px;
    background: #eef3f2;
    border-radius: 999px;
    overflow: hidden
}

    .progress-track span {
        display: block;
        height: 100%;
        border-radius: 999px;
        background: linear-gradient(90deg,var(--brand-blue),var(--brand-teal),var(--brand-orange))
    }

.mini-stats-grid {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 16px;
    margin-bottom: 18px
}

.mini-stat-card {
    padding: 18px
}

.mini-stat-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    color: var(--text-500);
    text-transform: uppercase
}

.mini-stat-value {
    margin-top: 10px;
    font-size: 28px;
    font-weight: 800;
    color: var(--text-900)
}

.mini-stat-text {
    margin-top: 8px;
    color: var(--text-700)
}

.news-section {
    margin-bottom: 20px
}

.news-header {
    margin-bottom: 14px
}

.news-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr 1fr;
    gap: 16px
}

.news-card {
    padding: 18px;
    transition: transform var(--transition),box-shadow var(--transition),border-color var(--transition)
}

    .news-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow);
        border-color: #cfe2cc
    }

.news-card-featured {
    grid-row: span 2;
    background: linear-gradient(180deg,#ffffff 0%,#f5f7f6 100%)
}

.news-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--brand-teal);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: 12px
}

    .news-badge.soft {
        background: rgba(45,183,163,.15);
        color: var(--brand-teal)
    }

.news-card h4 {
    margin: 0 0 10px;
    font-size: 18px;
    line-height: 1.3;
    color: var(--text-900);
    font-weight: 700
}

.news-card p {
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-700)
}

.news-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    font-size: 12px;
    color: var(--text-500)
}

    .news-meta a {
        font-weight: 700;
        color: var(--brand-teal)
    }

/* LOGIN */
body.login-page {
    background: linear-gradient( 180deg, #0F5F59 0%, #0D5450 100% );
}

    body.login-page .login-page-shell {
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 18px
    }

    body.login-page .login-layout {
        width: 100%;
        max-width: 1160px;
        display: grid;
        grid-template-columns: .95fr 1.05fr;
        background: rgba(255,255,255,.88);
        border: 1px solid rgba(230,236,234,.95);
        border-radius: 24px;
        overflow: hidden;
        box-shadow: 0 22px 54px rgba(0,0,0,.10);
        backdrop-filter: blur(10px)
    }

    body.login-page .login-hero {
        position: relative;
        padding: 36px 38px;
        background: linear-gradient(160deg, rgba(232,245,233,.96), rgba(255,255,255,.92)),linear-gradient(135deg,rgba(45,183,163,.15),#ffffff);
        border-right: 1px solid rgba(230,236,234,.95)
    }

    body.login-page .hero-badge {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 7px 12px;
        border-radius: 999px;
        background: #fff;
        border: 1px solid var(--line);
        color: var(--brand-teal);
        font-size: 10px;
        font-weight: 800;
        letter-spacing: .04em;
        text-transform: uppercase;
        box-shadow: var(--shadow-soft);
        margin-bottom: 16px
    }

    body.login-page .brand-row {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 18px
    }

    body.login-page .brand-icon {
        width: 54px;
        height: 54px;
        min-width: 54px;
        border-radius: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg,var(--brand-teal),var(--brand-orange));
        color: #fff;
        font-size: 24px;
        box-shadow: 0 12px 28px rgba(45,183,163,.22)
    }

    body.login-page .brand-title {
        margin: 0;
        font-size: 28px;
        line-height: 1.05;
        font-weight: 800;
        color: var(--brand-teal);
        letter-spacing: -.03em
    }

    body.login-page .brand-subtitle {
        margin-top: 4px;
        color: var(--text-700);
        font-size: 13px;
        line-height: 1.45;
        max-width: 540px;
        white-space: normal
    }

    body.login-page .hero-title {
        margin: 0 0 10px 0;
        font-size: 27px;
        line-height: 1.08;
        font-weight: 800;
        color: var(--text-900);
        letter-spacing: -.035em;
        max-width: 480px
    }

    body.login-page .hero-text {
        margin: 0;
        max-width: 500px;
        font-size: 14px;
        line-height: 1.65;
        color: var(--text-700)
    }

    body.login-page .hero-features {
        display: grid;
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: 10px;
        margin-top: 20px
    }

    body.login-page .feature-card {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 14px;
        border-radius: 12px;
        background: rgba(255,255,255,.92);
        border: 1px solid var(--line);
        box-shadow: 0 8px 22px rgba(0,0,0,.05)
    }

    body.login-page .feature-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(45,183,163,.15);
        color: var(--brand-teal);
        font-size: 15px
    }

    body.login-page .feature-title {
        display: block;
        font-size: 13px;
        font-weight: 700;
        color: var(--text-900);
        margin-bottom: 2px
    }

    body.login-page .feature-text {
        display: block;
        font-size: 11px;
        line-height: 1.45;
        color: var(--text-700)
    }

    body.login-page .login-panel {
        padding: 34px 34px;
        background: rgba(255,255,255,.94);
        display: flex;
        align-items: center;
        justify-content: center
    }

    body.login-page .login-card {
        width: 100%;
        max-width: 420px
    }

    body.login-page .login-kicker {
        margin-bottom: 10px;
        color: var(--brand-teal);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .10em;
        text-transform: uppercase;
        display: block;
        margin: 0 auto;
    }

    body.login-page .login-title {
        margin: 0 0 6px 0;
        font-size: 24px;
        line-height: 1.1;
        font-weight: 500;
        color: var(--brand-teal);
        letter-spacing: -.03em;
        text-align: center;
    }

    body.login-page .login-text {
        margin: 0 0 18px 0;
        color: var(--text-700);
        line-height: 1.55;
        font-size: 13px;
        text-align: center;
    }

    body.login-page .validation-summary-custom {
        margin-bottom: 14px;
        padding: 12px 14px;
        border-radius: 10px;
        background: #fdeeee;
        border: 1px solid #f1c9c9;
        color: #a94442;
        font-size: 12px
    }

    body.login-page .form-group-custom {
        margin-bottom: 14px
    }

    body.login-page .form-label-custom {
        display: block;
        margin-bottom: 6px;
        font-size: 12px;
        font-weight: 700;
        color: var(--text-900)
    }

    body.login-page .input-shell {
        position: relative
    }

    body.login-page .input-icon {
        position: absolute;
        top: 50%;
        left: 14px;
        transform: translateY(-50%);
        color: #2DB7A3;
        font-size: 15px;
        pointer-events: none;
        z-index: 2
    }

    body.login-page .form-control-custom {
        width: 100%;
        height: 46px;
        border-radius: 12px;
        border: 1px solid var(--line);
        background: #f2f8f3;
        color: var(--text-900);
        padding: 0 16px 0 42px;
        outline: none;
        transition: border-color var(--transition),box-shadow var(--transition),background var(--transition);
        box-sizing: border-box;
        font-size: 13px
    }

        body.login-page .form-control-custom::placeholder {
            color: #7f9492
        }

        body.login-page .form-control-custom:focus {
            background: #fff;
            border-color: var(--brand-teal);
            box-shadow: 0 0 0 4px rgba(45,183,163,.14)
        }

    body.login-page .btn-login {
        width: 100%;
        height: 48px;
        border: none;
        border-radius: 12px;
        background: linear-gradient(135deg, #f1b06c, var(--brand-teal));
        color: #fff;
        font-size: 14px;
        font-weight: 800;
        letter-spacing: .01em;
        cursor: pointer;
        box-shadow: 0 12px 28px rgba(45,183,163,.20);
        transition: transform var(--transition),filter var(--transition),box-shadow var(--transition)
    }

        body.login-page .btn-login:hover {
            transform: translateY(-1px);
            filter: brightness(1.03);
            box-shadow: 0 16px 32px rgba(242,102,58,.22)
        }

    body.login-page .login-divider {
        display: flex;
        align-items: center;
        gap: 12px;
        margin: 16px 0 12px;
        color: #7f9492;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .08em
    }

        body.login-page .login-divider:before, body.login-page .login-divider:after {
            content: "";
            flex: 1;
            height: 1px;
            background: var(--line)
        }

    body.login-page .login-note {
        padding: 13px 14px;
        border-radius: 12px;
        background: rgba(45,183,163,.15);
        border: 1px solid #d3e8d6;
        color: #4c6664;
        font-size: 12px;
        line-height: 1.5
    }

    body.login-page .footer-login {
        margin-top: 12px;
        text-align: center;
        color: #7f9492;
        font-size: 11px
    }

    body.login-page .field-validation-error {
        color: #a94442;
        display: block;
        margin-top: 6px;
        font-size: 11px
    }

    body.login-page .hero-decoration {
        position: absolute;
        right: -40px;
        bottom: -50px;
        width: 170px;
        height: 170px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(45,183,163,.15), rgba(45,183,163,.02) 62%, transparent 70%);
        pointer-events: none
    }

/* COLLAPSED */
body.sidebar-collapsed .app-sidebar {
    width: var(--sidebar-collapsed);
    padding-left: 10px;
    padding-right: 10px
}

body.sidebar-collapsed .brand-copy, body.sidebar-collapsed .sidebar-section-title, body.sidebar-collapsed .sidebar-text, body.sidebar-collapsed .sidebar-caret {
    display: none
}

body.sidebar-collapsed .brand-block, body.sidebar-collapsed .sidebar-link, body.sidebar-collapsed .sidebar-group-toggle {
    justify-content: center
}

body.sidebar-collapsed .app-main {
    margin-left: var(--sidebar-collapsed)
}

body.sidebar-collapsed .sidebar-submenu {
    max-height: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important
}

body.sidebar-collapsed .sidebar-link, body.sidebar-collapsed .sidebar-group-toggle {
    position: relative
}

    body.sidebar-collapsed .sidebar-link:hover::after, body.sidebar-collapsed .sidebar-group-toggle:hover::after {
        content: attr(data-title);
        position: absolute;
        left: 56px;
        top: 50%;
        transform: translateY(-50%);
        background: #0F2E2F;
        color: #fff;
        padding: 7px 10px;
        border-radius: 8px;
        font-size: 12px;
        font-weight: 600;
        white-space: nowrap;
        box-shadow: 0 8px 18px rgba(0,0,0,.16);
        z-index: 2000;
        pointer-events: none
    }

/* MOBILE */
.sidebar-overlay {
    display: none
}

@media (max-width:1199px) {
    .home-hero-grid, .rep-grid, .news-grid {
        grid-template-columns: 1fr
    }

    .kpi-grid {
        grid-template-columns: repeat(2,minmax(0,1fr))
    }

    .mini-stats-grid {
        grid-template-columns: 1fr
    }

    .news-card-featured {
        grid-row: auto
    }
}

@media (max-width:991px) {
    .app-sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width)
    }

    .app-main {
        margin-left: 0
    }

    body.sidebar-open .app-sidebar {
        transform: translateX(0)
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15,46,47,.35);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
        z-index: 1040
    }

    body.sidebar-open .sidebar-overlay {
        opacity: 1;
        pointer-events: auto
    }

    .app-header, .page-content {
        padding-left: 16px;
        padding-right: 16px
    }

    .header-page-title h1 {
        font-size: 20px
    }

    .user-chip {
        display: none
    }

    body.login-page .login-layout {
        grid-template-columns: 1fr;
        max-width: 860px
    }

    body.login-page .login-hero {
        padding: 28px 24px 22px;
        border-right: none;
        border-bottom: 1px solid rgba(230,236,234,.95)
    }

    body.login-page .hero-title {
        font-size: 24px
    }

    body.login-page .login-panel {
        padding: 28px 24px 30px
    }
}

@media (max-width:767px) {
    .app-header {
        flex-direction: column;
        align-items: stretch
    }

    .header-left, .header-right {
        justify-content: space-between
    }

    .home-hero {
        padding: 22px
    }

        .home-hero h2 {
            font-size: 28px
        }

    .kpi-grid {
        grid-template-columns: 1fr
    }

    body.login-page .login-page-shell {
        padding: 14px
    }

    body.login-page .login-layout {
        border-radius: 18px
    }

    body.login-page .login-hero, body.login-page .login-panel {
        padding-left: 18px;
        padding-right: 18px
    }

    body.login-page .brand-title {
        font-size: 24px
    }

    body.login-page .hero-features {
        grid-template-columns: 1fr
    }
}

@media (prefers-color-scheme:dark) {
    :root {
        --bg-app: #0f1712;
        --bg-surface: #16211a;
        --bg-soft: #19261e;
        --bg-soft-2: #1d2b22;
        --green-100: #203224;
        --text-900: #edf6ef;
        --text-700: #bdd1c2;
        --text-500: #8ea295;
        --line: #284034;
        --shadow: 0 10px 28px rgba(0,0,0,.28);
        --shadow-soft: 0 6px 18px rgba(0,0,0,.22)
    }

    body:not(.login-page) .app-sidebar, body:not(.login-page) .app-header, body:not(.login-page) .page-panel, body:not(.login-page) .card, body:not(.login-page) .kpi-card, body:not(.login-page) .mini-stat-card, body:not(.login-page) .news-card, body:not(.login-page) .hero-side-card, body:not(.login-page) .user-chip {
        background: var(--bg-surface);
        border-color: var(--line)
    }

    body:not(.login-page) .home-hero {
        background: linear-gradient(135deg,#16211a 0%,#1b2a20 55%,#1d2d22 100%);
        border-color: var(--line)
    }

    body:not(.login-page) .app-sidebar {
        background: linear-gradient(180deg,#16211a 0%,#18251d 100%)
    }

    body:not(.login-page) .sidebar-toggle, body:not(.login-page) .header-menu-button, body:not(.login-page) .logout-button {
        background: #1a271f;
        border-color: var(--line);
        color: var(--text-900)
    }

    body.login-page {
        background: radial-gradient(circle at top left, rgba(45,183,163,.12), transparent 28%),radial-gradient(circle at bottom right, rgba(45,183,163,.12), transparent 30%),linear-gradient(135deg,#101913 0%,#111b14 45%,#162119 100%)
    }

        body.login-page .login-layout {
            background: rgba(18,27,21,.92);
            border-color: var(--line)
        }

        body.login-page .login-hero, body.login-page .login-panel {
            background: rgba(21,32,25,.92);
            border-color: var(--line)
        }

        body.login-page .hero-badge, body.login-page .feature-card {
            background: #18251d;
            border-color: var(--line)
        }

        body.login-page .form-control-custom {
            background: #18251d;
            border-color: var(--line);
            color: var(--text-900)
        }

            body.login-page .form-control-custom:focus {
                background: #1b2a20
            }

        body.login-page .login-note {
            background: #18251d;
            border-color: var(--line);
            color: var(--text-700)
        }
}

.sidebar-group {
    display: flex;
    flex-direction: column;
}

.sidebar-submenu {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding-left: 14px;
    transition: max-height .28s ease, opacity .18s ease, padding .28s ease;
}

.sidebar-group.open > .sidebar-submenu {
    max-height: 400px;
    opacity: 1;
}

.sidebar-caret {
    margin-left: auto;
    transition: transform .25s ease;
}

.sidebar-group.open .sidebar-caret {
    transform: rotate(90deg);
}

.sidebar-sublink {
    display: block;
    min-height: 36px;
    padding: 8px 12px 8px 22px;
    color: var(--text-700);
    font-size: 13px;
    border-radius: 10px;
    transition: background .2s ease, color .2s ease;
}

    .sidebar-sublink:hover {
        background: #eef3f2;
        color: var(--brand-teal);
    }

    .sidebar-sublink.active {
        color: var(--brand-teal);
        font-weight: 600;
    }

body.sidebar-collapsed .sidebar-submenu {
    max-height: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
}

.sidebar-caret {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-500);
    transition: transform .25s ease;
    flex-shrink: 0;
}

    .sidebar-caret svg {
        width: 16px;
        height: 16px;
        stroke: currentColor;
    }

.sidebar-group.open .sidebar-caret {
    transform: rotate(90deg);
    color: var(--brand-teal);
}
/* Tooltip del sidebar colapsado */
body.sidebar-collapsed .app-sidebar {
    overflow: visible;
}

body.sidebar-collapsed .sidebar-link,
body.sidebar-collapsed .sidebar-group-toggle {
    position: relative;
    overflow: visible;
}

    body.sidebar-collapsed .sidebar-link:hover::after,
    body.sidebar-collapsed .sidebar-group-toggle:hover::after {
        content: attr(data-title);
        position: absolute;
        left: calc(100% + 14px);
        top: 50%;
        transform: translateY(-50%);
        z-index: 9999;
        display: inline-flex;
        align-items: center;
        min-height: 34px;
        padding: 0 12px;
        border-radius: 10px;
        background: #0F2E2F;
        color: #ffffff;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
        font-size: 12px;
        font-weight: 600;
        line-height: 1;
        white-space: nowrap;
        pointer-events: none;
    }

    /* flechita opcional */
    body.sidebar-collapsed .sidebar-link:hover::before,
    body.sidebar-collapsed .sidebar-group-toggle:hover::before {
        content: "";
        position: absolute;
        left: calc(100% + 8px);
        top: 50%;
        transform: translateY(-50%) rotate(45deg);
        width: 8px;
        height: 8px;
        background: #0F2E2F;
        z-index: 9998;
    }
/* SWITCH MODERNO */

.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

    .switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #E6ECEA;
    border-radius: 24px;
    transition: all .25s ease;
}

    .switch-slider:before {
        position: absolute;
        content: "";
        height: 18px;
        width: 18px;
        left: 3px;
        top: 3px;
        background: white;
        border-radius: 50%;
        transition: all .25s ease;
    }

.switch input:checked + .switch-slider {
    background: #2e7d32;
}

    .switch input:checked + .switch-slider:before {
        transform: translateX(22px);
    }

.instalacion-list {
    display: grid;
    gap: 8px;
}

.instalacion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #E6ECEA;
    background: #f5f7f6;
    transition: all .2s ease;
    cursor: pointer;
}

    .instalacion-item:hover {
        background: #eef3f2;
        border-color: #E6ECEA;
    }

    .instalacion-item input[type="checkbox"] {
        accent-color: #2e7d32;
    }
/* =========================================
   CHECKBOX / SWITCH / CHECKBOXLIST MODERNO
========================================= */

/* checkbox base */
input[type="checkbox"] {
    accent-color: var(--brand-teal);
}

/* switch */
.switch-field {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

    .switch input {
        position: absolute;
        opacity: 0;
        inset: 0;
        width: 100%;
        height: 100%;
        margin: 0;
        cursor: pointer;
        z-index: 2;
    }

.switch-slider {
    position: absolute;
    inset: 0;
    background: #E6ECEA;
    border: 1px solid #E6ECEA;
    border-radius: 999px;
    transition: all .22s ease;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.04);
}

    .switch-slider::before {
        content: "";
        position: absolute;
        width: 20px;
        height: 20px;
        left: 2px;
        top: 2px;
        border-radius: 50%;
        background: #fff;
        box-shadow: 0 2px 6px rgba(0,0,0,.12);
        transition: all .22s ease;
    }

.switch input:checked + .switch-slider {
    background: linear-gradient(180deg, var(--brand-teal), var(--brand-teal));
    border-color: var(--brand-teal);
}

    .switch input:checked + .switch-slider::before {
        transform: translateX(22px);
    }

.switch-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-700);
}

/* contenedor instalaciones */
.instalaciones-panel {
    display: grid;
    gap: 10px;
}

.instalaciones-help {
    font-size: 12px;
    color: var(--text-500);
    margin-top: -2px;
    margin-bottom: 4px;
}

/* estiliza el CheckBoxList renderizado por WebForms */
.instalaciones-list {
    width: 100%;
}

    .instalaciones-list table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0 8px;
    }

    .instalaciones-list td {
        padding: 0;
    }

    .instalaciones-list input[type="checkbox"] {
        accent-color: var(--brand-teal);
        transform: scale(1.05);
        margin-right: 10px;
    }

    .instalaciones-list label {
        display: block;
        width: 100%;
        padding: 12px 14px;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: #ffffff;
        color: var(--text-700);
        font-size: 13px;
        font-weight: 500;
        transition: all .2s ease;
        cursor: pointer;
        box-shadow: var(--shadow-soft);
    }

        .instalaciones-list label:hover {
            background: rgba(45,183,163,.15);
            border-color: #E6ECEA;
            color: var(--brand-teal);
        }

    /* fallback cuando WebForms no genera label como esperamos */
    .instalaciones-list span {
        display: inline-flex;
        align-items: center;
        width: 100%;
        padding: 12px 14px;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: #ffffff;
        color: var(--text-700);
        font-size: 13px;
        font-weight: 500;
        transition: all .2s ease;
        box-shadow: var(--shadow-soft);
    }

        .instalaciones-list span:hover {
            background: rgba(45,183,163,.15);
            border-color: #E6ECEA;
            color: var(--brand-teal);
        }

/* bloque visual alrededor del checkboxlist */
.instalaciones-box {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fcf7 100%);
}

/* seleccion manual si luego agregamos js */
.instalacion-activa {
    background: rgba(45,183,163,.15) !important;
    border-color: #E6ECEA !important;
    color: var(--brand-teal) !important;
}

/* dropdown y formularios */
.form-group-custom {
    margin-bottom: 14px;
}

.form-label-custom {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-900);
}
/* tarjetas instalaciones */

.instalacion-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #ffffff;
    cursor: pointer;
    transition: all .18s ease;
}

    .instalacion-card:hover {
        background: #eef6ee;
        border-color: #E6ECEA;
    }

    .instalacion-card input[type="checkbox"] {
        accent-color: var(--brand-teal);
        transform: scale(1.15);
    }

.instalacion-nombre {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-700);
}

.btn-nuevo-usuario {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 1.4rem;
    min-width: 155px;
    border-radius: 999px;
    background: #dff4ef;
    color: #2aa79b;
    font-size: 1.15rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid #d3ece7;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    transition: all 0.2s ease;
    cursor: pointer;
}

    .btn-nuevo-usuario:hover {
        background: #d2efe8;
        color: #238f85;
        text-decoration: none;
        transform: translateY(-1px);
        box-shadow: 0 8px 18px rgba(42, 167, 155, 0.10);
    }

    .btn-nuevo-usuario:active {
        transform: translateY(0);
        box-shadow: 0 2px 6px rgba(42, 167, 155, 0.10);
    }

.ee-head-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
}

.ee-head-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.ee-btn-back {
    background: #fff;
    border: 1px solid #dce9df;
    color: #203229;
}

    .ee-btn-back:hover {
        background: #f4f8f6;
    }

.se-head-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.se-head-actions {
    display: flex;
}

.se-btn-back {
    background: #fff;
    border: 1px solid #dce9df;
}

.ue-head-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ue-head-actions {
    display: flex;
}

.ue-btn-back {
    background: #fff;
    border: 1px solid #dce9df;
}


/* ===== LAYOUT AJUSTADO / SIDEBAR PEEK ===== */
.app-main {
    width: calc(100% - var(--sidebar-width));
    min-width: 0;
}

.page-content {
    width: 100%;
    min-width: 0;
}

body.sidebar-collapsed .app-main {
    width: calc(100% - var(--sidebar-collapsed));
}

body.sidebar-collapsed .app-sidebar {
    overflow: visible;
}

    body.sidebar-collapsed .app-sidebar:hover,
    body.sidebar-collapsed .app-sidebar:focus-within,
    body.sidebar-peek .app-sidebar {
        width: var(--sidebar-width);
        padding-left: 14px;
        padding-right: 14px;
        box-shadow: 18px 0 36px rgba(15,46,47,.12);
    }

        body.sidebar-collapsed .app-sidebar:hover .brand-copy,
        body.sidebar-collapsed .app-sidebar:hover .sidebar-section-title,
        body.sidebar-collapsed .app-sidebar:hover .sidebar-text,
        body.sidebar-collapsed .app-sidebar:hover .sidebar-caret,
        body.sidebar-collapsed .app-sidebar:focus-within .brand-copy,
        body.sidebar-collapsed .app-sidebar:focus-within .sidebar-section-title,
        body.sidebar-collapsed .app-sidebar:focus-within .sidebar-text,
        body.sidebar-collapsed .app-sidebar:focus-within .sidebar-caret,
        body.sidebar-peek .brand-copy,
        body.sidebar-peek .sidebar-section-title,
        body.sidebar-peek .sidebar-text,
        body.sidebar-peek .sidebar-caret {
            display: block;
        }

        body.sidebar-collapsed .app-sidebar:hover .brand-block,
        body.sidebar-collapsed .app-sidebar:hover .sidebar-link,
        body.sidebar-collapsed .app-sidebar:hover .sidebar-toggle-link,
        body.sidebar-collapsed .app-sidebar:focus-within .brand-block,
        body.sidebar-collapsed .app-sidebar:focus-within .sidebar-link,
        body.sidebar-collapsed .app-sidebar:focus-within .sidebar-toggle-link,
        body.sidebar-peek .brand-block,
        body.sidebar-peek .sidebar-link,
        body.sidebar-peek .sidebar-toggle-link {
            justify-content: flex-start;
        }

        body.sidebar-collapsed .app-sidebar:hover .sidebar-group.open > .sidebar-submenu,
        body.sidebar-collapsed .app-sidebar:focus-within .sidebar-group.open > .sidebar-submenu,
        body.sidebar-peek .sidebar-group.open > .sidebar-submenu {
            max-height: 420px !important;
            opacity: 1 !important;
            padding-top: 4px !important;
            margin: 0 0 0 10px !important;
        }

        body.sidebar-collapsed .app-sidebar:hover .sidebar-link:hover::after,
        body.sidebar-collapsed .app-sidebar:hover .sidebar-group-toggle:hover::after,
        body.sidebar-collapsed .app-sidebar:hover .sidebar-link:hover::before,
        body.sidebar-collapsed .app-sidebar:hover .sidebar-group-toggle:hover::before,
        body.sidebar-collapsed .app-sidebar:focus-within .sidebar-link:hover::after,
        body.sidebar-collapsed .app-sidebar:focus-within .sidebar-group-toggle:hover::after,
        body.sidebar-collapsed .app-sidebar:focus-within .sidebar-link:hover::before,
        body.sidebar-collapsed .app-sidebar:focus-within .sidebar-group-toggle:hover::before,
        body.sidebar-peek .sidebar-link:hover::after,
        body.sidebar-peek .sidebar-group-toggle:hover::after,
        body.sidebar-peek .sidebar-link:hover::before,
        body.sidebar-peek .sidebar-group-toggle:hover::before {
            display: none;
        }

@media (max-width: 991px) {
    .app-main {
        width: 100%;
        margin-left: 0;
    }
}

/* ===== MOBILE MASTER NUEVO ===== */
.is-mobile-shell {
    background: var(--bg-app);
}

.mobile-shell {
    min-height: 100vh;
    background: var(--bg-app);
}

.mobile-header-shell {
    position: sticky;
    top: 0;
    z-index: 1100;
    padding: 12px 14px 10px;
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}

.mobile-header-top {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    align-items: center;
    gap: 10px;
}

.mobile-menu-button,
.mobile-logout-button,
.mobile-drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--brand-teal);
    font-size: 13px;
    font-weight: 700;
    box-shadow: var(--shadow-soft);
}

    .mobile-menu-button svg {
        width: 18px;
        height: 18px;
    }

.mobile-logout-button {
    padding: 0 14px;
}

.mobile-brand-block {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg,rgba(45,183,163,.15),#eef3f2);
    border: 1px solid var(--line);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

    .mobile-brand-logo img {
        width: 24px;
        height: 24px;
        object-fit: contain;
    }

.mobile-brand-copy {
    min-width: 0;
}

.mobile-brand-eyebrow {
    font-size: 10px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-500);
}

.mobile-brand-title {
    font-size: 15px;
    line-height: 1.2;
    font-weight: 800;
    color: var(--text-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-brand-subtitle {
    font-size: 11px;
    line-height: 1.3;
    color: var(--text-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15,46,47,.38);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 1110;
}

    .mobile-menu-backdrop.is-open {
        opacity: 1;
        pointer-events: auto;
    }

.mobile-drawer-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(88vw, 320px);
    background: linear-gradient(180deg,#ffffff 0%,#eef3f2 100%);
    border-right: 1px solid var(--line);
    box-shadow: 16px 0 36px rgba(15,46,47,.12);
    transform: translateX(-100%);
    transition: transform .22s ease;
    z-index: 1120;
    padding: 16px 14px;
    overflow-y: auto;
}

    .mobile-drawer-panel.is-open {
        transform: translateX(0);
    }

.mobile-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
}

.mobile-drawer-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-900);
}

.mobile-drawer-close {
    width: 40px;
    min-width: 40px;
    padding: 0;
    font-size: 22px;
    line-height: 1;
}

.mobile-drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-drawer-link {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--text-900);
    font-size: 13px;
    font-weight: 700;
}

    .mobile-drawer-link:hover,
    .mobile-drawer-link:focus {
        background: rgba(45,183,163,.12);
        color: var(--brand-teal);
    }

.mobile-main-shell {
    padding: 14px;
}

@media (max-width: 767px) {
    .mobile-header-top {
        grid-template-columns: auto minmax(0,1fr);
    }

    .mobile-logout-button {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: center;
    }

    .mobile-main-shell {
        padding: 12px;
    }
}


/* ===== FIX SCROLL GLOBAL / MAR-2026 ===== */
html, body, form {
    height: 100%;
    overflow: hidden;
}

.app-layout {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.app-main {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.page-content {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

body.sr-modal-open .page-content,
body.rv-modal-open .page-content,
body.modal-open-scroll-lock .page-content {
    overflow: hidden !important;
}


/* ===== FIX MOBILE SHELL PRESERVANDO VARIABLES / ABR-2026 ===== */
body.is-mobile-shell,
body.is-mobile-shell html,
html body.is-mobile-shell {
    height: auto;
    min-height: 100%;
    overflow: auto;
}

body.is-mobile-shell form,
body.is-mobile-shell .mobile-shell {
    min-height: 100vh;
    height: auto;
    overflow: visible;
}

body.is-mobile-shell .mobile-main-shell {
    min-height: calc(100vh - 82px);
    overflow: visible;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

body.is-mobile-shell .mobile-menu-backdrop {
    pointer-events: none;
}

body.is-mobile-shell .mobile-menu-backdrop.is-open {
    pointer-events: auto;
}

body.is-mobile-shell .mobile-drawer-panel {
    max-height: 100vh;
    -webkit-overflow-scrolling: touch;
}

body.is-mobile-shell.mobile-menu-open {
    overflow: hidden;
}


/* ===== FIX MODALES MOBILE / ABR-2026 ===== */
@media (max-width: 767px) {
    .modal {
        padding-top: max(8px, env(safe-area-inset-top));
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }

    .modal-dialog {
        margin: 8px auto;
        width: calc(100vw - 16px);
    }

    .modal-content {
        display: flex;
        flex-direction: column;
        max-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px);
        overflow: hidden;
    }

    .modal-header {
        position: sticky;
        top: 0;
        z-index: 2;
        background: inherit;
        padding-right: 44px;
    }

    .modal-header .close {
        position: absolute;
        top: 10px;
        right: 12px;
        margin-top: 0;
        z-index: 3;
    }

    .modal-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@supports (height: 100dvh) {
    @media (max-width: 767px) {
        .modal-content {
            max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px);
        }
    }
}
