@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        z-index: 9999;
        width: 260px;
        height: 100vh;
        top: 0;
        left: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: none !important;
    }

    .sidebar-overlay.show {
        display: block !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 10px !important;
    }

    .mobile-toggle {
        display: block !important;
    }

    .header {
        padding: 8px 12px !important;
        left: 0 !important;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 12px;
    }

    .table th,
    .table td {
        padding: 4px 6px;
        white-space: nowrap;
    }

    .modal-dialog {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        height: 100% !important;
    }

    .modal-content {
        height: 100% !important;
        border-radius: 0 !important;
    }

    .modal-body {
        max-height: calc(100vh - 120px) !important;
        overflow-y: auto !important;
    }

    .form-row,
    .form-inline .form-group {
        flex-direction: column !important;
        display: block !important;
        margin-right: 0 !important;
    }

    .form-row > .form-group,
    .form-row > .col,
    .form-row > [class*="col-"] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        margin-bottom: 8px;
    }

    .form-control {
        font-size: 16px;
    }

    .card-deck,
    .card-columns {
        display: block !important;
    }

    .card-deck .card,
    .card {
        margin-bottom: 10px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    .dashboard-stats {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .stat-card {
        margin-bottom: 10px;
    }

    .btn-group .btn {
        padding: 4px 8px;
        font-size: 12px;
    }

    .btn-group-vertical-mobile .btn {
        display: block;
        width: 100%;
    }

    .pagination {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination .page-item .page-link {
        padding: 6px 10px;
        font-size: 12px;
    }

    .search-bar,
    .filter-bar {
        flex-direction: column !important;
    }

    .search-bar .form-group,
    .filter-bar > * {
        width: 100% !important;
        margin-bottom: 8px;
    }

    .nav-tabs {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
    }

    .nav-tabs .nav-link {
        white-space: nowrap;
    }

    .header .nav-tabs {
        max-width: 200px;
    }

    .navbar-custom-menu .hidden-xs {
        display: none !important;
    }

    .page-header h3 {
        font-size: 16px;
    }

    .page-content {
        padding: 8px !important;
    }

    .toolbar {
        flex-direction: column;
        gap: 8px;
    }

    .toolbar .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }

    .table th,
    .table td {
        padding: 3px 4px;
        font-size: 11px;
    }

    .btn {
        padding: 4px 8px;
        font-size: 12px;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.1rem; }
}
