.ck-editor__editable,
textarea {
    min-height: 150px;
}

.datatable {
    width: 100% !important;
}

table.dataTable tbody td.select-checkbox::before,
table.dataTable tbody td.select-checkbox::after,
table.dataTable tbody th.select-checkbox::before,
table.dataTable tbody th.select-checkbox::after {
    top: 50%;
}

.dataTables_length,
.dataTables_filter,
.dt-buttons {
    margin-bottom: 0.333em;
}

.dt-buttons .btn {
    margin-left: 0.333em;
    border-radius: 0;
}

.table.datatable {
    box-sizing: border-box;
    border-collapse: collapse;
}

table.dataTable thead th {
    border-bottom: 2px solid #dee2e6;
}

.dataTables_wrapper.no-footer .dataTables_scrollBody {
    border-bottom: 1px solid #dee2e6;
}

.select2 {
    max-width: 100%;
    width: 100%;
}

/* ============================================================
   Select2 Global Styling - Consistent across all pages
   Targets .select2-container--default (actual rendered classes)
   Overrides adminltev3.css select2 styles
   ============================================================ */

.select2-container {
    width: 100% !important;
}

/* Single select - match Bootstrap 4 form-control height & style */
.select2-container--default .select2-selection--single {
    height: calc(1.5em + 0.75rem + 2px) !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
    border: 1px solid #ced4da !important;
    border-radius: 0.25rem !important;
    background-color: #fff !important;
    display: flex !important;
    align-items: center !important;
}

/* Rendered text inside the select */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #495057 !important;
    line-height: 1.5 !important;
    padding-left: 0 !important;
    padding-right: 20px !important;
    margin-top: 0 !important;
}

/* Placeholder color */
.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #6c757d !important;
}

/* Arrow container */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100% !important;
    top: 0 !important;
    right: 8px !important;
    width: 20px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Arrow indicator - small clean caret */
.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #6c757d transparent transparent transparent !important;
    border-style: solid !important;
    border-width: 5px 4px 0 4px !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
}

/* Open state - flip arrow */
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #6c757d transparent !important;
    border-width: 0 4px 5px 4px !important;
}

/* Focus state */
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #80bdff !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
}

/* Dropdown panel */
.select2-container--default .select2-dropdown {
    border: 1px solid #ced4da !important;
    border-radius: 0.25rem !important;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1) !important;
    z-index: 9999 !important;
}

/* Search input inside dropdown */
.select2-container--default .select2-search--dropdown {
    padding: 6px 8px !important;
    background: #f8f9fa !important;
    border-bottom: 1px solid #dee2e6 !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #ced4da !important;
    border-radius: 0.25rem !important;
    padding: 0.3rem 0.6rem !important;
    font-size: 0.875rem !important;
    width: 100% !important;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: #80bdff !important;
    outline: 0 !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
}

/* Results list - fixed height with scrollbar */
.select2-container--default .select2-results__options {
    max-height: 250px !important;
    overflow-y: auto !important;
}

/* Scrollbar styling */
.select2-container--default .select2-results__options::-webkit-scrollbar {
    width: 6px;
}

.select2-container--default .select2-results__options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.select2-container--default .select2-results__options::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 4px;
}

.select2-container--default .select2-results__options::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

/* Individual option */
.select2-container--default .select2-results__option {
    padding: 0.4rem 0.75rem !important;
    font-size: 0.875rem !important;
}

/* Highlighted option */
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #007bff !important;
    color: #fff !important;
}

/* Selected option */
.select2-container--default .select2-results__option[aria-selected="true"] {
    background-color: #e9ecef !important;
    color: #495057 !important;
}

/* Disabled state */
.select2-container--default.select2-container--disabled .select2-selection--single {
    background-color: #e9ecef !important;
    cursor: not-allowed !important;
}

/* Multi-select */
.select2-container--default .select2-selection--multiple {
    min-height: calc(1.5em + 0.75rem + 2px) !important;
    border: 1px solid #ced4da !important;
    border-radius: 0.25rem !important;
    background-color: #fff !important;
    padding: 0.2rem 0.5rem !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #007bff !important;
    border: 1px solid #007bff !important;
    border-radius: 0.25rem !important;
    color: #fff !important;
    font-size: 0.8rem !important;
    padding: 0.15rem 0.5rem !important;
    margin: 0.1rem !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #fff !important;
    margin-right: 0.25rem !important;
}

/* Responsive */
@media (max-width: 768px) {
    .select2-container--default .select2-selection--single {
        font-size: 0.8rem !important;
    }
}

.select2-container {
    width: 100% !important;
}

.select2-container--bootstrap4 .select2-selection__placeholder {
    color: #6c757d;
}

table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc {
    background-image: none;
}

.btn-group-xs>.btn,
.btn-xs {
    padding: 1px 5px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 3px;
}

.searchable-title {
    font-weight: bold;
}

.select2-container--open {
    z-index: 9999;
}

.searchable-fields {
    padding-left: 5px;
}

.searchable-link {
    padding: 0 5px 0 5px;
}

.searchable-link:hover {
    cursor: pointer;
    background: #eaeaea;
}

.form-group .required::after {
    content: " *";
    color: red;
}

.form-check.is-invalid~.invalid-feedback {
    display: block;
}

.dataTables_length label select {
    width: 65px !important;
}

div.dt-button-collection {
    padding: 0;
}

.buttons-columnVisibility {
    display: block;
}

.buttons-columnVisibility.active {
    background-color: rgba(128, 128, 128, 0.1);
    font-weight: bolder;
}

/* Sidebar Menu Alignment Fixes */
.nav-sidebar .nav-link {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

.nav-sidebar .nav-link .nav-icon {
    margin-right: 0.5rem !important;
    width: 1.2rem !important;
    text-align: center !important;
}

.nav-sidebar .nav-link p {
    margin: 0 !important;
    padding: 0 !important;
}

/* Enhanced Sidebar Menu Styling */
.nav-sidebar .nav-item.has-treeview {
    position: relative;
}

.nav-sidebar .nav-item.has-treeview>.nav-link {
    background: transparent;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-sidebar .nav-item.has-treeview>.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: transparent;
}

.nav-sidebar .nav-item.has-treeview.menu-open>.nav-link {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: transparent;
    color: #ffffff;
}

.nav-sidebar .nav-item.has-treeview>.nav-link.active {
    background: #007bff;
    border-left-color: #03376e;
    color: #ffffff;
    font-weight: 600;
}

/* Submenu Styling */
.nav-sidebar .nav-treeview {
    background: rgba(0, 0, 0, 0.1);
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    margin-left: 0.5rem;
    border-radius: 0 4px 4px 0;
    padding: 0.25rem 0;
}

.nav-sidebar .nav-treeview .nav-item {
    position: relative;
}

.nav-sidebar .nav-treeview .nav-link {
    padding-left: 2.5rem !important;
    padding-right: 1rem !important;
    margin: 0.1rem 0.5rem;
    border-radius: 4px;
    background: transparent;
    border-left: 2px solid transparent;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    position: relative;
}

.nav-sidebar .nav-treeview .nav-link::before {
    content: '';
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.nav-sidebar .nav-treeview .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    border-left-color: transparent;
    transform: translateX(2px);
}

.nav-sidebar .nav-treeview .nav-link:hover::before {
    background: rgba(255, 255, 255, 0.6);
    transform: translateY(-50%) scale(1.2);
}

.nav-sidebar .nav-treeview .nav-link.active {
    background: #007bff;
    border-left-color: #03376e;
    color: #ffffff;
    font-weight: 500;
}

.nav-sidebar .nav-treeview .nav-link.active::before {
    background: #ffffff;
    transform: translateY(-50%) scale(1.3);
}

.nav-sidebar .nav-treeview .nav-link .nav-icon {
    margin-right: 0.75rem !important;
    width: 1rem !important;
    font-size: 0.85rem;
    opacity: 0.8;
}

.nav-sidebar .nav-treeview .nav-link:hover .nav-icon,
.nav-sidebar .nav-treeview .nav-link.active .nav-icon {
    opacity: 1;
}

/* Parent Menu Icon Styling */
.nav-sidebar .nav-item.has-treeview>.nav-link .nav-icon {
    font-size: 1.1rem;
    opacity: 0.9;
}

.nav-sidebar .nav-item.has-treeview>.nav-link:hover .nav-icon,
.nav-sidebar .nav-item.has-treeview>.nav-link.active .nav-icon {
    opacity: 1;
}

/* Dropdown Arrow Styling */
.nav-sidebar .nav-item.has-treeview>.nav-link .right.nav-icon {
    transition: transform 0.3s ease;
    font-size: 0.9rem;
    opacity: 0.7;
}

.nav-sidebar .nav-item.has-treeview.menu-open>.nav-link .right.nav-icon {
    transform: rotate(-90deg);
    opacity: 1;
}

/* Enhanced Visual Hierarchy */
.nav-sidebar .nav-item:not(.has-treeview)>.nav-link {
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.nav-sidebar .nav-item:not(.has-treeview)>.nav-link:hover {
    border-left-color: transparent;
    background: rgba(255, 255, 255, 0.05);
}

.nav-sidebar .nav-item:not(.has-treeview)>.nav-link.active {
    border-left-color: #03376e;
    background: #007bff;
    color: #ffffff;
    font-weight: 500;
}

/* Smooth Animation for Menu Open/Close */
.nav-sidebar .nav-treeview {
    display: none;
    overflow: hidden;
    transition: all 0.3s ease;
}

.nav-sidebar .nav-item.has-treeview.menu-open .nav-treeview {
    display: block;
}

/* Ensure dropdown stays open when menu-open class is present */
.nav-sidebar .nav-item.has-treeview.menu-open>.nav-treeview {
    display: block !important;
    opacity: 1;
    visibility: visible;
}

/* Add subtle shadow to submenu */
.nav-sidebar .nav-treeview {
    box-shadow: inset 2px 0 4px rgba(0, 0, 0, 0.1);
}

/* Sidebar Height and Overflow Fix */
.main-sidebar {
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1038;
}

.main-sidebar .sidebar {
    height: calc(100vh - 57px);
    /* Subtract header height */
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

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

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

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

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

/* Ensure sidebar nav doesn't exceed viewport */
.nav-sidebar {
    max-height: none;
    overflow: visible;
    min-height: auto;
}

/* Improve spacing and alignment */
.nav-sidebar .nav-treeview .nav-item {
    margin: 0.1rem 0;
}

.nav-sidebar .nav-treeview .nav-link p {
    font-size: 0.9rem;
    line-height: 1.3;
}

/* Brand Logo Fixes */
.brand-link {
    padding: 0.5rem 1rem !important;
}

.brand-image {
    border-radius: 0 !important;
    box-shadow: none !important;
    background: none !important;
    border: none !important;
}

/* Remove any oval/round styling from brand image */
.brand-image.img-circle {
    border-radius: 0 !important;
}

.brand-image.elevation-3 {
    box-shadow: none !important;
}

/* Sidebar Logo Styling */
.sidebar-logo-container {
    background: rgba(255, 255, 255, 0.1);
    margin: 0.5rem;
    border-radius: 0.25rem;
}

.sidebar-logo-container img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Stock Cards Styling */
.stock-card {
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.stock-card.border-success {
    border-color: #28a745 !important;
}

.stock-card.border-warning {
    border-color: #ffc107 !important;
}

.stock-card.border-danger {
    border-color: #dc3545 !important;
}

.stock-quantity {
    font-weight: bold;
    margin: 10px 0;
}

.stock-quantity h3 {
    font-size: 2rem;
    margin-bottom: 0;
}

/* Card Header Styling */
.stock-card .card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
}

.stock-card .card-header h6 {
    font-weight: 600;
    color: #495057;
}

/* Card Body Styling */
.stock-card .card-body {
    padding: 1rem;
}

.stock-card .card-footer {
    padding: 0.5rem 1rem;
    border-top: 1px solid #dee2e6;
}

/* Badge Styling */
.badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Search and Filter Section */
.form-group label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Pagination Styling */
.pagination .page-link {
    color: #007bff;
    border: 1px solid #dee2e6;
    padding: 0.5rem 0.75rem;
}

.pagination .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .stock-card .card-header h6 {
        font-size: 0.9rem;
    }

    .stock-quantity h3 {
        font-size: 1.5rem;
    }

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

@media (max-width: 576px) {
    .stock-card {
        margin-bottom: 1rem;
    }

    .stock-quantity h3 {
        font-size: 1.25rem;
    }
}

/* Loading Animation */
.stock-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.stock-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Empty State Styling */
.alert-info {
    border: none;
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

.alert-info i {
    color: #17a2b8;
}

/* Card Grid Animation */
#stock-cards .col-lg-3,
#stock-cards .col-md-4,
#stock-cards .col-sm-6 {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* AdminLTE Theme Consistency - Global Styles */
:root {
    --primary-color: #007bff;
    --primary-dark: #0056b3;
    --primary-light: #66b3ff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --sidebar-bg: #343a40;
    --sidebar-active: #007bff;
}

/* Consistent Card Styling */
.card {
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px 8px 0 0;
}

/* Consistent Button Styling */
.btn {
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Consistent Badge Styling */
.badge {
    border-radius: 4px;
    font-weight: 500;
}

/* Consistent Table Styling */
.table {
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.table thead th {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
    color: white !important;
    border: none !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
    padding: 12px 15px;
}

.table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
    transition: all 0.2s ease;
}

/* Override any conflicting AdminLTE table styles */
.table thead th,
.table thead td {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
    color: white !important;
    border: none !important;
}

/* Ensure table headers are always visible */
.table thead th {
    background-color: var(--primary-color) !important;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
    color: white !important;
    text-shadow: none !important;
}

/* Fix for DataTables styling */
.dataTable thead th {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
    color: white !important;
    border: none !important;
}

/* Fix for any AdminLTE table overrides */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.table-striped tbody tr:nth-of-type(even) {
    background-color: white;
}

/* Force table header visibility across all modules */
.table thead th,
.table thead td,
.dataTable thead th,
.dataTable thead td,
table thead th,
table thead td {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
    background-color: var(--primary-color) !important;
    color: white !important;
    border: none !important;
    text-shadow: none !important;
    font-weight: 600 !important;
}

/* Override any white background on table headers */
.table thead th[style*="background-color: white"],
.table thead th[style*="background: white"],
.dataTable thead th[style*="background-color: white"],
.dataTable thead th[style*="background: white"] {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
    background-color: var(--primary-color) !important;
    color: white !important;
}

/* Ensure table headers are visible in all contexts */
.content .table thead th,
.content .dataTable thead th,
.card .table thead th,
.card .dataTable thead th {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
    color: white !important;
    border: none !important;
}

/* Override AdminLTE table styling that might cause white text on white background */
.table thead th,
.table thead td {
    background-color: var(--primary-color) !important;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
    color: white !important;
    border: none !important;
}

/* Fix for any AdminLTE skin overrides */
.skin-blue .table thead th,
.skin-blue .table thead td,
.sidebar-dark-primary .table thead th,
.sidebar-dark-primary .table thead td {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
    color: white !important;
    border: none !important;
}

/* Ensure DataTables headers are visible */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_processing,
.dataTables_wrapper .dataTables_paginate {
    color: var(--dark-color) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--primary-color) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    color: white !important;
}

/* Consistent Alert Styling */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.alert-success {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: #ffffff;
    /* White text will stand out on darker green */
    border: 1px solid #1e7e34;
    /* Optional: add a darker border */
}


.alert-danger {
    background: linear-gradient(135deg, #ff0015 0%, #f5c6cb 100%);
    color: #ffffff;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

/* Consistent Form Styling */
.form-control {
    border-radius: 4px;
    border: 1px solid #ced4da;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Consistent Pagination */
.pagination .page-link {
    color: var(--primary-color);
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin: 0 2px;
}

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

.pagination .page-link:hover {
    color: var(--primary-dark);
    background-color: #e9ecef;
    border-color: #dee2e6;
}

/* Consistent Modal Styling */
.modal-content {
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 8px 8px;
}

/* Enhanced Modern UI Components */
.btn-group .btn {
    border-radius: 0;
    margin-right: 2px;
}

.btn-group .btn:first-child {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

.btn-group .btn:last-child {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
    margin-right: 0;
}

/* Enhanced Form Styling */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

.form-control {
    transition: all 0.2s ease;
}

.form-control:hover {
    border-color: #ced4da;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Enhanced Button Styling */
.btn {
    transition: all 0.2s ease;
    font-weight: 500;
}

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

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Enhanced Card Hover Effects */
.card {
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Enhanced Table Row Hover */
.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
    transform: scale(1.01);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Enhanced Badge Styling */
.badge {
    font-weight: 500;
    letter-spacing: 0.5px;
}

.badge-pill {
    border-radius: 50px;
    padding: 0.5rem 1rem;
}

/* Enhanced Alert Styling */
.alert {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: slideInDown 0.3s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Tooltip Styling */
.tooltip {
    font-size: 0.875rem;
}

.tooltip-inner {
    background-color: var(--dark-color);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
}

/* Enhanced Loading States */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Enhanced Focus States */
.btn:focus,
.form-control:focus,
.btn-group .btn:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Enhanced Responsive Design */
@media (max-width: 768px) {
    .btn-group {
        display: flex;
        flex-direction: column;
    }

    .btn-group .btn {
        border-radius: 4px !important;
        margin-right: 0 !important;
        margin-bottom: 2px;
    }

    .btn-group .btn:last-child {
        margin-bottom: 0;
    }
}

/* Enhanced Empty State Styling */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-weight: 300;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Enhanced Data Table Styling */
.dataTables_wrapper {
    padding: 1rem 0;
}

.dataTables_length,
.dataTables_filter {
    margin-bottom: 1rem;
}

.dataTables_length label,
.dataTables_filter label {
    font-weight: 500;
    color: var(--dark-color);
}

.dataTables_filter input {
    border-radius: 4px;
    border: 1px solid #ced4da;
    padding: 0.375rem 0.75rem;
    transition: all 0.2s ease;
}

.dataTables_filter input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Enhanced Pagination */
.dataTables_paginate .paginate_button {
    border-radius: 4px !important;
    margin: 0 2px !important;
    transition: all 0.2s ease !important;
}

.dataTables_paginate .paginate_button:hover {
    background: var(--primary-color) !important;
    color: white !important;
    transform: translateY(-1px);
}

.dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Header Shortcut Buttons Styling */
.navbar-nav .nav-item .nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: #495057;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 6px;
    margin: 0 0.25rem;
}

.navbar-nav .nav-item .nav-link:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.navbar-nav .nav-item .nav-link i {
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.navbar-nav .nav-item .nav-link:hover i {
    transform: scale(1.1);
}

.navbar-nav .nav-item .nav-link span {
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}

/* Active state for current page */
.navbar-nav .nav-item .nav-link.active {
    background: var(--primary-color);
    color: white !important;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .navbar-nav .nav-item .nav-link {
        padding: 0.4rem 0.6rem;
        margin: 0 0.1rem;
    }

    .navbar-nav .nav-item .nav-link i {
        font-size: 1rem;
    }
}

/* Animation for button appearance */
@keyframes fadeInButton {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.navbar-nav .nav-item {
    animation: fadeInButton 0.5s ease-out;
}

/* Stagger animation for each button */
.navbar-nav .nav-item:nth-child(1) {
    animation-delay: 0.1s;
}

.navbar-nav .nav-item:nth-child(2) {
    animation-delay: 0.2s;
}

.navbar-nav .nav-item:nth-child(3) {
    animation-delay: 0.3s;
}

.navbar-nav .nav-item:nth-child(4) {
    animation-delay: 0.4s;
}

.navbar-nav .nav-item:nth-child(5) {
    animation-delay: 0.5s;
}

.navbar-nav .nav-item:nth-child(6) {
    animation-delay: 0.6s;
}

/* User Profile Dropdown Styling */
#userProfileDropdown {
    cursor: pointer;
    padding: 0.25rem 0.75rem;
    transition: all 0.3s ease;
    border-radius: 6px;
}

#userProfileDropdown:hover {
    background: rgba(0, 123, 255, 0.05);
}

#userProfileDropdown .user-panel {
    margin: 0;
}

#userProfileDropdown .image i {
    transition: all 0.3s ease;
}

#userProfileDropdown:hover .image i {
    transform: scale(1.1);
    color: var(--primary-dark) !important;
}

#userProfileDropdown .info span {
    font-size: 0.9rem;
    line-height: 1.2;
}

#userProfileDropdown .badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* User Profile Dropdown Menu */
.dropdown-menu {
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 0;
    min-width: 250px;
    animation: dropdownFadeIn 0.3s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header {
    padding: 1rem;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

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

.dropdown-header small {
    font-size: 0.8rem;
}

.dropdown-header .badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.1) 0%, rgba(0, 123, 255, 0.05) 100%);
    color: var(--primary-color);
    transform: translateX(3px);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    transition: all 0.2s ease;
}

.dropdown-item:hover i {
    transform: scale(1.15);
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-top: 1px solid #e9ecef;
}

/* Responsive Design for User Profile Menu */
@media (max-width: 768px) {
    #userProfileDropdown .info {
        display: none !important;
    }

    #userProfileDropdown {
        padding: 0.5rem;
    }

    .dropdown-menu {
        min-width: 220px;
    }

    .dropdown-header {
        padding: 0.75rem;
    }

    .dropdown-item {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }
}

/* Badge Color Variations */
.badge-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.badge-success {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
}

.badge-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
}

.badge-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.badge-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

/* Smooth transitions for dropdown toggle */
.dropdown-toggle::after {
    transition: transform 0.3s ease;
}

.dropdown.show .dropdown-toggle::after {
    transform: rotate(180deg);
}

/* Enhanced hover effect for logout button */
.dropdown-item:last-child:hover {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(220, 53, 69, 0.05) 100%);
    color: var(--danger-color);
}

/* Fix for treeview menu expansion causing sidebar width issues */
.nav-sidebar .nav-item.has-treeview {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.nav-sidebar .nav-item.has-treeview .nav-treeview {
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

/* Prevent horizontal overflow in sidebar */
.main-sidebar,
.main-sidebar .sidebar,
.nav-sidebar,
.nav-sidebar .nav-item,
.nav-sidebar .nav-link,
.nav-sidebar .nav-treeview {
    box-sizing: border-box;
    max-width: 100%;
}

/* Ensure proper text wrapping in menu items */
.nav-sidebar .nav-link p {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.2;
}

/* Fix for menu items that might cause horizontal scrolling */
.nav-sidebar .nav-treeview .nav-link {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .main-sidebar .sidebar {
        height: calc(100vh - 56px);
        /* Adjust for mobile header height */
    }
}

/* Force sidebar to maintain fixed width and prevent expansion */
.sidebar-dark-primary {
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
}

.sidebar-collapse .sidebar-dark-primary {
    width: 4.6rem !important;
    min-width: 4.6rem !important;
    max-width: 4.6rem !important;
}

/* Mobile Menu Navigation Fixes */
@media (max-width: 768px) {

    /* Ensure sidebar is properly positioned on mobile */
    .main-sidebar {
        position: fixed;
        top: 0;
        left: -250px;
        width: 250px;
        height: 100vh;
        z-index: 1040;
        transition: left 0.3s ease-in-out;
    }

    /* Show sidebar when menu is open */
    body.sidebar-open .main-sidebar {
        left: 0;
    }

    /* Ensure sidebar overlay works */
    #sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1039;
        display: none;
    }

    body.sidebar-open #sidebar-overlay {
        display: block;
    }

    /* Ensure menu links are clickable */
    .nav-sidebar .nav-link {
        pointer-events: auto;
        cursor: pointer;
        position: relative;
        z-index: 1;
    }

    /* Ensure treeview toggle works */
    .nav-sidebar .nav-dropdown-toggle {
        pointer-events: auto;
        cursor: pointer;
    }

    /* Make sure submenu items are clickable */
    .nav-sidebar .nav-treeview .nav-link {
        pointer-events: auto;
        cursor: pointer;
        display: block;
        width: 100%;
    }

    /* Prevent any overlay from blocking clicks */
    .nav-sidebar,
    .nav-sidebar * {
        pointer-events: auto;
    }

    /* Ensure proper z-index for menu items */
    .nav-sidebar .nav-item {
        position: relative;
        z-index: 1;
    }

    /* Fix for hamburger menu button */
    .navbar-nav .nav-item a[data-widget="pushmenu"] {
        pointer-events: auto;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.5rem;
    }
}

/* Ensure menu items are always clickable regardless of screen size */
.nav-sidebar .nav-link {
    pointer-events: auto !important;
    cursor: pointer !important;
    user-select: none;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.nav-sidebar .nav-link:active {
    background: rgba(255, 255, 255, 0.15);
}

/* Fix for touch devices */
@media (hover: none) and (pointer: coarse) {
    .nav-sidebar .nav-link {
        min-height: 44px;
        /* Minimum touch target size */
        display: flex;
        align-items: center;
    }

    .nav-sidebar .nav-treeview .nav-link {
        min-height: 40px;
    }
}

/* Ensure sidebar content is scrollable on mobile */
@media (max-width: 768px) {
    .main-sidebar .sidebar {
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        /* Smooth scrolling on iOS */
    }
}

/* DataTables Buttons and Search in 2-Column Grid Layout for Medium Screens */
@media (min-width: 768px) and (max-width: 1024px) {

    /* Container for all DataTables controls */
    .dataTables_wrapper .row:first-child {
        display: block !important;
    }

    .dataTables_wrapper .row:first-child>div {
        width: 100% !important;
        padding: 0 !important;
    }

    /* Hide the "Show entries" on medium screens to save space */
    .dataTables_wrapper .dataTables_length {
        display: none !important;
    }

    /* Buttons and search wrapper */
    .dataTables_wrapper .dt-buttons,
    .dataTables_wrapper .dataTables_filter {
        float: none !important;
        text-align: left !important;
    }

    /* Buttons container takes full width */
    .dataTables_wrapper .dt-buttons {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin: 0 0 8px 0 !important;
        padding: 0 !important;
    }

    .dataTables_wrapper .dt-buttons .btn {
        width: 100% !important;
        margin: 0 !important;
        padding: 0.5rem !important;
        font-size: 0.9rem !important;
        text-align: center !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 42px !important;
        box-sizing: border-box !important;
    }

    /* Last row with Delete button and Search */
    .dataTables_wrapper .dt-buttons .btn-danger {
        grid-column: 1 / 2 !important;
    }

    /* Position search field next to delete button */
    .dataTables_wrapper .dataTables_filter {
        width: 100% !important;
        margin: -50px 0 0 0 !important;
        padding: 0 0 0 calc(50% + 4px) !important;
        position: relative !important;
    }

    .dataTables_wrapper .dataTables_filter label {
        display: block !important;
        margin: 0 !important;
        width: 100% !important;
        font-size: 0 !important;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        margin: 0 !important;
        padding: 0.5rem !important;
        font-size: 0.9rem !important;
        height: 42px !important;
        box-sizing: border-box !important;
        border: 1px solid #ced4da !important;
        border-radius: 4px !important;
    }
}

/* For larger tablets and small desktops (1025px - 1199px) - show normal layout */
@media (min-width: 1025px) and (max-width: 1199px) {

    /* Reset to default layout */
    .dataTables_wrapper .dataTables_length {
        display: block !important;
    }

    .dataTables_wrapper .dt-buttons .btn {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.85rem !important;
        margin-left: 4px !important;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 180px !important;
    }
}

/* For smaller tablets */
@media (min-width: 768px) and (max-width: 991px) {
    .dataTables_wrapper .dt-buttons .btn {
        font-size: 0.85rem !important;
        padding: 0.45rem !important;
        height: 40px !important;
    }

    .dataTables_wrapper .dataTables_filter input {
        padding: 0.45rem !important;
        font-size: 0.85rem !important;
        height: 40px !important;
    }

    .dataTables_wrapper .dataTables_filter {
        margin: -48px 0 0 0 !important;
    }
}

/* Hide "Search:" label text and use placeholder instead */
.dataTables_wrapper .dataTables_filter label {
    font-size: 0 !important;
    /* Hide the "Search:" text */
}

.dataTables_wrapper .dataTables_filter input {
    font-size: 0.9rem !important;
    /* Restore font size for input */
}

/* Style placeholder text */
.dataTables_wrapper .dataTables_filter input::placeholder {
    opacity: 0.6;
    font-size: 0.9rem;
}

.dataTables_wrapper .dataTables_filter input::-webkit-input-placeholder {
    opacity: 0.6;
    font-size: 0.9rem;
}

.dataTables_wrapper .dataTables_filter input::-moz-placeholder {
    opacity: 0.6;
    font-size: 0.9rem;
}

.dataTables_wrapper .dataTables_filter input:-ms-input-placeholder {
    opacity: 0.6;
    font-size: 0.9rem;
}

/* Fix DataTables button and search alignment on large screens (1200px+) */
@media (min-width: 1200px) {

    /* Force the controls row to use flexbox layout */
    .dataTables_wrapper .row:first-child {
        display: block !important;
        margin-bottom: 15px !important;
    }

    /* Override Bootstrap column widths */
    .dataTables_wrapper .row:first-child .col-sm-12,
    .dataTables_wrapper .row:first-child .col-md-6 {
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        float: none !important;
    }

    /* Length selector and buttons in one line */
    .dataTables_wrapper .row:first-child>div:first-child {
        display: flex !important;
        align-items: center !important;
        gap: 10px;
        flex-wrap: wrap !important;
        margin-bottom: 0 !important;
    }

    /* Length selector */
    .dataTables_wrapper .dataTables_length {
        display: inline-block !important;
        margin: 0 !important;
        float: none !important;
    }

    /* Buttons container */
    .dataTables_wrapper .dt-buttons {
        display: inline-flex !important;
        flex-wrap: wrap !important;
        gap: 4px;
        margin: 0 !important;
        float: none !important;
        flex: 1 1 auto !important;
    }

    .dataTables_wrapper .dt-buttons .btn {
        margin: 0 !important;
        padding: 0.375rem 0.75rem !important;
        font-size: 0.875rem !important;
        white-space: nowrap !important;
        width: auto !important;
        display: inline-block !important;
    }

    /* Make Delete button same size as others */
    .dataTables_wrapper .dt-buttons .btn-danger {
        width: auto !important;
        flex: 0 0 auto !important;
    }

    /* Search field - position it at the end of buttons row */
    .dataTables_wrapper .dataTables_filter {
        display: inline-block !important;
        float: none !important;
        text-align: right !important;
        margin: 0 !important;
        margin-left: auto !important;
    }

    .dataTables_wrapper .dataTables_filter label {
        margin: 0 !important;
        font-size: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 250px !important;
        margin: 0 !important;
        font-size: 0.9rem !important;
    }
}

/* For very large screens (1400px+) */
@media (min-width: 1400px) {
    .dataTables_wrapper .dataTables_filter input {
        width: 300px !important;
    }

    .dataTables_wrapper .dt-buttons .btn {
        padding: 0.4rem 0.85rem !important;
        font-size: 0.9rem !important;
    }
}

/* For screens between 1200px-1399px where buttons might wrap */
@media (min-width: 1200px) and (max-width: 1399px) {
    .dataTables_wrapper .dt-buttons .btn {
        padding: 0.3rem 0.6rem !important;
        font-size: 0.8rem !important;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 200px !important;
    }
}

/* Fix DataTables bottom row (info and pagination) alignment on large screens */
@media (min-width: 1200px) {

    /* Make the bottom row flex */
    .dataTables_wrapper>.row:last-child {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: wrap !important;
        gap: 10px;
        margin-top: 15px !important;
    }

    .dataTables_wrapper>.row:last-child>div {
        width: auto !important;
        flex: 0 0 auto !important;
        float: none !important;
    }

    /* Info text on left */
    .dataTables_wrapper .dataTables_info {
        order: 1;
        flex: 0 0 auto !important;
        margin: 0 !important;
    }

    /* Pagination on right */
    .dataTables_wrapper .dataTables_paginate {
        order: 2;
        flex: 0 0 auto !important;
        margin: 0 0 0 auto !important;
        text-align: right !important;
    }
}

/* For medium screens */
@media (min-width: 768px) and (max-width: 1199px) {
    .dataTables_wrapper>.row:last-child {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: wrap !important;
        gap: 10px;
        margin-top: 15px !important;
    }

    .dataTables_wrapper>.row:last-child>div {
        width: auto !important;
        flex: 0 0 auto !important;
    }

    .dataTables_wrapper .dataTables_info {
        flex: 0 0 auto !important;
    }

    .dataTables_wrapper .dataTables_paginate {
        flex: 0 0 auto !important;
        margin-left: auto !important;
    }
}

/* Clean fix for DataTables layout on large screens (1200px+) */
@media (min-width: 1200px) {

    /* Make the main row flexbox with no wrap */
    .dataTables_wrapper .row:first-child {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 10px;
    }

    /* Make both columns auto-width and inline */
    .dataTables_wrapper .row:first-child>.col-sm-12,
    .dataTables_wrapper .row:first-child>.col-md-6 {
        width: auto !important;
        max-width: none !important;
        flex: 0 0 auto !important;
        padding: 0 !important;
    }

    /* First column with length and buttons */
    .dataTables_wrapper .row:first-child>div:first-child {
        display: flex !important;
        align-items: center !important;
        gap: 10px;
        flex: 1 1 auto !important;
    }

    /* Show entries stays on left */
    .dataTables_wrapper .dataTables_length {
        margin: 0;
        flex: 0 0 auto;
    }

    /* Buttons wrap naturally */
    .dataTables_wrapper .dt-buttons {
        display: inline-flex !important;
        flex-wrap: wrap !important;
        gap: 4px;
        flex: 0 0 auto;
    }

    .dataTables_wrapper .dt-buttons .btn {
        width: auto !important;
    }

    /* Second column with search - keep it inline */
    .dataTables_wrapper .row:first-child>div:last-child {
        flex: 0 0 auto !important;
    }

    /* Search field inline */
    .dataTables_wrapper .dataTables_filter {
        display: inline-block !important;
        margin: 0 !important;
        text-align: right;
    }

    .dataTables_wrapper .dataTables_filter label {
        font-size: 0 !important;
        /* Hide "Search:" text */
        margin: 0 !important;
    }

    .dataTables_wrapper .dataTables_filter input {
        font-size: 0.9rem !important;
        width: 200px !important;
    }
}

/* For very large screens */
@media (min-width: 1400px) {
    .dataTables_wrapper .dataTables_filter input {
        width: 250px !important;
    }
}

/* Move search bar to the right on large screens */
@media (min-width: 1200px) {

    /* Make bottom row (pagination row) flexbox */
    .dataTables_wrapper .row:last-child {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        margin-top: 15px !important;
        gap: 15px;
    }

    .dataTables_wrapper .row:last-child>div {
        width: auto !important;
        flex: 0 0 auto !important;
    }

    /* Pagination info on left */
    .dataTables_wrapper .dataTables_info {
        order: 1;
        flex: 0 0 auto !important;
        margin: 0 !important;
    }

    /* Pagination controls in middle */
    .dataTables_wrapper .dataTables_paginate {
        order: 2;
        flex: 0 0 auto !important;
        margin: 0 !important;
    }

    /* Search bar on right (moved via JavaScript) */
    .dataTables_wrapper .row:last-child .dataTables_filter {
        order: 3;
        flex: 0 0 auto !important;
        margin: 0 0 0 auto !important;
        text-align: right !important;
    }

    .dataTables_wrapper .row:last-child .dataTables_filter label {
        margin: 0 !important;
    }
}


/* Simple flex layout for Show entries and Search bar */
@media (min-width: 1200px) {
    .dataTables_wrapper .row:first-child {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
    }

    .dataTables_wrapper .row:first-child>div {
        width: auto !important;
        flex: 0 0 auto !important;
    }

    /* Show entries on left */
    .dataTables_wrapper .dataTables_length {
        order: 1 !important;
    }

    /* Buttons stay in their column */
    .dataTables_wrapper .dt-buttons {
        order: 2 !important;
    }

    /* Search on right */
    .dataTables_wrapper .dataTables_filter {
        order: 3 !important;
        margin-left: auto !important;
    }
}


/* Move search bar to the right end */
@media (min-width: 1200px) {
    .dataTables_wrapper .dataTables_filter {
        float: right !important;
    }
}

/* Ensure pagination controls are visible on all screens */
@media (min-width: 768px) {
    .dataTables_wrapper .dataTables_paginate {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .dataTables_wrapper .dataTables_info {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Make bottom row visible */
    .dataTables_wrapper .row:last-child {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-top: 15px !important;
    }
}

/* Force pagination to always show even with few records */
.dataTables_wrapper .dataTables_paginate,
.dataTables_wrapper .dataTables_info {
    display: block !important;
    visibility: visible !important;
}

/* Ensure bottom row is always visible */
.dataTables_wrapper .row:last-child {
    display: block !important;
    min-height: 40px !important;
}

.dataTables_wrapper .row:last-child .col-sm-12,
.dataTables_wrapper .row:last-child .col-md-5,
.dataTables_wrapper .row:last-child .col-md-7 {
    display: inline-block !important;
}

/* Fix Bulk Print Labels button width to match other buttons */
.dataTables_wrapper .dt-buttons .btn-info {
    width: auto !important;
    flex: 0 0 auto !important;
}

/* Fix Bulk Print Labels button on medium screens to match 2-column layout */
@media (min-width: 768px) and (max-width: 1024px) {
    .dataTables_wrapper .dt-buttons .btn-info {
        width: 100% !important;
        grid-column: 1 / 2 !important;
    }
}

/* ========== CHECKBOX INPUT FIXES ========== */
/* Fix checkbox overlapping label issue globally */

/* Standard checkbox styling with proper spacing */
.form-check {
    padding-left: 0;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.form-check-input {
    position: relative;
    margin-left: 0;
    margin-right: 0.25rem;
    margin-top: 0;
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.form-check-label {
    margin-bottom: 0;
    cursor: pointer;
    user-select: none;
    display: inline-block;
    padding-left: 0;
    line-height: 1;
}

/* Inline checkbox styling */
.form-check-inline {
    display: inline-flex;
    align-items: center;
    padding-left: 0;
    margin-right: 1rem;
    gap: 0.25rem;
}

.form-check-inline .form-check-input {
    margin-left: 0;
    margin-right: 0.25rem;
}

/* Custom checkbox wrapper for better control */
.custom-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.custom-checkbox-wrapper input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    cursor: pointer;
    margin: 0;
}

.custom-checkbox-wrapper label {
    margin: 0;
    cursor: pointer;
    user-select: none;
    flex: 1;
    line-height: 1;
}

/* Fix for Bootstrap 4 custom controls */
.custom-control {
    padding-left: 1.75rem;
    min-height: 1.25rem;
    display: flex;
    align-items: center;
}

.custom-control-input {
    position: absolute;
    left: 0;
    z-index: -1;
    width: 1rem;
    height: 1rem;
    opacity: 0;
}

.custom-control-label {
    position: relative;
    margin-bottom: 0;
    vertical-align: top;
    cursor: pointer;
    line-height: 1;
}

.custom-control-label::before {
    position: absolute;
    top: 0.125rem;
    left: -1.75rem;
    display: block;
    width: 1rem;
    height: 1rem;
    pointer-events: none;
    content: "";
    background-color: #fff;
    border: 1px solid #adb5bd;
    border-radius: 0.25rem;
}

.custom-control-label::after {
    position: absolute;
    top: 0.125rem;
    left: -1.75rem;
    display: block;
    width: 1rem;
    height: 1rem;
    content: "";
    background: no-repeat 50% / 50% 50%;
}

.custom-control-input:checked~.custom-control-label::before {
    color: #fff;
    border-color: #007bff;
    background-color: #007bff;
}

.custom-checkbox .custom-control-input:checked~.custom-control-label::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3e%3c/svg%3e");
}

/* Fix for checkboxes in forms */
.form-group .form-check {
    margin-top: 0.5rem;
}

.form-group .form-check:first-child {
    margin-top: 0;
}

/* Fix for checkboxes in tables */
table .form-check {
    margin-bottom: 0;
    justify-content: center;
}

table .form-check-input {
    margin-right: 0;
}

/* Fix for checkboxes in cards */
.card-body .form-check {
    padding-left: 0;
}

/* Responsive checkbox sizing */
@media (max-width: 768px) {
    .form-check-input {
        width: 0.9rem;
        height: 0.9rem;
    }

    .custom-control-label::before,
    .custom-control-label::after {
        width: 0.9rem;
        height: 0.9rem;
    }
}

/* Enhanced checkbox hover effects */
.form-check-input:hover {
    border-color: #007bff;
    box-shadow: 0 0 0 0.1rem rgba(0, 123, 255, 0.15);
}

.form-check-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

/* Disabled state */
.form-check-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-check-input:disabled~.form-check-label {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Fix for specific product form checkboxes */
.product-form .form-check,
.customer-form .form-check,
.supplier-form .form-check {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding-left: 0;
    margin-bottom: 0.75rem;
}

.product-form .form-check-input,
.customer-form .form-check-input,
.supplier-form .form-check-input {
    margin: 0;
    margin-right: 0.25rem;
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
}

.product-form .form-check-label,
.customer-form .form-check-label,
.supplier-form .form-check-label {
    margin: 0;
    flex: 1;
    line-height: 1;
}

/* Fix for checkbox groups */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.checkbox-group .form-check {
    margin-bottom: 0;
    min-width: 200px;
}

/* Fix for inline checkboxes in rows */
.row .form-check {
    padding-left: 0;
}

/* Ensure checkboxes don't break layout */
.col .form-check,
.col-md-6 .form-check,
.col-lg-4 .form-check {
    padding-left: 0;
}

/* ========== FIX FOR CUSTOM-CONTROL CHECKBOX OVERLAP ========== */
/* Override inline padding that causes label overlap */
.custom-control.custom-checkbox[style*="padding-left"] {
    padding-left: 1.75rem !important;
}

/* Ensure proper spacing for custom checkbox labels */
.custom-control.custom-checkbox .custom-control-label {
    padding-left: 0.25rem;
    line-height: 1;
    min-height: 1rem;
    display: inline-block;
}

/* Fix for custom checkbox indicator positioning */
.custom-control.custom-checkbox .custom-control-label::before {
    left: -1.75rem;
    top: 0;
    width: 1rem;
    height: 1rem;
}

.custom-control.custom-checkbox .custom-control-label::after {
    left: -1.75rem;
    top: 0;
    width: 1rem;
    height: 1rem;
}

/* Ensure checkbox input is properly positioned */
.custom-control.custom-checkbox .custom-control-input {
    left: 0;
    width: 1rem;
    height: 1rem;
}

/* Fix for form-check-input overlap */
.form-check .form-check-input {
    float: none;
    margin-left: 0;
    margin-right: 0.25rem;
    position: relative;
}

.form-check .form-check-label {
    padding-left: 0;
    display: inline-block;
    line-height: 1;
}

/* Fix for form-switch overlap */
.form-check.form-switch {
    padding-left: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.form-check.form-switch .form-check-input {
    width: 2rem;
    height: 1rem;
    margin-left: 0;
    margin-right: 0.35rem;
    background-position: left center;
    border-radius: 2rem;
    transition: background-position 0.15s ease-in-out;
}

.form-check.form-switch .form-check-label {
    padding-left: 0;
    margin-bottom: 0;
    line-height: 1;
}

/* Additional spacing for better readability */
.custom-control+.custom-control {
    margin-top: 0.75rem;
}

/* Fix for checkboxes in grid layouts */
.col .custom-control.custom-checkbox,
.col-md-6 .custom-control.custom-checkbox,
.col-lg-3 .custom-control.custom-checkbox,
.col-lg-4 .custom-control.custom-checkbox {
    padding-left: 1.75rem !important;
}

/* Ensure text doesn't wrap under checkbox */
.custom-control-label {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Statistics Cards with Border-Left Styling */
.border-left-primary {
    border-left: 4px solid #007bff !important;
}

.border-left-success {
    border-left: 4px solid #28a745 !important;
}

.border-left-warning {
    border-left: 4px solid #ffc107 !important;
}

.border-left-info {
    border-left: 4px solid #17a2b8 !important;
}

.border-left-secondary {
    border-left: 4px solid #6c757d !important;
}

.border-left-dark {
    border-left: 4px solid #343a40 !important;
}

.border-left-danger {
    border-left: 4px solid #dc3545 !important;
}

/* Professional Statistics Card Styling */
.card.border-left-primary,
.card.border-left-success,
.card.border-left-warning,
.card.border-left-info,
.card.border-left-secondary,
.card.border-left-dark,
.card.border-left-danger {
    background: #ffffff;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.card.border-left-primary:hover,
.card.border-left-success:hover,
.card.border-left-warning:hover,
.card.border-left-info:hover,
.card.border-left-secondary:hover,
.card.border-left-dark:hover,
.card.border-left-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Text color utilities for statistics */
.text-gray-800 {
    color: #5a5c69 !important;
}

.text-gray-300 {
    color: #dddfeb !important;
}

/* Ensure statistics cards have proper spacing */
#statistics-cards .card-body {
    padding: 1rem;
}

#statistics-cards .h5 {
    font-size: 1.5rem;
    font-weight: 700;
}

#statistics-cards .text-xs {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Clickable Statistics Cards */
.stat-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.stat-card.active-stat-card {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.4);
    border-width: 2px;
}

.stat-card.active-stat-card.border-left-primary {
    border-left-width: 6px !important;
}

.stat-card.active-stat-card.border-left-success {
    border-left-width: 6px !important;
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.4);
}

.stat-card.active-stat-card.border-left-warning {
    border-left-width: 6px !important;
    box-shadow: 0 8px 20px rgba(255, 193, 7, 0.4);
}

.stat-card.active-stat-card.border-left-info {
    border-left-width: 6px !important;
    box-shadow: 0 8px 20px rgba(23, 162, 184, 0.4);
}

.stat-card.active-stat-card.border-left-secondary {
    border-left-width: 6px !important;
}

.stat-card.active-stat-card.border-left-dark {
    border-left-width: 6px !important;
    box-shadow: 0 8px 20px rgba(52, 58, 64, 0.4);
}