:root {
    --sidebar-width: 282px;

    /* Paleta AquaRuta */
    --primary: #0B63CE;
    --primary-dark: #06366F;
    --primary-soft: #EAF3FF;
    --primary-soft-strong: #D8E9FF;
    --primary-border: #B8D5F8;
    --white: #FFFFFF;

    /* Colores complementarios */
    --soft-bg: #F5F8FB;
    --text-main: #132238;
    --text-secondary: #64748B;
    --danger: #DC3545;
}

/* =====================================================
   ESTILOS GENERALES DEL PANEL
===================================================== */

body {
    background: var(--soft-bg);
    color: #223;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(
        180deg,
        var(--primary-dark) 0%,
        var(--primary) 100%
    );
    color: var(--white);
    position: fixed;
    inset: 0 auto 0 0;
    overflow-y: auto;
    z-index: 1020;
}

.brand {
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1.1rem 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.16);
    display: grid;
    place-items: center;
    font-size: 1.5rem;
}

.brand small {
    color: rgba(255, 255, 255, 0.72);
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.78);
    border-radius: 14px;
    margin: 0.18rem 0.35rem;
    padding: 0.78rem 0.9rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    font-weight: 500;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.16);
    color: var(--white);
}

.sidebar .nav-link i {
    font-size: 1.12rem;
    width: 22px;
    text-align: center;
}

.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
}

.topbar {
    height: 76px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.4rem;
    box-shadow: 0 2px 18px rgba(20, 30, 60, 0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.content-wrap {
    padding: 1.35rem;
}

.stat-card {
    border: 0;
    border-radius: 22px;
    box-shadow: 0 10px 28px rgba(20, 30, 60, 0.07);
    overflow: hidden;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 1.45rem;
}

.table > :not(caption) > * > * {
    vertical-align: middle;
}

.action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.form-label {
    font-weight: 600;
}

.required::after {
    content: " *";
    color: var(--danger);
}

/* =====================================================
   LOGIN
===================================================== */

.login-page {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--primary-soft);
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

.login-bg {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
    padding: 32px;
    background:
        radial-gradient(
            circle at 10% 10%,
            rgba(216, 233, 255, 0.95),
            transparent 33%
        ),
        radial-gradient(
            circle at 90% 90%,
            rgba(184, 213, 248, 0.75),
            transparent 32%
        ),
        linear-gradient(
            135deg,
            #F7FBFF 0%,
            var(--primary-soft) 45%,
            var(--primary-soft-strong) 100%
        );
}

.login-decoration {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.login-decoration-one {
    width: 320px;
    height: 320px;
    top: -150px;
    right: -80px;
    background: rgba(11, 99, 206, 0.08);
}

.login-decoration-two {
    width: 240px;
    height: 240px;
    bottom: -110px;
    left: -60px;
    background: rgba(6, 54, 111, 0.08);
}

.login-decoration-three {
    width: 110px;
    height: 110px;
    top: 14%;
    left: 8%;
    border: 22px solid rgba(11, 99, 206, 0.06);
}

.login-container {
    width: 100%;
    max-width: 1050px;
    min-height: 650px;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    position: relative;
    z-index: 2;
    border-radius: 34px;
    overflow: hidden;
    background: var(--white);
    box-shadow:
        0 35px 100px rgba(6, 54, 111, 0.18),
        0 8px 30px rgba(6, 54, 111, 0.08);
}

/* Panel azul izquierdo */

.login-presentation {
    position: relative;
    flex-direction: column;
    justify-content: space-between;
    padding: 52px;
    overflow: hidden;
    color: var(--white);
    background:
        radial-gradient(
            circle at 90% 10%,
            rgba(255, 255, 255, 0.16),
            transparent 32%
        ),
        linear-gradient(
            150deg,
            var(--primary) 0%,
            var(--primary-dark) 100%
        );
}

.login-presentation::before {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    right: -180px;
    bottom: -170px;
    border: 55px solid rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.login-presentation::after {
    content: "";
    position: absolute;
    width: 190px;
    height: 190px;
    left: -90px;
    top: 190px;
    background: rgba(255, 255, 255, 0.035);
    border-radius: 50%;
}

.presentation-content,
.presentation-footer {
    position: relative;
    z-index: 2;
}

.presentation-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.presentation-logo {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(10px);
    font-size: 26px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.presentation-brand h2 {
    margin: 0;
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.presentation-brand span {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

.presentation-message {
    margin-top: 85px;
}

.presentation-badge {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
    padding: 9px 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    font-weight: 600;
}

.presentation-message h1 {
    max-width: 450px;
    margin: 0 0 20px;
    color: var(--white);
    font-size: clamp(34px, 4vw, 46px);
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -1.5px;
}

.presentation-message p {
    max-width: 440px;
    margin: 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: 16px;
    line-height: 1.75;
}

.presentation-features {
    display: grid;
    gap: 14px;
    margin-top: 32px;
}

.presentation-feature {
    display: flex;
    align-items: center;
    gap: 11px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
}

.presentation-feature i {
    color: #A8D2FF;
    font-size: 17px;
}

.presentation-footer {
    display: flex;
    align-items: center;
    gap: 9px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
}

/* Formulario derecho */

.login-form-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px;
    background: var(--white);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border: 0;
    background: transparent;
}

.login-card-body {
    padding: 0;
}

.login-mobile-brand {
    align-items: center;
    gap: 12px;
    margin-bottom: 38px;
}

.login-mobile-brand strong {
    display: block;
    color: var(--text-main);
    font-size: 21px;
    line-height: 1.1;
}

.login-mobile-brand small {
    color: var(--text-secondary);
    font-size: 12px;
}

.login-brand-icon {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border-radius: 17px;
    color: var(--white);
    background: linear-gradient(
        145deg,
        var(--primary),
        var(--primary-dark)
    );
    box-shadow: 0 12px 28px rgba(11, 99, 206, 0.23);
    font-size: 23px;
}

.login-header {
    margin-bottom: 30px;
}

.login-label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.login-header h2 {
    margin: 0 0 10px;
    color: var(--text-main);
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -1px;
}

.login-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.65;
}

/* Alerta */

.login-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 22px;
    padding: 14px;
    border: 1px solid #FECACA;
    border-radius: 15px;
    color: #991B1B;
    background: #FEF2F2;
}

.login-alert-icon {
    width: 35px;
    height: 35px;
    min-width: 35px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: #DC2626;
    background: #FEE2E2;
}

.login-alert strong {
    display: block;
    margin-bottom: 3px;
    font-size: 13px;
}

.login-alert p {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
}

/* Campos */

.login-field {
    margin-bottom: 20px;
}

.login-field .form-label {
    margin-bottom: 9px;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 700;
}

.login-input-group {
    position: relative;
}

.login-input-icon {
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 17px;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
    color: #7D94AF;
    font-size: 19px;
    pointer-events: none;
    transition: color 0.2s ease;
}

.login-input-group .form-control {
    height: 57px;
    padding: 0 48px;
    border: 1.5px solid var(--primary-border);
    border-radius: 16px;
    color: var(--text-main);
    background: #FBFDFF;
    font-size: 14px;
    font-weight: 500;
    box-shadow: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.login-input-group .form-control::placeholder {
    color: #9AAABE;
    font-weight: 400;
}

.login-input-group .form-control:hover {
    border-color: #8ABAF1;
    background: var(--white);
}

.login-input-group .form-control:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(11, 99, 206, 0.11);
}

.login-input-group:focus-within .login-input-icon {
    color: var(--primary);
}

.login-password-input {
    padding-right: 54px !important;
}

.password-toggle {
    position: absolute;
    z-index: 4;
    top: 50%;
    right: 10px;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 12px;
    color: #71839A;
    background: transparent;
    transform: translateY(-50%);
    transition:
        color 0.2s ease,
        background 0.2s ease;
}

.password-toggle:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

/* Botón */

.login-button {
    width: 100%;
    height: 57px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    margin-top: 28px;
    padding: 0 24px;
    border: 0;
    border-radius: 17px;
    color: var(--white);
    background: linear-gradient(
        135deg,
        var(--primary) 0%,
        #0753AD 100%
    );
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 14px 30px rgba(11, 99, 206, 0.26);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.login-button i {
    font-size: 19px;
    transition: transform 0.2s ease;
}

.login-button:hover:not(:disabled) {
    color: var(--white);
    background: linear-gradient(
        135deg,
        #095ABB 0%,
        var(--primary-dark) 100%
    );
    box-shadow: 0 17px 36px rgba(6, 54, 111, 0.28);
    transform: translateY(-2px);
}

.login-button:hover:not(:disabled) i {
    transform: translateX(4px);
}

.login-button:active:not(:disabled) {
    transform: translateY(0);
}

.login-button:disabled {
    cursor: not-allowed;
    opacity: 0.82;
}

/* Seguridad y pie */

.login-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
    color: var(--text-secondary);
    font-size: 12px;
    text-align: center;
}

.login-security i {
    color: var(--primary);
    font-size: 15px;
}

.login-card-footer {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 46px;
    color: #94A3B8;
    font-size: 12px;
}

.login-card-footer a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

.login-card-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

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

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        width: 100%;
        margin-left: 0;
    }

    .login-bg {
        padding: 22px;
    }

    .login-container {
        display: block;
        max-width: 520px;
        min-height: auto;
        border-radius: 28px;
    }

    .login-form-section {
        padding: 48px;
    }

    .login-mobile-brand {
        display: flex !important;
    }
}

@media (max-width: 575.98px) {
    .login-bg {
        align-items: start;
        padding: 14px;
        overflow-y: auto;
    }

    .login-container {
        margin: 14px 0;
        border-radius: 24px;
        box-shadow: 0 20px 55px rgba(6, 54, 111, 0.15);
    }

    .login-form-section {
        padding: 30px 22px;
    }

    .login-mobile-brand {
        margin-bottom: 30px;
    }

    .login-header {
        margin-bottom: 25px;
    }

    .login-header h2 {
        font-size: 29px;
    }

    .login-input-group .form-control {
        height: 55px;
        border-radius: 15px;
    }

    .login-button {
        height: 55px;
        border-radius: 15px;
    }

    .login-security {
        align-items: flex-start;
        font-size: 11px;
    }

    .login-card-footer {
        margin-top: 34px;
    }
}