/* public/css/app-modern.css - Modern UI Stylesheet */

/* Light Theme (Default) */
:root, .light-mode {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --secondary-color: #f9fafb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --danger-color: #ef4444;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
}

/* Dark Theme */
.dark-mode {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #312e81;
    --secondary-color: #1f2937;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --bg-light: #111827;
    --bg-white: #1f2937;
    --border-color: #374151;
    --danger-color: #f87171;
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
}

* {
    box-sizing: border-box;
}

/* Smooth theme transition */
body, .sidebar-modern, .topbar-modern, .main-wrapper, .dropdown-modern,
.sidebar-menu-item, .dropdown-item-modern, .user-menu-trigger-modern,
.topbar-btn-modern, .search-box-modern input, .sidebar-header-modern,
.sidebar-profile-card, .sidebar-menu-label, .breadcrumb-modern {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary);
    margin: 0;
    line-height: 1.6;
}

/* --- Sidebar Styles --- */
.sidebar-modern {
    width: var(--sidebar-width);
    background-color: var(--bg-white);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.sidebar-modern.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-modern.collapsed .sidebar-menu-text,
.sidebar-modern.collapsed .profile-info-sm,
.sidebar-modern.collapsed .sidebar-menu-label,
.sidebar-modern.collapsed .sidebar-brand span {
    display: none;
}

.sidebar-modern.collapsed .sidebar-menu-item {
    justify-content: center;
    padding: 0.75rem;
}

.sidebar-modern.collapsed .sidebar-profile-card {
    justify-content: center;
    padding: 1rem;
}

.sidebar-header-modern {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--bg-white);
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-brand:hover {
    transform: translateX(3px);
}

.sidebar-brand-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 1.1rem;
    color: var(--bg-white);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(180deg);
}

.sidebar-profile-card {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.875rem;
    background: linear-gradient(to right, var(--primary-light), var(--bg-white));
}

.profile-avatar-sm {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.profile-avatar-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info-sm {
    flex-grow: 1;
    min-width: 0;
}

.profile-name-sm {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-role-sm {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Sidebar Navigation */
.sidebar-modern nav {
    flex-grow: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.sidebar-modern nav::-webkit-scrollbar {
    display: none;
}

.sidebar-menu-section {
    margin-bottom: 1.75rem;
}

.sidebar-menu-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 1rem;
    margin-bottom: 0.625rem;
}

.sidebar-menu-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    gap: 0.875rem;
    margin-bottom: 0.25rem;
    position: relative;
}

.sidebar-menu-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary-color);
    border-radius: 0 3px 3px 0;
    transition: height 0.3s ease;
}

.sidebar-menu-item:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
    transform: translateX(3px);
}

.sidebar-menu-item:hover::before {
    height: 70%;
}

.sidebar-menu-item.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: var(--bg-white);
    font-weight: 700;
    box-shadow: var(--shadow-md);
}

.sidebar-menu-item.active::before {
    height: 0;
}

.sidebar-menu-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.sidebar-menu-text {
    flex-grow: 1;
}

.sidebar-badge {
    background-color: var(--danger-color);
    color: white;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-weight: 700;
}

/* --- Submenu Styles --- */
.sidebar-submenu-toggle {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    position: relative;
    padding-right: 2rem;
}

.sidebar-submenu-toggle:hover {
    color: var(--primary-color);
}

.sidebar-submenu-toggle.active {
    color: var(--primary-color);
}

.sidebar-submenu-toggle .submenu-arrow {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
    font-size: 0.75rem;
}

.sidebar-submenu-toggle[aria-expanded="true"] .submenu-arrow {
    transform: translateY(-50%) rotate(180deg);
}

.submenu-collapse {
    overflow: hidden;
    transition: height 0.3s ease;
}

.sidebar-submenu-item {
    padding-left: 2.5rem;
    font-size: 0.85rem;
    margin-bottom: 0.125rem;
}

.sidebar-submenu-item::before {
    left: 1rem;
}

.sidebar-submenu-item .sidebar-menu-icon {
    font-size: 0.95rem;
    width: 20px;
}

/* Collapsed sidebar submenu handling */
.sidebar-modern.collapsed .sidebar-submenu-toggle {
    display: none;
}

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

/* --- Main Content Wrapper --- */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: var(--bg-light);
}

.main-wrapper.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed-width);
}

@media (min-width: 769px) {
    .main-wrapper {
        margin-left: var(--sidebar-width);
    }

    .main-wrapper.sidebar-collapsed {
        margin-left: var(--sidebar-collapsed-width);
    }
}

@media (max-width: 768px) {
    .main-wrapper {
        margin-left: 0 !important;
    }
}

/* --- Topbar --- */
.topbar-modern {
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: var(--shadow-sm);
}

.topbar-left {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 1rem;
    row-gap: 0.2rem;
    align-items: center;
    flex-grow: 1;
    flex: 1 1 auto;
    min-width: 0;
}

.breadcrumb-modern {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.breadcrumb-item-modern {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item-modern:hover {
    color: var(--primary-color);
}

.breadcrumb-separator {
    color: var(--border-color);
}

.breadcrumb-item-active {
    color: var(--text-primary);
    font-weight: 600;
}

.topbar-title-modern h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-title-modern {
    grid-column: 2;
    grid-row: 2;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
}

.mobile-menu-toggle {
    grid-column: 1;
    grid-row: 1 / span 2;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex: 0 0 auto;
    max-width: 100%;
}

.search-box-modern {
    position: relative;
}

.search-box-modern input {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.625rem 1rem 0.625rem 2.75rem;
    width: 260px;
    transition: all 0.3s ease;
    background-color: var(--bg-light);
    font-size: 0.9rem;
}

.search-box-modern input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
    background-color: var(--bg-white);
    width: 320px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
}

.topbar-btn-modern {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    position: relative;
}

.topbar-btn-modern:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.topbar-btn-modern:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.topbar-btn-modern:active {
    transform: translateY(0);
}

.notification-badge-modern {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    color: white;
    font-size: 0.65rem;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid var(--bg-white);
    animation: pulse 2s ease-in-out infinite;
}

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

/* User Menu */
.user-menu-trigger-modern {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: none;
    border: 1px solid var(--border-color);
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.user-menu-trigger-modern:hover {
    background-color: var(--bg-light);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.user-menu-trigger-modern:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.user-avatar-mini {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--primary-color);
}

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

.user-info-mini {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name-mini {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* Dropdowns */
.dropdown-modern {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    z-index: 1001;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-modern.show {
    display: block;
}

.notification-dropdown {
    min-width: 360px;
    width: min(420px, calc(100vw - 1rem));
    max-height: calc(100vh - 110px);
    overflow: hidden;
}

.notification-dropdown.show {
    display: flex;
    flex-direction: column;
}

.dropdown-header-modern {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(to bottom, var(--bg-white), var(--bg-light));
}

.dropdown-item-modern {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

.dropdown-item-modern:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.dropdown-item-modern:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

.dropdown-item-modern i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

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

.dropdown-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-muted-action {
    border: none;
    background: none;
    padding: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
    cursor: pointer;
}

.dropdown-muted-action:hover {
    color: var(--primary-color);
}

.notification-header-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary-color);
    background-color: var(--primary-light);
    border: 1px solid color-mix(in srgb, var(--primary-color) 25%, transparent);
}

.notification-list-modern {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
    max-height: min(52vh, 430px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.notification-item {
    width: 100%;
    background: transparent;
    text-align: left;
    border: 1px solid transparent;
    border-radius: 0.65rem;
    margin: 0;
    transition: transform 0.15s ease, border-color 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
}

.notification-item:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}

.notification-item.unread {
    border-color: color-mix(in srgb, var(--primary-color) 30%, transparent);
    background-color: color-mix(in srgb, var(--primary-light) 60%, transparent);
}

.notification-item:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--primary-color) 28%, transparent);
    background-color: color-mix(in srgb, var(--primary-light) 42%, transparent);
}

.notification-empty-state {
    justify-content: center;
    color: var(--text-secondary);
    cursor: default;
}

.notification-empty-state:hover {
    background-color: transparent;
    color: var(--text-secondary);
}

.notification-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-item-icon-accent {
    background: color-mix(in srgb, var(--primary-light) 75%, transparent);
}

.notification-item-icon-info {
    background: color-mix(in srgb, var(--bg-light) 55%, transparent);
}

.notification-item-icon i {
    color: var(--primary-color);
}
.dropdown-muted-action:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.notification-item-content {
    flex-grow: 1;
}

.notification-item-delete {
    border: none;
    background: transparent;
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.35rem;
    align-self: center;
    flex-shrink: 0;
}

.notification-item-delete:hover {
    color: #dc3545;
    background: color-mix(in srgb, #dc3545 16%, transparent);
}

.notification-item-delete:focus-visible {
    outline: 2px solid #dc3545;
    outline-offset: 1px;
}

.notification-item-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.notification-item-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.notification-unread-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--primary-color);
    flex-shrink: 0;
}

.notification-item:not(.unread) .notification-unread-dot {
    display: none;
}

.notification-item-subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.notification-item-time {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.notification-view-all {
    width: calc(100% - 1rem);
    margin: 0.25rem 0.5rem 0.5rem;
    border-radius: 0.6rem;
    border: 1px solid color-mix(in srgb, var(--primary-color) 25%, transparent);
    background: color-mix(in srgb, var(--primary-light) 50%, transparent);
    color: var(--primary-color);
    justify-content: center;
    font-weight: 700;
}

.notification-view-all i {
    color: var(--primary-color);
}

.notification-view-all:hover {
    background: var(--primary-color);
    color: #ffffff;
}

.notification-view-all:hover i {
    color: #ffffff;
}

.notification-view-all:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.dark-mode .notification-item {
    border-color: transparent;
}

.dark-mode .notification-item:hover {
    border-color: #3b4f68;
    background-color: #243446;
}

.dark-mode .notification-item.unread {
    border-color: #4d6b8e;
    background-color: #1f3a56;
}

.dark-mode .notification-count-pill {
    color: #bfdbfe;
    background: #1e3a5f;
    border-color: #365b85;
}

.dark-mode .notification-view-all {
    border-color: #47658d;
    background: #1f3a56;
    color: #bfdbfe;
}

.dark-mode .notification-view-all i {
    color: #bfdbfe;
}

.dark-mode .notification-view-all:hover {
    background: #2d4f73;
    color: #e2e8f0;
}

.dark-mode .notification-view-all:hover i {
    color: #e2e8f0;
}

.user-menu-chevron {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.user-dropdown-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-lg {
    width: 40px;
    height: 40px;
}

.user-dropdown-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-dropdown-role {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.dropdown-item-danger {
    color: var(--danger-color) !important;
}

.dropdown-item-danger:hover {
    background-color: rgba(239, 68, 68, 0.12);
    color: var(--danger-color) !important;
}

/* Main Content */
.main-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Guest view */
.guest-main {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-white) 100%);
}

/* Responsive Design */
@media (max-width: 1024px) {
    :root,
    .light-mode,
    .dark-mode {
        --sidebar-width: 240px;
    }

    .topbar-title-modern h1 {
        font-size: 1.25rem;
    }

    .breadcrumb-modern {
        display: none;
    }

    .topbar-left {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .topbar-title-modern,
    .mobile-menu-toggle {
        grid-column: auto;
        grid-row: auto;
    }

    .search-box-modern input {
        width: 200px;
    }

    .search-box-modern input:focus {
        width: 240px;
    }

    .topbar-right {
        gap: 1rem;
    }
}

/* Tablet specific styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .topbar-modern {
        padding: 0.85rem 1.5rem;
        height: auto;
        min-height: 70px;
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .topbar-left {
        gap: 1.5rem;
        width: 100%;
    }

    .topbar-right {
        width: 100%;
        justify-content: flex-end;
        padding-top: 0.65rem;
        border-top: 1px solid var(--border-color);
    }

    .topbar-title-modern h1 {
        font-size: 1.3rem;
    }

    .main-content {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .sidebar-modern {
        transform: translateX(-100%);
        z-index: 1050;
        width: min(84vw, 320px) !important;
    }

    .sidebar-modern.collapsed {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
    }

    .sidebar-modern.active {
        transform: translateX(0);
    }

    .sidebar-modern.active::after {
        display: none;
    }

    .sidebar-toggle {
        display: none;
    }

    /* Show all text on mobile even if desktop is collapsed */
    .sidebar-modern .sidebar-menu-text,
    .sidebar-modern .profile-info-sm,
    .sidebar-modern .sidebar-menu-label,
    .sidebar-modern .sidebar-brand span {
        display: block !important;
    }

    .sidebar-modern .sidebar-menu-item {
        justify-content: flex-start !important;
        padding: 0.75rem 1rem !important;
        min-height: 44px; /* Touch-friendly minimum height */
    }

    .sidebar-modern .sidebar-profile-card {
        justify-content: flex-start !important;
        padding: 1.25rem !important;
    }

    .topbar-modern {
        padding: 0 1rem;
        min-height: 60px;
        height: auto;
        gap: 0.5rem;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .topbar-left {
        display: flex;
        gap: 0.75rem;
        min-width: 0;
        width: 100%;
    }

    .breadcrumb-modern {
        display: none;
    }

    .topbar-title-modern h1 {
        font-size: 1.1rem;
        max-width: min(46vw, 220px);
    }

    .search-box-modern {
        display: none;
    }

    .topbar-right {
        gap: 0.5rem;
        margin-left: auto;
        flex-shrink: 0;
        width: 100%;
        justify-content: flex-end;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border-color);
    }

    .user-info-mini {
        display: none;
    }

    .user-menu-trigger-modern {
        padding: 0.5rem;
        min-height: 44px; /* Touch-friendly */
        min-width: 44px;
    }

    .user-menu-trigger-modern i.bi-chevron-down {
        display: none;
    }

    .topbar-btn-modern {
        font-size: 1.2rem;
        padding: 0.5rem;
        min-height: 44px; /* Touch-friendly */
        min-width: 44px;
    }

    /* Mobile dropdown positioning */
    .dropdown-modern {
        position: fixed;
        right: 0.5rem;
        left: 0.5rem;
        top: 68px;
        max-width: calc(100vw - 1rem);
        min-width: auto;
    }

    #notificationDropdown {
        max-height: calc(100vh - 90px);
        overflow: hidden;
        top: 68px;
    }

    #userDropdown {
        max-height: 400px;
        overflow-y: auto;
        top: 68px;
    }

    .main-content {
        padding: 1rem;
    }

    /* Touch-friendly improvements */
    * {
        -webkit-tap-highlight-color: rgba(79, 70, 229, 0.1);
    }
}

@media (max-width: 480px) {
    .sidebar-modern {
        width: min(88vw, 300px);
    }

    .topbar-modern {
        height: 56px;
        padding: 0 0.75rem;
        min-height: 56px;
    }

    .topbar-title-modern h1 {
        font-size: 1rem;
        max-width: min(42vw, 160px);
    }

    .topbar-btn-modern {
        font-size: 1.1rem;
        padding: 0.375rem;
    }

    .user-avatar-mini {
        width: 32px;
        height: 32px;
    }

    .notification-badge-modern {
        width: 16px;
        height: 16px;
        font-size: 0.6rem;
    }

    .topbar-right {
        gap: 0.375rem;
        padding-top: 0.45rem;
    }

    #notificationDropdown,
    #userDropdown {
        top: 62px;
    }

    .main-content {
        padding: 0.75rem;
    }

    /* Hide theme toggle on very small screens */
    #themeToggleBtn {
        display: none;
    }

    /* Keep topbar compact on very small screens */
    #notificationBtn {
        display: none;
    }
}

/* Mobile menu overlay */
@media (max-width: 768px) {
    body.sidebar-active {
        overflow: hidden;
    }

    body.sidebar-active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        animation: fadeIn 0.3s ease;
    }

    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
}

/* Landscape orientation for mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .topbar-modern {
        height: 56px;
    }

    .sidebar-modern {
        width: 240px !important;
    }

    .topbar-title-modern h1 {
        font-size: 1rem;
        max-width: 180px;
    }
}

/* Print styles */
@media print {
    .sidebar-modern,
    .topbar-modern {
        display: none;
    }

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

/* ============================================
   MOBILE BOTTOM NAVIGATION
   ============================================ */

.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-white);
    border-top: 1px solid var(--border-color);
    padding: 0.5rem 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }

    /* Add bottom padding to main content to prevent overlap */
    .main-content {
        padding-bottom: 80px !important;
    }
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    min-width: 60px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-nav-item i {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
}

.mobile-nav-item span {
    font-weight: 500;
}

.mobile-nav-item:hover,
.mobile-nav-item:active {
    color: var(--primary-color);
    background-color: var(--primary-light);
}

.mobile-nav-item.active {
    color: var(--primary-color);
    font-weight: 600;
}

.mobile-nav-item.active i {
    transform: scale(1.1);
}

.mobile-nav-menu-btn {
    position: relative;
}

/* ============================================
   MOBILE MENU MODAL
   ============================================ */

.mobile-menu-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.mobile-menu-modal.show {
    display: block;
}

.mobile-menu-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-white);
    border-radius: 1.5rem 1.5rem 0 0;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.mobile-menu-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.mobile-menu-close:hover {
    background-color: var(--bg-light);
    color: var(--text-primary);
}

.mobile-menu-body {
    overflow-y: auto;
    padding: 1rem 0;
    flex-grow: 1;
}

.mobile-menu-section {
    padding: 0.75rem 0;
}

.mobile-menu-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.5rem 1.5rem;
    margin-bottom: 0.25rem;
    letter-spacing: 0.5px;
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    min-height: 48px;
}

.mobile-menu-link i {
    font-size: 1.25rem;
    color: var(--text-secondary);
    width: 24px;
    text-align: center;
}

.mobile-menu-link:active {
    background-color: var(--bg-light);
}

.mobile-menu-link:hover {
    background-color: var(--primary-light);
}

.mobile-menu-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.mobile-menu-theme-btn,
.mobile-menu-logout-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    min-height: 48px;
    cursor: pointer;
}

.mobile-menu-theme-btn {
    background-color: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.mobile-menu-theme-btn:hover {
    background-color: var(--border-color);
}

.mobile-menu-logout-btn {
    background-color: var(--danger-color);
    color: white;
    border: none;
}

.mobile-menu-logout-btn:hover {
    background-color: #dc2626;
}

.mobile-menu-theme-btn i,
.mobile-menu-logout-btn i {
    font-size: 1.1rem;
}

/* Hide mobile menu on desktop */
@media (min-width: 769px) {
    .mobile-bottom-nav,
    .mobile-menu-modal {
        display: none !important;
    }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    line-height: 1;
}

.mobile-menu-toggle:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* ============================================
   ADDITIONAL RESPONSIVE COMPONENTS
   ============================================ */

/* Cards */
.card {
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-light);
}

.card-body {
    padding: 1.5rem;
}

@media (max-width: 768px) {
    .card {
        border-radius: 0.5rem;
        margin-bottom: 1rem;
    }

    .card-header {
        padding: 1rem;
    }

    .card-body {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .card {
        border-radius: 0.5rem;
    }

    .card-header {
        padding: 0.875rem;
        font-size: 0.9rem;
    }

    .card-body {
        padding: 0.875rem;
    }
}

/* Form Elements */
.form-group {
    margin-bottom: 1.25rem;
}

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

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--bg-white);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

@media (max-width: 768px) {
    .form-group {
        margin-bottom: 1rem;
    }

    .form-label {
        font-size: 0.875rem;
        margin-bottom: 0.375rem;
    }

    .form-control {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .form-group {
        margin-bottom: 0.875rem;
    }

    .form-label {
        font-size: 0.8rem;
    }

    .form-control {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn:active {
    transform: translateY(0);
}

.btn:focus-visible,
.mobile-menu-theme-btn:focus-visible,
.mobile-menu-logout-btn:focus-visible,
.dropdown-muted-action:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.btn:disabled,
.btn.disabled,
.mobile-menu-theme-btn:disabled,
.mobile-menu-logout-btn:disabled,
.topbar-btn-modern:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--bg-white);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--text-secondary);
    color: var(--bg-white);
}

.btn-secondary:hover {
    background-color: var(--text-primary);
}

.btn-success {
    background-color: var(--success-color);
    color: var(--bg-white);
}

.btn-danger {
    background-color: var(--danger-color);
    color: var(--bg-white);
}

@media (max-width: 768px) {
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        width: 100%;
    }
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.table th,
.table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.table thead th {
    background-color: var(--bg-light);
    font-weight: 600;
    color: var(--text-secondary);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.85rem;
    }

    .table thead th {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .table th,
    .table td {
        padding: 0.625rem 0.375rem;
        font-size: 0.8rem;
    }

    .table thead th {
        font-size: 0.75rem;
    }
}

/* ============================================
   ALERTS - Comprehensive Alert System
   ============================================ */

.alert {
    position: relative;
    padding: 1rem 1.25rem;
    padding-left: 3rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Alert Icon */
.alert::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Success Alert */
.alert-success {
    background-color: #d1fae5;
    border-color: var(--success-color);
    color: #065f46;
}

.alert-success::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: var(--success-color);
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}

.dark-mode .alert-success {
    background-color: rgba(16, 185, 129, 0.15);
    border-color: var(--success-color);
    color: #6ee7b7;
}

/* Danger Alert */
.alert-danger {
    background-color: #fee2e2;
    border-color: var(--danger-color);
    color: #991b1b;
}

.alert-danger::before {
    content: '✕';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: var(--danger-color);
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}

.dark-mode .alert-danger {
    background-color: rgba(239, 68, 68, 0.15);
    border-color: var(--danger-color);
    color: #fca5a5;
}

/* Warning Alert */
.alert-warning {
    background-color: #fef3c7;
    border-color: var(--warning-color);
    color: #92400e;
}

.alert-warning::before {
    content: '⚠';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: var(--warning-color);
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}

.dark-mode .alert-warning {
    background-color: rgba(245, 158, 11, 0.15);
    border-color: var(--warning-color);
    color: #fcd34d;
}

/* Info Alert */
.alert-info {
    background-color: #dbeafe;
    border-color: #3b82f6;
    color: #1e40af;
}

.alert-info::before {
    content: 'ℹ';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: #3b82f6;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}

.dark-mode .alert-info {
    background-color: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
    color: #93c5fd;
}

/* Dismissible Alert */
.alert-dismissible {
    padding-right: 3rem;
}

.btn-close {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    font-size: 1.25rem;
    line-height: 1;
}

.btn-close::before {
    content: '×';
    font-weight: 300;
}

.btn-close:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.1);
}

.dark-mode .btn-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Fade animation for dismissible alerts */
.alert.fade {
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.alert.fade.show {
    opacity: 1;
}

/* Alert with strong text */
.alert strong {
    font-weight: 700;
    display: block;
    margin-bottom: 0.25rem;
}

/* Alert with list */
.alert ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.5rem;
}

.alert li {
    margin-bottom: 0.25rem;
}

/* Alert link styling */
.alert a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

.alert a:hover {
    opacity: 0.8;
}

/* Responsive Alert Styles */
@media (max-width: 768px) {
    .alert {
        padding: 0.875rem 1rem;
        padding-left: 2.75rem;
        padding-right: 2.75rem;
        font-size: 0.875rem;
    }

    .alert::before {
        left: 0.875rem;
        width: 18px;
        height: 18px;
        font-size: 0.8rem;
    }

    .btn-close {
        width: 20px;
        height: 20px;
        right: 0.875rem;
        font-size: 1.1rem;
    }

    .alert strong {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .alert {
        padding: 0.75rem 0.875rem;
        padding-left: 2.5rem;
        padding-right: 2.5rem;
        font-size: 0.8rem;
        border-radius: 0.5rem;
    }

    .alert::before {
        left: 0.75rem;
        width: 16px;
        height: 16px;
        font-size: 0.75rem;
    }

    .btn-close {
        width: 18px;
        height: 18px;
        right: 0.75rem;
        font-size: 1rem;
    }

    .alert strong {
        font-size: 0.85rem;
    }

    .alert ul {
        padding-left: 1.25rem;
    }
}

/* Alert Variants - Solid Style */
.alert-solid {
    color: white;
    border: none;
}

.alert-solid.alert-success {
    background: linear-gradient(135deg, var(--success-color), #059669);
}

.alert-solid.alert-danger {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
}

.alert-solid.alert-warning {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
}

.alert-solid.alert-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

/* Alert Variants - Outline Style */
.alert-outline {
    background-color: transparent;
    border-width: 2px;
}

.alert-outline.alert-success {
    color: var(--success-color);
}

.alert-outline.alert-danger {
    color: var(--danger-color);
}

.alert-outline.alert-warning {
    color: var(--warning-color);
}

.alert-outline.alert-info {
    color: #3b82f6;
}

.dark-mode .alert-outline {
    background-color: rgba(255, 255, 255, 0.02);
}


/* Container */
.container-fluid {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

@media (max-width: 768px) {
    .container-fluid {
        padding-right: 12px;
        padding-left: 12px;
    }
}

@media (max-width: 480px) {
    .container-fluid {
        padding-right: 10px;
        padding-left: 10px;
    }
}

/* Grid System - Bootstrap Compatible */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

[class*="col-"] {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

.col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

.col-md-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
}

.col-lg-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

@media (max-width: 991px) {
    .col-lg-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

@media (max-width: 767px) {
    .col-md-4,
    .col-md-6,
    .col-md-8 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .row {
        margin-right: -12px;
        margin-left: -12px;
    }

    [class*="col-"] {
        padding-right: 12px;
        padding-left: 12px;
    }
}

@media (max-width: 480px) {
    .row {
        margin-right: -10px;
        margin-left: -10px;
    }

    [class*="col-"] {
        padding-right: 10px;
        padding-left: 10px;
    }
}

/* Text Utilities */
.text-end {
    text-align: right;
}

.text-center {
    text-align: center;
}

@media (max-width: 768px) {
    .text-end,
    .text-md-end {
        text-align: left;
    }
}

/* Spacing Utilities */
.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .mb-4 {
        margin-bottom: 1rem;
    }

    .mt-4 {
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    .mb-4 {
        margin-bottom: 0.875rem;
    }

    .mt-4 {
        margin-top: 0.875rem;
    }
}

/* Display Utilities */
.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.align-items-end {
    align-items: flex-end;
}

@media (max-width: 768px) {
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* Utility Classes */
.d-none {
    display: none;
}

.py-4 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .py-4 {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .py-4 {
        padding-top: 0.875rem;
        padding-bottom: 0.875rem;
    }
}

/* Theme Toggle Animation */
.theme-toggle-icon {
    transition: transform 0.3s ease;
}

.dark-mode .theme-toggle-icon {
    transform: rotate(180deg);
}

/* Global fallback for pages with hardcoded light styling patterns */
.dark-mode .card,
.dark-mode .card-header,
.dark-mode .card-body,
.dark-mode .card-footer,
.dark-mode .modal-content,
.dark-mode .offcanvas,
.dark-mode .list-group-item,
.dark-mode .accordion-item,
.dark-mode .dropdown-menu,
.dark-mode .nav-tabs .nav-link {
    background-color: var(--bg-white);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.dark-mode .card-header,
.dark-mode .card-footer,
.dark-mode .modal-header,
.dark-mode .modal-footer,
.dark-mode .table thead th,
.dark-mode .input-group-text {
    background-color: var(--bg-light);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.dark-mode .table,
.dark-mode .table td,
.dark-mode .table th {
    color: var(--text-primary);
    border-color: var(--border-color);
}

.dark-mode .form-control,
.dark-mode .form-select,
.dark-mode .form-check-input,
.dark-mode textarea,
.dark-mode select,
.dark-mode input {
    background-color: var(--bg-light);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.dark-mode .form-control:focus,
.dark-mode .form-select:focus,
.dark-mode textarea:focus,
.dark-mode select:focus,
.dark-mode input:focus {
    background-color: var(--bg-white);
    color: var(--text-primary);
}

.dark-mode .form-control::placeholder,
.dark-mode input::placeholder,
.dark-mode textarea::placeholder {
    color: var(--text-muted);
}

.dark-mode .pagination .page-link {
    background-color: var(--bg-white);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.dark-mode .pagination .page-link:hover {
    background-color: var(--bg-light);
    color: var(--text-primary);
}

.dark-mode .pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

.dark-mode .bg-white {
    background-color: var(--bg-white) !important;
}

.dark-mode .bg-light {
    background-color: var(--bg-light) !important;
}

.dark-mode .text-dark {
    color: var(--text-primary) !important;
}

.dark-mode .text-muted {
    color: var(--text-muted) !important;
}

.dark-mode hr,
.dark-mode .border,
.dark-mode .border-top,
.dark-mode .border-bottom,
.dark-mode .border-start,
.dark-mode .border-end {
    border-color: var(--border-color) !important;
}

/* Strong fallback for pages with inline light styles and Bootstrap defaults */
.dark-mode {
    --bs-body-bg: var(--bg-light);
    --bs-body-color: var(--text-primary);
    --bs-tertiary-bg: var(--bg-light);
    --bs-secondary-bg: var(--bg-white);
    --bs-card-bg: var(--bg-white);
    --bs-border-color: var(--border-color);
    --bs-modal-bg: var(--bg-white);
    --bs-dropdown-bg: var(--bg-white);
    --bs-dropdown-link-color: var(--text-primary);
    --bs-dropdown-link-hover-bg: var(--bg-light);
    --bs-table-bg: var(--bg-white);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.06);
}

.dark-mode body,
body.dark-mode {
    background-color: var(--bg-light) !important;
    color: var(--text-primary) !important;
}

.dark-mode [style*="background: #fff"],
.dark-mode [style*="background:#fff"],
.dark-mode [style*="background: #ffffff"],
.dark-mode [style*="background:#ffffff"],
.dark-mode [style*="background: #f8f9fa"],
.dark-mode [style*="background:#f8f9fa"],
.dark-mode [style*="background: #f8fafc"],
.dark-mode [style*="background:#f8fafc"],
.dark-mode [style*="background: #f1f5f9"],
.dark-mode [style*="background:#f1f5f9"],
.dark-mode [style*="background: white"],
.dark-mode [style*="background:white"],
.dark-mode [style*="background-color: #fff"],
.dark-mode [style*="background-color:#fff"],
.dark-mode [style*="background-color: #ffffff"],
.dark-mode [style*="background-color:#ffffff"],
.dark-mode [style*="background-color: #f8f9fa"],
.dark-mode [style*="background-color:#f8f9fa"],
.dark-mode [style*="background-color: #f8fafc"],
.dark-mode [style*="background-color:#f8fafc"],
.dark-mode [style*="background-color: #f1f5f9"],
.dark-mode [style*="background-color:#f1f5f9"],
.dark-mode [style*="background-color: white"],
.dark-mode [style*="background-color:white"],
.dark-mode [style*="background: rgb(255, 255, 255)"],
.dark-mode [style*="background-color: rgb(255, 255, 255)"],
.dark-mode [style*="background: rgb(248, 249, 250)"],
.dark-mode [style*="background-color: rgb(248, 249, 250)"],
.dark-mode [style*="background: rgb(248, 250, 252)"],
.dark-mode [style*="background-color: rgb(248, 250, 252)"] {
    background: var(--bg-white) !important;
    background-color: var(--bg-white) !important;
}

.dark-mode .card,
.dark-mode .card-header,
.dark-mode .card-footer,
.dark-mode .modal-content,
.dark-mode .offcanvas,
.dark-mode .list-group-item,
.dark-mode .accordion-item,
.dark-mode .table,
.dark-mode .table-light,
.dark-mode .table-light th,
.dark-mode .table-light td,
.dark-mode .bg-white,
.dark-mode .bg-light,
.dark-mode .bg-body,
.dark-mode .bg-body-tertiary,
.dark-mode .dropdown-menu,
.dark-mode .popover,
.dark-mode [class*="-card"],
.dark-mode [class*=" card"],
.dark-mode [class*="-panel"],
.dark-mode [class*=" panel"],
.dark-mode [class*="-box"],
.dark-mode [class*=" box"] {
    background-color: var(--bg-white) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

.dark-mode [style*="border-color: #e5e7eb"],
.dark-mode [style*="border-color:#e5e7eb"],
.dark-mode [style*="border-color: #dee2e6"],
.dark-mode [style*="border-color:#dee2e6"] {
    border-color: var(--border-color) !important;
}

