@media (max-width: 768px) {
    .sidebar.show {
        z-index: 1051;
    }
}
.sidebar.collapsed .sidebar-nav ul li a {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 12px 0 !important;
}
.sidebar.collapsed .nav-icon {
    display: block !important;
    text-align: center !important;
    margin: 0 auto 0 auto !important;
    font-size: 1.3em !important;
}
.sidebar.collapsed .sidebar-text {
    display: block !important;
    text-align: center !important;
    font-size: 0.6rem !important;
    margin: 2px 0 0 0 !important;
    line-height: 1.1 !important;
    font-weight: 500 !important;
    word-break: break-word !important;
    white-space: normal !important;
    max-width: 48px !important;
    overflow-wrap: break-word !important;
}
.sidebar.collapsed .nav-icon {
    display: block !important;
    text-align: center !important;
    margin: 0 auto !important;
}
/* Notification popover item separation */
#notificationPopover .notification-item {
    border-bottom: 1px solid #eee;
    padding: 0.75em 1em;
    margin-bottom: 0;
    background: #fff;
}
#notificationPopover .notification-item:last-child {
    border-bottom: none;
}
/* Ensure consistent header size across all modules */
.top-header h2 {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
    color: #212529 !important;
}
.top-header {
    margin-left: 0;
    width: 100%;
    transition: margin-left 0.3s;
}
.main-content {
    margin-left: 210px;
    transition: margin-left 0.3s;
}
.sidebar.collapsed ~ .main-content {
    margin-left: 60px !important;
}
.sidebar.collapsed {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    overflow-x: hidden;
    transition: width 0.3s;
}
/* Modern DataTable Custom Table Styling */
.custom-table {
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    color: #000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.custom-table th, .custom-table td {
    vertical-align: middle;
    border-color: #e5e5e5;
    font-size: 12px;
}
.custom-table thead {
    background: #000;
    color: #fff;
    font-size: 13px;
}
.custom-table tbody tr:hover {
    background: #f5f5f5;
}

/* DataTables integration for black & white theme */
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #000;
    border-radius: 6px;
    background: #fff;
    color: #000;
    padding: 4px 8px;
}
.dataTables_wrapper .dataTables_length select {
    border: 1px solid #000;
    border-radius: 6px;
    background: #fff;
    color: #000;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border: 1px solid #000;
    border-radius: 4px;
    background: #fff;
    color: #000 !important;
    margin: 0 2px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #000 !important;
    color: #fff !important;
}
.dataTables_wrapper .dataTables_info {
    color: #333;
}
/* Momentum Theme - Bootstrap Override */

/* Global Styles */
body {
    font-family: Calibri, sans-serif;
    font-size: 14px;
    background-color: #f8f9fa;
}

/* Layout Wrapper */
.layout-wrapper {
    display: flex;
    min-height: 0;
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 210px;
    height: 100vh;
    background: #f5f5f5;
    color: #333;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    border-right: 1px solid #ddd;
}

.sidebar-header {
    padding: 1.75rem 1.5rem;
    background: #e8e8e8;
    border-bottom: 1px solid #ddd;
    text-align: center;
}

.sidebar-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin: 0;
    color: #333;
}

.sidebar-logo {
    max-width: 180px;
    height: auto;
    max-height: 70px;
    display: block;
    margin: 0 auto;
    border: none;
    outline: none;
    background: transparent;
    object-fit: contain;
}

.sidebar-nav {
    padding: 0;
}

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

.sidebar-nav li {
    margin: 0;
}

.nav-section-title {
    padding: 1rem 1.5rem 0.5rem;
    color: #666;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: #555;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background-color: #e8e8e8;
    color: #000;
    border-left-color: #000000;
}

.sidebar-nav a.active {
    background-color: #ddd;
    color: #000;
    border-left-color: #000000;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid #ddd;
    margin-top: auto;
}

/* Main Content Area */
.main-content {
    margin-left: 210px;
    min-height: 100vh;
    background-color: #f8f9fa;
    display: block;
    width: calc(100% - 210px);
    transition: margin-left 0.3s ease, width 0.3s ease;
    margin-top: 0;
    margin-bottom: 0;
}

.top-header {
    background: white;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.top-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: #212529;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Search Bar */
.search-container {
    position: relative;
}

.search-input {
    width: 300px;
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #000000;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
    width: 350px;
}

.search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
}

.search-results.show {
    display: block;
}

.search-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.search-result-item:hover {
    background-color: #f8f9fa;
}

.search-result-title {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.search-result-subtitle {
    font-size: 0.8rem;
    color: #6c757d;
}

.search-no-results {
    padding: 1rem;
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
}

.content-wrapper {
    padding: 0.5rem 1rem 0.5rem 1rem;
    width: 100%;
    max-width: 100%;
}

.container-fluid {
    max-width: 100%;
    width: 100%;
    padding: 0;
}

/* Profile Section */
.profile-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    position: relative;
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #212529;
}

.profile-role {
    font-size: 0.75rem;
    color: #6c757d;
}

.profile-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #666 0%, #333 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
    overflow: hidden;
}

.profile-avatar:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    display: none;
    min-width: 160px;
    z-index: 1000;
}

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

.profile-dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: #212529;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.profile-dropdown a:hover {
    background-color: #f8f9fa;
}

/* Badge Customizations */
.badge-priority-critical {
    background-color: #dc3545;
    color: white;
}

.badge-priority-high {
    background-color: #ffc107;
    color: #212529;
}

.badge-priority-medium {
    background-color: #b66a2c;
    color: #212529;
}

.badge-priority-low {
    background-color: #6c757d;
    color: white;
}

.badge-active {
    background-color: #198754;
    color: white;
}

.badge-inactive {
    background-color: #dc3545;
    color: white;
}

/* Table Sorting */
.table thead th a {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: inherit !important;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.table thead th a:hover {
    color: #000000 !important;
}

.table thead th {
    cursor: pointer;
    user-select: none;
}

/* Active Navigation Indicator */
.sidebar-nav a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #000000 0%, #222222 100%);
    box-shadow: 0 0 8px rgba(13, 110, 253, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 8px rgba(13, 110, 253, 0.5);
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 12px rgba(13, 110, 253, 0.7);
    }
}

.sidebar-nav a {
    position: relative;
}

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
    background: transparent;
    border: none;
    color: #333;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle-btn:hover {
    background: #f0f0f0;
    color: #000;
}

.sidebar-toggle-btn svg {
    width: 24px;
    height: 24px;
}

/* Sidebar Collapsed State */
.sidebar.collapsed {
    width: 70px !important;
    transition: width 0.3s ease;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-logo {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sidebar.collapsed .nav-text {
    display: none !important;
    opacity: 0;
    width: 0;
}

.sidebar.collapsed .nav-icon {
    font-size: 1.5rem;
    margin-right: 0;
}

.sidebar.collapsed .sidebar-nav a {
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-nav a:hover .nav-text {
    display: none !important;
}

.sidebar.collapsed .nav-section-title {
    display: none;
}

.sidebar.collapsed + .main-content,
.main-content.sidebar-collapsed {
    margin-left: 70px !important;
    width: calc(100% - 70px) !important;
    transition: all 0.3s ease;
}

/* Navigation icons and text */
.nav-icon {
    display: inline-block;
    margin-right: 8px;
}

.nav-text {
    display: inline-block;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 900;
}

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

@media (max-width: 768px) {
    .sidebar.collapsed {
        width: 220px;
    }
    
    .sidebar.collapsed + .main-content {
        margin-left: 0;
        width: 100%;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-210px);
        transition: transform 0.3s ease;
        z-index: 1050;
    }
    .sidebar.show {
        transform: translateX(0);
        z-index: 1051;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .top-header h2 {
        font-size: 1.25rem;
    }
    
    .header-actions {
        gap: 0.5rem;
    }
    
    .search-container {
        display: none;
    }
    
    .profile-info {
        display: none;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .d-flex.gap-2 {
        flex-direction: column;
        gap: 0.5rem !important;
    }
}

@media (max-width: 576px) {
    .col-md-2, .col-md-3, .col-md-4, .col-md-6 {
        margin-bottom: 0.5rem;
    }
    
    .display-6 {
        font-size: 1.5rem;
    }
    
    .btn-sm {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Custom Modal Styles */
.custom-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.custom-modal-content {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    animation: slideDown 0.3s ease;
}

.custom-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.custom-modal-header h5 {
    margin: 0;
    font-weight: 600;
    font-size: 1.25rem;
    color: #1E2A38;
}

.custom-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.custom-modal-close:hover {
    background-color: #f8f9fa;
    color: #000;
}

.custom-modal-body {
    padding: 1.5rem;
    font-size: 1rem;
    color: #495057;
}

.custom-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.custom-modal-footer .btn {
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.custom-modal-footer .btn-secondary {
    background-color: #6c757d;
    color: white;
}

.custom-modal-footer .btn-secondary:hover {
    background-color: #5a6268;
}

.custom-modal-footer .btn-danger {
    background-color: #dc3545;
    color: white;
}

.custom-modal-footer .btn-danger:hover {
    background-color: #bb2d3b;
}

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

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
/* Message Popup Styles */
.message-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 500px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.message-popup.show {
    opacity: 1;
    transform: translateX(0);
}

.message-popup-content {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 12px;
}

.message-popup-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-popup-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.message-popup-close {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-popup-close:hover {
    color: #333;
}

/* Message Types */
.message-popup.message-success {
    border-left: 4px solid #198754;
}

.message-popup.message-success .message-popup-icon {
    color: #198754;
}

.message-popup.message-danger,
.message-popup.message-error {
    border-left: 4px solid #dc3545;
}

.message-popup.message-danger .message-popup-icon,
.message-popup.message-error .message-popup-icon {
    color: #dc3545;
}

.message-popup.message-warning {
    border-left: 4px solid #ffc107;
}

.message-popup.message-warning .message-popup-icon {
    color: #ffc107;
}

.message-popup.message-info {
    border-left: 4px solid #b66a2c;
}

.message-popup.message-info .message-popup-icon {
    color: #0dcaf0;
}.message-popup.message-warning .message-popup-icon {
    color: #ffc107;
}

.message-popup.message-info {
    border-left: 4px solid #0dcaf0;
}

.message-popup.message-info .message-popup-icon {
    color: #0dcaf0;
}

/* Responsive adjustments for message popups */
@media (max-width: 768px) {
    .message-popup {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
}

/* Card and Section Styling - Global Gray Theme */
.card {
    background: #f5f5f5!important;
    border: 1px solid #ddd !important;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.card-body {
    background: #f5f5f5;
}

.section {
    background: #f5f5f5 !important;
    border: 1px solid #ddd !important;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}

.stat-card {
    background: #f5f5f5 !important;
    border: 1px solid #ddd !important;
}
