/**
 * Navigation Components Styles
 * Enhanced navigation elements: breadcrumbs, tabs, pagination, steps
 *
 * Components:
 * - Enhanced breadcrumbs (with icons, colors, responsive)
 * - Styled tabs (pills, underline, vertical)
 * - Advanced pagination (with info, sizes)
 * - Step indicators (wizard progress)
 * - Back to top button
 */

/* =====================================
   ENHANCED BREADCRUMBS
   ===================================== */

.breadcrumb-enhanced {
    background-color: transparent;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    background-color: #f8f9fa;
}

.breadcrumb-enhanced .breadcrumb-item {
    font-size: 0.9375rem;
}

.breadcrumb-enhanced .breadcrumb-item + .breadcrumb-item::before {
    content: '\f285'; /* Bootstrap Icons chevron-right */
    font-family: 'bootstrap-icons';
    color: #6c757d;
    padding: 0 0.5rem;
}

/* Breadcrumb with icons */
.breadcrumb-enhanced .breadcrumb-item i {
    margin-right: 0.375rem;
    font-size: 0.875rem;
}

/* Breadcrumb item states */
.breadcrumb-enhanced .breadcrumb-item a {
    color: #0d6efd;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-enhanced .breadcrumb-item a:hover {
    color: #0a58ca;
    text-decoration: underline;
}

.breadcrumb-enhanced .breadcrumb-item.active {
    color: #495057;
    font-weight: 500;
}

/* Breadcrumb sizes */
.breadcrumb-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.breadcrumb-lg {
    padding: 1rem 1.25rem;
    font-size: 1.0625rem;
}

/* Breadcrumb color variants */
.breadcrumb-primary {
    background-color: #cfe2ff;
}

.breadcrumb-secondary {
    background-color: #e2e3e5;
}

/* Responsive breadcrumbs (collapse on mobile) */
@media (max-width: 576px) {
    .breadcrumb-enhanced .breadcrumb-item:not(:last-child):not(:first-child) {
        display: none;
    }

    .breadcrumb-enhanced .breadcrumb-item:not(:last-child):not(:first-child)::before {
        content: '...';
        padding: 0 0.25rem;
    }
}

/* =====================================
   STYLED TABS
   ===================================== */

/* Tab underline style */
.nav-tabs-underline {
    border-bottom: 2px solid #dee2e6;
}

.nav-tabs-underline .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: #6c757d;
    font-weight: 500;
    padding: 0.75rem 1.25rem;
    transition: all 0.3s ease;
    position: relative;
}

.nav-tabs-underline .nav-link:hover {
    color: #0d6efd;
    border-bottom-color: #0d6efd;
    background-color: transparent;
}

.nav-tabs-underline .nav-link.active {
    color: #0d6efd;
    border-bottom-color: #0d6efd;
    background-color: transparent;
}

/* Tab pills enhanced */
.nav-pills-enhanced .nav-link {
    border-radius: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    color: #495057;
    transition: all 0.3s ease;
}

.nav-pills-enhanced .nav-link:hover {
    background-color: #e9ecef;
    color: #212529;
}

.nav-pills-enhanced .nav-link.active {
    background-color: #0d6efd;
    color: #fff;
}

/* Tab with icons */
.nav-tabs .nav-link i,
.nav-pills .nav-link i {
    margin-right: 0.5rem;
    font-size: 1rem;
}

/* Tab with badges */
.nav-link .badge {
    margin-left: 0.5rem;
}

/* Vertical tabs */
.nav-tabs-vertical {
    flex-direction: column;
    border-right: 1px solid #dee2e6;
    border-bottom: none;
}

.nav-tabs-vertical .nav-link {
    border: 1px solid transparent;
    border-right: 3px solid transparent;
    text-align: left;
}

.nav-tabs-vertical .nav-link.active {
    border-color: #dee2e6;
    border-right-color: #0d6efd;
    background-color: #f8f9fa;
}

/* =====================================
   ADVANCED PAGINATION
   ===================================== */

.pagination-enhanced {
    gap: 0.25rem;
}

.pagination-enhanced .page-link {
    border-radius: 0.375rem;
    padding: 0.5rem 0.875rem;
    color: #495057;
    border: 1px solid #dee2e6;
    margin: 0 0.125rem;
    transition: all 0.2s ease;
}

.pagination-enhanced .page-link:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
    color: #212529;
}

.pagination-enhanced .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
    font-weight: 600;
}

.pagination-enhanced .page-item.disabled .page-link {
    background-color: #e9ecef;
    border-color: #dee2e6;
    color: #6c757d;
    cursor: not-allowed;
}

/* Pagination with icons */
.pagination-enhanced .page-link i {
    font-size: 0.875rem;
}

/* Pagination sizes */
.pagination-sm .page-link {
    padding: 0.375rem 0.625rem;
    font-size: 0.875rem;
}

.pagination-lg .page-link {
    padding: 0.625rem 1.125rem;
    font-size: 1.0625rem;
}

/* Pagination info */
.pagination-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: #6c757d;
    font-size: 0.9375rem;
}

.pagination-info .showing-text {
    font-weight: 500;
}

/* Compact pagination */
.pagination-compact {
    gap: 0;
}

.pagination-compact .page-link {
    margin: 0;
    border-radius: 0;
}

.pagination-compact .page-item:first-child .page-link {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.pagination-compact .page-item:last-child .page-link {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

/* =====================================
   STEP INDICATORS (Wizard)
   ===================================== */

.steps-indicator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 0;
    position: relative;
}

.steps-indicator::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    background-color: #dee2e6;
    z-index: 0;
}

.step-item {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}

.step-circle {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: #fff;
    border: 3px solid #dee2e6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #6c757d;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.step-circle i {
    font-size: 1.25rem;
}

.step-label {
    display: block;
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}

/* Step states */
.step-item.step-completed .step-circle {
    background-color: #198754;
    border-color: #198754;
    color: #fff;
}

.step-item.step-completed .step-label {
    color: #198754;
}

.step-item.step-active .step-circle {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.2);
}

.step-item.step-active .step-label {
    color: #0d6efd;
    font-weight: 600;
}

/* Vertical steps */
.steps-indicator-vertical {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 0;
}

.steps-indicator-vertical::before {
    left: 1.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    height: auto;
}

.steps-indicator-vertical .step-item {
    text-align: left;
    padding-left: 4rem;
    padding-bottom: 2rem;
    width: 100%;
}

.steps-indicator-vertical .step-circle {
    position: absolute;
    left: 0;
    top: 0;
}

.steps-indicator-vertical .step-label {
    display: inline-block;
}

/* =====================================
   BACK TO TOP BUTTON
   ===================================== */

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: #0d6efd;
    color: #fff;
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top:hover {
    background-color: #0a58ca;
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

.back-to-top.show {
    display: flex;
}

.back-to-top i {
    font-size: 1.25rem;
}

/* =====================================
   SIDEBAR NAVIGATION
   ===================================== */

.nav-sidebar {
    flex-direction: column;
}

.nav-sidebar .nav-link {
    padding: 0.75rem 1rem;
    color: #495057;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.nav-sidebar .nav-link:hover {
    background-color: #e9ecef;
    color: #212529;
}

.nav-sidebar .nav-link.active {
    background-color: #0d6efd;
    color: #fff;
    font-weight: 500;
}

.nav-sidebar .nav-link i {
    margin-right: 0.75rem;
    width: 1.25rem;
    text-align: center;
}

/* Collapsible sidebar nav */
.nav-sidebar .nav-link[data-bs-toggle="collapse"]::after {
    content: '\f282'; /* Bootstrap Icons chevron-down */
    font-family: 'bootstrap-icons';
    margin-left: auto;
    transition: transform 0.3s ease;
}

.nav-sidebar .nav-link[data-bs-toggle="collapse"]:not(.collapsed)::after {
    transform: rotate(180deg);
}

.nav-sidebar .collapse .nav-link {
    padding-left: 3rem;
    font-size: 0.9375rem;
}

/* =====================================
   DROPDOWN NAVIGATION ENHANCED
   ===================================== */

.dropdown-menu-enhanced {
    border-radius: 0.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
    padding: 0.5rem 0;
}

.dropdown-menu-enhanced .dropdown-item {
    padding: 0.625rem 1.25rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.dropdown-menu-enhanced .dropdown-item i {
    margin-right: 0.75rem;
    width: 1.25rem;
    text-align: center;
    color: #6c757d;
}

.dropdown-menu-enhanced .dropdown-item:hover {
    background-color: #e9ecef;
}

.dropdown-menu-enhanced .dropdown-item:active {
    background-color: #0d6efd;
    color: #fff;
}

.dropdown-menu-enhanced .dropdown-item:active i {
    color: #fff;
}

.dropdown-menu-enhanced .dropdown-divider {
    margin: 0.5rem 0;
}

/* Dropdown header */
.dropdown-menu-enhanced .dropdown-header {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
}

/* =====================================
   RESPONSIVE ADJUSTMENTS
   ===================================== */

@media (max-width: 768px) {
    .nav-tabs-underline .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .pagination-enhanced .page-link {
        padding: 0.375rem 0.625rem;
        font-size: 0.875rem;
    }

    .steps-indicator {
        padding: 1rem 0;
    }

    .step-circle {
        width: 2.5rem;
        height: 2.5rem;
    }

    .step-label {
        font-size: 0.75rem;
    }

    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 2.5rem;
        height: 2.5rem;
    }

    .back-to-top i {
        font-size: 1rem;
    }

    /* Horizontal steps become vertical on mobile */
    .steps-indicator:not(.steps-indicator-vertical) {
        flex-direction: column;
        align-items: flex-start;
    }

    .steps-indicator:not(.steps-indicator-vertical)::before {
        left: 1.25rem;
        top: 0;
        bottom: 0;
        width: 2px;
        height: auto;
    }

    .steps-indicator:not(.steps-indicator-vertical) .step-item {
        text-align: left;
        padding-left: 3.5rem;
        padding-bottom: 1.5rem;
        width: 100%;
    }

    .steps-indicator:not(.steps-indicator-vertical) .step-circle {
        position: absolute;
        left: 0;
        top: 0;
    }

    /* Tabs scroll on mobile */
    .nav-tabs,
    .nav-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-tabs .nav-link,
    .nav-pills .nav-link {
        white-space: nowrap;
    }
}

/* =====================================
   DARK MODE SUPPORT
   ===================================== */

@media (prefers-color-scheme: dark) {
    .breadcrumb-enhanced {
        background-color: #212529;
    }

    .breadcrumb-enhanced .breadcrumb-item a {
        color: #6ea8fe;
    }

    .breadcrumb-enhanced .breadcrumb-item a:hover {
        color: #9ec5fe;
    }

    .breadcrumb-enhanced .breadcrumb-item.active {
        color: #adb5bd;
    }

    .nav-tabs-underline {
        border-bottom-color: #495057;
    }

    .nav-tabs-underline .nav-link {
        color: #adb5bd;
    }

    .nav-tabs-underline .nav-link:hover,
    .nav-tabs-underline .nav-link.active {
        color: #6ea8fe;
        border-bottom-color: #6ea8fe;
    }

    .pagination-enhanced .page-link {
        background-color: #212529;
        border-color: #495057;
        color: #adb5bd;
    }

    .pagination-enhanced .page-link:hover {
        background-color: #343a40;
        border-color: #495057;
        color: #fff;
    }

    .pagination-enhanced .page-item.active .page-link {
        background-color: #0d6efd;
        border-color: #0d6efd;
    }

    .steps-indicator::before {
        background-color: #495057;
    }

    .step-circle {
        background-color: #212529;
        border-color: #495057;
        color: #adb5bd;
    }

    .step-label {
        color: #adb5bd;
    }

    .dropdown-menu-enhanced {
        background-color: #212529;
        border-color: #495057;
    }

    .dropdown-menu-enhanced .dropdown-item {
        color: #adb5bd;
    }

    .dropdown-menu-enhanced .dropdown-item:hover {
        background-color: #343a40;
        color: #fff;
    }

    .nav-sidebar .nav-link {
        color: #adb5bd;
    }

    .nav-sidebar .nav-link:hover {
        background-color: #343a40;
        color: #fff;
    }
}

/* =====================================
   SIDEBAR LAYOUT - Collapsible Sidebar
   ===================================== */

/* Sidebar Container */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    background-color: #1e293b;
    color: #e2e8f0;
    z-index: 1040;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-transition: width 0.3s ease;
    transition: width 0.3s ease;
    overflow: hidden;
}

/* ===================
   FOUC PREVENTION
   Applied via inline script in <head> before first paint
   =================== */
html.sidebar-will-collapse .sidebar {
    width: 80px !important;
}

html.sidebar-will-collapse .main-wrapper {
    margin-left: 80px !important;
}

html.sidebar-will-collapse .sidebar-text,
html.sidebar-will-collapse .sidebar-brand-text,
html.sidebar-will-collapse .sidebar-section,
html.sidebar-will-collapse .sidebar-toggle {
    display: none !important;
}

html.sidebar-will-collapse .sidebar-link {
    width: 56px !important;
    height: 56px !important;
    padding: 0 !important;
    margin: 0 auto 4px auto !important;
    -webkit-box-pack: center !important;
    justify-content: center !important;
}

html.sidebar-will-collapse .sidebar-link i {
    margin: 0 !important;
    min-width: 0 !important;
}

/* ===================
   COLLAPSED STATE
   Safari-optimized using CSS Grid
   =================== */
.sidebar.collapsed {
    width: 80px;
    overflow: visible;
}

.sidebar.collapsed .sidebar-header {
    padding: 16px 0;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    position: relative;
    overflow: visible;
}

.sidebar.collapsed .sidebar-brand {
    width: 80px;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
}

.sidebar.collapsed .sidebar-brand i {
    font-size: 1.75rem;
    min-width: 0;
    width: 48px;
    height: 48px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
}

.sidebar.collapsed .sidebar-brand-text {
    position: absolute;
    left: -9999px;
    visibility: hidden;
}

.sidebar.collapsed .sidebar-toggle {
    display: none;
}

.sidebar.collapsed .sidebar-nav {
    padding: 12px 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar.collapsed .sidebar-section {
    height: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
    visibility: hidden;
}

.sidebar.collapsed .sidebar-section-text {
    display: none;
}

.sidebar.collapsed .sidebar-item {
    margin-bottom: 4px;
    display: block;
    text-align: center;
}

.sidebar.collapsed .sidebar-link {
    width: 56px;
    height: 56px;
    padding: 0;
    margin-left: auto;
    margin-right: auto;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    border-radius: 12px;
    position: relative;
}

.sidebar.collapsed .sidebar-link i {
    font-size: 1.375rem;
    min-width: 0;
    width: auto;
    height: auto;
    margin: 0;
    display: block;
    line-height: 1;
}

.sidebar.collapsed .sidebar-text {
    position: absolute;
    left: -9999px;
    visibility: hidden;
    width: 0;
    height: 0;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-footer {
    padding: 12px 0;
}

.sidebar.collapsed .sidebar-footer .sidebar-link {
    width: 56px;
    height: 56px;
    padding: 0;
    margin: 0 auto 4px auto;
}

.sidebar.collapsed .sidebar-badge {
    position: absolute;
    left: -9999px;
    visibility: hidden;
}

/* Sidebar Header */
.sidebar-header {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 64px;
}

.sidebar-brand {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-brand i {
    font-size: 1.5rem;
    min-width: 38px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
}

.sidebar-brand-text {
    margin-left: 0.5rem;
    transition: opacity 0.2s ease;
}

/* overridden by collapsed state above */

/* Sidebar Toggle Button */
.sidebar-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #e2e8f0;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    cursor: pointer;
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.sidebar-toggle i {
    -webkit-transition: transform 0.3s ease;
    transition: transform 0.3s ease;
}

/* collapsed toggle hidden - using navbar toggle instead */

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 0.75rem;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-item {
    margin-bottom: 2px;
}

.sidebar-link {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-link.active {
    background-color: #3b82f6;
    color: #fff;
}

.sidebar-link i {
    font-size: 1.25rem;
    min-width: 38px;
    width: 38px;
    height: 24px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-flex-shrink: 0;
    flex-shrink: 0;
}

.sidebar-text {
    margin-left: 0.5rem;
    transition: opacity 0.2s ease;
}

/* overridden by collapsed state above */

/* Sidebar Section Headers */
.sidebar-section {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.05em;
    margin-top: 1rem;
    white-space: nowrap;
    overflow: hidden;
}

/* overridden by collapsed state above */

.sidebar-section-line {
    display: none;
}

/* Sidebar Footer */
.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem;
}

.sidebar-footer .sidebar-link {
    margin-bottom: 2px;
}

/* Sidebar Badge */
.sidebar-badge {
    margin-left: auto;
    background-color: #ef4444;
    color: #fff;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-weight: 600;
}

/* sidebar-badge collapsed state handled above */

/* Main Content Wrapper */
.main-wrapper {
    margin-left: 260px;
    min-height: 100vh;
    -webkit-transition: margin-left 0.3s ease;
    transition: margin-left 0.3s ease;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    flex-direction: column;
}

.sidebar.collapsed ~ .main-wrapper {
    margin-left: 80px;
}

/* (Old top-bar removed - now using top-navbar) */

/* Main Content */
.main-content {
    flex: 1;
    padding: 1.5rem;
}

/* Sidebar Tooltips (collapsed state) */
.sidebar.collapsed .sidebar-link {
    position: relative;
}

.sidebar.collapsed .sidebar-link::after {
    content: attr(data-title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background-color: #1e293b;
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    margin-left: 10px;
    z-index: 1050;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar.collapsed .sidebar-link:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Submenu Support */
.sidebar-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar-submenu.show {
    max-height: 500px;
}

.sidebar-submenu .sidebar-link {
    padding-left: 3.5rem;
    font-size: 0.9375rem;
}

.sidebar.collapsed .sidebar-submenu {
    display: none;
}

.sidebar-link[data-bs-toggle="collapse"]::after {
    content: '\F282';
    font-family: 'bootstrap-icons';
    margin-left: auto;
    transition: transform 0.3s ease;
}

.sidebar-link[data-bs-toggle="collapse"]:not(.collapsed)::after {
    transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-link[data-bs-toggle="collapse"]::after {
    display: none;
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1035;
}

.sidebar-overlay.show {
    display: block;
}

/* =====================================
   SIDEBAR RESPONSIVE
   ===================================== */

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: 260px !important;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar.collapsed {
        width: 260px !important;
    }

    .sidebar.collapsed .sidebar-text,
    .sidebar.collapsed .sidebar-brand-text {
        opacity: 1;
        width: auto;
    }

    .main-wrapper {
        margin-left: 0 !important;
    }

    .sidebar-toggle {
        display: none;
    }

    .sidebar.collapsed .sidebar-section {
        height: auto;
        overflow: visible;
        padding: 0.5rem 1rem;
        margin-top: 1rem;
        visibility: visible;
    }

    .sidebar.collapsed .sidebar-link {
        width: auto;
        height: auto;
        padding: 0.75rem 1rem;
        margin: 0;
        border-radius: 8px;
    }

    .sidebar.collapsed .sidebar-link i {
        font-size: 1.25rem;
        min-width: 38px;
        width: 38px;
        margin: 0;
    }
}

@media (min-width: 992px) {
    .sidebar-overlay {
        display: none !important;
    }
}

/* =====================================
   SIDEBAR SCROLLBAR
   ===================================== */

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* =====================================
   TOP NAVBAR
   ===================================== */

.top-navbar {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    justify-content: space-between;
    background-color: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 1.5rem;
    height: 70px;
    position: sticky;
    top: 0;
    z-index: 1020;
    gap: 1rem;
}

.top-navbar-left {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    gap: 1rem;
    -webkit-flex: 1;
    flex: 1;
}

.top-navbar-right {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    gap: 0.5rem;
}

.top-navbar-toggle {
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    cursor: pointer;
    color: #374151;
    font-size: 1.5rem;
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
}

.top-navbar-toggle:hover {
    background-color: #f3f4f6;
    color: #111827;
}

/* Search Bar */
.top-navbar-search {
    position: relative;
    max-width: 400px;
    width: 100%;
}

.top-navbar-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1rem;
}

.top-navbar-search .form-control {
    padding-left: 2.75rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background-color: #f9fafb;
    height: 44px;
    font-size: 0.9375rem;
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
}

.top-navbar-search .form-control:focus {
    background-color: #fff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.top-navbar-search .form-control::placeholder {
    color: #9ca3af;
}

/* Navbar Icon Buttons */
.top-navbar-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background-color: transparent;
    color: #6b7280;
    font-size: 1.25rem;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    cursor: pointer;
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
    position: relative;
}

.top-navbar-icon:hover {
    background-color: #f3f4f6;
    color: #111827;
}

.top-navbar-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: #ef4444;
    color: #fff;
    font-size: 0.625rem;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    padding: 0 4px;
}

/* User Dropdown */
.top-navbar-user {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 8px;
    border: none;
    background-color: transparent;
    cursor: pointer;
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
}

.top-navbar-user:hover {
    background-color: #f3f4f6;
}

.top-navbar-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
}

.top-navbar-user-info {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    text-align: left;
}

.top-navbar-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.2;
}

.top-navbar-user-role {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.2;
}

.top-navbar-user i.bi-chevron-down {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Notification Dropdown */
.notification-dropdown {
    width: 360px;
    padding: 0;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.notification-dropdown .dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f9fafb;
    border-radius: 12px 12px 0 0;
}

.notification-list {
    max-height: 300px;
    overflow-y: auto;
}

/* Main Content adjustments */
.main-content {
    -webkit-flex: 1;
    flex: 1;
    padding: 1.5rem;
    /* min-height rimosso - flexbox gestisce il layout per sticky footer */
}

/* Footer */
.main-footer {
    background-color: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
    color: #6b7280;
    font-size: 0.875rem;
}

/* =====================================
   TOP NAVBAR RESPONSIVE
   ===================================== */

@media (max-width: 991.98px) {
    .top-navbar {
        padding: 0 1rem;
        height: 60px;
    }

    .top-navbar-search {
        display: none;
    }

    .top-navbar-toggle {
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }

    .top-navbar-icon {
        width: 36px;
        height: 36px;
        font-size: 1.125rem;
    }

    .notification-dropdown {
        width: 300px;
    }
}

@media (max-width: 575.98px) {
    .top-navbar-right {
        gap: 0.25rem;
    }

    .notification-dropdown {
        width: calc(100vw - 2rem);
        right: -0.5rem !important;
    }
}

/* =====================================
   SIDEBAR DARK MODE
   ===================================== */

@media (prefers-color-scheme: dark) {
    .sidebar {
        background-color: #0f172a;
    }

    .top-navbar {
        background-color: #1e293b;
        border-bottom-color: #334155;
    }

    .top-navbar-toggle {
        color: #e2e8f0;
    }

    .top-navbar-toggle:hover {
        background-color: #334155;
        color: #fff;
    }

    .top-navbar-search .form-control {
        background-color: #334155;
        border-color: #475569;
        color: #e2e8f0;
    }

    .top-navbar-search .form-control::placeholder {
        color: #94a3b8;
    }

    .top-navbar-icon {
        color: #94a3b8;
    }

    .top-navbar-icon:hover {
        background-color: #334155;
        color: #fff;
    }

    .top-navbar-user:hover {
        background-color: #334155;
    }

    .top-navbar-user-name {
        color: #e2e8f0;
    }

    .main-footer {
        background-color: #1e293b;
        border-top-color: #334155;
        color: #94a3b8;
    }
}
