@media (max-width: 768px) {
    .app-container { flex-direction: column; }
    
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        height: 100%;
        z-index: 1000;
        transition: left 0.3s ease;
        width: 260px;
    }
    
    .sidebar.open { left: 0; }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.open { display: block; }
    
    .staff-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 220px;
    }
    
    .staff-sidebar.open { transform: translateX(0); }
    
    #sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    #sidebar-overlay.active { display: block; }
    
    .main-content {
        width: 100%;
        margin-left: 0;
        min-height: 100vh;
    }
    
    .header {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .header-left { 
        flex: 1;
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .header-actions {
        display: flex;
        justify-content: flex-end;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .header-actions .btn {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    
    .header-actions .btn span { display: none; }
    
    .header-actions .btn svg { margin: 0; }
    
    .page-title { font-size: 1.1rem; }
    
    .menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: var(--text-primary);
        padding: 8px;
        cursor: pointer;
    }
    
    .content-area { 
        padding: 12px; 
        overflow-x: hidden;
    }
    
    .stats-grid,
    .grid-4,
    .grid.grid-4 {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }
    
    .stat-card { 
        padding: 14px; 
        flex-direction: column;
        gap: 8px;
    }
    
    .stat-card-new { 
        padding: 12px !important; 
        gap: 8px !important;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .stat-icon-circle {
        width: 36px !important;
        height: 36px !important;
    }
    
    .stat-content h3 { font-size: 1.25rem; }
    .stat-content p { font-size: 0.75rem; }
    
    .stat-info h3 { font-size: 0.65rem !important; }
    .stat-info p { font-size: 1rem !important; margin: 0 !important; }
    
    .stat-value { font-size: 1.25rem; }
    
    .grid[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    
    .chart-card { padding: 16px !important; }
    .chart-card h3 { font-size: 0.9rem !important; }
    
    .glass-card, .card { 
        border-radius: 12px; 
        padding: 12px;
        overflow: hidden;
    }
    
    .card-header {
        padding: 12px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .card-header h3 { font-size: 1rem; }
    
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -12px;
        padding: 0 12px;
        width: calc(100% + 24px);
    }
    
    .data-table, .service-table, .reminder-table {
        min-width: 650px;
        font-size: 0.8rem;
    }
    
    .data-table th, .data-table td,
    .service-table th, .service-table td,
    .reminder-table th, .reminder-table td {
        padding: 10px 8px;
        white-space: nowrap;
    }
    
    .action-buttons {
        display: flex;
        gap: 4px;
        flex-wrap: nowrap;
    }
    
    .btn-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
        padding: 6px;
    }
    
    .btn-icon svg { width: 14px; height: 14px; }
    
    .action-btn {
        padding: 10px 14px;
        font-size: 0.75rem;
        margin: 2px;
        white-space: nowrap;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .action-btn.whatsapp {
        background: #22c55e;
        color: white;
        border: none;
    }
    
    .action-btn.call {
        background: #3b82f6;
        color: white;
        border: none;
        text-decoration: none;
    }
    
    .action-btn.mark {
        background: #6b7280;
        color: white;
        border: none;
    }
    
    .modal-overlay {
        padding: 12px;
        align-items: flex-start;
        overflow-y: auto;
    }
    
    .modal { 
        width: 100%;
        max-width: 100%; 
        margin: 0;
        max-height: none;
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 14px 16px;
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
    }
    
    .modal-title { font-size: 1rem; }
    
    .modal-body { 
        padding: 16px; 
        overflow-y: visible;
    }
    
    .modal-footer { 
        padding: 12px 16px;
        flex-direction: column;
        gap: 8px;
        position: sticky;
        bottom: 0;
        background: white;
    }
    
    .modal-footer .btn { width: 100%; }
    
    .form-row,
    .form-grid,
    [style*="grid-template-columns: 1fr 1fr"] {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .form-group { margin-bottom: 14px; }
    
    .form-input, 
    .form-select,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="date"],
    input[type="number"],
    select,
    textarea { 
        padding: 12px 14px;
        font-size: 16px !important;
        border-radius: 8px;
    }
    
    .form-label {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }
    
    .queue-tabs, .settings-tabs, .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        gap: 6px;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
    }
    
    .queue-tab, .settings-tab, .tab {
        padding: 10px 14px;
        font-size: 0.75rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .empty-state { padding: 40px 20px; }
    
    .empty-state svg { width: 60px; height: 60px; }
    
    .empty-state h3 { font-size: 1rem; }
    
    .toast-container {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }
    
    .toast {
        width: 100%;
        padding: 12px 16px;
        font-size: 0.875rem;
    }
    
    .user-info { 
        padding: 12px; 
        flex-direction: column;
        text-align: center;
    }
    
    .user-avatar { width: 40px; height: 40px; font-size: 1rem; }
    
    .user-details { text-align: center; }
    
    .sidebar-nav .nav-item { 
        padding: 14px 16px; 
        font-size: 0.9rem;
    }
    
    .status-badge, .badge {
        padding: 4px 8px;
        font-size: 0.65rem;
    }
    
    .date-cell { font-size: 0.75rem; }
    
    .vehicle-cell, .customer-cell { min-width: 90px; }
    
    .vehicle-number, .customer-name { font-size: 0.8rem; }
    
    .vehicle-model, .customer-phone { font-size: 0.7rem; }
    
    .settings-card { 
        padding: 16px; 
        margin-bottom: 16px;
    }
    
    .settings-section { margin-bottom: 20px; }
    
    .staff-form { padding: 16px; }
    
    .staff-form-grid { grid-template-columns: 1fr; }
    
    .team-table { min-width: 450px; }
    
    .chart-container { height: 220px !important; }
    
    .quick-actions { 
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .quick-action-btn {
        padding: 12px 16px;
        font-size: 0.8rem;
        flex: 1;
        min-width: 120px;
    }
    
    .login-card {
        margin: 16px;
        padding: 24px 20px;
        width: calc(100% - 32px);
        max-width: none;
    }
    
    .login-header h1 { font-size: 1.5rem; }
    
    .login-header p { font-size: 0.85rem; }
    
    .quick-login {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .quick-login-btn {
        flex: 1;
        min-width: 80px;
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    
    .mobile-card {
        display: block !important;
    }
    
    .desktop-table {
        display: none !important;
    }
    
    .mobile-card-item {
        background: white;
        border: 1px solid var(--glass-border);
        border-radius: 12px;
        padding: 14px;
        margin-bottom: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    }
    
    .mobile-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
        padding-bottom: 10px;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .mobile-card-title {
        font-weight: 600;
        font-size: 0.95rem;
        color: var(--text-primary);
    }
    
    .mobile-card-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        font-size: 0.85rem;
    }
    
    .mobile-card-label {
        color: var(--text-muted);
        font-size: 0.8rem;
    }
    
    .mobile-card-value {
        color: var(--text-primary);
        font-weight: 500;
        text-align: right;
    }
    
    .mobile-card-actions {
        display: flex;
        gap: 8px;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #f0f0f0;
        flex-wrap: wrap;
    }
    
    .mobile-card-actions .btn {
        flex: 1;
        min-width: 70px;
        padding: 10px;
        font-size: 0.75rem;
        justify-content: center;
    }
    
    .row-sent {
        background: #f0fdf4 !important;
        border-left: 3px solid #22c55e;
    }
    
    .row-pending {
        background: #fefce8 !important;
        border-left: 3px solid #eab308;
    }
    
    .template-textarea {
        min-height: 120px !important;
        font-size: 14px !important;
    }
    
    .password-toggle {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        cursor: pointer;
        padding: 4px;
    }
    
    .password-wrapper {
        position: relative;
    }
    
    .forgot-password-link {
        display: block;
        text-align: center;
        margin-top: 12px;
        font-size: 0.85rem;
        color: var(--primary);
    }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    
    .header {
        padding: 10px 12px;
    }
    
    .page-title { font-size: 1rem; }
    
    .header-actions .btn {
        width: 34px;
        height: 34px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .content-area { padding: 10px; }
    
    .data-table, .service-table, .reminder-table { min-width: 550px; }
    
    .btn-icon { width: 30px; height: 30px; min-width: 30px; }
    
    .action-btn { padding: 6px 8px; font-size: 0.65rem; }
    
    .stat-card { padding: 12px; }
    
    .stat-content h3 { font-size: 1.1rem; }
    
    .mobile-card-item { padding: 12px; }
    
    .mobile-card-actions .btn {
        font-size: 0.7rem;
        padding: 8px;
    }
    
    .modal { border-radius: 10px; }
    
    .modal-body { padding: 14px; }
    
    .login-card {
        margin: 12px;
        padding: 20px 16px;
    }
    
    .login-header h1 { font-size: 1.3rem; }
    
    .quick-login-btn {
        padding: 6px 10px;
        font-size: 0.7rem;
    }
}

@media (max-width: 768px) {
    .toggle-switch {
        min-width: 48px;
        min-height: 28px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .toggle-switch .toggle-slider:before {
        width: 22px;
        height: 22px;
    }
    
    .btn, button, a.btn {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .btn-primary, .btn-secondary {
        min-height: 44px;
    }
    
    .mobile-menu-toggle {
        min-width: 44px;
        min-height: 44px;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    
    .reminder-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .reminder-actions {
        width: 100%;
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .reminder-actions button,
    .reminder-actions a {
        flex: 1;
        min-width: 80px;
        text-align: center;
        min-height: 44px;
    }
    
    .btn-whatsapp, .btn-call, .btn-mark-sent {
        padding: 12px 16px;
        font-size: 0.85rem;
        border-radius: 8px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (min-width: 769px) {
    .mobile-card {
        display: none !important;
    }
    
    .desktop-table {
        display: block !important;
    }
    
    .menu-toggle {
        display: none;
    }
}
