/* Controles compartidos de acceso, sin alterar el diseño de los módulos. */
.session-user-card {
    padding: 14px;
    line-height: 1.5;
    border: 1px solid #ded8cf;
    border-radius: 14px;
    background: #fffdfa;
}

.session-user-identity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.session-user-identity > div {
    min-width: 0;
    overflow-wrap: anywhere;
}

.session-user-identity strong {
    display: block;
    color: #191919;
    font-size: 14px;
}

.session-user-identity small {
    display: block;
    margin-top: 3px;
    color: #716c65;
    font-size: 12px;
    line-height: 1.5;
}

.session-user-identity .user-avatar {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
}

.session-user-photo {
    object-fit: cover;
}

.session-user-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.session-user-actions form {
    margin: 0;
}

.session-user-actions a,
.session-user-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border: 1px solid #ded8cf;
    border-radius: 10px;
    background: #fffdfa;
    color: #191919;
    font: inherit;
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
}

.session-user-actions .session-logout,
.account-topbar .account-logout {
    color: #fff;
    background: #853939;
    border-color: #853939;
}

.session-user-actions .session-logout:hover,
.account-topbar .account-logout:hover {
    color: #fff;
    background: #713030;
    border-color: #713030;
}

.module-switcher {
    position: relative;
    display: inline-block;
    z-index: 30;
}

.module-switcher > summary {
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    list-style: none;
    border-radius: 10px;
}

.module-switcher > summary::-webkit-details-marker {
    display: none;
}

.module-switcher > summary:focus-visible {
    outline: 2px solid #716c65;
    outline-offset: 6px;
}

.module-switcher h1 {
    margin: 0;
    color: #191919;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.8rem, 3.2vw, 3rem);
    font-weight: 600;
    letter-spacing: -.06em;
    line-height: 1.15;
}

.module-chevron {
    color: #716c65;
    font-size: 25px;
    transition: transform .15s;
}

.module-switcher[open] .module-chevron {
    transform: rotate(180deg);
}

.module-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    width: 270px;
    max-width: calc(100vw - 48px);
    display: grid;
    gap: 4px;
    padding: 8px;
    border: 1px solid #ded8cf;
    border-radius: 14px;
    background: #fffdfa;
    box-shadow: 0 12px 30px rgba(25, 25, 25, .1);
}

.module-menu a {
    display: block;
    padding: 11px 14px;
    border-radius: 9px;
    color: #191919;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.module-menu a:hover,
.module-menu a[aria-current="page"] {
    background: #f1eee8;
}

/* Perfil compartido por Mi cuenta y el directorio de RRHH. */
.profile-page {
    width: min(100%, 820px);
    margin: 0 auto;
    padding: 28px 24px 40px;
}

.profile-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px 0 28px;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    background: #eeebe6;
    border: 4px solid #fffdf9;
    box-shadow: 0 0 0 1px #ded8cf;
    margin-bottom: 18px;
}

.profile-initial {
    display: grid;
    place-items: center;
    color: #716c65;
    font-size: 48px;
}

.profile-hero h2 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.6rem, 3vw, 2rem);
    letter-spacing: -.04em;
    overflow-wrap: anywhere;
}

.profile-email { margin: 8px 0 16px; color: #716c65; overflow-wrap: anywhere; }
.account-status, .account-role {
    display: inline-block;
    padding: 6px 11px;
    border-radius: 999px;
    background: #eeebe6;
    color: #514d47;
    font-size: 12px;
}
.profile-details h3 { margin: 0 0 8px; font-size: 17px; }
.profile-data { margin: 0; }
.profile-data > div {
    display: grid;
    grid-template-columns: minmax(150px, .8fr) minmax(0, 1.2fr);
    align-items: center;
    gap: 20px;
    padding: 18px 0;
    border-bottom: 1px solid #e0d9d2;
}
.profile-data dt { color: #716c65; font-size: 13px; }
.profile-data dd { margin: 0; overflow-wrap: anywhere; }
.account-role-list { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-note, .access-help, .camera-help, .camera-status {
    color: #716c65;
    font-size: 13px;
    line-height: 1.6;
}
.profile-note { margin: 18px 0 0; }
.profile-footer { display: flex; justify-content: center; }

/* El panel ocupa la ventana; sólo su contenido en iframe se desplaza. */
body.dashboard-body {
    height: 100dvh;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}
.dashboard-body .dashboard-shell, .dashboard-body .employee-page {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}
.dashboard-body .content-panel, .dashboard-body .workspace {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    padding-bottom: 24px;
}
.dashboard-body .content-scroll, .dashboard-body .workspace-scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    padding: 0;
}
.dashboard-body .section-frame { height: 100%; min-height: 0; }
.dashboard-body .sidebar { height: 100%; min-height: 0; }
.dashboard-body .brand-box { min-width: 0; }
.dashboard-body .brand-box > div:last-child { min-width: 0; }
.dashboard-body .brand-tag { display: block; line-height: 1.4; overflow-wrap: anywhere; }
@media (min-width: 761px) {
    .dashboard-body .dashboard-shell { grid-template-columns: 260px minmax(0, 1fr); }
    .dashboard-body .employee-page { grid-template-columns: 260px minmax(0, 1fr); }
}
@media (max-width: 760px) {
    .dashboard-body .dashboard-shell, .dashboard-body .employee-page {
        display: flex;
        flex-direction: column;
        padding: 12px;
    }
    .dashboard-body .sidebar { flex: 0 0 auto; height: auto; padding: 12px; }
    .dashboard-body .mobile-menu-toggle:checked ~ .dashboard-shell .sidebar,
    .dashboard-body .mobile-menu-toggle:checked ~ .employee-page .sidebar {
        position: absolute;
        inset: 12px 12px auto;
        width: auto;
        max-height: calc(100dvh - 24px);
        overflow-y: auto;
        z-index: 50;
    }
    .dashboard-body .content-panel, .dashboard-body .workspace {
        flex: 1 1 0;
        height: auto;
        padding: 16px 0 0;
    }
    .dashboard-body .topbar { margin-bottom: 16px; }
    .profile-page { padding: 20px 16px 32px; }
    .profile-data > div { grid-template-columns: 1fr; gap: 8px; }
}

.employee-camera {
    margin: 22px 0;
    padding: 20px;
    border: 1px solid #ded8cf;
    border-radius: 12px;
}

.employee-camera legend {
    width: auto;
    padding: 0 6px;
    font-size: 14px;
    font-weight: 600;
}

.camera-panel video,
.camera-preview {
    display: block;
    width: 320px;
    max-width: 100%;
    height: 220px;
    object-fit: contain;
    background: #f0ede7;
    border-radius: 12px;
    margin: 14px 0;
}

.employee-camera [hidden] {
    display: none !important;
}

.camera-placeholder {
    display: inline-block;
    padding: 16px;
    color: #716c65;
    border: 1px dashed #ded8cf;
    border-radius: 10px;
    font-size: 13px;
}

.security-permissions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 20px;
}

@media (max-width: 720px) {
    .security-permissions {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* El menú se desplaza sin empujar fuera de pantalla la tarjeta de sesión. */
.dashboard-body .sidebar {
    min-height: 0;
    overflow: hidden;
}
.dashboard-body .sidebar-header,
.dashboard-body .sidebar-user {
    flex-shrink: 0;
}
.dashboard-body .sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    align-content: start;
    grid-auto-rows: max-content;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: #b7b0a5 transparent;
}
@media (max-width: 760px) {
    .dashboard-body .mobile-menu-toggle:checked ~ .dashboard-shell .sidebar,
    .dashboard-body .mobile-menu-toggle:checked ~ .employee-page .sidebar {
        height: calc(100dvh - 24px);
        overflow: hidden;
    }
}
