:root {
    --app-topbar-height: 4.5rem;
    --app-sidebar-width: 17.25rem;
    --app-radius: 1rem;
    --app-radius-sm: .75rem;
    --app-shadow: 0 10px 30px rgba(15, 23, 42, .06);
    --app-shadow-sm: 0 3px 12px rgba(15, 23, 42, .05);
    --app-page-bg: #f5f7fb;
    --app-sidebar-bg: #ffffff;
    --app-topbar-bg: #0f172a;
    --app-topbar-border: rgba(255, 255, 255, .10);
}

[data-bs-theme="dark"] {
    --app-page-bg: #111827;
    --app-sidebar-bg: #18212f;
    --app-topbar-bg: #0b1220;
    --app-topbar-border: rgba(255, 255, 255, .08);
    --app-shadow: 0 10px 30px rgba(0, 0, 0, .18);
    --app-shadow-sm: 0 3px 12px rgba(0, 0, 0, .15);
}

html, body { min-height: 100%; }
body { background: var(--app-page-bg); color: var(--bs-body-color); }
a, button { -webkit-tap-highlight-color: transparent; }

.app-topbar {
    min-height: var(--app-topbar-height);
    background: var(--app-topbar-bg);
    border-bottom: 1px solid var(--app-topbar-border);
    box-shadow: 0 1px 0 rgba(0, 0, 0, .08);
}

.app-topbar .container-fluid { min-height: var(--app-topbar-height); }

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
    max-width: min(50vw, 23rem);
    color: #fff;
    font-weight: 700;
    letter-spacing: -.02em;
    text-decoration: none;
}

.brand-link:hover, .brand-link:focus { color: #fff; }

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 2.35rem;
    height: 2.35rem;
    flex: 0 0 2.35rem;
    border-radius: .8rem;
    background: linear-gradient(135deg, var(--bs-primary), #7c3aed);
    box-shadow: 0 8px 18px rgba(79, 70, 229, .32);
    color: #fff;
    font-size: .95rem;
}

.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.topbar-action, .mobile-menu-toggle {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 2.45rem;
    height: 2.45rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: .78rem;
    background: rgba(255, 255, 255, .05);
    color: rgba(255, 255, 255, .92);
    transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.topbar-action:hover, .topbar-action:focus,
.mobile-menu-toggle:hover, .mobile-menu-toggle:focus {
    background: rgba(255, 255, 255, .13);
    border-color: rgba(255, 255, 255, .27);
    color: #fff;
    transform: translateY(-1px);
}

.notification-badge, .system-alert-badge {
    min-width: 1.15rem;
    height: 1.15rem;
    display: inline-grid;
    place-items: center;
    padding: 0 .25rem;
    border: 2px solid var(--app-topbar-bg);
    border-radius: 99rem;
    font-size: .61rem;
    font-weight: 800;
    line-height: 1;
}

.system-alert-badge { background: #f59e0b; color: #1f2937; }
.system-alert-badge.is-critical { background: #ef4444; color: #fff; }

.system-alert-dropdown, .notification-dropdown {
    width: min(24rem, calc(100vw - 1rem));
    margin-top: .65rem !important;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    background: var(--bs-body-bg);
    box-shadow: 0 18px 42px rgba(15, 23, 42, .22);
}

.system-alert-dropdown-header, .notification-dropdown-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    padding: .9rem 1rem .75rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.system-alert-dropdown-title, .notification-dropdown-title {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: 0;
    color: var(--bs-body-color);
    font-size: .92rem;
    font-weight: 800;
}

.system-alert-summary, .notification-summary {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .22rem .48rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 99rem;
    color: var(--bs-secondary-color);
    font-size: .7rem;
    font-weight: 700;
    white-space: nowrap;
}

.system-alert-summary.is-critical {
    border-color: rgba(239, 68, 68, .35);
    background: rgba(239, 68, 68, .10);
    color: #dc2626;
}

[data-bs-theme="dark"] .system-alert-summary.is-critical { color: #fca5a5; }

.system-alert-list, .notification-list {
    max-height: min(23rem, calc(100vh - 11rem));
    overflow-y: auto;
}

.system-alert-item, .notification-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .8rem 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    color: var(--bs-body-color);
    text-decoration: none;
    transition: background-color .15s ease;
}

.system-alert-item:hover, .system-alert-item:focus,
.notification-item:hover, .notification-item:focus {
    background: var(--bs-tertiary-bg);
    color: var(--bs-body-color);
}

.system-alert-item:last-child, .notification-item:last-child { border-bottom: 0; }

.system-alert-icon, .notification-icon {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
    margin-top: .05rem;
    border-radius: .65rem;
    background: var(--bs-secondary-bg);
    color: var(--bs-secondary-color);
    font-size: .82rem;
}

.system-alert-item.is-critical .system-alert-icon { background: rgba(239, 68, 68, .12); color: #dc2626; }
.system-alert-item.is-warning .system-alert-icon { background: rgba(245, 158, 11, .14); color: #b45309; }
.system-alert-item.is-info .system-alert-icon { background: rgba(59, 130, 246, .12); color: #2563eb; }
[data-bs-theme="dark"] .system-alert-item.is-critical .system-alert-icon { color: #fca5a5; }
[data-bs-theme="dark"] .system-alert-item.is-warning .system-alert-icon { color: #fcd34d; }
[data-bs-theme="dark"] .system-alert-item.is-info .system-alert-icon { color: #93c5fd; }

.notification-item.is-unread { background: transparent; }
.notification-item.is-unread:hover, .notification-item.is-unread:focus { background: var(--bs-tertiary-bg); }
.notification-item.is-unread .notification-icon { background: var(--bs-primary); color: #fff; }
.notification-item.is-success .notification-icon { background: rgba(22, 163, 74, .12); color: #15803d; }
.notification-item.is-warning .notification-icon { background: rgba(245, 158, 11, .14); color: #b45309; }
.notification-item.is-danger .notification-icon { background: rgba(239, 68, 68, .12); color: #dc2626; }
.notification-item.is-info .notification-icon { background: rgba(59, 130, 246, .12); color: #2563eb; }
[data-bs-theme="dark"] .notification-item.is-success .notification-icon { color: #86efac; }
[data-bs-theme="dark"] .notification-item.is-warning .notification-icon { color: #fcd34d; }
[data-bs-theme="dark"] .notification-item.is-danger .notification-icon { color: #fca5a5; }
[data-bs-theme="dark"] .notification-item.is-info .notification-icon { color: #93c5fd; }

.system-alert-copy, .notification-copy { min-width: 0; flex: 1 1 auto; }

.system-alert-title, .notification-title {
    display: block;
    overflow: hidden;
    color: var(--bs-body-color);
    font-size: .84rem;
    font-weight: 750;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.system-alert-message, .notification-message {
    display: -webkit-box;
    margin-top: .18rem;
    overflow: hidden;
    color: var(--bs-secondary-color);
    font-size: .74rem;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.system-alert-meta, .notification-meta {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin-top: .32rem;
    color: var(--bs-secondary-color);
    font-size: .67rem;
}

.system-alert-dot, .notification-dot {
    width: .2rem;
    height: .2rem;
    flex: 0 0 .2rem;
    border-radius: 50%;
    background: currentColor;
    opacity: .65;
}

.system-alert-empty, .notification-empty {
    padding: 1.35rem 1rem;
    color: var(--bs-secondary-color);
    font-size: .84rem;
    text-align: center;
}

.system-alert-empty i, .notification-empty i {
    display: block;
    margin-bottom: .55rem;
    color: var(--bs-success);
    font-size: 1.35rem;
}

.system-alert-dropdown-footer, .notification-dropdown-footer {
    padding: .7rem 1rem;
    border-top: 1px solid var(--bs-border-color);
    background: var(--bs-tertiary-bg);
}

.system-alert-dropdown-footer a, .notification-dropdown-footer a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    color: var(--bs-primary);
    font-size: .8rem;
    font-weight: 750;
    text-decoration: none;
}

.system-alert-dropdown-footer a:hover, .system-alert-dropdown-footer a:focus,
.notification-dropdown-footer a:hover, .notification-dropdown-footer a:focus { color: var(--bs-primary-text-emphasis); }

.preferences-dropdown {
    width: min(18rem, calc(100vw - 1rem));
    margin-top: .65rem !important;
    padding: .45rem;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    background: var(--bs-body-bg);
    box-shadow: 0 18px 42px rgba(15, 23, 42, .22);
}

.preferences-heading {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem .65rem;
    color: var(--bs-secondary-color);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.preferences-heading-small { padding-top: .35rem; }

.preferences-action, .preferences-language {
    display: flex;
    align-items: center;
    width: 100%;
    border: 0;
    border-radius: .7rem;
    background: transparent;
    color: var(--bs-body-color);
    text-align: left;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}

.preferences-action { gap: .7rem; padding: .7rem; }
.preferences-language { justify-content: space-between; padding: .58rem .7rem; font-size: .86rem; }

.preferences-action:hover, .preferences-action:focus,
.preferences-language:hover, .preferences-language:focus,
.preferences-language.is-active { background: var(--bs-tertiary-bg); color: var(--bs-primary); }

.preferences-language.is-active { font-weight: 700; }

.preferences-action-icon {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
    border-radius: .65rem;
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
}

.preferences-action-copy { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; }
.preferences-action-copy strong { font-size: .84rem; }
.preferences-action-copy small { margin-top: .1rem; color: var(--bs-secondary-color); font-size: .72rem; }
.preferences-action-arrow { color: var(--bs-secondary-color); font-size: .72rem; }
.preferences-divider { height: 1px; margin: .45rem 0; background: var(--bs-border-color); }

.profile-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    max-width: 15rem;
    min-height: 2.45rem;
    padding: .3rem .5rem .3rem .35rem;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: .85rem;
    background: rgba(255, 255, 255, .05);
    color: #fff;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.profile-dropdown-toggle:hover,
.profile-dropdown-toggle:focus {
    color: #fff;
    background: rgba(255, 255, 255, .13);
    border-color: rgba(255, 255, 255, .27);
    transform: translateY(-1px);
}

.profile-avatar {
    display: inline-grid;
    place-items: center;
    width: 1.8rem;
    height: 1.8rem;
    flex: 0 0 1.8rem;
    border-radius: .6rem;
    background: rgba(255,255,255,.18);
    color:#fff;
    font-size:.75rem;
    font-weight:700;
}

.profile-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .875rem;
    font-weight: 600;
}

.profile-chevron {
    flex: 0 0 auto;
    color: rgba(255, 255, 255, .72);
    font-size: .67rem;
    transition: transform .18s ease;
}

.profile-dropdown-toggle[aria-expanded="true"] .profile-chevron {
    transform: rotate(180deg);
}

.profile-dropdown {
    width: min(18rem, calc(100vw - 1rem));
    margin-top: .65rem !important;
    padding: .45rem;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    background: var(--bs-body-bg);
    box-shadow: 0 18px 42px rgba(15, 23, 42, .22);
}

.profile-dropdown-header {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .55rem .65rem .7rem;
}

.profile-dropdown-avatar {
    display: inline-grid;
    place-items: center;
    width: 2.35rem;
    height: 2.35rem;
    flex: 0 0 2.35rem;
    border-radius: .72rem;
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
    font-size: .88rem;
    font-weight: 800;
}

.profile-dropdown-copy {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.profile-dropdown-copy strong {
    overflow: hidden;
    color: var(--bs-body-color);
    font-size: .85rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-dropdown-copy small {
    overflow: hidden;
    margin-top: .1rem;
    color: var(--bs-secondary-color);
    font-size: .72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: .7rem;
    width: 100%;
    padding: .68rem .7rem;
    border: 0;
    border-radius: .7rem;
    background: transparent;
    color: var(--bs-body-color);
    font-size: .86rem;
    font-weight: 650;
    text-align: left;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}

.profile-dropdown-item:hover,
.profile-dropdown-item:focus {
    background: var(--bs-tertiary-bg);
    color: var(--bs-primary);
}

.profile-dropdown-item i {
    display: inline-grid;
    place-items: center;
    width: 1.25rem;
    flex: 0 0 1.25rem;
    color: var(--bs-secondary-color);
    text-align: center;
}

.profile-dropdown-item:hover i,
.profile-dropdown-item:focus i {
    color: var(--bs-primary);
}

.profile-dropdown-item.is-danger {
    color: var(--bs-danger);
}

.profile-dropdown-item.is-danger:hover,
.profile-dropdown-item.is-danger:focus {
    background: var(--bs-danger-bg-subtle);
    color: var(--bs-danger);
}

.profile-dropdown-item.is-danger i {
    color: currentColor;
}

.profile-dropdown-divider {
    height: 1px;
    margin: .45rem 0;
    background: var(--bs-border-color);
}

.guest-auth {
    gap: .45rem !important;
}

.guest-auth-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 2.45rem;
    padding: .35rem .7rem;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: .78rem;
    background: rgba(255, 255, 255, .05);
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.guest-auth-action:hover,
.guest-auth-action:focus {
    border-color: rgba(255, 255, 255, .34);
    background: rgba(255, 255, 255, .14);
    color: #fff;
    transform: translateY(-1px);
}

.guest-auth-action.is-primary {
    border-color: var(--bs-primary);
    background: var(--bs-primary);
}

.guest-auth-action.is-primary:hover,
.guest-auth-action.is-primary:focus {
    border-color: var(--bs-primary);
    background: var(--bs-primary-text-emphasis);
    color: #fff;
}

.guest-auth-label {
    white-space: nowrap;
}

.app-shell { display: flex; flex: 1 1 auto; min-width: 0; }
.app-sidebar { width: var(--app-sidebar-width); flex: 0 0 var(--app-sidebar-width); background: var(--app-sidebar-bg); border-right: 1px solid var(--bs-border-color); }
.sidebar-desktop { position: sticky; top: var(--app-topbar-height); height: calc(100vh - var(--app-topbar-height)); overflow-y: auto; padding: 1rem; scrollbar-width: thin; }
.sidebar-section-label { display:block; margin:.5rem .75rem .65rem; color:var(--bs-secondary-color); font-size:.68rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; }
.sidebar-nav { list-style:none; margin:0; padding:0; }
.sidebar-item { margin-bottom:.2rem; }
.sidebar-link { display:flex; align-items:center; justify-content:space-between; gap:.55rem; width:100%; min-height:2.8rem; padding:.65rem .72rem; border-radius:.78rem; color:var(--bs-body-color); line-height:1.25; text-decoration:none; transition:background-color .15s ease,color .15s ease,transform .15s ease; }
.sidebar-link:hover, .sidebar-link:focus { background:var(--bs-tertiary-bg); color:var(--bs-primary); transform:translateX(2px); }
.sidebar-link.active { background:var(--bs-primary-bg-subtle); color:var(--bs-primary); font-weight:700; }
.sidebar-link.parent-active { color:var(--bs-primary); font-weight:700; }
.sidebar-link-main { display:flex; align-items:center; gap:.72rem; min-width:0; }
.sidebar-link-main i { display:inline-grid; place-items:center; width:1.35rem; flex:0 0 1.35rem; color:var(--bs-secondary-color); text-align:center; transition:color .15s ease; }
.sidebar-link:hover i, .sidebar-link.active i, .sidebar-link.parent-active i { color:var(--bs-primary); }
.sidebar-title { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sidebar-link-end { display:inline-flex; align-items:center; gap:.45rem; flex:0 0 auto; }
.sidebar-chevron { font-size:.72rem; transition:transform .18s ease; }
.sidebar-link[aria-expanded="true"] .sidebar-chevron { transform:rotate(180deg); }
.sidebar-sub { margin:.25rem 0 .35rem 1.08rem; padding:.15rem 0 .15rem .75rem; border-left:1px solid var(--bs-border-color); }
.sidebar-sub .sidebar-link { min-height:2.45rem; padding:.55rem .65rem; font-size:.91rem; }

.app-main { min-width:0; flex:1 1 auto; padding:1.25rem; }
.main-content { width:100%; max-width:1800px; margin:0 auto; }
.breadcrumb { flex-wrap:nowrap; overflow-x:auto; white-space:nowrap; scrollbar-width:none; font-size:.875rem; }
.breadcrumb::-webkit-scrollbar { display:none; }
.breadcrumb-item { float:none; display:inline-flex; align-items:center; }
.breadcrumb-item + .breadcrumb-item::before { float:none; display:inline-flex; align-items:center; }
.breadcrumb a { color:var(--bs-secondary-color); text-decoration:none; }
.breadcrumb a:hover, .breadcrumb a:focus { color:var(--bs-primary); }
.content-scroll-x { min-width:0; max-width:100%; overflow:visible; }
.content-scroll-x > .table, .content-scroll-x > table { display:block; width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
.content-scroll-x .card, .content-scroll-x .modal-content, .content-scroll-x .list-group-item, .content-scroll-x .table td, .content-scroll-x .table th { min-width:0; }
.content-scroll-x a:not(.btn):not(.nav-link):not(.dropdown-item) { overflow-wrap:anywhere; }
.content-scroll-x .card { border-color:var(--bs-border-color); border-radius:var(--app-radius); box-shadow:var(--app-shadow-sm); }
.content-scroll-x .card-header { padding:.9rem 1rem; border-bottom-color:var(--bs-border-color); border-radius:var(--app-radius) var(--app-radius) 0 0 !important; }
.content-scroll-x .table { margin-bottom:0; }
.content-scroll-x .table > :not(caption) > * > * { vertical-align:middle; }
.attachment-name { display:inline-block; max-width:min(100%,22rem); overflow:hidden; text-overflow:ellipsis; vertical-align:middle; white-space:nowrap; }
.app-footer { padding:1rem 1.25rem 1.35rem; color:var(--bs-secondary-color); font-size:.81rem; text-align:center; }
.app-footer-inner { display:inline-flex; align-items:center; justify-content:center; gap:.45rem; flex-wrap:wrap; }
.offcanvas { width:min(21rem,88vw) !important; background:var(--app-sidebar-bg); }
.offcanvas-header { min-height:var(--app-topbar-height); padding:1rem; }
.offcanvas-title { display:flex; align-items:center; gap:.65rem; min-width:0; margin:0; font-size:1rem; font-weight:700; }
.offcanvas-title .brand-mark { width:2rem; height:2rem; flex-basis:2rem; border-radius:.65rem; font-size:.8rem; }
.offcanvas-body { padding:.75rem 1rem 1.25rem; }
[data-bs-theme="dark"] .btn-close { filter:invert(1) grayscale(100%) brightness(200%); }

@media (max-width: 991.98px) {
    :root { --app-topbar-height:4rem; }
    .app-main { padding:.85rem; }
    .sidebar-sub { margin-left:.8rem; }
    .content-scroll-x { overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:thin; }
    .content-scroll-x > .card, .content-scroll-x > .alert, .content-scroll-x > .row, .content-scroll-x > form, .content-scroll-x > div { min-width:0; }
    .app-footer { padding:.95rem .8rem 1.1rem; }
}

@media (max-width: 767.98px) {
    .guest-auth-label { display: none; }

    .guest-auth-action {
        width: 2.25rem;
        min-height: 2.25rem;
        padding: 0;
        border-radius: .7rem;
    }
}

@media (max-width: 575.98px) {
    .app-topbar .container-fluid { gap:.45rem; }
    .brand-link { gap:.55rem; max-width:calc(100vw - 15.2rem); }
    .brand-mark { width:2.1rem; height:2.1rem; flex-basis:2.1rem; border-radius:.7rem; font-size:.84rem; }
    .topbar-action, .mobile-menu-toggle { width:2.25rem; height:2.25rem; border-radius:.7rem; }
    .system-alert-dropdown, .notification-dropdown, .preferences-dropdown, .profile-dropdown { position:fixed !important; top:3.35rem !important; right:.5rem !important; left:.5rem !important; width:auto; max-height:calc(100vh - 4rem); transform:none !important; }
    .profile-dropdown-toggle { width:2.25rem; min-height:2.25rem; justify-content:center; padding:0; border-radius:.7rem; }
    .profile-name, .profile-chevron { display:none; }
    .profile-avatar { width:1.65rem; height:1.65rem; flex-basis:1.65rem; border-radius:.52rem; font-size:.68rem; }
    .content-scroll-x .card { border-radius:.8rem; box-shadow:none; }
    .attachment-name { max-width:11.5rem; }
}

/* Legal documents and cookie consent */
.app-footer-links {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    flex-wrap: wrap;
}

.app-footer-links a,
.app-footer-link-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--bs-secondary-color);
    font: inherit;
    text-decoration: none;
}

.app-footer-links a:hover,
.app-footer-links a:focus,
.app-footer-link-button:hover,
.app-footer-link-button:focus {
    color: var(--bs-primary);
    text-decoration: underline;
}

.legal-document-icon {
    display: inline-grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    flex: 0 0 3rem;
    border-radius: .9rem;
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
    font-size: 1.2rem;
}

.legal-document-content {
    max-width: 78rem;
    margin-inline: auto;
    font-size: .98rem;
    line-height: 1.72;
}

.legal-document-content h2,
.legal-document-content h3,
.legal-document-content h4 {
    margin-top: 2rem;
    margin-bottom: .75rem;
    scroll-margin-top: calc(var(--app-topbar-height) + 1rem);
}

.legal-document-content h2:first-child,
.legal-document-content h3:first-child { margin-top: 0; }
.legal-document-content p:last-child,
.legal-document-content ul:last-child { margin-bottom: 0; }
.legal-document-content li + li { margin-top: .4rem; }

.cookie-consent-banner {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    z-index: 1090;
    pointer-events: none;
}

.cookie-consent-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    width: min(74rem, 100%);
    margin-inline: auto;
    padding: 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--bs-body-bg) 96%, transparent);
    box-shadow: 0 22px 55px rgba(15, 23, 42, .24);
    backdrop-filter: blur(12px);
    pointer-events: auto;
}

.cookie-consent-icon {
    display: inline-grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: .9rem;
    background: var(--bs-warning-bg-subtle);
    color: var(--bs-warning-text-emphasis);
    font-size: 1.15rem;
}

.cookie-consent-copy { min-width: 0; }
.cookie-consent-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    flex-wrap: wrap;
}

.cookie-category-card {
    padding: 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .85rem;
    background: var(--bs-tertiary-bg);
}

.cookie-settings-modal { z-index: 1205; }
.cookie-settings-modal + .modal-backdrop,
.modal-backdrop:has(+ .cookie-settings-modal) { z-index: 1200; }
body:has(.cookie-settings-modal.show) .modal-backdrop { z-index: 1200; }

@media (max-width: 991.98px) {
    .cookie-consent-card {
        grid-template-columns: auto minmax(0, 1fr);
    }
    .cookie-consent-actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }
    .cookie-consent-actions .btn { flex: 1 1 auto; }
}

@media (max-width: 575.98px) {
    .cookie-consent-banner { right: .5rem; bottom: .5rem; left: .5rem; }
    .cookie-consent-card {
        grid-template-columns: 1fr;
        gap: .8rem;
        max-height: calc(100vh - 1rem);
        overflow-y: auto;
        padding: .9rem;
        border-radius: .85rem;
    }
    .cookie-consent-icon { width: 2.5rem; height: 2.5rem; }
    .cookie-consent-actions { display: grid; grid-template-columns: 1fr; }
    .cookie-consent-actions .btn { width: 100%; }
    .legal-document-content { font-size: .94rem; line-height: 1.65; }
}
