/* CSS Reset & Variables */
        :root {
            --primary: #16a34a;
            --primary-dark: #15803d;
            --bg: #f8fafc;
            --surface: #ffffff;
            --text: #0f172a;
            --text-light: #64748b;
            --border: #e2e8f0;
            --danger: #ef4444;
            --warning: #f59e0b;
            --radius: 12px;
            --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        }

        * {
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }

        body {
            font-family: 'Inter', sans-serif;
            background-color: var(--bg);
            color: var(--text);
            margin: 0;
            padding: 0;
            padding-bottom: 80px;
            /* Space for bottom nav */
            min-height: 100vh;
        }

        /* Header */
        .header {
            background: var(--surface);
            padding: 16px;
            position: sticky;
            top: 0;
            z-index: 100;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .header h1 {
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--primary-dark);
            margin: 0;
        }

        .add-btn {
            background: var(--primary);
            color: white;
            border: none;
            padding: 8px 16px;
            border-radius: 20px;
            font-weight: 600;
            font-size: 0.9rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
            box-shadow: 0 2px 4px rgba(22, 163, 74, 0.2);
            transition: all 0.2s;
        }

        .add-btn:active {
            transform: scale(0.96);
        }

        /* Search & Filter Container */
        .controls-container {
            position: sticky;
            top: 60px;
            /* Below header */
            z-index: 90;
            background: var(--bg);
            padding: 0 16px 12px 16px;
            backdrop-filter: blur(8px);
        }

        .search-wrapper {
            position: relative;
            margin-top: 12px;
        }

        .search-input {
            width: 100%;
            padding: 12px 16px;
            padding-left: 40px;
            border: 1px solid var(--border);
            border-radius: var(--radius);
            font-size: 1rem;
            background: var(--surface);
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
            outline: none;
        }

        .search-icon {
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-light);
        }

        /* Categories Tabs */
        .tabs {
            display: flex;
            gap: 8px;
            overflow-x: auto;
            padding: 12px 0 4px 0;
            scrollbar-width: none;
            /* Hide scrollbar Firefox */
            -ms-overflow-style: none;
            /* Hide scrollbar IE */
        }

        .tabs::-webkit-scrollbar {
            display: none;
        }

        .tab {
            padding: 6px 14px;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 20px;
            font-size: 0.9rem;
            color: var(--text-light);
            white-space: nowrap;
            display: flex;
            align-items: center;
            gap: 4px;
            cursor: pointer;
            transition: all 0.2s;
            font-weight: 500;
        }

        .tab.active {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
            box-shadow: 0 2px 4px rgba(22, 163, 74, 0.2);
        }

        .tab-edit-btn {
            font-size: 0.7rem;
            opacity: 0.6;
            cursor: pointer;
            padding: 0 2px;
            transition: opacity 0.2s;
        }

        .tab-edit-btn:hover {
            opacity: 1;
        }

        .tab-name {
            pointer-events: none;
        }

        /* Product Grid */
        .grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 12px;
            padding: 0 16px;
            max-width: 800px;
            margin: 0 auto;
        }

        @media (min-width: 600px) {
            .grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        .card {
            background: var(--surface);
            border-radius: var(--radius);
            padding: 12px;
            display: flex;
            align-items: center;
            gap: 12px;
            box-shadow: var(--shadow);
            border: 1px solid var(--border);
            transition: all 0.2s;
            position: relative;
        }

        .card.out-stock {
            opacity: 0.7;
            background: #f1f5f9;
        }

        .card-img {
            width: 70px;
            height: 70px;
            border-radius: 8px;
            object-fit: cover;
            background: #e2e8f0;
            flex-shrink: 0;
        }

        .card-info {
            flex: 1;
            min-width: 0;
            /* Text truncation fix */
        }

        .card-title {
            font-weight: 600;
            font-size: 1rem;
            color: var(--text);
            margin-bottom: 4px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .card-meta {
            font-size: 0.85rem;
            color: var(--text-light);
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .price {
            color: var(--primary-dark);
            font-weight: 700;
            font-size: 0.95rem;
        }

        .special-badge {
            position: absolute;
            top: -6px;
            left: -6px;
            background: var(--warning);
            color: white;
            font-size: 0.7rem;
            padding: 2px 6px;
            border-radius: 4px;
            font-weight: 700;
            box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
            z-index: 10;
        }

        /* Actions */
        .card-actions {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 10px;
        }

        .edit-icon {
            background: #f1f5f9;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 1.1rem;
            border: 1px solid var(--border);
            color: var(--text-light);
        }

        .delete-icon {
            background: #fee2e2;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 1rem;
            border: 1px solid #fecaca;
            color: var(--danger);
        }

        /* Toggle Switch */
        .switch {
            position: relative;
            display: inline-block;
            width: 44px;
            height: 24px;
        }

        .switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #cbd5e1;
            transition: .3s;
            border-radius: 24px;
        }

        .slider:before {
            position: absolute;
            content: "";
            height: 18px;
            width: 18px;
            left: 3px;
            bottom: 3px;
            background-color: white;
            transition: .3s;
            border-radius: 50%;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
        }

        input:checked+.slider {
            background-color: var(--primary);
        }

        input:checked+.slider:before {
            transform: translateX(20px);
        }

        /* Modal */
        .modal-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(4px);
            z-index: 1000;
            display: none;
            justify-content: center;
            align-items: center;
            padding: 20px;
        }

        .modal-overlay.active {
            display: flex;
            animation: fadeIn 0.2s ease;
        }

        .modal-content {
            background: var(--surface);
            width: 100%;
            max-width: 450px;
            border-radius: 20px;
            padding: 24px;
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
            max-height: 90vh;
            overflow-y: auto;
            position: relative;
            animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .modal-title {
            font-size: 1.25rem;
            font-weight: 700;
            margin-bottom: 20px;
            color: var(--text);
        }

        .form-group {
            margin-bottom: 16px;
        }

        .form-label {
            display: block;
            margin-bottom: 6px;
            font-weight: 500;
            font-size: 0.9rem;
            color: var(--text-light);
        }

        .form-input {
            width: 100%;
            padding: 12px;
            border: 1px solid var(--border);
            border-radius: var(--radius);
            font-size: 1rem;
            font-family: inherit;
            transition: border-color 0.2s, box-shadow 0.2s;
        }

        .form-input:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
        }

        .form-row {
            display: flex;
            gap: 12px;
        }

        .form-col {
            flex: 1;
        }

        .image-preview {
            width: 100%;
            height: 120px;
            border-radius: var(--radius);
            background: #f1f5f9;
            margin-top: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-light);
            font-size: 0.9rem;
            overflow: hidden;
            border: 1px dashed var(--border);
        }

        .image-preview img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .paste-btn {
            position: absolute;
            right: 10px;
            top: 38px;
            background: var(--bg);
            border: 1px solid var(--border);
            padding: 4px 8px;
            border-radius: 6px;
            font-size: 0.8rem;
            cursor: pointer;
            color: var(--primary-dark);
            font-weight: 600;
        }

        .modal-buttons {
            display: flex;
            gap: 12px;
            margin-top: 24px;
        }

        .btn {
            flex: 1;
            padding: 14px;
            border: none;
            border-radius: var(--radius);
            font-weight: 600;
            font-size: 1rem;
            cursor: pointer;
        }

        .btn-cancel {
            background: var(--bg);
            color: var(--text);
        }

        .btn-save {
            background: var(--primary);
            color: white;
        }

        .btn-delete {
            background: #fee2e2;
            color: var(--danger);
            flex: 0 0 auto;
            width: 50px;
            font-size: 1.2rem;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* Animations */
        @keyframes fadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }

        @keyframes slideUp {
            from {
                transform: translateY(20px);
                opacity: 0;
            }

            to {
                transform: translateY(0);
                opacity: 1;
            }
        }

        /* Loader */
        .loader {
            text-align: center;
            padding: 40px;
            color: var(--text-light);
        }

        /* View Toggler */
        .view-toggler {
            display: flex;
            background: #fff;
            padding: 4px;
            margin: 16px 16px 0 16px;
            border-radius: 12px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        .view-btn {
            flex: 1;
            padding: 10px;
            text-align: center;
            border: none;
            background: transparent;
            color: var(--text-light);
            font-weight: 600;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .view-btn.active {
            background: var(--primary-light);
            color: var(--primary-dark);
        }

        /* Orders View Styles */
        .date-nav {
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: white;
            padding: 12px 16px;
            margin: 16px;
            border-radius: 12px;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        }

        .order-card-admin {
            background: white;
            border-radius: 12px;
            padding: 16px;
            margin: 0 16px 12px 16px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
            border: 1px solid #e2e8f0;
        }

        .admin-order-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 10px;
        }

        .order-card-admin.delivered {
            background: #f0fdf4;
            border-left: 4px solid #16a34a;
        }

        .admin-order-actions {
            display: flex;
            gap: 8px;
            margin-top: 12px;
            border-top: 1px solid #f1f5f9;
            padding-top: 10px;
        }

        .admin-order-btn {
            flex: 1;
            padding: 8px;
            border: none;
            border-radius: 8px;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
            transition: all 0.2s;
        }

        .admin-order-btn:active {
            transform: scale(0.96);
        }

        .btn-wa {
            background: #dcfce7;
            color: #166534;
        }

        .btn-delv {
            background: #f1f5f9;
            color: #475569;
        }

        .btn-delv.active {
            background: #16a34a;
            color: white;
        }

        /* Bulk Add Modal Styles */
        .bulk-tab-content {
            display: none;
        }

        .bulk-tab-content.active {
            display: block;
        }

        .tab-btn {
            border: 1px solid #e2e8f0;
            background: #f8fafc;
            color: #64748b;
            padding: 8px 16px;
            border-radius: 8px;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            flex: 1;
            transition: all 0.2s;
        }
