/* 
  Lavdin Loader Component
  ─────────────────────────────────────────────
  Extracted from core/components/lavdin_loader.php
*/

:root {
    --ld-primary: var(--color-blue-500);
    --ld-success: var(--color-emerald-500);
    --ld-error: var(--color-red-500);
    --ld-bg: var(--color-white);
    --ld-blur: 15px;
    --ld-transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    /* ld-sidebar-width is now handled statically below */
}

:root {
    --ld-sidebar-width: 0px;
}

body.admin-dashboard-body:not(.tenant-page) {
    --ld-sidebar-width: 280px;
}

@media (max-width: 991px) {
    :root {
        --ld-sidebar-width: 0px !important;
    }

    body.admin-dashboard-body:not(.tenant-page) {
        --ld-sidebar-width: 0px !important;
    }
}

[data-theme="dark"],
.dark-theme,
.theme-elegant,
[data-theme="dark"] {
    --ld-bg: var(--color-slate-900);
    --ld-primary: var(--color-blue-400);
}

body.system-booting {
    overflow: hidden !important;
}

/* Component visibility is managed by the loader overlay z-index and opacity */

/* ── TOP PROGRESS BAR ────────────────────────── */
#ld-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--ld-primary), var(--color-blue-400), var(--ld-primary));
    background-size: 200% 100%;
    animation: ld-progress-shine 3s linear infinite;
    z-index: 2001;
    /* Above EVERYTHING */
    width: 0;
    opacity: 0;
    transition: width 0.4s cubic-bezier(0.1, 0.7, 0.1, 1), opacity 0.3s ease;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
    pointer-events: none;
}

@keyframes ld-progress-shine {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ── FULL PAGE BOOTER ─────────────────────────── */
#lavdin-booter {
    position: fixed;
    inset: 0;
    z-index: 9999 !important;
    background: var(--ld-bg);
    backdrop-filter: blur(var(--ld-blur));
    -webkit-backdrop-filter: blur(var(--ld-blur));
    display: flex;
    box-sizing: border-box;
    transition: opacity var(--ld-transition), visibility var(--ld-transition), backdrop-filter 0.5s ease;
    margin-left: var(--ld-sidebar-width, 0px);
}

.ld-booter-content {
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

#lavdin-booter.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
}

/* ── CIRCULAR LIQUID LOADER ───────────────────── */
.ld-loader-container {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ld-circle-bg {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid rgba(59, 130, 246, 0.1);
    /* fallback rgb */
    background: rgba(59, 130, 246, 0.05);
}

.ld-circle-liquid {
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: var(--ld-primary);
    border-right-color: var(--ld-primary);
    animation: ld-liquid-spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    filter: drop-shadow(0 0 5px var(--ld-primary));
}

.ld-circle-inner {
    position: absolute;
    width: 44px;
    height: 44px;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.ld-circle-inner img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

[data-theme="dark"] .ld-circle-inner img,
.dark-theme .ld-circle-inner img,
.theme-elegant .ld-circle-inner img {
    filter: brightness(0) invert(1);
}

@keyframes ld-liquid-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes ld-heartbeat {

    0%,
    100% {
        opacity: 1;
        transform: translateY(0);
        opacity: 1;
    }

    50% {
        opacity: 0.9;
        transform: translateY(10px);
        opacity: 0.8;
    }
}

/* ── TEXT & MESSAGES ─────────────────────────── */
.ld-text {
    margin-top: 32px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--ld-primary);
}

.ld-status-msg {
    margin-top: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-muted, var(--color-text-muted));
    opacity: 0;
    transform: translateY(10px);
    animation: ld-fade-in-up 0.6s ease-out 0.2s forwards;
}

@keyframes ld-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── BOOTER PROGRESS BAR ────────────────────── */
.ld-boot-progress-wrap {
    width: 180px;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
    margin-top: 40px;
    overflow: hidden;
    position: relative;
    opacity: 0;
    animation: ld-fade-in 1s ease-out 0.5s forwards;
}

[data-theme="dark"] .ld-boot-progress-wrap,
.dark-theme .ld-boot-progress-wrap,
.theme-elegant .ld-boot-progress-wrap {
    background: rgba(255, 255, 255, 0.05);
}

.ld-boot-progress-inner {
    position: absolute;
    inset: 0;
    width: 0%;
    background: linear-gradient(90deg, var(--ld-primary), var(--color-blue-400));
    border-radius: inherit;
    transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

@keyframes ld-fade-in {
    to {
        opacity: 1;
    }
}

/* ── INLINE CONTAINER ────────────────────────── */
.ld-inline-wrap {
    position: absolute;
    inset: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    border-radius: inherit;
}

[data-theme="dark"] .ld-inline-wrap,
.dark-theme .ld-inline-wrap,
.theme-elegant .ld-inline-wrap {
    background: rgba(10, 15, 25, 0.7);
}

.ld-inline-wrap.active {
    opacity: 1;
    visibility: visible;
}

/* ── STATES (SUCCESS/ERROR) ──────────────────── */
.ld-state-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: none;
    animation: ld-pop-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes ld-pop-in {
    from {
        opacity: 0.5;
        transform: translateY(10px);
        opacity: 0;
    }

    to {
        opacity: 1;
        transform: translateY(0);
        opacity: 1;
    }
}

.ld-inline-wrap.success .ld-state-icon.success {
    display: block;
    color: var(--ld-success);
}

.ld-inline-wrap.error .ld-state-icon.error {
    display: block;
    color: var(--ld-error);
}

.ld-inline-wrap.success .ld-loader-container,
.ld-inline-wrap.error .ld-loader-container {
    display: none;
}
/* 
  Lavdin Sidebar Navigation Component
  ─────────────────────────────────────────────
  Extracted from core/components/sidebar_navigation.php
*/

/* ── SIDEBAR PROFILE ENHANCEMENTS ── */
.sidebar-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: var(--color-white);
    box-shadow: 0 4px 12px var(--color-primary-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-user-avatar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px var(--color-primary-glow);
}

.sidebar-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-role-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    margin-top: 3px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.sidebar-username-text {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text-main);
    margin-bottom: 0px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
    line-height: 1.5;
}

/* ── NAV LINKS ── */
.nav-link {
    position: relative;
    padding: 8px 12px;
    margin: 1px 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.nav-link i {
    width: 16px;
    text-align: center;
    font-size: 0.85rem;
}

.sidebar-nav-section-label {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--color-text-muted);
    padding: 12px 20px 4px;
    display: block;
}

/* ── QUICK ACTION BUTTONS ── */
.sidebar-quick-actions {
    display: flex;
    gap: 10px;
    padding: 0 10px;
    padding-right: 10px;
    padding-left: 10px;
    flex-wrap: wrap-reverse;
}

.sidebar-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.18s ease;
    border: 1px solid transparent;
    width: 100%;
    box-sizing: border-box;
}

.sidebar-action-btn i {
    font-size: 0.85rem;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

.sidebar-action-btn span {
    flex: 1;
}

.sidebar-action-ext {
    font-size: 0.6rem !important;
    opacity: 0.45;
    width: auto !important;
    margin-left: auto;
    transition: opacity 0.15s ease;
}

.sidebar-action-primary {
    background: var(--color-primary-soft);
    color: var(--color-primary);
    border-color: color-mix(in srgb, var(--color-primary) 15%, transparent);
}

.sidebar-action-primary:hover {
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
    border-color: color-mix(in srgb, var(--color-primary) 30%, transparent);
    color: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.sidebar-action-primary:hover .sidebar-action-ext {
    opacity: 0.7;
}

.sidebar-action-logout {
    background: rgba(239, 68, 68, 0.05);
    color: var(--color-text-muted, var(--color-text-muted));
    border-color: rgba(0, 0, 0, 0.05);
}

.sidebar-action-logout:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--color-danger);
}

/* ── GLOBAL SIDEBAR MASK ── */
#sidebarMask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#sidebarMask.show {
    display: block;
    opacity: 1;
}

.nav-link-active-dot {
    width: 6px;
    height: 6px;
    background: var(--color-primary);
    flex-shrink: 0;
    margin-left: auto;
    animation: dotpulse 2s ease-in-out infinite;
}

@keyframes dotpulse {

    0%,
    100% {
        opacity: 1;
        transform: translateY(0);
    }

    50% {
        opacity: 0.7;
        transform: translateY(10px);
    }
}

/* ── BRANDING ── */
.dashboard-sidebar-brand:hover .brand-icon-box {
    transform: translateY(-2px) rotate(-2deg);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1) !important;
}

.dashboard-sidebar-brand:hover .branding-title {
    letter-spacing: -0.5px !important;
}

.brand-icon-box {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.branding-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    letter-spacing: -0.8px;
    line-height: 1.5;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: all 0.3s ease;
    text-shadow: 0 10px 20px var(--color-primary-soft);
}

/* ── ACCORDION BASE ── */
.sidebar-accordion {
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.sidebar-accordion-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--color-text-main);
    border-radius: 8px;
    transition: background 0.18s ease, color 0.18s ease;
    user-select: none;
    margin: 1px 10px;
}

.sidebar-accordion-trigger:hover {
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

.sidebar-accordion.active>.sidebar-accordion-trigger {
    color: var(--color-primary);
    background: transparent;
}

.sidebar-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-accordion.active .sidebar-accordion-content {
    max-height: 400px;
    transition: max-height 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-accordion.active .accordion-icon {
    transform: rotate(180deg);
    opacity: 0.9;
    color: var(--color-primary);
}

.sidebar-accordion .nav-link {
    margin: 1px 10px !important;
    font-size: 0.78rem !important;
    padding: 6px 12px 6px 36px !important;
    border-radius: 8px !important;
}

.sidebar-accordion .nav-link i {
    width: 16px;
    font-size: 0.82rem;
}

.accordion-icon {
    transition: transform 0.3s ease, color 0.2s ease, opacity 0.2s ease;
    font-size: 0.68rem;
    opacity: 0.45;
    flex-shrink: 0;
}

/* ── MOBILE CLOSE BUTTON ── */
.sidebar-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 8px;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.sidebar-close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--color-text-main);
    transform: rotate(90deg);
}

@media (max-width: 991px) {
    .sidebar-close-btn {
        display: flex;
    }
}

/* ── DASHBOARD SIDEBAR BASE ── */

@media screen and (max-width: 764px) {
    body:not(.tenant-page):not(.forum-page) .d-comp {
        display: none !important;
    }
}

.dashboard-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    width: var(--sidebar-w, 280px);
    z-index: 1060;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--color-bg-card);
    border-right: 1px solid var(--color-border);
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.04);
    transition: transform 0.4s var(--transition-bezier);
}

/* ── UNIFIED DARK THEME SUPPORT (Leveraging modern_core.css tokens) ── */
.dark-theme .dashboard-sidebar {
    background: var(--color-slate-900, #0f172a);
    border-right: 1px solid var(--color-border) !important;
}

.dark-theme .dashboard-sidebar .branding-title {
    background: linear-gradient(135deg, var(--color-blue-400), var(--color-indigo-300)) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

.dark-theme .user-profile {
    background: transparent !important;
    border-top: 1px solid var(--color-border) !important;
}

.dark-theme .nav-link {
    color: var(--color-text-muted) !important;
    background: transparent !important;
    border: 1px solid transparent !important;
}

.dark-theme .nav-link:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--color-text-main) !important;
}

.dark-theme .nav-link.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.15) 0%, rgba(37, 99, 235, 0.02) 100%) !important;
    color: var(--color-blue-400) !important;
    border: 1px solid rgba(37, 99, 235, 0.15) !important;
    box-shadow: inset 3px 0 0 var(--color-blue-500), 0 4px 15px rgba(0, 0, 0, 0.1) !important;
}

.dark-theme .nav-link.active i {
    color: var(--color-blue-400) !important;
    text-shadow: 0 0 12px rgba(37, 99, 235, 0.5);
}

.dark-theme .sidebar-action-primary {
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.25);
    color: var(--color-blue-400);
}

.dark-theme .sidebar-action-primary:hover {
    background: rgba(37, 99, 235, 0.2);
    color: var(--color-blue-300);
}

.dark-theme .sidebar-action-logout {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
    color: var(--color-text-muted);
}

.dark-theme .sidebar-action-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--color-red-400);
}

.dark-theme .sidebar-accordion-trigger {
    color: var(--color-text-main);
}

.dark-theme .sidebar-accordion-trigger:hover {
    background: rgba(37, 99, 235, 0.12);
    color: var(--color-blue-300);
}

.dark-theme .sidebar-accordion.active>.sidebar-accordion-trigger {
    color: var(--color-blue-400);
    background: transparent;
}

.dark-theme .sidebar-close-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-muted);
}

/* ── MOBILE SIDEBAR CONNECTION FIX ── */
@media (max-width: 991px) {
    .dashboard-sidebar {
        top: var(--dashboard-mobile-header-height) !important;
        height: calc(100vh - var(--dashboard-mobile-header-height)) !important;
        height: calc(100dvh - var(--dashboard-mobile-header-height)) !important;
        border-top-left-radius: 0 !important;
        border-top-right-radius: 0 !important;
    }
}

/* ── COLLAPSED SIDEBAR (ALL SCREENS) ── */
body.sidebar-collapsed {
    --sidebar-width: 82px !important;
    --ld-sidebar-width: 82px !important;
    --sidebar-w: 82px !important;
}

body.sidebar-collapsed .dashboard-sidebar {
    width: var(--sidebar-width) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: var(--color-bg-card) !important;
}

.dark-theme body.sidebar-collapsed .dashboard-sidebar,
body.dark-theme.sidebar-collapsed .dashboard-sidebar {
    background: var(--color-slate-900, #0f172a) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}



body.sidebar-collapsed .dashboard-sidebar .dashboard-sidebar-brand .branding-title,
body.sidebar-collapsed .dashboard-sidebar .dashboard-sidebar-brand .text-muted,
body.sidebar-collapsed .dashboard-sidebar .nav-link span:not(.badge),
body.sidebar-collapsed .dashboard-sidebar .sidebar-nav-section-label,
body.sidebar-collapsed .dashboard-sidebar .sidebar-accordion-trigger span,
body.sidebar-collapsed .dashboard-sidebar .sidebar-accordion-trigger .accordion-icon,
body.sidebar-collapsed .dashboard-sidebar .user-profile .fw-bold,
body.sidebar-collapsed .dashboard-sidebar .user-profile .text-truncate,
body.sidebar-collapsed .dashboard-sidebar .user-profile div[style*="font-size: 0.65rem"],
body.sidebar-collapsed .dashboard-sidebar .sidebar-action-btn span,
body.sidebar-collapsed .dashboard-sidebar .sidebar-action-ext,
body.sidebar-collapsed .dashboard-sidebar .sidebar-user-details,
body.sidebar-collapsed .dashboard-sidebar .sidebar-toolbox {
    display: none !important;
}

body.sidebar-collapsed .dashboard-sidebar>.d-flex.align-items-center.justify-content-between {
    flex-direction: column !important;
    gap: 15px !important;
    padding-top: 15px !important;
}

body.sidebar-collapsed .btn-link[data-desktop-sidebar-toggle="sidebar"] {
    margin-right: 0 !important;
}

body.sidebar-collapsed .sidebar-collapse-icon {
    transform: rotate(180deg) !important;
}

body.sidebar-collapsed .dashboard-sidebar-brand {
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.sidebar-collapsed .dashboard-sidebar .nav-link,
body.sidebar-collapsed .sidebar-accordion-trigger {
    justify-content: center !important;
    padding: 10px !important;
    margin: 2px 8px !important;
    width: auto !important;
}

body.sidebar-collapsed .dashboard-sidebar .nav-link i,
body.sidebar-collapsed .sidebar-accordion-trigger i:first-child {
    margin-right: 0 !important;
    font-size: 1.15rem !important;
}

body.sidebar-collapsed .sidebar-quick-actions {
    flex-direction: column !important;
    gap: 6px !important;
    padding: 0 8px !important;
}

body.sidebar-collapsed .sidebar-action-btn {
    justify-content: center !important;
    padding: 10px !important;
}

body.sidebar-collapsed .sidebar-action-btn i {
    margin-right: 0 !important;
    font-size: 1.1rem !important;
}

body.sidebar-collapsed .user-profile>div {
    padding: 10px;
}

body.sidebar-collapsed .toolbox-icon-premium {
    display: none !important;
}

body.sidebar-collapsed .nav-link .badge,
body.sidebar-collapsed .res-unread-count-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    padding: 3px 5px !important;
    font-size: 0.55rem;
    margin: 0 !important;
}

/* Tooltips for collapsed mode */
body.sidebar-collapsed .nav-link:hover::after,
body.sidebar-collapsed .sidebar-action-btn:hover::after,
body.sidebar-collapsed .sidebar-accordion-trigger:hover::after {
    content: attr(title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15, 23, 42, 0.9);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1000;
    margin-left: 10px;
    opacity: 1;
}

/* --- Extracted from sidebar_navigation.php --- */
.user-profile {
    padding: 0 16px 12px 16px;
    margin-top: auto;
    flex-shrink: 0;
    background: transparent;
    border: none !important;
}

.user-profile-inner {
    background: var(--color-bg-card, rgba(0, 0, 0, 0.02));
    border: 1px solid var(--color-border, rgba(0, 0, 0, 0.05));
    border-radius: 12px;
    padding: 20px 16px 0px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.sidebar-user-avatar {
    width: 44px;
    height: 44px;
    font-size: 1.15rem;
    font-weight: 600;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), #3b82f6);
    color: white;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.sidebar-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.sidebar-user-details {
    min-width: 0;
    width: 100%;
}

.sidebar-user-name {
    font-size: 0.95rem;
    letter-spacing: -0.2px;
    color: var(--color-text-main);
}

.sidebar-user-role {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: 4px;
}

.sidebar-toolbox {
    background: var(--hover-bg, rgba(0, 0, 0, 0.03));
    border-radius: 8px;
    border: 1px solid var(--color-border, rgba(0, 0, 0, 0.05));
    margin: 0px 0px 10px 0px;
}

.toolbox-btn {
    border: none;
    background: transparent;
    cursor: pointer;
}

.dark-theme .user-profile {
    border-top: none !important;
}

.toolbox-icon-premium {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    color: var(--color-text-muted, rgba(0, 0, 0, 0.45));
    font-size: 0.95rem;
    border-radius: 5px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none !important;
}

.toolbox-icon-premium:hover {
    color: var(--color-primary, #2563eb);
    background: var(--hover-bg, rgba(0, 0, 0, 0.08));
    transform: translateY(-1px);
}

.dark-theme .toolbox-icon-premium {
    color: rgba(255, 255, 255, 0.45);
}

.dark-theme .toolbox-icon-premium:hover {
    color: white;
    background: rgba(255, 255, 255, 0.08);
}

/* --- Extracted from sidebar_navigation.php --- */

.sidebar-d-contents {
    display: contents;
}

.sidebar-brand-box {
    border-radius: 20px;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-brand-img {
    width: 65%;
    height: 65%;
    object-fit: contain;
    filter: brightness(0) invert(1);
    border-radius: 20px;
}

.sidebar-title {
    letter-spacing: 0.5px;
}

.sidebar-subtitle {
    font-size: 0.55rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    opacity: 0.7;
}

.sidebar-toggle-btn {
    width: 28px;
    height: 28px;
    text-decoration: none;
}

.sidebar-collapse-icon {
    transition: transform 0.3s ease;
}

.sidebar-help-btn-custom {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}
/* 
  Lavdin Navbar & Auth Page Component
  ─────────────────────────────────────────────
  Extracted from core/components/navbar.php
*/

:root {
    --auth-card-max-width: 1100px;
}

body.is-register-page {
    --auth-card-max-width: 1150px;
}

@media screen and (min-width: 992px) {

    /* Remove top padding of main container on auth pages to allow exact centering */
    body.is-login-page main.main-content,
    body.is-register-page main.main-content {
        padding-top: 0 !important;
        min-height: 100vh !important;
    }

    body.is-login-page .auth-page-wrapper,
    body.is-register-page .auth-page-wrapper {
        width: 100%;
        min-height: 100vh !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 40px 20px !important;
        box-sizing: border-box;
    }

    body.is-login-page .auth-container-premium,
    body.is-register-page .auth-container-premium {
        margin: auto !important;
        height: calc(100vh - 160px) !important;
    }

    .auth-crd-arr-fxd {
        width: 100%;
        max-width: var(--auth-card-max-width, 1100px);
        margin-left: auto;
        margin-right: auto;
        position: relative;
        font-size: 20px;
        padding: 0;
        display: flex;
        justify-content: flex-start;
        top: 2.5rem;
        /* Positioned cleanly in the middle of the 80px space above the card */
    }
}

@media screen and (max-width: 991px) {
    .auth-crd-arr-fxd {
        width: 100%;
        height: 100%;
        padding: 0;
        margin: 0;
        position: relative;
        top: 0;
        display: flex;
        justify-content: center;
        align-items: center;
    }
}

/* --- Extracted from navbar.php --- */

@media screen and (min-width: 764px) {
    body:not(.tenant-page):not(.forum-page) #sidebarToggle {
        display: none !important;
    }
}



/* --- Extracted from toolbox_navbar.php --- */
/* Sleek floating alert banner 30px above bottom */
.lavdin-toolbox-navbar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 8px 12px 8px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 1050;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    transition: all 0.3s var(--transition-bezier);
    color: var(--color-slate-50);
    min-width: max-content;
    justify-content: center;
}

.lavdin-toolbox-navbar:hover {
    transform: translateX(-50%) translateY(-4px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
    border-color: rgba(59, 130, 246, 0.4);
}

@media (min-width: 992px) {
    body.admin-dashboard-body:not(.tenant-page) .lavdin-toolbox-navbar {
        left: calc(50% + (var(--sidebar-width, 280px) / 2));
    }
}

.lavdin-toolbox-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #38bdf8;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) inset;
}

.lavdin-toolbox-text-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    cursor: default;
}

.lavdin-toolbox-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lavdin-toolbox-subtitle {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 2px;
}

.lavdin-toolbox-subtitle strong {
    color: #e2e8f0;
    font-weight: 600;
}

.lavdin-toolbox-divider {
    width: 1px;
    height: 32px;
    background: rgba(255, 255, 255, 0.15);
}

.lavdin-toolbox-btn {
    color: var(--color-white);
    background: var(--color-primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 20px;
    border-radius: var(--radius-xl);
    transition: all 0.2s ease;
    text-decoration: none !important;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    box-shadow: 0 4px 15px var(--color-primary-soft);
    cursor: pointer;
}

.lavdin-toolbox-btn:hover {
    color: var(--color-white);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--color-primary-glow);
}

.lavdin-toolbox-btn i {
    font-size: 0.9rem;
}

/* Superadmin Floating Toolbox Styles */
.sa-floating-toolbox {
    display: none;
}

.sa-floating-toolbox.active {
    display: flex !important;
    animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.btn-sa-tool {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: none;
    color: #e2e8f0;
    width: 40px;
    height: 40px;
    padding: 0 !important;
    border-radius: 50% !important;
    justify-content: center;
}

.btn-sa-tool:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    color: #fff;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .lavdin-toolbox-navbar {
        min-width: auto;
        max-width: 100%;
        bottom: 15px;
        gap: 10px;
        padding: 8px 12px;
        justify-content: flex-start;
        overflow-x: auto;
        border-radius: 12px;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .lavdin-toolbox-navbar::-webkit-scrollbar {
        display: none;
    }

    .lavdin-toolbox-text-container,
    .lavdin-toolbox-divider {
        display: none !important;
    }

    .lavdin-toolbox-btn,
    .lavdin-toolbox-icon {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* --- Extracted from navbar.php --- */

.navbar-brand-box {
    border-radius: 30px;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.navbar-brand-img {
    border-radius: 20px;
    width: 65%;
    height: 65%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.lh-1 {
    line-height: 1;
}

.navbar-community-text {
    font-size: 0.55rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    opacity: 0.7;
    line-height: 1;
    color: var(--fr-primary, #60a5fa);
}

.filter-invert {
    filter: brightness(0) invert(1);
}

.navbar-mobile-logo {
    height: 24px;
    width: auto;
    filter: var(--logo-filter, none);
}

.cursor-pointer {
    cursor: pointer;
}

.nav-action-btn {
    width: 38px;
    height: 38px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    background: transparent;
    color: inherit;
    text-decoration: none;
    padding: 0;
    flex-shrink: 0;
}

body.light-theme .nav-action-btn {
    background: transparent;
    color: var(--color-text-main, #1e293b);
}

.nav-action-btn:hover,
.nav-action-btn:focus,
.nav-action-btn[aria-expanded="true"] {
    background: rgba(128, 128, 128, 0.1);
    transform: translateY(-1px);
    color: inherit;
}

.nav-action-btn i {
    font-size: 1.1rem;
}

.w-h-100-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.navbar-user-dropdown-btn {
    border-radius: 20px;
    height: 38px;
    padding: 0 16px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
}

.navbar-user-dropdown-btn:hover,
.navbar-user-dropdown-btn[aria-expanded="true"] {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.text-white-imp {
    color: white !important;
}

.navbar-badge {
    display: none;
    font-size: 0.65rem;
    border-radius: 0;
}

.navbar-mobile-badge {
    display: none;
    font-size: 0.75rem;
    border-radius: 0;
}

.nav-btn-transition {
    transition: all 0.2s;
    border-radius: 12px;
}

.nav-btn-transition-slow {
    transition: all 0.3s;
    border-radius: 12px;
}

.w-20px {
    width: 20px;
}

.navbar-mobile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
}

.navbar-mobile-avatar-container {
    border-radius: 12px;
    width: 36px;
    height: 36px;
    margin: 0;
}

.fr-text-color {
    color: var(--fr-text, #fff);
}

.admin-subtitle {
    font-size: 0.55rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    opacity: 0.7;
    line-height: 1;
}

/* Enhanced Dropdown */
.premium-dropdown {
    border-radius: 16px;
    min-width: 260px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 8px;
    border: 1px solid rgba(128, 128, 128, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: var(--color-bg-card, #ffffff);
}

:root.dark-theme .premium-dropdown {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.premium-dropdown .dropdown-item {
    border-radius: 8px;
    padding: 10px 16px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

.premium-dropdown .dropdown-item:hover {
    background: rgba(128, 128, 128, 0.1);
    transform: translateX(2px);
}

.header-glass {
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.light-theme .header-glass {
    background: rgba(255, 255, 255, 0.85) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.form-control {
  background-color: var(--color-bg-main);
  border: 1px solid var(--color-border-light);
  border-radius: 3px;
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-main);
  transition: 0.25s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.01);
}

.form-control:focus {
  background-color: var(--color-white);
  border-color: var(--color-border-light);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  outline: 0;
}

.search-container input {
  box-shadow: none !important;
  border: none;
}

.auth-card .form-control {
  background-color: var(--color-bg-main) !important;
  border: 1px solid var(--color-border-light) !important;
  padding: 0.875rem 1.25rem !important;
  border-radius: 3px !important;
  font-size: 0.95rem !important;
  transition: 0.2s !important;
  color: var(--color-text-main) !important;
}

.auth-card .form-control:focus {
  background-color: var(--color-white) !important;
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08) !important;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-text-muted);
}

.dark-theme .form-control,
.dark-theme .form-select,
.dark-theme .input-group-text,
.dark-theme
  input:not([type="hidden"]):not([type="submit"]):not([type="button"]):not(
    [type="checkbox"]
  ):not([type="radio"]),
.dark-theme textarea {
  background-color: rgba(15, 23, 42, 0.8) !important;
  border-color: var(--dark-border) !important;
  color: var(--dark-text-main) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.dark-theme .form-control:focus,
.dark-theme .form-select:focus,
.dark-theme input:focus,
.dark-theme textarea:focus {
  background-color: var(--color-bg-surface) !important;
  border-color: var(--color-blue-500) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25),
    inset 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

