.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: var(--db-primary, #0161c4);
    --primary-dark: var(--db-primary-dark, #013d96);
    --primary-light: #4d94e0;
    --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
   :not(.ds-items-table) on every rule below: DataTables' core (`dataTable`
   class) and its Bootstrap4 integration (`table` class) both re-add their
   own classes to the <table> element at runtime regardless of what static
   class the Blade markup sets - so a page-local `class="ds-items-table"`
   alone does NOT stop these rules from matching once DataTables
   initializes. Without this exclusion, these !important blue-gradient
   headers silently override .ds-items-table's own header styling and its
   corner/background handling, which is exactly the "table blends into the
   card" symptom already documented in docs/design-system.md - see the
   .ds-card-body.ds-p0:first-child fix for the other half of that bug. */
.table:not(.ds-items-table) {
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.table:not(.ds-items-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:not(.ds-items-table) tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
    transition: all 0.2s ease;
}

/* Override any conflicting AdminLTE table styles */
.table:not(.ds-items-table) thead th,
.table:not(.ds-items-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:not(.ds-items-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:not(.ds-items-table) 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:not(.ds-items-table) thead th,
.content .dataTable:not(.ds-items-table) thead th,
.card .table:not(.ds-items-table) thead th,
.card .dataTable:not(.ds-items-table) 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:not(.ds-items-table) thead th,
.skin-blue .table:not(.ds-items-table) thead td,
.sidebar-dark-primary .table:not(.ds-items-table) thead th,
.sidebar-dark-primary .table:not(.ds-items-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;
}

/* ========== FIX FOR CUSTOM-SWITCH (TOGGLE) CENTERING ==========
   The generic .custom-control-label::before/::after rules above are tuned for
   checkboxes (1rem square, top: 0.125rem) but also match .custom-switch since
   it's built on the same .custom-control-label markup. Bootstrap's own
   switch-specific rule for ::after (the thumb) keeps a different fixed offset
   (calc(.25rem + 2px)), so the track and the thumb ended up anchored to two
   different vertical offsets - the thumb visually sat low, off-center inside
   the pill, on every custom-switch toggle in the app. These rules fully
   re-define both the track and the thumb together so they always share one
   consistent, centered vertical alignment. */
.custom-switch {
    padding-left: 2.75rem;
    min-height: 1.5rem;
}

.custom-switch .custom-control-label {
    line-height: 1.5rem;
    padding-left: 0.5rem;
    min-height: 0;
}

.custom-switch .custom-control-label::before {
    top: 0.1875rem;
    left: -2.75rem;
    width: 2.25rem;
    height: 1.125rem;
    border-radius: 1rem;
    background-color: #dee2e6;
    border: 1px solid #ced4da;
}

.custom-switch .custom-control-label::after {
    top: calc(0.1875rem + 2px);
    left: calc(-2.75rem + 2px);
    width: calc(1.125rem - 4px);
    height: calc(1.125rem - 4px);
    border-radius: 50%;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

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

.custom-switch .custom-control-input:checked ~ .custom-control-label::after {
    background-color: #fff;
    transform: translateX(1.125rem);
}

.custom-switch .custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.custom-switch .custom-control-input:disabled ~ .custom-control-label {
    opacity: 0.5;
    cursor: not-allowed;
}

.custom-switch.custom-switch-lg {
    padding-left: 3.5rem;
    min-height: 1.75rem;
}

.custom-switch.custom-switch-lg .custom-control-label {
    line-height: 1.75rem;
}

.custom-switch.custom-switch-lg .custom-control-label::before {
    width: 2.75rem;
    height: 1.375rem;
    left: -3.5rem;
    top: 0.1875rem;
}

.custom-switch.custom-switch-lg .custom-control-label::after {
    width: calc(1.375rem - 4px);
    height: calc(1.375rem - 4px);
    left: calc(-3.5rem + 2px);
    top: calc(0.1875rem + 2px);
}

.custom-switch.custom-switch-lg .custom-control-input:checked ~ .custom-control-label::after {
    transform: translateX(1.375rem);
}

/* 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);
}

/* .modal-dialog-scrollable polyfill - this app loads Bootstrap 4.2.1, but the
   class was only added in Bootstrap 4.3.0, so it's a no-op without this. Several
   modals (voucher create/edit, POS hold/held carts, purchases) already use the
   class expecting Bootstrap's real implementation. Without it, the *whole* modal
   (backdrop included) scrolls instead of just .modal-body, which also breaks
   Select2's dropdown positioning inside those modals - dropdownParent is a
   scrolled ancestor, so the dropdown renders at the wrong offset once scrolled.
   Rules mirror Bootstrap 4.3+'s upstream CSS exactly. */
.modal-dialog-scrollable {
    display: flex;
    max-height: calc(100% - 1rem);
}

.modal-dialog-scrollable .modal-content {
    max-height: calc(100vh - 1rem);
    overflow: hidden;
}

.modal-dialog-scrollable .modal-header,
.modal-dialog-scrollable .modal-footer {
    flex-shrink: 0;
}

.modal-dialog-scrollable .modal-body {
    overflow-y: auto;
}

/* NOTE: a `.modal-dialog-centered.modal-dialog-scrollable` combination rule
   briefly lived here setting `.modal-content { max-height: none }`. That was
   wrong - it removed the height cap entirely, so on a tall modal the content
   (now unbounded) got vertically centered and clipped equally top+bottom by
   the `overflow: hidden` above, hiding the header AND footer with no way to
   reach either. Removed. The plain rules above are sufficient on their own:
   `.modal-dialog-centered` only adds `align-items: center` (no flex-direction
   override, so the dialog's main axis stays row and align-items governs
   cross-axis/vertical sizing) - combined with `.modal-dialog-scrollable`
   capping the dialog's own height and `.modal-content`'s max-height/overflow
   above, `.modal-content` still sizes to min(natural height, its cap) and
   centers within the dialog, with its own column-flex children (header/footer
   shrink-0, body flex:1 1 auto + overflow-y:auto, both from Bootstrap's base
   .modal-content/.modal-body) doing the actual internal scrolling. */

/* `.modal-dialog-centered` sets `align-items: center` on the dialog, which
   only ever sizes `.modal-content` to ITS OWN natural height and centers
   that within the dialog - it never stretches modal-content to actually
   claim the full available height. Forcing `align-items: stretch` fixes
   that half of it. */
#closeSessionModal .modal-dialog,
#openSessionModal .modal-dialog {
    align-items: stretch;
}

/* THE ACTUAL BUG, found by actually opening this modal in a real browser
   (Playwright + Chromium) and reading computed layout instead of continuing
   to guess at the CSS cascade - see the fix below for the diagnosis. */
#closeSessionModal .modal-content,
#openSessionModal .modal-content {
    height: 100%;
}

/* THE REAL FIX, verified live (Playwright + Chromium) before writing it here:
   both this modal's <form> and open-session-modal's wrap `.modal-body` AND
   `.modal-footer` together -
       .modal-content > .modal-header
       .modal-content > form > .modal-body
       .modal-content > form > .modal-footer
   `.modal-content`'s `display:flex; flex-direction:column` (from the
   scrollable polyfill above) only ever governs ITS OWN direct children -
   .modal-header and the <form> - as the two flex items. .modal-body and
   .modal-footer are two levels down, inside a plain block-level <form>, so
   none of the flex-shrink/flex-grow machinery that makes `.modal-body`
   actually shrink to fit and scroll ever reached them. That's why every
   earlier attempt at this (align-items, height:100%, even switching
   .modal-content to CSS Grid) measured ZERO change to .modal-body's
   height - none of those rules could touch an element two levels below the
   one they targeted. Confirmed with `content.children` in a live page: the
   two direct children really are [.modal-header, form#closeSessionForm].

   The fix makes the <form> itself the flex-column participant that
   .modal-content expects:

     .modal-content (flex column, height:100%, overflow:hidden)
       .modal-header                (flex-shrink: 0, from the polyfill)
       form                         (flex: 1 1 auto, min-height: 0, overflow: hidden) <- NEW
         .modal-body                (flex: 1 1 auto, min-height: 0, overflow-y: auto)
         .modal-footer              (flex-shrink: 0, from the polyfill)

   `min-height: 0` on both the form and the body is required, not optional -
   flex items default to `min-height: auto`, which for a block-level child
   means "at least as tall as your content", and that default alone is
   enough to defeat flex-shrink even with the form now correctly wired as a
   flex container. Verified in the browser: before this rule .modal-body
   measured 741px tall with the footer's own box ending 125px below the
   modal's visible edge (clipped, not scrollable); after it .modal-body
   measures 614px with a genuine internal overflow (741px of real content in
   a 614px box) and the footer sits fully inside the modal. */
#closeSessionModal form,
#openSessionModal form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

#closeSessionModal .modal-body,
#openSessionModal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
}

#closeSessionModal .modal-footer,
#openSessionModal .modal-footer {
    flex-shrink: 0;
}

/* ============================================================
   POS Sessions - Close/Open modal premium experience
   ------------------------------------------------------------
   Scoped by ID (not a sitewide modal-lg change) - these two modals carry
   more content than a typical modal-lg (session info, cash breakdown,
   denomination counter, notes, warnings), so they get their own sizing and
   polish without changing every other modal-lg dialog in the app.

   IMPORTANT: lookup-modals-responsive.css (the file that gives .modal-lg a
   bigger max-width per breakpoint, and a fullscreen mobile treatment)
   is NOT loaded here - it's only linked from lookup-types/index.blade.php
   and lookups/index.blade.php's own <link> tags, not the shared admin
   layout. So these two modals were running on bare Bootstrap 4.2.1
   defaults the whole time: .modal-lg only widens past the base 500px at
   >=992px (max-width: 800px), and there is no tablet/mobile widening or
   fullscreen behavior at all below that. All of the sizing below has to be
   supplied here from scratch, not layered on top of an existing responsive
   scheme. */

@media (min-width: 576px) and (max-width: 767.98px) {
    #closeSessionModal .modal-dialog,
    #openSessionModal .modal-dialog {
        max-width: 92%;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    #closeSessionModal .modal-dialog,
    #openSessionModal .modal-dialog {
        max-width: 700px;
    }
}

/* Desktop: meaningfully past Bootstrap's 800px modal-lg cap, so two-column
   rows (Session Information, Expected Cash Total) stay side-by-side instead
   of stacking, and less of the form needs scrolling to reach. Still short of
   full-bleed - this is a form, not a data table. */
@media (min-width: 992px) {
    #closeSessionModal .modal-dialog,
    #openSessionModal .modal-dialog {
        max-width: 900px;
    }
}

@media (min-width: 1400px) {
    #closeSessionModal .modal-dialog,
    #openSessionModal .modal-dialog {
        max-width: 1000px;
    }
}

/* Mobile: true edge-to-edge width, not Bootstrap's default small-margin
   floating card - there's no other rule doing this for these two modals (see
   note above), so it has to be built here rather than just tweaked.

   Deliberately NOT forcing a min-height (100vh) on .modal-content here: that
   is the exact mistake that briefly broke this modal earlier (see the NOTE
   above the scrollable-polyfill block) - a min-height taller than the
   scrollable polyfill's own `max-height: calc(100vh - 1rem)` cap wins the
   CSS height conflict and blows the cap open again. Leaving height alone,
   the modal already reaches almost the full viewport on a phone because
   these forms are tall enough to hit that cap on their own. */
@media (max-width: 575.98px) {
    #closeSessionModal .modal-dialog,
    #openSessionModal .modal-dialog {
        margin: 0;
        max-width: 100%;
    }
}

/* A default OS scrollbar on modal-body is thin/pale enough to miss entirely
   at a glance - which is exactly what read as "no scrollbar". Thin but
   clearly visible, matching the sidebar's own scrollbar treatment
   (.main-sidebar .sidebar::-webkit-scrollbar above) but in a dark-on-light
   variant since this modal's body is a white surface, not the dark sidebar. */
#closeSessionModal .modal-body,
#openSessionModal .modal-body {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, .25) transparent;
    -webkit-overflow-scrolling: touch;
}

#closeSessionModal .modal-body::-webkit-scrollbar,
#openSessionModal .modal-body::-webkit-scrollbar {
    width: 8px;
}

#closeSessionModal .modal-body::-webkit-scrollbar-track,
#openSessionModal .modal-body::-webkit-scrollbar-track {
    background: transparent;
}

#closeSessionModal .modal-body::-webkit-scrollbar-thumb,
#openSessionModal .modal-body::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, .22);
    border-radius: 4px;
}

#closeSessionModal .modal-body::-webkit-scrollbar-thumb:hover,
#openSessionModal .modal-body::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, .38);
}

/* The header/footer sit above the scrolling body in the stacking order and
   cast a faint shadow toward it - the same "floating app bar" cue native
   apps use to signal there's more content between two fixed bars, rather
   than the body just abruptly ending at a flat line. */
#closeSessionModal .modal-header,
#openSessionModal .modal-header {
    position: relative;
    z-index: 1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
}

#closeSessionModal .modal-footer,
#openSessionModal .modal-footer {
    position: relative;
    z-index: 1;
    box-shadow: 0 -2px 6px rgba(0, 0, 0, .06);
}

/* Mobile: a softly rounded top edge rather than the sitewide hard square
   corner (lookup-modals-responsive.css forces border-radius:0 on every
   modal at this width) - the small radius is what makes a fullscreen modal
   read as a deliberate "sheet" rather than a plain page swap, the same way
   native iOS/Android sheet modals do it even at full height. */
@media (max-width: 575.98px) {
    #closeSessionModal .modal-content,
    #openSessionModal .modal-content {
        border-radius: 14px 14px 0 0;
        overflow: hidden;
    }
}