/* ============================================
   RESPONSIVE CSS - ALL DEVICE MEDIA QUERIES
   ============================================ */

/* ============================================
   EXTRA SMALL DEVICES (Mobile Phones)
   ============================================ */
@media (max-width: 575.98px) {
    /* Override admin.css overflow settings for mobile - MUST be at the top */
    .main-content .data-table-wrapper,
    body .data-table-wrapper {
        overflow-x: auto !important;
        overflow-y: visible !important;
    }
    /* Sidebar - Hidden by default on mobile */
    .sidebar {
        width: 100%;
        height: 100vh;
        margin-left: -100%;
        z-index: 1050;
        transition: margin-left 0.3s ease;
    }

    .sidebar.show {
        margin-left: 0;
    }

    .sidebar.collapsed {
        margin-left: -100%;
    }

    /* Sidebar Overlay/Backdrop */
    .sidebar::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: -1;
    }

    .sidebar.show::before {
        opacity: 1;
        visibility: visible;
    }

    /* Main Wrapper - Full width on mobile */
    .main-wrapper {
        margin-left: 0 !important;
    }

    /* Top Header - Full width, adjust padding */
    .top-header {
        left: 0 !important;
        padding: 0 1rem;
        height: 56px;
    }

    /* Header Right - Stack items vertically or reduce gap */
    .header-right {
        gap: 0.5rem;
    }

    .admin-profile span {
        display: none;
    }

    .language-selector,
    .notifications {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }

    /* Main Content - Reduce padding */
    .main-content {
        padding: 1rem;
        margin-top: 56px;
    }

    /* Page Header - Stack vertically */
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .page-header > h1,
    .page-header > .page-title {
        margin-bottom: 0;
    }

    .page-header > .d-flex {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem !important;
    }

    /* Make all page headers with d-flex responsive */
    .d-flex.justify-content-between.align-items-center.mb-4 {
        flex-direction: column;
        align-items: stretch !important;
        gap: 1rem;
    }

    .d-flex.justify-content-between.align-items-center.mb-4 > h2,
    .d-flex.justify-content-between.align-items-center.mb-4 > h1 {
        margin-bottom: 0;
        width: 100%;
    }

    .d-flex.justify-content-between.align-items-center.mb-4 > .d-flex,
    .d-flex.justify-content-between.align-items-center.mb-4 > a {
        width: 100%;
    }

    .d-flex.justify-content-between.align-items-center.mb-4 .btn {
        width: 100%;
        justify-content: center;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .page-header .btn,
    .btn-add-new {
        width: 100%;
        justify-content: center;
        padding: 0.625rem 1rem;
    }

    /* Table Controls - Stack vertically */
    .table-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .entries-selector {
        width: 100%;
        justify-content: space-between;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        width: 100%;
    }

    /* Data Table Wrapper - Enable scrolling on mobile */
    .data-table-wrapper {
        padding: 1rem;
        overflow-x: auto !important; /* Enable horizontal scrolling on mobile */
        overflow-y: visible !important; /* Preserve dropdown visibility */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        max-width: 100%;
    }

    /* Preserve Bootstrap table-responsive behavior - Force horizontal scroll on mobile */
    .data-table-wrapper .table-responsive {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important; /* Force horizontal scrolling */
        overflow-y: visible !important; /* Preserve dropdown visibility */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        position: relative;
        min-height: 0.01%; /* Force hasLayout for IE */
    }

    /* Ensure table can scroll horizontally */
    .data-table-wrapper .table-responsive table {
        min-width: 600px; /* Minimum table width to force scrolling */
        width: 100% !important;
    }

    /* Tables - Adjust font size and padding for mobile */
    table.dataTable {
        font-size: 0.875rem;
        width: 100% !important;
    }

    table.dataTable thead th {
        padding: 0.5rem 0.375rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    table.dataTable tbody td {
        padding: 0.5rem 0.375rem;
        font-size: 0.875rem;
        white-space: nowrap;
    }

    /* Ensure DataTables wrapper maintains proper layout with scrolling */
    .data-table-wrapper .dataTables_wrapper,
    .dataTables_wrapper {
        width: 100% !important;
        position: relative !important;
        overflow-x: auto !important; /* Enable horizontal scrolling */
        overflow-y: visible !important; /* Preserve for dropdowns */
        -webkit-overflow-scrolling: touch !important; /* Smooth scrolling on iOS */
        display: block;
    }

    .dataTables_wrapper .dataTables_scroll {
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }

    .dataTables_wrapper .dataTables_scrollBody {
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }

    .dataTables_wrapper .dataTables_scrollHead {
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
    }

    .dataTables_wrapper .dataTables_scrollHeadInner,
    .dataTables_wrapper .dataTables_scrollFootInner {
        overflow-y: visible !important;
    }

    /* Fix for DataTables container */
    .dataTables_wrapper .dataTables_scrollHeadInner table,
    .dataTables_wrapper .dataTables_scrollBody table {
        width: 100% !important;
        min-width: 600px; /* Force scrolling on mobile */
    }

    /* Preserve table cell overflow for dropdowns */
    table.dataTable tbody td,
    table.dataTable tbody th,
    table tbody td,
    table tbody th {
        position: relative !important;
        overflow: visible !important;
        white-space: nowrap; /* Prevent text wrapping */
    }

    /* Ensure table wrapper allows scrolling - override admin.css */
    .main-content .data-table-wrapper,
    body .data-table-wrapper {
        position: relative !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: thin; /* Firefox */
        overflow-x: auto !important;
        overflow-y: visible !important;
    }

    /* Custom scrollbar for better mobile UX */
    .main-content .data-table-wrapper::-webkit-scrollbar,
    body .data-table-wrapper::-webkit-scrollbar,
    .data-table-wrapper .table-responsive::-webkit-scrollbar,
    .dataTables_wrapper::-webkit-scrollbar {
        height: 8px;
        width: 8px;
        -webkit-appearance: none;
    }

    .main-content .data-table-wrapper::-webkit-scrollbar-track,
    body .data-table-wrapper::-webkit-scrollbar-track,
    .data-table-wrapper .table-responsive::-webkit-scrollbar-track,
    .dataTables_wrapper::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }

    .main-content .data-table-wrapper::-webkit-scrollbar-thumb,
    body .data-table-wrapper::-webkit-scrollbar-thumb,
    .data-table-wrapper .table-responsive::-webkit-scrollbar-thumb,
    .dataTables_wrapper::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 4px;
    }

    .main-content .data-table-wrapper::-webkit-scrollbar-thumb:hover,
    body .data-table-wrapper::-webkit-scrollbar-thumb:hover,
    .data-table-wrapper .table-responsive::-webkit-scrollbar-thumb:hover,
    .dataTables_wrapper::-webkit-scrollbar-thumb:hover {
        background: #555;
    }

    /* Table Avatar - Smaller on mobile */
    .table-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }

    /* Action Dropdown - Preserve button size but make touch-friendly */
    .action-dropdown .btn-action {
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem 0.75rem;
    }

    /* Cards - Remove side padding and margins */
    .card-modern {
        margin: 0;
        border-radius: 0;
    }

    .card {
        margin-bottom: 1rem;
    }

    /* Sidebar Brand - Adjust padding */
    .sidebar-brand {
        padding: 1rem;
    }

    .brand-logo {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .brand-name {
        font-size: 0.875rem;
    }

    /* Navigation Links - Adjust padding */
    .sidebar-nav .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .nav-group-title {
        font-size: 0.7rem;
        padding: 0.5rem 1rem 0.375rem;
    }

    /* DataTables Info and Pagination - Stack on mobile */
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: center;
        padding: 0.5rem 0;
        width: 100%;
        display: block;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        margin-bottom: 0.75rem;
        width: 100%;
    }

    .dataTables_wrapper .dataTables_length label,
    .dataTables_wrapper .dataTables_filter label {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
    }

    /* Dropdown Menus - Adjust for mobile, but preserve table dropdowns */
    .dropdown-menu:not(.dropdown-menu-end):not(.action-dropdown .dropdown-menu) {
        width: 100%;
        max-width: 100%;
    }

    /* Preserve action dropdown menus in tables */
    .action-dropdown .dropdown-menu,
    table .dropdown-menu {
        width: auto;
        min-width: 150px;
        max-width: 300px;
    }

    /* Forms - Full width inputs */
    .form-control,
    .form-select {
        width: 100%;
    }

    /* Form rows - Stack columns on mobile */
    .row .col-md-6,
    .row .col-md-4,
    .row .col-md-3,
    .row .col-md-8,
    .row .col-md-12 {
        margin-bottom: 1rem;
    }

    /* Cards - Remove side margins on mobile */
    .card-modern {
        margin: 0;
        border-radius: 0;
    }

    /* Input groups - Stack on mobile */
    .input-group {
        flex-wrap: wrap;
    }

    .input-group .btn {
        width: 100%;
        margin-top: 0.5rem;
    }

    /* Two column layouts - Stack on mobile */
    .row .col-md-8 + .col-md-4 {
        margin-top: 1rem;
    }

    /* Buttons - Full width on mobile, but preserve inline buttons in tables */
    .main-content > .btn:not(.btn-sm):not(table .btn),
    .card .btn:not(.btn-sm):not(table .btn) {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .main-content > .btn:last-child:not(.btn-sm):not(table .btn),
    .card .btn:last-child:not(.btn-sm):not(table .btn) {
        margin-bottom: 0;
    }

    /* Preserve small buttons and buttons in tables */
    table .btn,
    table .btn-sm,
    .d-flex.gap-1 .btn,
    .d-flex.gap-2 .btn,
    table .action-dropdown .btn-action {
        width: auto;
        margin-bottom: 0;
        min-width: auto;
    }

    /* Alert boxes - Full width on mobile */
    .alert {
        margin-bottom: 1rem;
    }

    /* Statistics cards - Stack on mobile */
    .row.g-4 .col-md-3,
    .row .col-md-3.mb-3,
    .row .col-md-4.mb-3 {
        margin-bottom: 1rem;
    }

    /* Filter forms - Stack on mobile */
    .card .card-body .row.g-3 > div {
        margin-bottom: 1rem;
    }

    /* Modal dialogs - Full width on mobile */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    /* Statistics cards in rows - Full width */
    .row.mb-4 .col-md-3,
    .row.mb-4 .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Two-column layouts - Stack on mobile */
    .row > .col-md-8,
    .row > .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Alert info boxes - Stack content on mobile */
    .alert .row .col-md-6 {
        margin-bottom: 0.5rem;
    }
}

/* ============================================
   SMALL DEVICES (Small Tablets)
   ============================================ */
@media (min-width: 576px) and (max-width: 767.98px) {
    /* Sidebar - Still hidden by default */
    .sidebar {
        width: 260px;
        margin-left: -260px;
        transition: margin-left 0.3s ease;
    }

    .sidebar.show {
        margin-left: 0;
    }

    .sidebar.collapsed {
        margin-left: -260px;
    }

    /* Sidebar Overlay/Backdrop */
    .sidebar::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: -1;
    }

    .sidebar.show::before {
        opacity: 1;
        visibility: visible;
    }

    /* Main Wrapper */
    .main-wrapper {
        margin-left: 0 !important;
    }

    /* Top Header */
    .top-header {
        left: 0 !important;
        padding: 0 1.25rem;
    }

    /* Main Content */
    .main-content {
        padding: 1.5rem;
    }

    /* Page Header - Can be side by side */
    .page-header {
        flex-wrap: wrap;
        gap: 1rem;
    }

    /* Make d-flex headers responsive on small tablets */
    .d-flex.justify-content-between.align-items-center.mb-4 {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .d-flex.justify-content-between.align-items-center.mb-4 > .d-flex {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .page-title {
        font-size: 1.625rem;
    }

    /* Table Controls - Can be side by side */
    .table-controls {
        flex-wrap: wrap;
    }

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

    /* Tables */
    table.dataTable {
        font-size: 0.9rem;
        width: 100% !important;
    }

    table.dataTable thead th {
        padding: 0.625rem 0.5rem;
        white-space: nowrap;
    }

    table.dataTable tbody td {
        padding: 0.625rem 0.5rem;
        white-space: nowrap;
    }

    /* Preserve table responsive behavior on small tablets */
    .data-table-wrapper {
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
    }

    .data-table-wrapper .table-responsive {
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }

    .data-table-wrapper .table-responsive table {
        min-width: 700px; /* Minimum table width */
    }

    .dataTables_wrapper {
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Admin Profile - Can show name */
    .admin-profile span {
        display: inline;
    }
}

/* ============================================
   MEDIUM DEVICES (Tablets)
   ============================================ */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Sidebar - Can be visible */
    .sidebar {
        width: 260px;
    }

    .sidebar.collapsed {
        margin-left: -260px;
    }

    /* Main Wrapper */
    .main-wrapper {
        margin-left: 260px;
    }

    .sidebar.collapsed ~ .main-wrapper {
        margin-left: 0;
    }

    /* Top Header */
    .top-header {
        left: 260px;
    }

    .sidebar.collapsed ~ .main-wrapper .top-header {
        left: 0;
    }

    /* Main Content */
    .main-content {
        padding: 1.75rem;
    }

    /* Page Header */
    .page-title {
        font-size: 1.75rem;
    }

    /* Search Box */
    .search-box input {
        width: 220px;
    }

    /* Tables */
    table.dataTable {
        font-size: 0.95rem;
        width: 100% !important;
    }

    .data-table-wrapper .table-responsive {
        overflow-x: auto;
        overflow-y: visible !important;
    }

    /* Two-column layouts - Can be side by side on tablets */
    .row > .col-md-8 {
        flex: 0 0 66.666667%;
        max-width: 66.666667%;
    }

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

/* ============================================
   LARGE DEVICES (Small Desktops)
   ============================================ */
@media (min-width: 992px) and (max-width: 1199.98px) {
    /* Sidebar */
    .sidebar {
        width: 270px;
    }

    .sidebar.collapsed {
        margin-left: -270px;
    }

    /* Main Wrapper */
    .main-wrapper {
        margin-left: 270px;
    }

    .sidebar.collapsed ~ .main-wrapper {
        margin-left: 0;
    }

    /* Top Header */
    .top-header {
        left: 270px;
    }

    .sidebar.collapsed ~ .main-wrapper .top-header {
        left: 0;
    }

    /* Main Content */
    .main-content {
        padding: 2rem;
    }

    /* Search Box */
    .search-box input {
        width: 240px;
    }
}

/* ============================================
   EXTRA LARGE DEVICES (Large Desktops)
   ============================================ */
@media (min-width: 1200px) {
    /* Sidebar - Full width */
    .sidebar {
        width: 280px;
    }

    /* Main Wrapper */
    .main-wrapper {
        margin-left: 280px;
    }

    /* Top Header */
    .top-header {
        left: 280px;
    }

    /* Main Content - Can have more padding */
    .main-content {
        padding: 2.5rem;
        max-width: 1600px;
        margin-left: auto;
        margin-right: auto;
    }

    /* Search Box - Full width */
    .search-box input {
        width: 250px;
    }

    /* Tables - Can be larger */
    table.dataTable {
        font-size: 1rem;
        width: 100% !important;
    }

    /* Ensure proper table responsive behavior on large screens */
    .data-table-wrapper {
        overflow-x: auto;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
    }

    .data-table-wrapper .table-responsive {
        overflow-x: auto;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
    }

    .dataTables_wrapper {
        overflow-x: auto;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
    }
}

/* ============================================
   ULTRA WIDE SCREENS (Extra Large Desktops)
   ============================================ */
@media (min-width: 1400px) {
    .main-content {
        padding: 3rem;
        max-width: 1800px;
    }

    .page-title {
        font-size: 2rem;
    }
}

/* ============================================
   LANDSCAPE ORIENTATION (Mobile/Tablet)
   ============================================ */
@media (max-width: 991.98px) and (orientation: landscape) {
    .sidebar {
        width: 240px;
    }

    .main-content {
        padding: 1.25rem;
    }

    .top-header {
        height: 56px;
    }

    .main-content {
        margin-top: 56px;
    }
}

/* ============================================
   SWEETALERT – HIDE CKEDITOR IN TOAST/MODAL
   ============================================ */
.swal2-container .ck-editor,
.swal2-container .ck.ck-editor {
    display: none !important;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .sidebar,
    .top-header,
    .toggle-sidebar,
    .header-right,
    .btn-add-new,
    .action-dropdown,
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_paginate,
    .swal2-container,
    .no-print,
    /* CKEditor: hide toolbar and chrome when printing; only content shows */
    .ck-toolbar,
    .ck-toolbar__line-break,
    .ck.ck-editor .ck-toolbar,
    .ck-editor__top {
        display: none !important;
    }

    /* CKEditor: Ensure content is visible and properly styled for print */
    .ck-editor,
    .ck.ck-editor {
        display: block !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .ck-editor__editable,
    .ck.ck-editor__editable {
        display: block !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        padding: 0 !important;
        margin: 0 !important;
        min-height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        color: #000 !important;
        font-size: inherit !important;
        line-height: inherit !important;
    }

    .ck-editor__editable.ck-focused,
    .ck.ck-editor__editable.ck-focused {
        box-shadow: none !important;
        outline: none !important;
    }

    /* Ensure CKEditor content text prints properly */
    .ck-editor__editable p,
    .ck.ck-editor__editable p,
    .ck-editor__editable div,
    .ck.ck-editor__editable div,
    .ck-editor__editable span,
    .ck.ck-editor__editable span {
        color: #000 !important;
        background: transparent !important;
    }

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

    .main-content {
        margin-top: 0;
        padding: 0;
    }

    .data-table-wrapper {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    table.dataTable {
        font-size: 0.75rem;
    }
}

/* ============================================
   HIGH DPI DISPLAYS (Retina)
   ============================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .brand-logo,
    .table-avatar,
    .admin-avatar {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* ============================================
   TOUCH DEVICE OPTIMIZATIONS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch target sizes */
    .sidebar-nav .nav-link {
        min-height: 44px;
        padding: 0.875rem 1.25rem;
    }

    .btn,
    .btn-add-new,
    .action-dropdown .btn-action {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
    }

    .toggle-sidebar {
        min-width: 44px;
        min-height: 44px;
    }

    /* Remove hover effects on touch devices */
    .sidebar-nav .nav-link:hover {
        background-color: transparent;
    }

    .btn-add-new:hover {
        transform: none;
    }
}

/* ============================================
   DARK MODE SUPPORT (if needed)
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed in the future */
}

/* ============================================
   REDUCED MOTION (Accessibility)
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   UTILITY CLASSES FOR RESPONSIVE DESIGN
   ============================================ */

/* Hide on mobile */
@media (max-width: 767.98px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Hide on tablet and below */
@media (max-width: 991.98px) {
    .hide-tablet {
        display: none !important;
    }
}

/* Show only on mobile */
.show-mobile {
    display: none !important;
}

@media (max-width: 767.98px) {
    .show-mobile {
        display: block !important;
    }
}

/* Show only on tablet */
.show-tablet {
    display: none !important;
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .show-tablet {
        display: block !important;
    }
}

/* Full width on mobile */
@media (max-width: 767.98px) {
    .full-width-mobile {
        width: 100% !important;
    }
}

/* ============================================
   CRITICAL MOBILE TABLE SCROLLING FIX
   Must override all other styles for mobile
   ============================================ */
@media (max-width: 767.98px) {
    /* Force horizontal scrolling on mobile - highest priority */
    html body .main-content .data-table-wrapper {
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch !important;
        position: relative !important;
        max-width: 100vw !important;
    }

    html body .main-content .data-table-wrapper .table-responsive {
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch !important;
        position: relative !important;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    html body .main-content .data-table-wrapper .dataTables_wrapper {
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch !important;
        position: relative !important;
        width: 100% !important;
    }

    html body .main-content .data-table-wrapper .dataTables_wrapper .dataTables_scroll {
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch !important;
    }

    html body .main-content .data-table-wrapper .dataTables_wrapper .dataTables_scrollBody {
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch !important;
    }

    html body .main-content .data-table-wrapper .table-responsive table,
    html body .main-content .data-table-wrapper .table-responsive table.dataTable {
        min-width: 600px !important;
        width: 100% !important;
        display: table !important;
    }

    /* Prevent text wrapping in table cells on mobile */
    html body .main-content .data-table-wrapper table.dataTable thead th,
    html body .main-content .data-table-wrapper table.dataTable tbody td {
        white-space: nowrap !important;
    }
}

/* ============================================
   ERROR PAGES RESPONSIVE STYLES
   ============================================ */
@media (max-width: 575.98px) {
    .error-container {
        padding: 15px !important;
    }

    .error-content {
        padding: 30px 20px !important;
        border-radius: 15px !important;
    }

    .error-code {
        font-size: 80px !important;
    }

    .error-title {
        font-size: 24px !important;
    }

    .error-message {
        font-size: 16px !important;
    }

    .error-icon {
        font-size: 60px !important;
    }

    .btn-home {
        width: 100%;
        margin-bottom: 10px;
    }

    .d-flex.gap-3 {
        flex-direction: column;
        gap: 10px !important;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .error-content {
        padding: 40px 30px !important;
    }

    .error-code {
        font-size: 100px !important;
    }

    .error-title {
        font-size: 28px !important;
    }

    .error-message {
        font-size: 17px !important;
    }

    .error-icon {
        font-size: 70px !important;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .error-content {
        padding: 50px 35px !important;
    }

    .error-code {
        font-size: 110px !important;
    }
}
