/* Shared app-profile presentation. Bootstrap remains the component toolkit. */
:root {
    --profile-accent: #343a40;
    --profile-display-font: Arial, sans-serif;
    --profile-body-font: Arial, sans-serif;
    --profile-panel-radius: 0.4rem;
    --profile-control-radius: 0.3rem;
    --profile-density-space: 0.9rem;
    --profile-surface-background: #fff;
    --profile-surface-border: #dee2e6;
    --profile-footer-background: #f1f3f5;
    --profile-footer-text: #495057;
    --module-sidebar-width: 240px;
    --module-banner-offset: 4.9375rem;
}

body.app-profile-shell {
    border-top: 5px solid var(--profile-accent);
    font-family: var(--profile-body-font);
}

body.app-profile-shell .banner.text-center.py-3 {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}

body.app-profile-shell h1,
body.app-profile-shell h2,
body.app-profile-shell .profile-heading,
body.app-profile-shell .banner h5,
body.app-profile-shell .banner .navbar-brand {
    font-family: var(--profile-display-font);
}

body.app-profile-corporate h1,
body.app-profile-corporate h2,
body.app-profile-corporate .profile-heading,
body.app-profile-corporate .banner h5 {
    letter-spacing: 0.01em;
}

body.app-profile-shell .card,
body.app-profile-shell .modal-content,
body.app-profile-shell .profile-panel,
body.app-profile-shell .login-section {
    border-radius: var(--profile-panel-radius);
    border-color: var(--profile-surface-border);
}

/* /modules keeps module colours while inheriting the active app profile's shape. */
body.app-profile-shell .module-launcher .module-launcher-card.card {
    border: 1px solid var(--profile-surface-border);
    border-radius: var(--profile-panel-radius);
}

body.app-profile-shell .module-launcher .module-launcher-card .card-body {
    padding: calc(var(--profile-density-space) * 1.5);
}

body.app-profile-shell .module-launcher .module-launcher-card .card-title {
    font-family: var(--profile-display-font);
}

body.app-profile-shell .modal-content {
    background-color: var(--profile-surface-background);
}

body.app-profile-shell .form-control,
body.app-profile-shell .form-select,
body.app-profile-shell .input-group-text,
body.app-profile-shell .btn,
body.app-profile-shell .page-link,
body.app-profile-shell .dropdown-menu {
    border-radius: var(--profile-control-radius);
}

body.app-profile-shell .card-body,
body.app-profile-shell .profile-panel,
body.app-profile-shell .login-section {
    padding: calc(var(--profile-density-space) * 1.5);
}

body.app-profile-shell .card,
body.app-profile-shell .profile-panel,
body.app-profile-shell .login-section {
    box-shadow: none !important;
}

body.app-profile-shell .card:hover,
body.app-profile-shell .card:focus,
body.app-profile-shell .card:active,
body.app-profile-shell .module-launcher .module-launcher-card.card:hover,
body.app-profile-shell .module-launcher .module-launcher-card.card:focus,
body.app-profile-shell .module-launcher .module-launcher-card.card:active {
    transform: none !important;
    box-shadow: none !important;
}

body.app-profile-shell .module-launcher .module-launcher-card.card:hover,
body.app-profile-shell .module-launcher .module-launcher-card.card:focus-visible {
    filter: brightness(1.035);
}

body.app-profile-shell .module-navbar,
body.app-profile-shell nav.navbar {
    border-color: var(--profile-surface-border) !important;
}

body.app-profile-shell .module-navigation-sidebar,
body.app-profile-shell .module-navigation-offcanvas,
body.app-profile-shell .module-navigation-mobile-trigger {
    background-color: var(--profile-surface-background) !important;
    border-color: var(--profile-surface-border) !important;
}

body.app-profile-shell .module-navigation-sidebar {
    box-shadow: none;
}

body.app-profile-shell .module-sidebar-visibility-toggle {
    background-color: var(--profile-surface-background);
    border: 1px solid var(--profile-surface-border);
    box-shadow: none;
    color: #343a40;
    height: 2rem;
    justify-content: center;
    padding: 0;
    width: 2rem;
    z-index: 1020;
}

body.app-profile-shell .module-sidebar-visibility-toggle:hover,
body.app-profile-shell .module-sidebar-visibility-toggle:focus {
    background-color: #f1f3f5;
    box-shadow: none;
    color: #212529;
    transform: none;
}

body.app-profile-shell .module-sidebar-heading,
body.app-profile-shell .module-sidebar-account {
    padding: 0.75rem;
}

body.app-profile-shell .module-sidebar-home {
    color: inherit;
    display: block;
    font-weight: 600;
    text-decoration: none;
}

body.app-profile-shell .module-sidebar-menu {
    overflow-y: auto;
    padding: 0.5rem;
}

body.app-profile-shell .module-sidebar-menu .nav-link,
body.app-profile-shell .module-sidebar-toggle {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: var(--profile-control-radius);
    color: #343a40;
    display: flex;
    justify-content: flex-start;
    padding: 0.5rem 0.65rem;
    text-align: left;
    width: 100%;
}

body.app-profile-shell .module-sidebar-toggle {
    justify-content: space-between;
}

body.app-profile-shell .module-sidebar-menu .nav-link:hover,
body.app-profile-shell .module-sidebar-menu .nav-link:focus,
body.app-profile-shell .module-sidebar-toggle:hover,
body.app-profile-shell .module-sidebar-toggle:focus {
    background-color: rgba(0, 0, 0, 0.045);
    box-shadow: none;
    transform: none;
}

body.app-profile-shell .module-sidebar-menu .nav-link.active,
body.app-profile-shell .module-sidebar-toggle.active {
    background-color: rgba(0, 0, 0, 0.075);
    border-left: 3px solid var(--profile-accent);
    font-weight: 600;
}

body.app-profile-shell .module-sidebar-children {
    padding-left: 1rem;
}

body.app-profile-shell .module-sidebar-children .nav-link {
    font-size: 0.925rem;
}

body.app-profile-shell .module-sidebar-chevron {
    font-size: 0.7rem;
    transition: none;
}

body.app-profile-shell .module-sidebar-toggle:not(.collapsed) .module-sidebar-chevron {
    transform: rotate(180deg);
}

body.app-profile-shell .module-sidebar-account {
    flex: 0 0 auto;
}

body.app-profile-shell .module-navigation-mobile-trigger .navbar-toggler {
    border: 0;
    box-shadow: none;
    padding: 0.25rem;
}

body.app-profile-shell .module-navigation-offcanvas {
    top: var(--module-banner-offset);
    height: calc(100vh - var(--module-banner-offset));
    width: min(var(--module-sidebar-width), 85vw);
}

@media (min-width: 992px) {
    body.app-navigation-sidebar > .module-sidebar-visibility-toggle {
        left: calc(var(--module-sidebar-width) - 1px);
        position: fixed;
        top: calc(var(--module-banner-offset) + 0.5rem);
    }

    body.app-navigation-sidebar:has(> .module-navigation-sidebar) {
        padding-left: var(--module-sidebar-width);
    }

    body.app-navigation-sidebar:has(> .module-navigation-sidebar) > .banner {
        margin-left: calc(-1 * var(--module-sidebar-width));
        width: calc(100% + var(--module-sidebar-width));
    }

    body.app-navigation-sidebar > .module-navigation-sidebar {
        float: left;
        margin-left: calc(-1 * var(--module-sidebar-width));
        min-height: calc(100vh - var(--module-banner-offset));
        position: sticky;
        top: 0;
        width: var(--module-sidebar-width);
        z-index: 100;
    }

    body.app-navigation-sidebar:has(> .module-navigation-sidebar) > .app-profile-footer {
        clear: both;
        margin-left: calc(-1 * var(--module-sidebar-width));
        width: calc(100% + var(--module-sidebar-width));
    }

    body.app-navigation-sidebar.module-sidebar-hidden:has(> .module-navigation-sidebar) {
        padding-left: 0;
    }

    body.app-navigation-sidebar.module-sidebar-hidden:has(> .module-navigation-sidebar) > .banner,
    body.app-navigation-sidebar.module-sidebar-hidden:has(> .module-navigation-sidebar) > .app-profile-footer {
        margin-left: 0;
        width: 100%;
    }

    body.app-navigation-sidebar.module-sidebar-hidden > .module-navigation-sidebar {
        display: none !important;
        margin-left: 0;
        width: 0;
    }

    body.app-navigation-sidebar.module-sidebar-hidden > .module-sidebar-visibility-toggle {
        left: 0.5rem;
    }
}

body.app-profile-shell .environment-badge {
    animation: none !important;
}

body.app-profile-shell .app-profile-footer {
    background-color: var(--profile-footer-background) !important;
    border-top: 2px solid var(--profile-accent);
    color: var(--profile-footer-text) !important;
}

body.app-profile-shell .app-profile-footer a {
    color: var(--profile-footer-text) !important;
}

@media (max-width: 575.98px) {
    :root {
        --module-banner-offset: 4.875rem;
    }

    body.app-profile-shell {
        border-top-width: 4px;
    }

    body.app-profile-shell .card-body,
    body.app-profile-shell .profile-panel,
    body.app-profile-shell .login-section {
        padding: var(--profile-density-space);
    }

    body.app-profile-shell .module-launcher .module-launcher-card .card-body {
        padding: var(--profile-density-space);
    }

    body.app-profile-shell .app-profile-footer {
        padding-inline: 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.app-profile-shell *,
    body.app-profile-shell *::before,
    body.app-profile-shell *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
