/* Custom Properties */
:root {
    --primary-light: #5B74BC;
    --primary: #4C60A7;
    --primary-dark: #292A64;
    --background: #FFFFFF;
    --surface: #E9E9EC;
    --divider: #D1D1D6;
    --text-primary: #424242;
    --text-secondary: #757575;

    /* Derived colors */
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #3498db;
    --sidebar-width: 280px;
    --transition-speed: 0.3s;
}

/* Dark mode variables */
[data-theme="dark"] {
    --primary-light: #7B94DC;
    --primary: #5B74BC;
    --primary-dark: #4C60A7;
    --background: #1a1a1a;
    --surface: #3a3a3a;
    --divider: #404040;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;

    /* Dark mode specific */
    --body-bg: #1a1a1a;
    --body-color: #e0e0e0;
    --card-bg: #2d2d2d;
    --border-color: #404040;
    --navbar-bg: #2d2d2d;
    --table-bg: #2d2d2d;
    --table-hover-bg: #3a3a3a;
    --dropdown-bg: #2d2d2d;
    --dropdown-color: #e0e0e0;
    --input-bg: #3a3a3a;
    --input-color: #e0e0e0;
    --input-border: #505050;
    --sidebar-gradient-start: #3a3d7a;
    --sidebar-gradient-end: #292A64;
}

/* Light mode variables (default) */
[data-theme="light"] {
    --body-bg: #FFFFFF;
    --body-color: #424242;
    --card-bg: #FFFFFF;
    --border-color: #D1D1D6;
    --navbar-bg: #FFFFFF;
    --table-bg: #FFFFFF;
    --table-hover-bg: #E9E9EC;
    --dropdown-bg: #FFFFFF;
    --dropdown-color: #424242;
    --input-bg: #FFFFFF;
    --input-color: #424242;
    --input-border: #D1D1D6;
    --sidebar-gradient-start: #4C60A7;
    --sidebar-gradient-end: #292A64;
}

/* Base Styles */
body {
    background-color: var(--body-bg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--body-color);
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* Loader */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

[data-theme="dark"] .loader {
    background: rgba(0, 0, 0, 0.9);
}

.loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner-border.text-primary {
    color: var(--primary) !important;
}

/* Enhanced Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(135deg, var(--sidebar-gradient-start) 0%, var(--sidebar-gradient-end) 100%);
    color: #ffffff;
    z-index: 1045;
    overflow-y: auto;
    transition: transform var(--transition-speed) ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

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

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

.sidebar-header {
    background-color: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
}

.sidebar-header h5 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sidebar-header .btn-close {
    filter: invert(1);
    opacity: 0.8;
    transition: opacity var(--transition-speed);
}

.sidebar-header .btn-close:hover {
    opacity: 1;
}

/* Navigation Links with Icons */
.sidebar-body .nav-link {
    color: rgba(255, 255, 255, 0.9);
    padding: 14px 24px;
    border-radius: 0;
    transition: all var(--transition-speed) ease;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.sidebar-body .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.sidebar-body .nav-link:hover::before {
    left: 100%;
}

.sidebar-body .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding-left: 30px;
}

.sidebar-body .nav-link.active {
    background-color: var(--primary-light);
    color: #ffffff;
    border-left: 4px solid #ffffff;
    font-weight: 500;
}

.sidebar-body .nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* Sidebar Accordion Customization */
.sidebar .accordion-button {
    color: rgba(255, 255, 255, 0.9);
}

.sidebar .accordion-button:not(.collapsed) {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.sidebar .accordion-button:focus {
    box-shadow: none;
}

.sidebar .accordion-button::after {
    filter: invert(1) brightness(2);
}

.sidebar .accordion-body {
    background-color: transparent;
    padding: 0;
}

.sidebar .accordion-body .nav-link {
    padding-left: 3.5rem; /* Indent sub-menu items */
    font-size: 0.9rem;
}

.sidebar .accordion-body .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.sidebar .accordion-body .nav-link.active {
    background-color: var(--primary);
    border-left: 4px solid #ffffff;
    font-weight: 500;
}


/* Section Headers */
.sidebar-section {
    padding: 20px 24px 10px;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    letter-spacing: 1.5px;
    margin-top: 10px;
}

/* Enhanced Top Navigation */
.navbar {
    background: var(--navbar-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--divider);
    transition: all var(--transition-speed);
    color: var(--body-color);
}

[data-theme="light"] .navbar {
    background-color: #FFFFFF;
}

[data-theme="dark"] .navbar {
    background: linear-gradient(135deg, var(--sidebar-gradient-start) 0%, var(--sidebar-gradient-end) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .navbar-brand {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.navbar-toggler {
    border: 1px solid var(--primary-light);
    color: var(--primary-light);
    background-color: rgba(91, 116, 188, 0.1);
}

.navbar-toggler:hover {
    background-color: rgba(91, 116, 188, 0.2);
    border-color: var(--primary-light);
}

[data-theme="light"] .navbar-toggler {
    border-color: var(--divider);
}

[data-theme="light"] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0, 0, 0, 0.75)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

[data-theme="dark"] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.75)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    filter: none;
}

/* Breadcrumb styling for navbar - make it super visible */
.navbar .breadcrumb {
    background: transparent;
    margin: 0;
}

[data-theme="dark"] .navbar .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.navbar .breadcrumb-item a:hover {
    color: #ffffff;
}

[data-theme="dark"] .navbar .breadcrumb-item.active {
    color: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .navbar .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

[data-theme="light"] .navbar .breadcrumb-item a {
    color: var(--text-secondary);
}

[data-theme="light"] .navbar .breadcrumb-item a:hover {
    color: var(--text-primary);
}

[data-theme="light"] .navbar .breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
}

/* Search bar styling for navbar - make it super visible */
/*.navbar .search-bar {*/
/*    position: relative;*/
/*}*/

/*.navbar .search-bar .form-control {*/
/*    background-color: rgba(255, 255, 255, 0.95);*/
/*    border: 1px solid rgba(255, 255, 255, 0.95);*/
/*    color: var(--primary-dark);*/
/*    border-radius: 25px;*/
/*    padding: 0.5rem 1rem 0.5rem 2.5rem;*/
/*    backdrop-filter: blur(10px);*/
/*    font-weight: 500;*/
/*}*/

/*.navbar .search-bar .form-control::placeholder {*/
/*    color: var(--primary-dark);*/
/*    opacity: 0.7;*/
/*}*/

/*.navbar .search-bar .form-control:focus {*/
/*    background-color: #ffffff;*/
/*    border-color: #ffffff;*/
/*    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.3);*/
/*    color: var(--primary-dark);*/
/*}*/

/*.navbar .search-bar .search-icon {*/
/*    position: absolute;*/
/*    left: 0.75rem;*/
/*    top: 50%;*/
/*    transform: translateY(-50%);*/
/*    color: var(--primary-dark);*/
/*    z-index: 2;*/
/*}*/

/* Theme Switcher - Single button design */
.theme-switcher {
    display: flex;
    align-items: center;
    padding: 0.25rem;
    /*background-color: rgba(255, 255, 255, 0.15);*/
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.theme-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    /*border: 2px solid transparent;*/
    /*background: rgba(255, 255, 255, 0.2);*/
    /*color: rgba(255, 255, 255, 0.9);*/
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-speed);
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.theme-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
    transform: scale(1.05);
}

.theme-toggle-btn:active {
    transform: scale(0.95);
}

/* Theme-specific button styling */
[data-theme="light"] .theme-toggle-btn {
    background: rgba(76, 96, 167, 0.9);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(76, 96, 167, 0.3);
    border: 2px solid rgba(76, 96, 167, 0.3);
}

[data-theme="light"] .theme-toggle-btn:hover {
    background: rgba(76, 96, 167, 1);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(76, 96, 167, 0.4);
    transform: scale(1.05);
}

[data-theme="dark"] .theme-toggle-btn {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 1);
    color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

/* System theme styling */
[data-theme="system"] .theme-toggle-btn {
    background: rgba(128, 128, 128, 0.9);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(128, 128, 128, 0.3);
    border: 2px solid rgba(128, 128, 128, 0.3);
}

[data-theme="system"] .theme-toggle-btn:hover {
    background: rgba(128, 128, 128, 1);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(128, 128, 128, 0.4);
    transform: scale(1.05);
}

/* Ensure theme switcher is always visible */
.theme-switcher {
    z-index: 1000;
    position: relative;
}

/* Theme switching animation */
.theme-toggle-btn i {
    transition: transform var(--transition-speed) ease;
}

.theme-toggle-btn:hover i {
    transform: rotate(15deg);
}

.theme-toggle-btn:active i {
    transform: rotate(-15deg) scale(0.9);
}

/* Notification Dropdown */
.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    width: 380px;
    background-color: var(--dropdown-bg);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-speed);
    z-index: 1050;
    border: 1px solid var(--divider);
}

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

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

.notification-header h6 {
    margin: 0;
    font-weight: 600;
    color: var(--body-color);
}

[data-theme="dark"] .notification-header h6 {
    color: #ffffff;
}

.notification-badge-count {
    background-color: var(--primary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

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

.notification-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--transition-speed);
    cursor: pointer;
}

.notification-item:hover {
    background-color: var(--table-hover-bg);
}

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

.notification-item.unread {
    background-color: rgba(91, 116, 188, 0.05);
    border-left: 3px solid var(--primary-light);
}

[data-theme="dark"] .notification-item.unread {
    background-color: rgba(91, 116, 188, 0.1);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.notification-icon.success {
    background-color: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
}

.notification-icon.warning {
    background-color: rgba(243, 156, 18, 0.1);
    color: var(--warning-color);
}

.notification-icon.info {
    background-color: rgba(91, 116, 188, 0.1);
    color: var(--primary-light);
}

.notification-icon.danger {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
}

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

.notification-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--body-color);
}

[data-theme="dark"] .notification-title {
    color: #ffffff;
}

.notification-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.notification-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.notification-footer a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
    /*border: 2px solid rgba(255, 255, 255, 0.3);*/
    backdrop-filter: blur(10px);
    transition: all var(--transition-speed);
}

[data-theme="light"] .user-avatar {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--divider);
}

[data-theme="light"] .user-avatar:hover {
    border-color: var(--primary);
    background: var(--card-bg);
    color: var(--primary);
}

.user-avatar:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.2) 100%);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

/* Enhanced Cards */
.dashboard-card {
    border-radius: 12px;
    padding: 1.75rem;
    color: white;
    margin-bottom: 1.5rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    transform: rotate(45deg);
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.dashboard-card h3 {
    font-size: 2.5rem;
    font-weight: 300;
    margin: 0.5rem 0 0;
    position: relative;
    z-index: 1;
}

.dashboard-card p {
    margin: 0;
    opacity: 0.95;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.dashboard-card .card-icon {
    position: absolute;
    right: 20px;
    bottom: 20px;
    font-size: 4rem;
    opacity: 0.2;
}

/* Table Enhancements */
.table-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: box-shadow var(--transition-speed), background-color var(--transition-speed);
    border: 1px solid var(--divider);
}

[data-theme="dark"] .table-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.table-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.table-card-header {
    background-color: var(--surface);
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

[data-theme="dark"] .table-card-header {
    background-color: rgba(255, 255, 255, 0.08);
}

.table-card-header h5 {
    margin: 0;
    color: var(--body-color);
    font-weight: 600;
}

[data-theme="dark"] .table-card-header h5 {
    color: #ffffff;
}

.table {
    margin-bottom: 0;
    color: var(--body-color);
}

.table th {
    background-color: var(--surface);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-secondary);
    padding: 1rem;
}

[data-theme="dark"] .table th {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    background-color: var(--table-bg);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .table td {
    color: var(--body-color);
}

.table tbody tr {
    transition: background-color var(--transition-speed);
}

.table tbody tr:hover {
    background-color: var(--table-hover-bg);
}

/* Status Badges */
.status-badge {
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Button Styles */
.btn-light {
    background-color: var(--surface);
    border-color: var(--divider);
    color: var(--text-primary);
}

.btn-light:hover {
    background-color: var(--card-bg);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

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

.btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--divider);
}

.btn-outline-secondary:hover {
    background-color: var(--text-secondary);
    border-color: var(--text-secondary);
    color: white;
}

[data-theme="dark"] .btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--text-secondary);
}

[data-theme="dark"] .btn-outline-secondary:hover {
    background-color: var(--text-secondary);
    color: var(--background);
}

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

.btn-outline-success:hover {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

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

.btn-outline-danger:hover {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

.btn-action {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 6px;
    transition: all var(--transition-speed);
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Welcome Section */
.welcome-section {
    background: linear-gradient(135deg, var(--surface) 0%, var(--card-bg) 100%);
    border-radius: 12px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--divider);
}

.welcome-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(91, 116, 188, 0.05) 0%, transparent 70%);
    transform: rotate(45deg);
}

.welcome-section h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

[data-theme="dark"] .welcome-section h1 {
    color: #ffffff;
}

.welcome-section p {
    color: var(--text-secondary);
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

/* Notification Badge */
.notification-badge {
    position: relative;
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    backdrop-filter: blur(10px);
    transition: all var(--transition-speed);
}

[data-theme="light"] .notification-badge {
    background-color: var(--surface);
    border: 1px solid var(--divider);
    color: var(--text-secondary);
}

[data-theme="light"] .notification-badge:hover {
    background-color: var(--card-bg);
    border-color: var(--primary);
    color: var(--primary);
}

[data-theme="light"] .notification-badge:hover .notification-count {
    border-color: var(--card-bg);
}

.notification-badge:hover {
    background-color: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.95);
    color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.notification-badge .notification-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: var(--danger-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    border: 2px solid var(--navbar-bg);
    transition: all var(--transition-speed);
}

/* Search Bar */
/*.search-bar {*/
/*    position: relative;*/
/*    min-width: 200px;*/
/*    max-width: 400px;*/
/*    flex: 1;*/
/*}*/

/*.search-bar input {*/
/*    width: 100%;*/
/*    padding: 0.5rem 2.5rem 0.5rem 1rem;*/
/*    border: 1px solid var(--border-color);*/
/*    border-radius: 20px;*/
/*    background-color: var(--input-bg);*/
/*    color: var(--input-color);*/
/*    transition: all var(--transition-speed);*/
/*}*/

/*.search-bar input::placeholder {*/
/*    color: var(--text-secondary);*/
/*}*/

/*.search-bar input:focus {*/
/*    outline: none;*/
/*    border-color: var(--primary);*/
/*    box-shadow: 0 0 0 3px rgba(91, 116, 188, 0.1);*/
/*}*/

/*.search-bar .search-icon {*/
/*    position: absolute;*/
/*    right: 0.75rem;*/
/*    top: 50%;*/
/*    transform: translateY(-50%);*/
/*    color: var(--text-secondary);*/
/*    pointer-events: none;*/
/*}*/

/* Mobile Search Toggle */
/*.mobile-search-toggle {*/
/*    display: none;*/
/*    background-color: rgba(255, 255, 255, 0.15);*/
/*    border: 1px solid rgba(255, 255, 255, 0.2);*/
/*    color: #ffffff;*/
/*    backdrop-filter: blur(10px);*/
/*}*/

/*.mobile-search-toggle:hover {*/
/*    background-color: rgba(255, 255, 255, 0.2);*/
/*    border-color: rgba(255, 255, 255, 0.4);*/
/*}*/

/* Main Content */
.main-content {
    min-height: 84.6vh;
    background-color: var(--body-bg);
    transition: background-color var(--transition-speed);
}

/* Dropdown Menus */
.dropdown-menu {
    background-color: var(--dropdown-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.dropdown-item {
    color: var(--dropdown-color);
    transition: all var(--transition-speed);
}

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

[data-theme="dark"] .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--primary-light);
}

.dropdown-divider {
    border-color: var(--border-color);
}

/* User dropdown styling - make text super visible */
.dropdown-header {
    background-color: rgba(255, 255, 255, 0.95);
    color: var(--primary-dark);
    padding: 1rem 1.25rem;
}

.dropdown-header strong {
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 1rem;
}

.dropdown-header small {
    color: var(--primary-dark) !important;
    font-weight: 500;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Override Bootstrap's text-muted and text-black-50 */
.dropdown-header .text-muted,
.dropdown-header .text-black-50 {
    color: var(--primary-dark) !important;
    opacity: 0.8 !important;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.quick-action-btn {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    background-color: var(--card-bg);
    transition: all var(--transition-speed);
    text-decoration: none;
    color: var(--body-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--divider);
}

[data-theme="dark"] .quick-action-btn {
    color: #ffffff;
}

.quick-action-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: var(--primary);
}

.quick-action-btn i {
    font-size: 1.25rem;
    color: var(--primary);
}

/* Breadcrumb Enhancement */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-speed);
}

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

.breadcrumb-item.active {
    color: var(--text-secondary);
}

[data-theme="dark"] .breadcrumb-item.active {
    color: #ffffff;
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: 8px;
}

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, var(--surface) 25%, var(--card-bg) 50%, var(--surface) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Custom Tooltips */
.custom-tooltip {
    position: relative;
    cursor: help;
}

.custom-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background-color: var(--primary-dark);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    transition: all var(--transition-speed);
    pointer-events: none;
}

.custom-tooltip:hover::after {
    transform: translateX(-50%) scale(1);
    opacity: 1;
}

/* Footer */
footer {
    background-color: var(--surface);
    color: var(--text-secondary);
    border-top: 1px solid var(--divider);
}

[data-theme="dark"] footer {
    background-color: #232323;
    color: #ffffff;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] footer small {
    color: var(--text-secondary);
}

/* Custom gradients for dashboard cards */
.card-gradient-1 {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.card-gradient-2 {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
}

.card-gradient-3 {
    background: linear-gradient(135deg, #5B74BC 0%, #7B94DC 100%);
}

/* Footer Theming - Matches Sidebar */
.footer-themed {
    background: linear-gradient(135deg, var(--sidebar-gradient-start) 0%, var(--sidebar-gradient-end) 100%);
    color: #ffffff !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    transition: background var(--transition-speed) ease;
}

.footer-themed small {
    color: #ffffff !important;
    font-weight: 600;
    letter-spacing: 0.02em;
    font-size: 0.95rem;
    padding: 0.75rem 1.5rem;
}

.footer-themed .bi-fire {
    font-size: 1.1rem;
    color: var(--danger-color);
}

/* Auth buttons styling for non-authenticated users */
.auth-buttons .btn {
    backdrop-filter: blur(10px);
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    transition: all var(--transition-speed);
    border-width: 2px;
}

.auth-buttons .btn-outline-primary {
    background-color: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.95);
    color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .auth-buttons .btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
    background-color: transparent;
    box-shadow: none;
}

[data-theme="light"] .auth-buttons .btn-outline-primary:hover {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.auth-buttons .btn-primary {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    border: 2px solid var(--primary-light);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.auth-buttons .btn-primary:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Active state for current page */
.auth-buttons .btn-primary[href*="login"],
.auth-buttons .btn-primary[href*="signup"] {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    border-color: var(--primary-light);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.auth-buttons .btn-primary[href*="login"]:hover,
.auth-buttons .btn-primary[href*="signup"]:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ===== BOOTSTRAP 5.3.7 MEDIA QUERIES ===== */
/* Using Bootstrap 5.3.7 standard breakpoints for consistency */

/* X-Small devices (portrait phones, less than 576px) - Default styles */
/* No media query needed - these are the base styles */

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
    .quick-action-btn {
        flex: 1 1 calc(50% - 0.5rem);
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .theme-switcher {
        display: flex !important;
    }

    /*.search-bar {*/
    /*    display: block;*/
    /*    position: relative;*/
    /*    top: auto;*/
    /*    left: auto;*/
    /*    right: auto;*/
    /*    margin-top: 0;*/
    /*    padding: 0;*/
    /*    background-color: transparent;*/
    /*    box-shadow: none;*/
    /*    z-index: auto;*/
    /*}*/
    /*.mobile-search-toggle {*/
    /*    display: none;*/
    /*}*/
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .sidebar {
        transform: translateX(0) !important;
    }

    .main-content {
        margin-left: var(--sidebar-width);
        transition: margin-left var(--transition-speed) ease;
    }

    .navbar-toggler {
        display: none;
    }

    .sidebar-header .btn-close {
        display: none;
    }
}

/* X-Large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .notification-dropdown {
        width: 380px;
        right: 0;
    }
}

/* XX-Large devices (larger desktops, 1400px and up) */
@media (min-width: 1400px) {
    .dashboard-card h3 {
        font-size: 2.75rem;
    }

    .welcome-section h1 {
        font-size: 2.25rem;
    }
}

/* ===== MAX-WIDTH MEDIA QUERIES (Bootstrap 5.3.7 style) ===== */

/* Small devices (landscape phones, less than 768px) */
@media (max-width: 767.98px) {
    .navbar {
        padding: 0.75rem 1rem;
    }

    .user-menu {
        gap: 0.5rem;
    }

    .breadcrumb {
        display: none !important;
    }

    .table-responsive {
        font-size: 0.875rem;
    }

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

    .table td {
        padding: 0.75rem 0.5rem;
    }

    .status-badge {
        font-size: 0.7rem;
        padding: 4px 8px;
    }

    .btn-action {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    /*.search-bar {*/
    /*    display: none;*/
    /*    position: absolute;*/
    /*    top: 100%;*/
    /*    left: 0;*/
    /*    right: 0;*/
    /*    margin-top: 0.5rem;*/
    /*    padding: 0 1rem;*/
    /*    background-color: var(--navbar-bg);*/
    /*    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);*/
    /*    z-index: 1000;*/
    /*}*/
    /*.search-bar.show {*/
    /*    display: block;*/
    /*}*/
    /*.mobile-search-toggle {*/
    /*    display: block;*/
    /*}*/
    /* Theme switcher mobile responsiveness - consolidated here */
    .theme-switcher {
        padding: 0.2rem;
    }

    .theme-toggle-btn {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .theme-toggle-btn:hover {
        transform: none; /* Disable hover effects on mobile */
    }
}

/* Medium devices (tablets, less than 992px) */
@media (max-width: 991.98px) {
    .table .d-none-mobile {
        display: none;
    }

    .sidebar {
        transform: translateX(-100%);
    }

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

    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        display: none;
    }

    .sidebar.show + .sidebar-backdrop {
        display: block;
    }

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

    .notification-dropdown {
        width: 320px;
        right: -60px;
    }
}

/* X-Small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    .dashboard-card {
        padding: 1.25rem;
    }

    .dashboard-card h3 {
        font-size: 2rem;
    }

    .dashboard-card .card-icon {
        font-size: 3rem;
    }

    .welcome-section {
        padding: 1.5rem;
    }

    .welcome-section h1 {
        font-size: 1.5rem;
    }

    .quick-actions {
        flex-wrap: wrap;
    }

    .quick-action-btn {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 140px;
    }

    .table-card {
        margin: 0 -1rem;
        border-radius: 0;
    }

    .theme-switcher {
        display: none;
    }

    /*.notification-dropdown {*/
    /*    width: calc(100vw - 2rem);*/
    /*    left: 50%;*/
    /*    right: auto;*/
    /*    transform: translateX(-50%);*/
    /*}*/
    /*.notification-dropdown.show {*/
    /*    transform: translateX(-50%) translateY(0);*/
    /*}*/
    .notification-dropdown,
    .notification-dropdown.show {
        /*margin-left: auto !important;*/
        /*margin-right: auto !important;*/
        width: calc(100vw - 2rem);
        right: -60px;
    }
}

/* Large devices (desktops, less than 1200px) */
@media (max-width: 1199.98px) {
    .notification-dropdown {
        width: 350px;
    }
}

/* X-Large devices (large desktops, less than 1400px) */
@media (max-width: 1399.98px) {
    .dashboard-card h3 {
        font-size: 2.25rem;
    }

    .welcome-section h1 {
        font-size: 1.875rem;
    }
}