/* ================================================= */
/* ================ LOGIN Y HOME ================== */
/* ================================================= */

.auth-screen,
.home-screen {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'Segoe UI', sans-serif;
    color: #2D3436;
    background-color: #f5f7fa;
}

/* Encabezado compartido con la identidad de Harvest */

.auth-screen .custom-navbar,
.home-screen .custom-navbar {
    background: linear-gradient(60deg, #FF6633, #FFCC33, #99CC33);
}

.auth-screen .navbar-brand,
.home-screen .navbar-brand {
    min-width: 0;
    margin-right: 0;
}

.harvest-brand-text {
    min-width: 0;
}

.harvest-brand-text small {
    font-size: 0.8rem;
    white-space: normal;
}

/* ================================================= */
/* ===================== LOGIN ==================== */
/* ================================================= */

.auth-shell {
    display: flex;
    justify-content: center;
    padding: clamp(24px, 5vw, 56px) 16px;
}

.auth-form-panel {
    width: 100%;
    max-width: 480px;
    padding: clamp(24px, 5vw, 36px);
    background-color: white;
    border-radius: 18px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.07);
}

.auth-form-panel h2 {
    font-size: clamp(1.5rem, 4vw, 1.8rem);
    font-weight: 700;
}

.auth-form-panel .form-label {
    font-weight: 600;
    margin-bottom: 8px;
}

.auth-form-panel .form-control {
    min-height: 46px;
    font-size: 16px;
    border: 1px solid #dfe4ea;
    border-radius: 12px;
}

.auth-form-panel .form-control:focus {
    border-color: #99CC33;
    box-shadow: 0 0 0 0.15rem rgba(153, 204, 51, 0.15);
}

.auth-form-panel .input-group>.form-control {
    min-width: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.auth-password-toggle {
    min-width: 82px;
    min-height: 46px;
    font-size: 0.875rem;
    border-color: #dfe4ea;
    border-radius: 0 12px 12px 0;
}

.auth-submit {
    min-height: 46px;
    padding: 10px 24px;
    background: linear-gradient(60deg, #FF6633, #FFCC33, #99CC33);
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-weight: 700;
}

.auth-submit:hover,
.auth-submit:focus {
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.auth-submit:disabled {
    opacity: 0.65;
}

.auth-note {
    color: #6c757d;
    font-size: 0.9rem;
}

.auth-notice {
    padding: 12px 14px;
    margin-bottom: 20px;
    background-color: #fff5df;
    border: 1px solid #e8d6a9;
    border-radius: 12px;
    overflow-wrap: anywhere;
}

/* Nombre del usuario conectado */

.session-actions [data-usuario] {
    color: #ffffff;
    font-size: 0.9rem;
    overflow-wrap: anywhere;
    min-width: 0;
}

/* ================================================= */
/* ====================== HOME ==================== */
/* ================================================= */

.home-layout {
    display: flex;
    min-height: calc(100dvh - 68px);
}

.home-screen .sidebar {
    min-height: 0;
    overflow-y: auto;
}

.home-main {
    flex: 1;
    min-width: 0;
    padding: 1.5rem;
}

.home-title {
    font-size: 2rem;
    font-weight: 700;
}


.home-modules {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.home-module {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 24px;
    background-color: white;
    border-radius: 18px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.07);
    color: #2D3436;
    text-decoration: none;
    transition: box-shadow 0.2s ease;
}

.home-module:hover {
    color: #2D3436;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.home-module-icon {
    font-size: 2rem;
    color: #6BA539;
}

.home-module h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
}

.home-module p {
    margin: 0 0 8px;
    color: #6c757d;
}

.home-module-action {
    margin-top: auto;
    color: #495057;
    font-weight: 600;
}

.home-screen #toggleSidebar {
    width: 44px;
    height: 44px;
    padding: 0;
    flex-shrink: 0;
    background-color: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    color: #2d3436;
}

.home-screen #toggleSidebar .bi {
    font-size: 1.5rem;
}

/* Foco visible al navegar con el teclado */

.auth-screen button:focus-visible,

.home-screen a:focus-visible,

.home-screen button:focus-visible {
    outline: 3px solid #2c2c2c;
    outline-offset: 3px;
}

.session-status {
    padding: 24px;
    text-align: center;
}

.auth-pending [data-contenido-protegido] {
    visibility: hidden;
}


.session-actions button {
    min-height: 44px;
}

.session-actions [data-usuario] {
    color: white;
    font-size: 14px;
}


/* Menú del usuario */

.session-user-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 10px;
    color: #ffffff;
    background-color: transparent;
}

.session-user-toggle > .bi {
    flex-shrink: 0;
    font-size: 1.5rem;
    line-height: 1;
}

.session-user-toggle [data-usuario] {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
}

.session-user-toggle:hover,
.session-user-toggle:focus,
.session-user-toggle.show {
    color: #ffffff;
    background-color: rgba(0, 0, 0, 0.12);
    border-color: #ffffff;
}

.session-user-toggle:focus-visible {
    outline: 3px solid #2c2c2c;
    outline-offset: 3px;
}

.session-user-menu {
    min-width: 180px;
    padding: 6px;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.session-user-menu .dropdown-item {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #2D3436;
}

.session-user-menu .dropdown-item:hover,
.session-user-menu .dropdown-item:focus {
    color: #2D3436;
    background-color: #f1f3f5;
}

/* Tablet y celular: menú lateral desplegable */

@media (max-width: 991px) {

    .home-layout {
        display: block;
    }

    .home-main {
        padding: 1rem;
    }

    .home-screen .sidebar {
        position: fixed;
        top: 68px;
        left: 0;
        width: 220px;
        min-width: 220px;
        height: calc(100dvh - 68px);
        z-index: 9999;
        transform: translateX(-100%);
    }

    .home-screen .sidebar.active {
        transform: translateX(0);
    }

}

/* Celular: tarjetas en una columna */

@media (max-width: 767px) {

    .home-modules {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .home-module {
        padding: 20px;
    }

    .home-title {
        font-size: 1.7rem;
    }

    .session-actions {
        width: 100%;
        justify-content: flex-end;
        padding-top: 8px;
    }

    .auth-screen .navbar > .container-fluid,
    .home-screen .navbar > .container-fluid {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

}

/* Ajustes del encabezado en celulares pequeños */

@media (max-width: 399px) {

    .auth-screen .navbar-brand,
    .home-screen .navbar-brand {
        gap: 10px !important;
        font-size: 1rem;
    }

    .harvest-brand-text small {
        max-width: 190px;
        font-size: 0.7rem;
    }

}

/* Celular horizontal: menos espacio alrededor del formulario */

@media (orientation: landscape) and (max-height: 500px) {

    .auth-shell {
        padding-top: 16px;
        padding-bottom: 16px;
    }

}

/* Respeta la preferencia de reducir animaciones */

@media (prefers-reduced-motion: reduce) {

    .home-module,
    .home-screen .sidebar {
        transition: none;
    }

}