/**
 * Mobile Admin Panel Optimizations
 * Professional, clean, and fast mobile experience
 */

/* ==========================================
   MOBILE ARROW MENU BUTTON (NO HAMBURGER)
   ========================================== */

/* Hide sidebar by default on mobile */
@media (max-width: 768px) {
    /* Hide role indicator by default on mobile, show when menu opens */
    #roleIndicator {
        display: none;
    }
    
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        width: 280px;
        transition: left 0.3s ease;
        z-index: 1000;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
        background: #1e293b;
        color: #f1f5f9;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    /* Sidebar link colors in light mode */
    .sidebar-menu-item {
        color: #f1f5f9;
    }
    
    .sidebar-menu-item:hover {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .sidebar-menu-item.active {
        background: rgba(99, 102, 241, 0.2);
        border-left: 3px solid #6366f1;
    }
    
    .sidebar-brand {
        color: #f1f5f9;
    }
    
    /* FORCE show text labels with icons - don't hide them */
    .sidebar-menu-item span,
    .sidebar-brand span {
        display: inline-block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    .sidebar-menu-item {
        padding: 12px 20px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
    }
    
    .sidebar-menu-item i {
        margin-right: 12px !important;
        width: 20px !important;
        text-align: center !important;
    }
    
    /* Arrow menu button */
    .mobile-menu-toggle {
        position: fixed;
        top: 20px;
        left: 20px;
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 1001;
        transition: all 0.3s ease;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    }
    
    .mobile-menu-toggle:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: scale(1.05);
    }
    
    .mobile-menu-toggle i {
        color: #fff;
        font-size: 18px;
        transition: transform 0.3s ease;
    }
    
    .mobile-menu-toggle.active i {
        transform: rotate(180deg);
    }
    
    /* Dark mode button styling */
    body.dark .mobile-menu-toggle,
    body.dark-mode .mobile-menu-toggle {
        background: rgba(30, 41, 59, 0.9);
        border-color: rgba(148, 163, 184, 0.2);
    }
    
    body.dark .mobile-menu-toggle:hover,
    body.dark-mode .mobile-menu-toggle:hover {
        background: rgba(30, 41, 59, 1);
    }
    
    /* Overlay when menu is open */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Adjust main content margin */
    .main-content {
        margin-left: 0;
        padding: 80px 15px 20px;
    }
}

/* ==========================================
   GLOBAL MOBILE TEXT SIZES (STOP SHOUTING)
   ========================================== */

@media (max-width: 768px) {
    /* Page titles */
    .page-header h1,
    .page-title h1,
    h1 {
        font-size: 18px !important;
        font-weight: 600 !important;
        line-height: 1.4;
    }
    
    /* Section titles */
    h2, h3, .section-title,
    .product-form-container h2,
    .form-section-title {
        font-size: 15px !important;
        font-weight: 600 !important;
        line-height: 1.4;
    }
    
    h4, h5, h6 {
        font-size: 14px !important;
        font-weight: 600 !important;
    }
    
    /* Input labels */
    label,
    .form-label {
        font-size: 13px !important;
        font-weight: 500 !important;
        line-height: 1.5;
        margin-bottom: 6px;
    }
    
    /* Button text - exclude header buttons */
    button:not(.page-header button):not(.actions button),
    .btn:not(.page-header .btn):not(.actions .btn),
    .primary-btn,
    .secondary-btn,
    .action-btn {
        font-size: 14px !important;
        padding: 10px 16px !important;
        font-weight: 500 !important;
        line-height: 1.4;
    }
    
    /* Keep header buttons small on mobile */
    .page-header button,
    .page-header .btn,
    .actions button,
    .actions .btn {
        font-size: 11px;
        padding: 5px 10px;
        font-weight: 500;
    }
    
    /* Body text */
    p, span, div {
        font-size: 14px;
        line-height: 1.6;
    }
    
    /* Small text */
    small, .help-text {
        font-size: 12px !important;
        line-height: 1.5;
    }
    
    /* Page subtitle */
    .page-header p,
    .page-title p {
        font-size: 13px !important;
        font-weight: 400;
        opacity: 0.8;
    }
}

/* ==========================================
   ADD NEW PRODUCT PAGE (PREMIUM & CLEAN)
   ========================================== */

@media (max-width: 768px) {
    /* Main card container */
    .card {
        margin: 0 !important;
        padding: 15px !important;
        border-radius: 12px !important;
        background: #fff !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    }
    
    body.dark .card,
    body.dark-mode .card {
        background: #1e293b !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    }
    
    .card h2 {
        font-size: 18px !important;
        margin-bottom: 15px !important;
    }
    
    /* Category tab buttons - Horizontal compact tabs */
    .tab-container {
        margin-bottom: 20px;
    }
    
    .tab-buttons {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        margin-bottom: 20px;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .tab-buttons::-webkit-scrollbar {
        display: none;
    }
    
    .tab-button {
        padding: 8px 16px !important;
        background: rgba(100, 116, 139, 0.1) !important;
        border: 1px solid rgba(100, 116, 139, 0.2) !important;
        border-radius: 20px !important;
        font-size: 13px !important;
        font-weight: 500 !important;
        white-space: nowrap;
        cursor: pointer;
        transition: all 0.2s ease;
        color: inherit;
    }
    
    .tab-button.active {
        background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%) !important;
        color: #fff !important;
        border-color: transparent !important;
    }
    
    body.dark .tab-button,
    body.dark-mode .tab-button {
        background: rgba(148, 163, 184, 0.1) !important;
        border-color: rgba(148, 163, 184, 0.15) !important;
    }
    
    body.dark .tab-button.active,
    body.dark-mode .tab-button.active {
        background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%) !important;
        color: #fff !important;
    }
    
    /* Tab content */
    .tab-content {
        animation: fadeIn 0.3s ease;
    }
    
    .tab-content h3 {
        font-size: 15px !important;
        margin-bottom: 15px !important;
        font-weight: 600;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(5px); }
        to { opacity: 1; transform: translateY(0); }
    }
    
    /* Form container - Clean and smooth */
    .product-form-container,
    .form-container {
        padding: 20px 15px !important;
        border-radius: 12px;
        background: #fff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
    
    body.dark .product-form-container,
    body.dark-mode .product-form-container,
    body.dark .form-container,
    body.dark-mode .form-container {
        background: #1e293b;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    /* All inputs - Same height, clean style */
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="tel"],
    textarea,
    select {
        height: 42px !important;
        padding: 0 12px !important;
        border: 1.5px solid rgba(100, 116, 139, 0.2) !important;
        border-radius: 8px !important;
        font-size: 14px !important;
        background: #fff !important;
        transition: all 0.2s ease;
    }
    
    textarea {
        height: 90px !important;
        padding: 10px 12px !important;
        resize: vertical;
    }
    
    /* Focus state */
    input:focus,
    textarea:focus,
    select:focus {
        outline: none !important;
        border-color: #6366f1 !important;
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
    }
    
    body.dark input[type="text"],
    body.dark input[type="number"],
    body.dark input[type="email"],
    body.dark input[type="tel"],
    body.dark textarea,
    body.dark select,
    body.dark-mode input[type="text"],
    body.dark-mode input[type="number"],
    body.dark-mode input[type="email"],
    body.dark-mode input[type="tel"],
    body.dark-mode textarea,
    body.dark-mode select {
        background: #0f172a !important;
        border-color: rgba(148, 163, 184, 0.2) !important;
        color: #f1f5f9 !important;
    }
    
    /* Form groups - Reduced spacing */
    .form-group {
        margin-bottom: 14px !important;
    }
    
    .form-group label {
        margin-bottom: 6px !important;
        display: block;
    }
    
    .form-row {
        display: flex;
        flex-direction: column !important;
        gap: 14px !important;
        margin-bottom: 14px !important;
    }
    
    .form-row .form-group {
        width: 100% !important;
        margin-bottom: 0 !important;
    }
    
    /* Special width classes */
    .third-width,
    .half-width {
        width: 100% !important;
    }
    
    /* Buttons in forms */
    .form-group button,
    form button[type="button"],
    form button[type="submit"] {
        width: 100%;
        padding: 12px 16px !important;
        font-size: 14px !important;
        border-radius: 8px;
        margin-top: 8px;
    }
    
    /* Section grouping - Visual separation without boxes */
    .form-section {
        margin-bottom: 24px;
        padding-bottom: 20px;
        border-bottom: 1px solid rgba(100, 116, 139, 0.1);
    }
    
    .form-section:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }
    
    .form-section-title {
        margin-bottom: 12px !important;
        color: #64748b;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-size: 12px !important;
        font-weight: 600 !important;
    }
    
    body.dark .form-section,
    body.dark-mode .form-section {
        border-color: rgba(148, 163, 184, 0.1);
    }
    
    body.dark .form-section-title,
    body.dark-mode .form-section-title {
        color: #94a3b8;
    }
    
    /* Category switch animation */
    .category-content {
        animation: fadeInUp 0.3s ease;
    }
    
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ==========================================
   ORDERS PAGE (BUSINESS-CRITICAL MOBILE)
   ========================================== */

@media (max-width: 768px) {
    /* Orders page container */
    .orders-container,
    .container {
        padding: 15px;
    }
    
    /* Page header styling */
    .page-header h1 {
        font-size: 18px;
        margin-bottom: 4px;
        font-weight: 600;
    }
    
    .page-header p {
        font-size: 13px;
        opacity: 0.7;
        margin-bottom: 15px;
    }
    
    /* Filter tabs (Pending/Completed) */
    .status-tabs,
    .filter-tabs {
        display: flex;
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .status-tab,
    .filter-tab {
        flex: 1;
        padding: 10px 16px;
        border-radius: 10px;
        font-size: 13px;
        font-weight: 600;
        text-align: center;
        cursor: pointer;
        border: 2px solid transparent;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }
    
    .status-tab:not(.active),
    .filter-tab:not(.active) {
        background: rgba(100, 116, 139, 0.08);
        color: #64748b;
    }
    
    .status-tab.active,
    .filter-tab.active {
        background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
        color: #fff;
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    }
    
    body.dark .status-tab:not(.active),
    body.dark-mode .status-tab:not(.active),
    body.dark .filter-tab:not(.active),
    body.dark-mode .filter-tab:not(.active) {
        background: #1e293b;
        border: 1px solid rgba(148, 163, 184, 0.2);
        color: #94a3b8;
    }
    
    body.dark .status-tab.active,
    body.dark-mode .status-tab.active,
    body.dark .filter-tab.active,
    body.dark-mode .filter-tab.active {
        background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
        color: #fff;
    }
    
    /* Search and filter controls */
    .search-filter-section {
        margin-bottom: 15px;
    }
    
    .search-box {
        margin-bottom: 10px;
    }
    
    .search-box input {
        width: 100%;
        height: 42px;
        padding: 0 12px;
        border: 1.5px solid rgba(100, 116, 139, 0.2);
        border-radius: 10px;
        font-size: 14px;
        background: #fff;
        transition: all 0.2s ease;
    }
    
    .search-box input:focus {
        outline: none;
        border-color: #6366f1;
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    }
    
    body.dark .search-box input,
    body.dark-mode .search-box input {
        background: #0f172a;
        border-color: rgba(148, 163, 184, 0.2);
        color: #f1f5f9;
    }
    
    /* Local mode badge */
    .local-mode-badge,
    .mode-badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 6px 12px;
        background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
        color: #fff;
        border-radius: 8px;
        font-size: 12px;
        font-weight: 600;
        margin-bottom: 10px;
        box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    }
    
    /* Status filter dropdown */
    .filter-select select,
    .status-filter select {
        width: 100%;
        height: 42px;
        padding: 0 12px;
        border: 1.5px solid rgba(100, 116, 139, 0.2);
        border-radius: 10px;
        font-size: 14px;
        background: #fff;
        cursor: pointer;
    }
    
    body.dark .filter-select select,
    body.dark-mode .filter-select select,
    body.dark .status-filter select,
    body.dark-mode .status-filter select {
        background: #0f172a;
        border-color: rgba(148, 163, 184, 0.2);
        color: #f1f5f9;
    }
    
    /* Order cards - Compact */
    .order-card {
        padding: 12px;
        margin-bottom: 10px;
        border-radius: 10px;
        background: #fff;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
        border: 1px solid rgba(100, 116, 139, 0.1);
    }
    
    body.dark .order-card,
    body.dark-mode .order-card {
        background: #1e293b;
        border-color: rgba(148, 163, 184, 0.15);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    }
    
    /* Order detail sections */
    .order-details,
    .order-info,
    .customer-details,
    .order-items-section {
        background: #fff;
        border-radius: 10px;
        padding: 12px;
        margin-bottom: 10px;
    }
    
    body.dark .order-details,
    body.dark-mode .order-details,
    body.dark .order-info,
    body.dark-mode .order-info,
    body.dark .customer-details,
    body.dark-mode .customer-details,
    body.dark .order-items-section,
    body.dark-mode .order-items-section {
        background: #1e293b;
        border: 1px solid rgba(148, 163, 184, 0.15);
    }
    
    /* Product items in orders */
    .order-item,
    .product-item,
    .item-card {
        background: #fff;
        border: 1px solid rgba(100, 116, 139, 0.1);
        border-radius: 8px;
        padding: 10px;
        margin-bottom: 8px;
    }
    
    body.dark .order-item,
    body.dark-mode .order-item,
    body.dark .product-item,
    body.dark-mode .product-item,
    body.dark .item-card,
    body.dark-mode .item-card {
        background: #0f172a;
        border-color: rgba(148, 163, 184, 0.2);
    }
    
    /* Order summary sections */
    .order-summary,
    .payment-info,
    .shipping-info {
        background: #fff;
        padding: 12px;
        border-radius: 10px;
        margin-bottom: 10px;
    }
    
    body.dark .order-summary,
    body.dark-mode .order-summary,
    body.dark .payment-info,
    body.dark-mode .payment-info,
    body.dark .shipping-info,
    body.dark-mode .shipping-info {
        background: #1e293b;
        border: 1px solid rgba(148, 163, 184, 0.15);
    }
    
    /* Action buttons in dark mode */
    body.dark .btn-light,
    body.dark-mode .btn-light {
        background: #1e293b;
        border-color: rgba(148, 163, 184, 0.3);
        color: #f1f5f9;
    }
    
    body.dark .btn-light:hover,
    body.dark-mode .btn-light:hover {
        background: #334155;
    }
    
    /* Order timing section */
    .order-timing {
        background: rgba(100, 116, 139, 0.08);
        padding: 8px 12px;
        border-radius: 8px;
        margin: 10px 0;
    }
    
    body.dark .order-timing,
    body.dark-mode .order-timing {
        background: #0f172a;
        border: 1px solid rgba(148, 163, 184, 0.2);
    }
    
    .timing-item {
        font-size: 12px;
        color: #64748b;
        margin-right: 12px;
    }
    
    body.dark .timing-item,
    body.dark-mode .timing-item {
        color: #94a3b8;
    }
    
    .timing-item i {
        margin-right: 4px;
        font-size: 11px;
    }
    
    /* Order footer */
    .order-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px;
        background: rgba(100, 116, 139, 0.05);
        border-top: 1px solid rgba(100, 116, 139, 0.1);
        border-radius: 0 0 10px 10px;
        margin-top: 10px;
    }
    
    body.dark .order-footer,
    body.dark-mode .order-footer {
        background: #0f172a;
        border-color: rgba(148, 163, 184, 0.2);
    }
    
    .order-total .label {
        font-size: 13px;
        color: #64748b;
        margin-right: 8px;
    }
    
    body.dark .order-total .label,
    body.dark-mode .order-total .label {
        color: #94a3b8;
    }
    
    .order-total .amount {
        font-size: 16px;
        font-weight: 700;
        color: #22c55e;
    }
    
    .order-actions {
        display: flex;
        gap: 8px;
    }
    
    .order-action-btn {
        padding: 6px 12px;
        font-size: 12px;
        border-radius: 8px;
    }
    
    body.dark .btn-outline-primary,
    body.dark-mode .btn-outline-primary {
        border-color: #6366f1;
        color: #6366f1;
        background: transparent;
    }
    
    body.dark .btn-outline-primary:hover,
    body.dark-mode .btn-outline-primary:hover {
        background: rgba(99, 102, 241, 0.1);
    }
    
    body.dark .btn-outline-danger,
    body.dark-mode .btn-outline-danger {
        border-color: #ef4444;
        color: #ef4444;
        background: transparent;
    }
    
    body.dark .btn-outline-danger:hover,
    body.dark-mode .btn-outline-danger:hover {
        background: rgba(239, 68, 68, 0.1);
    }
    
    /* Tab buttons with badges */
    .tab-btn {
        padding: 10px 16px;
        border: none;
        background: rgba(100, 116, 139, 0.08);
        color: #64748b;
        border-radius: 10px;
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .tab-btn.active {
        background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
        color: #fff;
    }
    
    body.dark .tab-btn,
    body.dark-mode .tab-btn {
        background: #1e293b;
        color: #94a3b8;
        border: 1px solid rgba(148, 163, 184, 0.2);
    }
    
    body.dark .tab-btn.active,
    body.dark-mode .tab-btn.active {
        background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
        color: #fff;
        border-color: transparent;
    }
    
    .tab-btn .badge {
        background: rgba(99, 102, 241, 0.15);
        color: #6366f1;
        padding: 2px 8px;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 700;
    }
    
    .tab-btn.active .badge {
        background: rgba(255, 255, 255, 0.25);
        color: #fff;
    }
    
    body.dark .tab-btn .badge,
    body.dark-mode .tab-btn .badge {
        background: rgba(99, 102, 241, 0.2);
        color: #818cf8;
    }
    
    body.dark .tab-btn.active .badge,
    body.dark-mode .tab-btn.active .badge {
        background: rgba(255, 255, 255, 0.25);
        color: #fff;
    }
    
    /* Empty state */
    .empty-state,
    .no-orders {
        text-align: center;
        padding: 40px 20px;
    }
    
    .empty-state i,
    .no-orders i {
        font-size: 48px;
        color: #cbd5e1;
        margin-bottom: 12px;
    }
    
    .empty-state h3,
    .no-orders h3 {
        font-size: 15px;
        font-weight: 600;
        margin-bottom: 6px;
    }
    
    .empty-state p,
    .no-orders p {
        font-size: 13px;
        opacity: 0.7;
        line-height: 1.6;
    }
    
    /* First row - Order ID and status */
    .order-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
    }
    
    .order-id {
        font-size: 13px !important;
        font-weight: 600;
        font-family: 'Courier New', monospace;
    }
    
    .status-badge {
        padding: 4px 10px !important;
        border-radius: 12px;
        font-size: 11px !important;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }
    
    .status-badge.pending {
        background: rgba(234, 179, 8, 0.15);
        color: #eab308;
        border: 1px solid rgba(234, 179, 8, 0.3);
    }
    
    .status-badge.completed {
        background: rgba(34, 197, 94, 0.15);
        color: #22c55e;
        border: 1px solid rgba(34, 197, 94, 0.3);
    }
    
    .status-badge.cancelled {
        background: rgba(239, 68, 68, 0.15);
        color: #ef4444;
        border: 1px solid rgba(239, 68, 68, 0.3);
    }
    
    /* Second row - Customer info */
    .order-customer {
        margin-bottom: 8px;
    }
    
    .customer-name {
        font-size: 14px !important;
        font-weight: 500;
        margin-bottom: 4px;
    }
    
    .customer-phone {
        font-size: 13px !important;
        opacity: 0.8;
        display: flex;
        align-items: center;
        gap: 6px;
    }
    
    .customer-phone i {
        font-size: 11px;
    }
    
    /* Address - Collapsible */
    .order-address {
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid rgba(100, 116, 139, 0.1);
    }
    
    body.dark .order-address,
    body.dark-mode .order-address {
        border-color: rgba(148, 163, 184, 0.15);
    }
    
    .address-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
        padding: 6px 0;
        font-size: 13px !important;
        font-weight: 500;
        color: #6366f1;
    }
    
    .address-toggle i {
        font-size: 12px;
        transition: transform 0.2s ease;
    }
    
    .address-toggle.active i {
        transform: rotate(180deg);
    }
    
    .address-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        font-size: 13px !important;
        line-height: 1.6;
        padding-top: 0;
    }
    
    .address-content.open {
        max-height: 200px;
        padding-top: 8px;
    }
    
    /* Search and filters - Full width, compact */
    .filter-bar,
    .filters-container {
        padding: 12px !important;
        margin-bottom: 15px;
    }
    
    .search-box,
    .filter-select {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .search-box input,
    .filter-select select {
        height: 38px !important;
        font-size: 14px !important;
    }
    
    /* Stats cards - Compact */
    .stats-card {
        padding: 12px !important;
        margin-bottom: 10px;
    }
    
    .stats-card h3 {
        font-size: 24px !important;
    }
    
    .stats-card p {
        font-size: 12px !important;
    }
}

/* ==========================================
   GENERAL MOBILE RULES (NON-NEGOTIABLE)
   ========================================== */

@media (max-width: 768px) {
    /* No horizontal scrolling */
    body {
        overflow-x: hidden;
    }
    
    * {
        max-width: 100%;
    }
    
    /* No oversized text */
    * {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Reduce wasted white space */
    .container,
    .main-content {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    /* Buttons - Thumb-friendly but not huge */
    button,
    .btn,
    a.btn {
        min-height: 44px;
        padding: 10px 16px !important;
        touch-action: manipulation;
    }
    
    /* Everything readable without zoom */
    input,
    textarea,
    select {
        font-size: 16px !important; /* Prevents iOS zoom */
    }
    
    /* Tap targets */
    a, button, input[type="submit"], input[type="button"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Tables - Responsive */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Cards - Full width */
    .card,
    .product-card {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Remove excessive padding */
    .page-header {
        padding: 15px 0 !important;
    }
    
    /* Action buttons - Stack vertically */
    .form-actions,
    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-actions button,
    .action-buttons button {
        width: 100%;
    }
}

/* ==========================================
   PERFORMANCE OPTIMIZATIONS
   ========================================== */

@media (max-width: 768px) {
    /* Hardware acceleration */
    .sidebar,
    .mobile-menu-toggle,
    .mobile-menu-overlay {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        will-change: transform, opacity;
    }
    
    /* Smooth scrolling */
    html {
        scroll-behavior: smooth;
    }
    
    /* Touch optimization */
    * {
        -webkit-tap-highlight-color: rgba(99, 102, 241, 0.1);
    }
}
