/* ===== D1 COMPLETE NAVBAR & SIDEBAR STYLES ===== */
/* All navbar and sidebar styles consolidated in one file */

/* ===== NAVBAR STYLES ===== */

/* Mobile Profile Dropdown Styles */
.d1-mobile-profile {
    position: relative;
    display: none;
}

.d1-mobile-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.d1-mobile-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.d1-mobile-dropdown-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
}

.d1-mobile-dropdown-item {
    margin: 0;
}

.d1-mobile-dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--bs-body-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.d1-mobile-dropdown-link:hover {
    background-color: var(--bs-secondary-bg);
    color: var(--bs-body-color);
    text-decoration: none;
}

.d1-mobile-dropdown-link i {
    width: 16px;
    text-align: center;
    color: var(--bs-secondary);
}

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

.d1-mobile-user-info {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    margin-bottom: 0.5rem;
}

.d1-mobile-user-email {
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0;
    color: var(--bs-body-color);
}

.d1-mobile-user-role {
    font-size: 0.8rem;
    color: var(--bs-secondary);
    margin: 0;
    margin-top: 0.25rem;
}

/* Show mobile profile only on mobile and tablet screens (consistent with Bootstrap lg breakpoint) */
@media (max-width: 991.98px) {
    .d1-mobile-profile {
        display: block !important;
    }
    
    /* Ensure desktop profile is hidden on mobile/tablet */
    .d1-user-dropdown {
        display: none !important;
    }
}

/* Hide mobile profile on larger screens and show desktop profile */
@media (min-width: 992px) {
    .d1-mobile-profile {
        display: none !important;
    }
    
    .d1-user-dropdown {
        display: block !important;
    }
}

/* Global Navbar Styles - Unique classes to avoid Bootstrap conflicts */
/* Web Component Wrapper */
d1-navbar {
    display: block;
    position: sticky;
    top: 0;
    z-index: 1030;
    width: 100%;
    left: 0;
    right: 0;
}

/* Inner Navbar Container */
.d1-navbar {
    background: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative; /* Changed from sticky since parent handles it */
    z-index: 1030;
    transition: all 0.3s ease;
    width: 100%;
}

.d1-navbar-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 60px;
    position: relative;
}

.d1-navbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.d1-navbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.d1-navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--bs-body-color);
    font-weight: 600;
    font-size: 1.25rem;
}

.d1-navbar-brand:hover {
    color: var(--bs-primary);
    text-decoration: none;
}

.d1-navbar-logo {
    height: 28px;
    width: auto;
    margin-right: 0.75rem;
    transition: transform 0.2s ease;
}

.d1-navbar-logo:hover {
    transform: scale(1.05);
}

.d1-sidebar-toggle {
    background: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--bs-body-color);
    font-size: 1rem;
}

.d1-sidebar-toggle:hover {
    background-color: var(--bs-primary);
    color: white;
    transform: scale(1.05);
    border-color: var(--bs-primary);
}

.d1-navbar-toggle {
    display: none;
    background: none;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--bs-body-color);
}

.d1-navbar-toggle:hover {
    background-color: var(--bs-secondary-bg);
}

.d1-navbar-toggle-icon {
    width: 18px;
    height: 18px;
}

.d1-navbar-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.d1-navbar-item {
    position: relative;
}

/* Hamburger Menu Animation */
.d1-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 18px;
    height: 14px;
    cursor: pointer;
}

.d1-hamburger-line {
    width: 100%;
    height: 2px;
    background-color: currentColor;
    transition: all 0.3s ease;
    transform-origin: center;
}

.d1-navbar-toggle.active .d1-hamburger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.d1-navbar-toggle.active .d1-hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.d1-navbar-toggle.active .d1-hamburger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Theme Toggle Styles */
.d1-theme-toggle {
    background: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--bs-body-color);
}

.d1-theme-toggle:hover {
    background-color: var(--bs-primary);
    color: white;
    transform: scale(1.05);
}

/* Notifications Styles */
.d1-notifications {
    position: relative;
}

.d1-notifications-toggle {
    background: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--bs-body-color);
    position: relative;
}

.d1-notifications-toggle:hover {
    background-color: var(--bs-primary);
    color: white;
    transform: scale(1.05);
}

.d1-notifications-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background-color: var(--bs-danger);
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bs-body-bg);
    animation: notificationPulse 2s infinite;
}

@keyframes notificationPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.d1-notifications-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    min-width: 320px;
    max-width: 400px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.d1-notifications-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.d1-notifications-header {
    padding: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.d1-notifications-tabs {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--bs-border-color);
    padding: 0 0.5rem;
    gap: 0.5rem;
}

.d1-notifications-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 0.75rem 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.d1-notifications-tab:hover,
.d1-notifications-tab:focus {
    color: var(--bs-body-color);
}

.d1-notifications-tab.active {
    color: var(--bs-body-color);
    border-bottom-color: var(--bs-primary);
}

.d1-notifications-tab-count {
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
    border-radius: 999px;
    padding: 0 0.5rem;
    font-size: 0.75rem;
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 24px;
}

.d1-notifications-content {
    max-height: 340px;
    overflow-y: auto;
}

.d1-notifications-history-list {
    display: none;
}

.d1-notifications-history-empty {
    padding: 2rem;
    text-align: center;
    color: var(--bs-secondary);
}

.d1-notifications-history-empty .d1-notifications-empty-icon {
    margin-bottom: 0.75rem;
}

.d1-notifications-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0;
    color: var(--bs-body-color);
}

.d1-notifications-clear {
    background: none;
    border: none;
    color: var(--bs-primary);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease;
}

.d1-notifications-clear:hover {
    background-color: var(--bs-secondary-bg);
}

.d1-notifications-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.d1-notification-item {
    padding: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
}

.d1-notification-item:hover {
    background-color: var(--bs-secondary-bg);
}

.d1-notification-item:last-child {
    border-bottom: none;
}

.d1-notification-item.unread {
    background-color: var(--bs-primary-bg-subtle);
    border-left: 3px solid var(--bs-primary);
}

.d1-notification-item.unread::before {
    content: '';
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 8px;
    height: 8px;
    background-color: var(--bs-primary);
    border-radius: 50%;
}

.d1-notification-content {
    display: flex;
    gap: 0.75rem;
}

.d1-notification-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.d1-notification-icon.info {
    background-color: var(--bs-info-bg-subtle);
    color: var(--bs-info);
}

.d1-notification-icon.success {
    background-color: var(--bs-success-bg-subtle);
    color: var(--bs-success);
}

.d1-notification-icon.warning {
    background-color: var(--bs-warning-bg-subtle);
    color: var(--bs-warning);
}

.d1-notification-icon.danger {
    background-color: var(--bs-danger-bg-subtle);
    color: var(--bs-danger);
}

.d1-notification-body {
    flex: 1;
    min-width: 0;
}

.d1-notification-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin: 0 0 0.25rem 0;
    color: var(--bs-body-color);
}

.d1-notification-message {
    font-size: 0.825rem;
    color: var(--bs-secondary);
    margin: 0 0 0.25rem 0;
    line-height: 1.4;
}

.d1-notification-time {
    font-size: 0.75rem;
    color: var(--bs-secondary);
    margin: 0;
}

.d1-notifications-empty {
    padding: 2rem;
    text-align: center;
    color: var(--bs-secondary);
}

.d1-notifications-empty-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* User Dropdown Styles */
.d1-user-dropdown {
    position: relative;
}

.d1-user-toggle {
    background: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--bs-body-color);
    overflow: hidden;
}

.d1-user-toggle:hover {
    background-color: var(--bs-primary);
    color: white;
    transform: scale(1.05);
    border-color: var(--bs-primary);
}

.d1-user-toggle img {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.d1-user-toggle:hover img {
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.d1-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease;
}

.d1-user-info:hover {
    background-color: var(--bs-secondary-bg);
}

.d1-user-details {
    text-align: right;
    line-height: 1.2;
}

.d1-user-email {
    font-size: 0.875rem;
    color: var(--bs-body-color);
    margin: 0;
}

.d1-user-role {
    font-size: 0.75rem;
    color: var(--bs-secondary);
    margin: 0;
}

.d1-user-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.d1-user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.d1-user-dropdown-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
}

.d1-user-dropdown-item {
    margin: 0;
}

.d1-user-dropdown-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--bs-body-color);
    text-decoration: none;
    transition: background-color 0.2s ease;
    font-size: 0.875rem;
}

.d1-user-dropdown-link:hover {
    background-color: var(--bs-secondary-bg);
    color: var(--bs-body-color);
    text-decoration: none;
}

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

/* ===== SIDEBAR STYLES ===== */

/* Sidebar Navigation Styles */
.sidebar {
    width: 320px;
    background: var(--bs-body-bg);
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    position: fixed;
    top: 60px;
    left: 0;
    height: calc(100vh - 60px);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1001;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.04);
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: var(--bs-body-bg);
    position: sticky;
    top: 0;
    z-index: 10;
    width: 100%;
    box-sizing: border-box;
    backdrop-filter: blur(10px);
}

.sidebar-title {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--bs-body-color);
    word-wrap: break-word;
}

.sidebar-search {
    position: relative;
    width: 100%;
}

.sidebar-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bs-secondary);
    font-size: 0.9rem;
}

.sidebar-search input {
    padding-left: 2.5rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    font-size: 0.875rem;
    height: 40px;
    width: 100%;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.02);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-search input:focus {
    outline: none;
    border-color: var(--bs-primary);
    background: var(--bs-body-bg);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.sidebar-content {
    padding: 1rem 0;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.sidebar-category {
    margin-bottom: 0.5rem;
    width: 100%;
    box-sizing: border-box;
}

.sidebar-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    background: none;
    width: calc(100% - 16px);
    max-width: calc(100% - 16px);
    text-align: left;
    color: var(--bs-body-color);
    border-radius: 10px;
    margin: 2px 8px;
    font-weight: 600;
    box-sizing: border-box;
    overflow: hidden;
}

.sidebar-category-header:hover {
    background: rgba(0, 0, 0, 0.03);
}

.sidebar-category-title-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-category-main-icon {
    font-size: 1rem;
    color: var(--bs-primary);
    width: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-category-title {
    font-size: 0.8125rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.01em;
}

.sidebar-category-icon {
    font-size: 0.75rem;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--bs-secondary);
    opacity: 0.6;
}

.sidebar-category.collapsed .sidebar-category-icon {
    transform: rotate(-90deg);
}

.sidebar-category-header:hover .sidebar-category-icon {
    opacity: 1;
}

.sidebar-modules {
    padding-left: 0;
    margin: 0 0 0.5rem 0;
    list-style: none;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-category.collapsed .sidebar-modules {
    max-height: 0;
    margin: 0;
}

.sidebar-category:not(.collapsed) .sidebar-modules {
    max-height: 1000px;
}

.sidebar-module {
    margin: 0;
}

.sidebar-module-link {
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem 0.625rem 1rem;
    text-decoration: none;
    color: var(--bs-body-color);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    position: relative;
    border-radius: 10px;
    margin: 1px 8px;
    width: calc(100% - 16px);
    max-width: calc(100% - 16px);
    box-sizing: border-box;
    overflow: hidden;
}

.sidebar-module-link:hover {
    background: rgba(13, 110, 253, 0.06);
    color: var(--bs-primary);
    text-decoration: none;
    transform: translateX(2px);
}

.sidebar-module-link:active {
    transform: scale(0.98);
}

.sidebar-module-link.coming-soon {
    opacity: 0.6;
    cursor: not-allowed;
}

.sidebar-module-link.coming-soon:hover {
    background: none;
    color: var(--bs-body-color);
}

.sidebar-module-link.coming-soon:hover .sidebar-module-icon {
    color: #6c757d !important;
}

.sidebar-module-icon {
    width: 18px;
    height: 18px;
    margin-right: 0.75rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.7;
}

.sidebar-module-link:hover .sidebar-module-icon {
    opacity: 1;
    transform: scale(1.1);
}

.sidebar-module-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.sidebar-module-title {
    font-size: 0.8125rem;
    font-weight: 500;
    margin: 0 0 0.125rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.sidebar-module-description {
    font-size: 0.6875rem;
    color: var(--bs-secondary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    opacity: 0.8;
}

.sidebar-module-link:hover .sidebar-module-description {
    opacity: 1;
}

.sidebar-favorite-star {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--bs-secondary);
    font-size: 0.75rem;
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-module-link:hover .sidebar-favorite-star {
    opacity: 0.5;
}

.sidebar-favorite-star.active {
    color: #ffc107;
    opacity: 1;
}

.sidebar-favorite-star:hover {
    color: #ffc107;
    opacity: 1 !important;
    transform: translateY(-50%) scale(1.15);
}

/* Permission-based styling for sidebar */
.sidebar-module-link.permission-admin .sidebar-module-icon {
    color: #dc3545;
}

.sidebar-module-link.permission-restricted .sidebar-module-icon {
    color: #fd7e14;
}

.sidebar-module-link.permission-open .sidebar-module-icon {
    color: #0d6efd;
}

.sidebar-module-link.permission-admin:hover .sidebar-module-icon {
    color: #dc3545 !important;
}

.sidebar-module-link.permission-restricted:hover .sidebar-module-icon {
    color: #fd7e14 !important;
}

.sidebar-module-link.permission-open:hover .sidebar-module-icon {
    color: #0d6efd !important;
}

/* Collapsed sidebar state */
.sidebar.collapsed {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

/* Main area adjustments */
.main-area {
    margin-left: 0;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-area:not(.sidebar-collapsed) {
    margin-left: 320px;
}

.main-area.sidebar-collapsed {
    margin-left: 0;
}

/* Sidebar overlay for all screen sizes */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Sidebar favorites section */
.sidebar-favorites {
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding-bottom: 0.75rem;
    background: var(--bs-body-bg);
}

.sidebar-favorites-header {
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: #ffc107;
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 193, 7, 0.08);
    border-radius: 10px;
    margin: 0 8px 0.5rem 8px;
    border-left: 3px solid #ffc107;
    letter-spacing: -0.01em;
}

/* Ensure favorites modules have consistent styling */
.sidebar-favorites .sidebar-modules {
    background: var(--bs-body-bg);
}

.sidebar-favorites .sidebar-module-link {
    background: rgba(255, 193, 7, 0.04);
    border-left: 3px solid #ffc107;
    margin: 1px 8px;
    border-radius: 10px;
}

.sidebar-favorites .sidebar-module-link:hover {
    background: rgba(255, 193, 7, 0.12);
    color: var(--bs-body-color);
    transform: translateX(2px);
}

.sidebar-favorites .sidebar-module-icon {
    color: #ffc107 !important;
    opacity: 1 !important;
}

/* Search results in sidebar */
.sidebar-search-results {
    padding: 0 1rem;
}

.sidebar-search-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color);
}

.sidebar-search-no-results {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--bs-secondary);
    font-size: 0.9rem;
}

.sidebar-search-no-results i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* ===== RESPONSIVE STYLES ===== */

/* Mobile Responsive */
@media (max-width: 768px) {
    .d1-navbar-container {
        padding: 0 0.75rem;
    }
    
    .d1-navbar-right {
        gap: 0.5rem;
    }
    
    .d1-navbar-toggle {
        display: block;
    }
    
    .d1-navbar-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bs-body-bg);
        border-top: 1px solid var(--bs-border-color);
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .d1-navbar-nav.show {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .d1-user-info {
        justify-content: center;
    }
    
    .d1-user-details {
        text-align: center;
    }
    
    .d1-notifications-dropdown,
    .d1-user-dropdown-menu {
        position: fixed;
        top: 60px;
        left: 1rem;
        right: 1rem;
        max-width: none;
    }

    /* Mobile hamburger adjustments */
    .d1-hamburger {
        width: 16px;
        height: 12px;
    }
    
    .d1-navbar-toggle.active .d1-hamburger-line:nth-child(1) {
        transform: translateY(5px) rotate(45deg);
    }
    
    .d1-navbar-toggle.active .d1-hamburger-line:nth-child(3) {
        transform: translateY(-5px) rotate(-45deg);
    }

    /* Mobile sidebar */
    .sidebar {
        transform: translateX(-100%);
        width: 100%;
        max-width: 340px;
        overflow-x: hidden !important; /* Prevent horizontal scroll */
        overflow-y: auto;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    /* Mobile: Keep sidebar modules as vertical list (NOT horizontal scroll) */
    .sidebar-modules {
        display: block !important; /* Changed from flex to block */
        overflow-x: hidden !important; /* Prevent horizontal scroll */
        overflow-y: visible;
        white-space: normal;
        padding: 0;
        gap: 0;
    }
    
    .sidebar-module {
        flex-shrink: 1;
        min-width: auto;
        width: 100%;
    }
    
    .sidebar-module-link {
        display: flex;
        white-space: normal;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Mobile-specific sidebar styling */
    .sidebar-header {
        padding: 1rem;
    }
    
    .sidebar-category-header {
        padding: 1rem;
        font-size: 0.9rem;
        min-height: 48px;
    }
    
    .sidebar-module-link {
        padding: 0.75rem 1rem 0.75rem 2rem;
        min-height: 48px;
        align-items: center;
    }
    
    .sidebar-module-title {
        font-size: 0.9rem;
    }
    
    .sidebar-module-description {
        font-size: 0.75rem;
        line-height: 1.2;
    }
    
    .sidebar-module-icon {
        font-size: 1rem;
        width: 18px;
        height: 18px;
    }
    
    .sidebar-category-main-icon {
        font-size: 1.1rem;
        width: 18px;
    }
}

/* Tablet adjustments */
@media (max-width: 992px) and (min-width: 769px) {
    .d1-hamburger {
        width: 17px;
        height: 13px;
    }
    
    .d1-navbar-toggle.active .d1-hamburger-line:nth-child(1) {
        transform: translateY(5.5px) rotate(45deg);
    }
    
    .d1-navbar-toggle.active .d1-hamburger-line:nth-child(3) {
        transform: translateY(-5.5px) rotate(-45deg);
    }

    /* Tablet sidebar - hidden by default, shown with .show class */
    .sidebar {
        width: 300px;
        transform: translateX(-100%);
        overflow-x: hidden !important; /* Prevent horizontal scroll */
        overflow-y: auto;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    /* Tablet: Keep sidebar modules as vertical list (NOT horizontal scroll) */
    .sidebar-modules {
        display: block !important; /* Changed from flex to block */
        overflow-x: hidden !important; /* Prevent horizontal scroll */
        overflow-y: visible;
        white-space: normal;
        padding: 0;
        gap: 0;
    }
    
    .sidebar-module {
        flex-shrink: 1;
        min-width: auto;
        width: 100%;
    }
    
    .sidebar-module-link {
        display: flex;
        white-space: normal;
        padding: 0.5rem 0.75rem 0.5rem 1.75rem;
        width: 100%;
        box-sizing: border-box;
    }
    
    .main-area:not(.sidebar-collapsed) {
        margin-left: 0; /* Changed from 280px to 0 for tablet */
    }
    
    .sidebar-module-description {
        font-size: 0.7rem;
        line-height: 1.1;
    }
    
    .sidebar-category-header {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
    
    /* Tablet-specific sidebar styling */
    .sidebar-header {
        padding: 1rem;
    }
}

/* Additional hamburger states for better UX */
.d1-navbar-toggle:hover .d1-hamburger-line {
    background-color: var(--bs-primary);
}

.d1-navbar-toggle.active:hover .d1-hamburger-line {
    background-color: var(--bs-danger);
}

/* ===== DARK MODE STYLES ===== */

/* Dark mode adjustments */
[data-bs-theme="dark"] .d1-navbar {
    background-color: #1a1d23 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-bs-theme="dark"] .sidebar {
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

[data-bs-theme="dark"] .sidebar-search input {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

[data-bs-theme="dark"] .sidebar-search input:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: #58a6ff;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

[data-bs-theme="dark"] .sidebar-category-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

[data-bs-theme="dark"] .sidebar-module-link:hover {
    background: rgba(88, 166, 255, 0.1);
    color: #58a6ff;
}

[data-bs-theme="dark"] .d1-navbar-container {
    background-color: #1a1d23;
}

[data-bs-theme="dark"] .d1-navbar-brand {
    color: #e6edf3;
}

[data-bs-theme="dark"] .d1-navbar-brand:hover {
    color: #58a6ff;
}

[data-bs-theme="dark"] .d1-navbar-toggle {
    border-color: #30363d;
    color: #e6edf3;
}

[data-bs-theme="dark"] .d1-navbar-toggle:hover {
    background-color: #262c36;
}

[data-bs-theme="dark"] .d1-sidebar-toggle {
    background-color: #21262d;
    border-color: #30363d;
    color: #e6edf3;
}

[data-bs-theme="dark"] .d1-sidebar-toggle:hover {
    background-color: #58a6ff;
    border-color: #58a6ff;
    color: white;
}

[data-bs-theme="dark"] .d1-theme-toggle {
    background-color: #21262d;
    border-color: #30363d;
    color: #e6edf3;
}

[data-bs-theme="dark"] .d1-theme-toggle:hover {
    background-color: #58a6ff;
    color: white;
}

[data-bs-theme="dark"] .d1-notifications-toggle {
    background-color: #21262d;
    border-color: #30363d;
    color: #e6edf3;
}

[data-bs-theme="dark"] .d1-notifications-toggle:hover {
    background-color: #58a6ff;
    color: white;
}

[data-bs-theme="dark"] .d1-user-toggle {
    background-color: #21262d !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
}

[data-bs-theme="dark"] .d1-user-toggle:hover {
    background-color: #58a6ff !important;
    border-color: #58a6ff !important;
    color: white !important;
}

[data-bs-theme="dark"] .d1-user-email {
    color: #e6edf3 !important;
}

[data-bs-theme="dark"] .d1-user-role {
    color: #7d8590 !important;
}

[data-bs-theme="dark"] .d1-user-info:hover .d1-user-email {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .d1-user-info:hover .d1-user-role {
    color: #c9d1d9 !important;
}

[data-bs-theme="dark"] .d1-notifications-dropdown,
[data-bs-theme="dark"] .d1-user-dropdown-menu {
    background-color: #21262d;
    border-color: #30363d;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

/* Dark mode favorites styling */
[data-bs-theme="dark"] .sidebar-favorites {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

[data-bs-theme="dark"] .sidebar-favorites-header {
    background: rgba(255, 193, 7, 0.12);
    border-left-color: #ffc107;
    color: #ffc107;
}

[data-bs-theme="dark"] .sidebar-favorites .sidebar-module-link {
    background: rgba(255, 193, 7, 0.08);
    border-left-color: #ffc107;
}

[data-bs-theme="dark"] .sidebar-favorites .sidebar-module-link:hover {
    background: rgba(255, 193, 7, 0.18);
    color: #e6edf3;
}
