     @font-face {
            font-family: 'IranSans';
            src: url('../assets/fonts/iransansfanumd/IRANSansDN_Fa_Num.ttf') format('truetype');
            font-weight: normal;
            font-display: swap;
        }
        @font-face {
            font-family: 'IranSans';
            src: url('../assets/fonts/iransansfanumd/IRANSansXFaNum-Bold.ttf') format('truetype');
            font-weight: bold;
            font-display: swap;
        }
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        button {
            font-family: 'IranSans';
        }
        body {
            font-family: 'IranSans', 'Vazirmatn', sans-serif;
            background-color: #f4f6f9;
            color: #1e293b;
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
        }
        .app-container {
            display: grid;
            grid-template-columns: 260px 1fr 380px;
            background-color: #fff;
            width: 100%;
            max-width: 1440px;
            height: 95vh;
            border-radius: 28px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
            overflow: hidden;
        }
        /* ---------- SIDEBAR ---------- */
        .sidebar {
            background-color: #fff;
            border-left: 1px solid #edf2f7;
            display: flex;
            flex-direction: column;
            padding: 28px 18px;
            overflow-y: auto;
        }
        .logo-area {
            display: flex;
            align-items: center;
            gap: 10px;
            font-weight: 800;
            font-size: 1.35rem;
            margin-bottom: 40px;
            color: #0f172a;
        }
        .logo-area i { color: #f59e0b; font-size: 1.6rem; }
        .nav-menu {
            display: flex;
            flex-direction: column;
            gap: 12px;
            flex-grow: 1;
        }
        .nav-item {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 12px 16px;
            border-radius: 16px;
            cursor: pointer;
            color: #5b6e8c;
            font-weight: 500;
            transition: 0.2s;
        }
        .nav-item i { width: 24px; font-size: 1.2rem; }
        .nav-item:hover { background-color: #f8fafc; color: #0f172a; }
        .nav-item.active { background-color: #fef9e3; color: #f59e0b; }
        .basket-section {
            background: #fefcf5;
            border-radius: 24px;
            padding: 16px 14px;
            margin: 20px 0 24px 0;
            border: 1px solid #ffedd5;
        }
        .basket-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1px dashed #fde68a;
            padding-bottom: 10px;
            margin-bottom: 12px;
        }
        .basket-count {
            background-color: #f59e0b20;
            color: #b45309;
            border-radius: 40px;
            padding: 2px 10px;
            font-size: 0.7rem;
            font-weight: bold;
        }
        .cart-items-list { max-height: 200px; overflow-y: auto; margin-bottom: 12px; }
        .cart-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.75rem;
            padding: 8px 0;
            border-bottom: 1px solid #f1f5f9;
        }
        .cart-item-info { width: 70%; }
        .cart-item-name { font-weight: 700; }
        .cart-item-vendor { font-size: 0.65rem; color: #6c757d; }
        .cart-item-price { font-weight: 800; }
        .remove-item { background: none; border: none; color: #ef4444; cursor: pointer; }
        .basket-total {
            display: flex;
            justify-content: space-between;
            font-weight: 800;
            border-top: 1px solid #fde68a;
            padding-top: 10px;
            margin-top: 6px;
        }
        .empty-basket-msg { text-align: center; color: #94a3b8; font-size: 0.7rem; padding: 12px 0; }
        .clear-basket {
            background: #fff1f0;
            border: none;
            width: 100%;
            margin-top: 8px;
            border-radius: 30px;
            padding: 6px;
            font-size: 0.7rem;
            font-weight: 500;
            cursor: pointer;
            color: #dc2626;
        }
        .invite-box {
            background-color: #fef9e3;
            border-radius: 20px;
            padding: 14px;
            text-align: center;
            margin-bottom: 18px;
        }
        .invite-btn {
            background-color: #1e293b;
            color: white;
            border: none;
            padding: 6px 12px;
            border-radius: 30px;
            font-size: 0.7rem;
            width: 100%;
            cursor: pointer;
        }
        .user-profile {
            display: flex;
            align-items: center;
            gap: 12px;
            padding-top: 12px;
            border-top: 1px solid #eef2f6;
            margin-top: auto;
        }
        .user-info { display: flex; flex-direction: column; }
        .user-name { font-weight: 700; font-size: 0.9rem; }
        .user-role { font-size: 0.7rem; color: #94a3b8; }
        /* ---------- MAIN CONTENT ---------- */
        .main-content {
            background-color: #fff;
            padding: 28px;
            overflow-y: auto;
            border-left: 1px solid #edf2f7;
        }
        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
            flex-wrap: wrap;
        }
        .header h1 { font-size: 1.5rem; font-weight: 700; }
        .header-icons { display: flex; gap: 18px; color: #5b6e8c; font-size: 1.2rem; cursor: pointer; position: relative; }
        #cartCountBadgeDesktop {
            position: absolute;
            top: -8px;
            right: -8px;
            background: #e61c4b;
            color: white;
            border-radius: 20px;
            padding: 2px 6px;
            font-size: 0.65rem;
            font-weight: bold;
        }
        .date-filter {
            display: flex;
            gap: 10px;
            margin-bottom: 30px;
            padding: 8px 0;
            border-bottom: 1px solid #edf2f7;
            overflow-x: auto;
        }
        .date-item {
            min-width: 70px;
            padding: 10px 8px;
            text-align: center;
            border-radius: 20px;
            font-size: 0.8rem;
            color: #6c757d;
            cursor: pointer;
            transition: 0.2s;
        }
        .date-item.active { background-color: #fef3c7; color: #b45309; font-weight: bold; }
        /* ---------- WEEKLY PLAN ---------- */
        .weekly-plan h3 {
            font-size: 1.2rem;
            margin-bottom: 20px;
            font-weight: 700;
        }
        .day-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: white;
            border-radius: 20px;
            padding: 12px 16px;
            margin-bottom: 12px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.05);
            border: 1px solid #e9eef3;
            cursor: pointer;
            transition: 0.2s;
            flex-wrap: wrap;
            gap: 10px;
        }
        .day-row.disabled-row { background: #f1f5f9; opacity: 0.75; cursor: not-allowed; }
        .day-row:not(.disabled-row):hover { background: #fefce8; border-color: #f5c34b; }
        .day-info { flex: 0 0 auto; min-width: 85px; font-weight: bold; font-size: 0.9rem; text-align: center; }
        .day-info span { display: block; font-size: 0.7rem; color: #5b6e8c; font-weight: normal; }
        .day-status {
            background: #eef2ff;
            color: #1e40af;
            text-align: center;
            padding: 5px 12px;
            border-radius: 40px;
            font-size: 0.75rem;
            font-weight: 500;
        }
        .day-status.disabled { background: #e2e8f0; color: #64748b; }
        .day-status.active { background: #f5c34b; color: #3b2e1e; font-weight: bold; }
        .day-status.active-order { background: #4bf598; color: #3b2e1e; font-weight: bold; }
        .day-thumbnails { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
        .food-thumb { width: 48px; height: 48px; border-radius: 18px; overflow: hidden; background: #f8fafc; }
        .food-thumb img { width: 100%; height: 100%; object-fit: cover; }
        /* Accordion for next week */
        .accordion-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: #f1f5f9;
            padding: 12px 20px;
            border-radius: 30px;
            margin: 20px 0 15px 0;
            cursor: pointer;
            transition: 0.2s;
        }
        .accordion-header:hover { background: #e6edf5; }
        .accordion-header h3 { margin: 0; font-size: 1.1rem; }
        .accordion-icon { font-size: 1.2rem; transition: transform 0.2s; }
        .accordion-content { display: none; }
        .accordion-content.open { display: block; }
        /* ---------- CART SIDEBAR (DESKTOP) ---------- */
        #cartSidebar {
            background: #fff;
            display: flex;
            flex-direction: column;
            overflow-y: auto;
            border-right: 1px solid #edf2f7;
        }
        .hero-food {
            background: #fefaf5;
            border-radius: 24px;
            padding: 16px;
            margin: 16px;
        }
        .hero-food img { width: 100%; border-radius: 20px; max-height: 140px; object-fit: cover; }
        .hero-info h4 { margin: 8px 0 4px; }
        .stats { display: flex; gap: 20px; margin-top: 8px; font-size: 0.7rem; color: #5b6e8c; }
        .cart-header {
            background: #fef9e3;
            padding: 16px;
            border-bottom: 2px solid #f5c34b;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .close-cart { background: none; border: none; font-size: 1.3rem; cursor: pointer; display: none; }
        .cart-items {
            flex: 1;
            overflow-y: auto;
            padding: 16px;
        }
        .cart-item {
            border-bottom: 1px solid #edf2f7;
            padding: 12px 0;
        }
        .cart-item-title { font-weight: bold; font-size: 0.85rem; }
        .cart-item-meta { font-size: 0.65rem; color: #5b6e8c; margin: 4px 0; }
        .cart-item-controls {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-top: 8px;
            flex-wrap: wrap;
        }
        .cart-item-controls button {
            background: #f1f5f9;
            border: none;
            width: 30px;
            height: 30px;
            border-radius: 15px;
            cursor: pointer;
        }
        .cart-footer {
            padding: 16px;
            border-top: 1px solid #e2e8f0;
        }
        /* ---------- MODAL (MENU) ---------- */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(6px);
            z-index: 2000;
            display: flex;
            align-items: center;
            justify-content: center;
            visibility: hidden;
            opacity: 0;
            transition: 0.2s;
        }
        .modal-overlay.active { visibility: visible; opacity: 1; }
        .wide-modal {
            background: #fff;
            width: 90%;
            max-width: 1300px;
            height: 85vh;
            border-radius: 36px;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            direction: rtl;
            box-shadow: 0 30px 50px rgba(0,0,0,0.3);
        }
        .modal-header {
            padding: 16px 20px;
            border-bottom: 1px solid #edf2f7;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .close-modal {
            background: #f1f5f9;
            border: none;
            width: 40px;
            height: 40px;
            border-radius: 40px;
            cursor: pointer;
        }
        .search-area {
            padding: 12px 20px;
            background: #fafcff;
            border-bottom: 1px solid #edf2f7;
        }
        .search-input-group {
            display: flex;
            gap: 10px;
            margin-bottom: 12px;
        }
        .search-input-group input {
            flex: 1;
            padding: 10px 14px;
            border-radius: 60px;
            border: 1px solid #e2e8f0;
            font-family: inherit;
        }
        .search-input-group button {
            background: #f59e0b;
            border: none;
            padding: 0 20px;
            border-radius: 40px;
            font-weight: 700;
            cursor: pointer;
        }
        .filter-group { margin-top: 8px; }
        .filter-title { font-size: 0.75rem; font-weight: bold; color: #475569; margin-bottom: 6px; }
        .vendor-filters, .category-filters {
            display: flex;
            flex-wrap: nowrap;
            overflow-x: auto;
            gap: 8px;
            padding-bottom: 6px;
        }
        .filter-chip {
            background: #f1f5f9;
            padding: 6px 14px;
            border-radius: 40px;
            font-size: 0.7rem;
            cursor: pointer;
            white-space: nowrap;
        }
        .filter-chip.active { background: #f59e0b; color: white; }
        .modal-body {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
        }
        .products-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
            gap: 16px;
        }
        .product-card {
            background: white;
            border-radius: 1rem;
            overflow: hidden;
            border: 1px solid #edf2f7;
            transition: 0.2s;
        }
        .product-img { height: 150px; overflow: hidden; }
        .product-img img { width: 100%; height: 100%; object-fit: cover; }
        .product-info { padding: 12px; }
        .product-name { font-weight: bold; margin-bottom: 6px; }
        .product-meta {
            display: flex;
            justify-content: space-between;
            font-size: 0.7rem;
            margin: 6px 0;
        }
        .vendor-badge, .category-badge {
            background: #fef3c7;
            padding: 2px 8px;
            border-radius: 20px;
        }
        .price { font-weight: bold; color: #e67e22; margin: 8px 0; }
        .add-to-cart-btn {
            background: #f5c34b;
            border: none;
            width: 100%;
            padding: 8px;
            border-radius: 40px;
            font-weight: bold;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            transition: 0.2s;
        }
        .add-to-cart-btn.added-to-cart {
            background: #10b981;
            color: white;
        }
        .no-results { text-align: center; padding: 2rem; color: #94a3b8; }
        /* ---------- PAYMENT CONFIRM MODAL ---------- */
        .payment-modal .wide-modal { max-width: 500px; height: auto; max-height: 80vh; overflow-y: auto; }
        .payment-summary { padding: 20px; }
        .day-group { margin-bottom: 20px; border-bottom: 1px solid #e2e8f0; padding-bottom: 12px; }
        .day-group h4 { color: #f59e0b; margin-bottom: 8px; }
        .payment-item { display: flex; justify-content: space-between; font-size: 0.85rem; margin: 6px 0; }
        .wallet-info { background: #f0fdf4; padding: 12px; border-radius: 20px; margin: 16px 0; }
        .confirm-pay-btn {
            background: #10b981;
            color: white;
            border: none;
            width: 100%;
            padding: 12px;
            border-radius: 40px;
            font-weight: bold;
            font-size: 1rem;
            cursor: pointer;
        }
        .confirm-pay-btn.disabled { background: #ccc; cursor: not-allowed; }
        /* ---------- MOBILE STYLES ---------- */
        .mobile-cart-fab, .cart-drawer { display: none; }
        @media (max-width: 1100px) {
            .app-container { grid-template-columns: 240px 1fr; }
            #cartSidebar { display: none; }
        }
        @media (max-width: 820px) {
            .app-container { grid-template-columns: 1fr; }
            .sidebar { display: none; }
            .main-content { padding: 16px; padding-bottom: 80px; }
            .day-row { flex-direction: column; align-items: stretch; }
            .day-thumbnails { justify-content: center; }
            .mobile-cart-fab {
                position: fixed;
                bottom: 20px;
                left: 20px;
                background: #e61c4b;
                width: 56px;
                height: 56px;
                border-radius: 28px;
                display: flex;
                align-items: center;
                justify-content: center;
                box-shadow: 0 4px 12px rgba(0,0,0,0.2);
                z-index: 1000;
                cursor: pointer;
                color: white;
                font-size: 1.5rem;
            }
            .mobile-cart-fab span {
                position: absolute;
                top: -5px;
                right: -5px;
                background: #dc2626;
                color: white;
                border-radius: 20px;
                padding: 2px 8px;
                font-size: 0.7rem;
                font-weight: bold;
            }
            .cart-drawer {
                position: fixed;
                bottom: -100%;
                left: 0;
                width: 100%;
                background: white;
                border-radius: 28px 28px 0 0;
                transition: bottom 0.3s ease;
                z-index: 1100;
                max-height: 80vh;
                display: flex;
                flex-direction: column;
                box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
            }
            .cart-drawer.open { bottom: 0; }
            .drawer-header {
                padding: 16px;
                background: #fef7e8;
                display: flex;
                justify-content: space-between;
                align-items: center;
                border-bottom: 1px solid #fde3a7;
            }
            .drawer-items { flex: 1; overflow-y: auto; padding: 16px; }
            .drawer-footer { padding: 16px; border-top: 1px solid #ecf3fa; background: white; }
            .close-drawer { background: none; border: none; font-size: 1.8rem; cursor: pointer; }
        }
        .loading-spinner { text-align: center; padding: 2rem; color: #f59e0b; }
        .error-message { text-align: center; padding: 2rem; color: #dc2626; background: #fee2e2; border-radius: 1rem; }


        .product-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.remove-from-cart-btn {
    transition: all 0.2s ease;
}

.remove-from-cart-btn:hover {
    background: #dc2626 !important;
    transform: scale(0.98);
}

.added-to-cart-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
@media (max-width: 768px) {
    /* سایدبار را به صورت نوار پایین ثابت تبدیل می‌کنیم */
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 70px;
        background: white;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 1000;
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        padding: 0 8px;
        border-radius: 0;
    }

    /* مخفی کردن لوگو و باکس دعوت و پروفایل در موبایل */
    .sidebar .logo-area,
    .sidebar .invite-box,
    .sidebar .user-profile {
        display: none;
    }

    /* منوی ناوبری به صورت افقی */
    .sidebar .nav-menu {
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        width: 100%;
        background: transparent;
        gap: 0;
    }

    .sidebar .nav-item {
        flex: 1;
        text-align: center;
        padding: 12px 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        font-size: 12px;
    }

    .sidebar .nav-item i {
        font-size: 22px;
        margin: 0;
    }

    .sidebar .nav-item span {
        font-size: 11px;
    }

    /* محتوای اصلی را طوری تنظیم کنیم که زیر نوار پایین نرود */
    .main-content {
        margin-bottom: 70px;
        padding-bottom: 16px;
    }

    /* دکمه شناور سبد خرید را بالاتر از نوار پایین قرار بده */
    .mobile-cart-fab {
        bottom: 80px;
        z-index: 1001;
    }

    /* سایدبار دسکتاپ (سمت راست) را هم در موبایل به حالت عادی برگردان */
    #cartSidebar {
        width: 100%;
        max-width: 320px;
        /* ... */
    }

    /* تنظیم هدر برای موبایل */
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
.calendar-container {
    max-width: 1100px;
    width: 100%;
    height: 94vh;
    background: #fffef7;          /* removed duplicate background */
    backdrop-filter: blur(2px);
    border-radius: 48px;
    box-shadow: 0 25px 45px -12px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow-y: auto;             /* was 'overflow: hidden' — enables vertical scroll */
    padding: 1.2rem;
    transition: all 0.2s ease;
    border: 1px solid #ffddb0;
     display: none;
    position: absolute;
}

        /* header navigation */
        .cal-header {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            flex-wrap: wrap;
            gap: 1rem;
            margin-bottom: 1.8rem;
            padding: 0 0.5rem;
        }
        .month-year {
            background: #da2035;
            padding: 0.5rem 1.5rem;
            border-radius: 60px;
            display: inline-flex;
            align-items: baseline;
            gap: 10px;
            box-shadow: inset 0 1px 2px #fff8, 0 4px 8px #0001;
        }
        .month-name {
            font-size: 1.7rem;
            font-weight: 800;
            color: #fff;
            letter-spacing: -0.5px;
        }
        .year-num {
            font-size: 1.4rem;
            font-weight: 600;
            color: #a16207;
            background: #fff0db;
            padding: 0.1rem 0.8rem;
            border-radius: 36px;
        }
        .nav-buttons {
            display: flex;
            gap: 12px;
        }
        .nav-btn {
            background: #fb485c;
            border: none;
            font-size: 1.3rem;
            font-weight: bold;
            padding: 0.5rem 1rem;
            border-radius: 2rem;
            cursor: pointer;
            transition: all 0.2s;
            color: #422006;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            font-family: inherit;
            width: 48px;
            text-align: center;
        }
        .nav-btn.special {
            background: #f59e0b;
            color: white;
            width: auto;
            padding: 0.5rem 1.2rem;
            font-size: 0.9rem;
        }
        .nav-btn:hover {
            background: #f97316;
            transform: scale(0.96);
            color: white;
        }
        /* weekdays header */
        .weekdays {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            background: #fb485c;
            border-radius: 2rem;
            margin: 1rem 0 0.8rem;
            padding: 0.6rem 0;
            font-weight: 700;
            text-align: center;
            color: #fff;
            font-size: 1rem;
            gap: 5px;
        }
        .weekday {
            background: transparent;
            font-weight: bold;
        }
        /* calendar grid */
        .calendar-grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 8px;
            background: #fffbee;
            border-radius: 28px;
            padding: 8px;
        }
        .day-cell {
            background: #ffffff;
            border-radius: 20px;
            min-height: 110px;
            padding: 8px 5px;
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            transition: all 0.2s;
            box-shadow: 0 1px 3px rgba(0,0,0,0.05);
            border: 1px solid #ffefcf;
            cursor: pointer;
            position: relative;
        }
        .day-cell.empty {
            background: #fdf7ef;
            opacity: 0.6;
            cursor: default;
            box-shadow: none;
        }
        .day-cell:not(.empty):hover {
            transform: translateY(-3px);
            background: #fffbee;
            border-color: #fbbf24;
            box-shadow: 0 10px 15px -10px #f9731666;
        }
        .day-number {
            font-size: 1.2rem;
            font-weight: 800;
            background: #fef3c7;
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 30px;
            margin-bottom: 6px;
            color: #78350f;
        }
        .today-badge {
            background: #f97316;
            color: white;
            box-shadow: 0 0 0 2px white, 0 0 0 4px #f97316;
        }
        .food-item {
            background: #fef9e3;
            border-radius: 24px;
            padding: 6px 8px;
            font-size: 0.75rem;
            font-weight: 500;
            width: 100%;
            word-break: break-word;
            color: #92400e;
            margin-top: 5px;
            border-right: 3px solid #f59e0b;
            text-align: right;
            line-height: 1.3;
            font-family: monospace;
            font-size: 0.7rem;
            max-height: 55px;
            overflow-y: auto;
        }
        .food-icon {
            font-size: 1rem;
            margin-left: 4px;
        }
        .empty-message {
            font-size: 0.65rem;
            color: #d4a373;
            margin-top: 5px;
        }

        /* MODAL styles */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.5);
 backdrop-filter: blur(3px);
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: center;
            visibility: hidden;
            opacity: 0;
            transition: all 0.2s ease;
        }
        .modal-overlay.active {
            visibility: visible;
            opacity: 1;
        }
        .modal-card {
            background: #fffaf2;
            width: 90%;
            max-width: 380px;
            border-radius: 48px;
            padding: 1.8rem 1.5rem;
            text-align: center;
            box-shadow: 0 25px 40px rgba(0,0,0,0.3);
            direction: rtl;
            border: 1px solid #ffd8a9;
        }
        .modal-card h3 {
            font-size: 1.7rem;
            color: #b45309;
            margin: 0 0 0.5rem;
        }
        .modal-date {
            background: #ffedd5;
            padding: 8px;
            border-radius: 40px;
            font-weight: bold;
            margin-bottom: 1rem;
            color: #92400e;
        }
        .food-input {
            width: 100%;
            padding: 12px 16px;
            font-size: 1rem;
            border-radius: 60px;
            border: 2px solid #fed7aa;
            background: white;
            font-family: inherit;
            margin: 1rem 0;
            outline: none;
            transition: 0.2s;
        }
        .food-input:focus {
            border-color: #f97316;
            box-shadow: 0 0 0 2px #ffb951;
        }
        .modal-actions {
            display: flex;
            gap: 12px;
            justify-content: center;
            flex-wrap: wrap;
        }
        .btn {
            border: none;
            background: #fbbf24;
            padding: 10px 20px;
            border-radius: 40px;
            font-weight: bold;
            cursor: pointer;
            transition: 0.1s;
            font-family: inherit;
            font-size: 0.9rem;
        }
        .btn-save {
            background: #f59e0b;
            color: white;
            box-shadow: 0 2px 6px rgba(0,0,0,0.1);
        }
        .btn-delete {
            background: #fff0e0;
            color: #b91c1c;
            border: 1px solid #fecaca;
        }
        .btn-cancel {
            background: #e9e4dc;
            color: #5a3e1b;
        }
        .btn:hover {
            filter: brightness(0.93);
            transform: scale(0.97);
        }
        .clear-all {
            background: #fef2e0;
            margin-top: 20px;
            border: 1px solid #fcd34d;
            color: #a16207;
            font-size: 0.8rem;
            padding: 8px 18px;
        }
        .footer-note {
            text-align: center;
            margin-top: 22px;
            font-size: 0.7rem;
            color: #b98f64;
        }
        @media (max-width: 680px) {
            .calendar-container { padding: 0.8rem; }
            .day-cell { min-height: 85px; padding: 5px; }
            .day-number { width: 28px; height: 28px; font-size: 0.9rem; }
            .food-item { font-size: 0.6rem; }
            .month-name { font-size: 1.2rem; }
        }

        .action-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.order-action-btn {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.order-action-btn.detail {
    background-color: #3b82f6;
    color: white;
}

.order-action-btn.remove {
    background-color: #ef4444;
    color: white;
}

.order-action-btn.edit {
    background-color: #f59e0b;
    color: white;
}

.order-action-btn:hover {
    opacity: 0.85;
    transform: scale(0.96);
}
 .loading-overlay {
     position: fixed;
     top: 0; left: 0; right: 0; bottom: 0;
     background: rgba(0,0,0,0.5);
     display: flex;
     align-items: center;
     justify-content: center;
     z-index: 10001;
 }
 .loading-spinner {
     width: 50px; height: 50px;
     border: 5px solid #f3f3f3;
     border-top: 5px solid #e5466b;
     border-radius: 50%;
     animation: spin 1s linear infinite;
 }

/* ---------- Fidilio mockup dashboard refresh ---------- */
:root {
    --fidilio-purple: #e5466b;
    --fidilio-purple-dark: #da2035;
    --fidilio-purple-soft: #fff1f4;
    --fidilio-border: #eef1f7;
    --fidilio-text: #24243f;
    --fidilio-muted: #8b91a7;
    --fidilio-green: #188c54;
    --fidilio-gold: #d8941d;
}

html {
    background: #f5f6fb;
}

body {
    background: #f5f6fb;
    padding: 8px;
    color: var(--fidilio-text);
}

.app-container {
    grid-template-columns: 260px minmax(0, 1fr) 310px;
    direction: rtl;
    max-width: 1420px;
    height: calc(100vh - 16px);
    border-radius: 12px;
    box-shadow: 0 18px 45px rgba(31, 35, 75, 0.08);
    border: 1px solid #edf0f7;
}

.sidebar {
    order: 1;
    border-left: 1px solid var(--fidilio-border);
    border-right: 0;
    padding: 28px 20px;
}

.main-content {
    order: 2;
    border-left: 1px solid var(--fidilio-border);
    padding: 34px 34px 24px;
}

#cartSidebar {
    order: 3;
    border-right: 0;
    border-left: 1px solid var(--fidilio-border);
    padding: 18px 16px;
}

.logo-area {
    justify-content: flex-start;
    margin-bottom: 24px;
    font-size: 1.05rem;
}

.logo-area img {
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

.profile-card {
    background: linear-gradient(145deg, var(--fidilio-purple), var(--fidilio-purple-dark));
    color: #fff;
    border-radius: 10px;
    padding: 20px;
    min-height: 150px;
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 12px;
    align-items: center;
    box-shadow: 0 16px 24px rgba(229, 70, 107, 0.22);
    margin-bottom: 26px;
}

.avatar-wrap {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.42);
    overflow: hidden;
    background: #fff;
}

.avatar-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-card strong {
    display: block;
    font-size: 0.9rem;
}

.profile-card span {
    display: block;
    font-size: 0.7rem;
    opacity: 0.78;
    margin-top: 4px;
}

.wallet-mini {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    margin-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.wallet-mini strong {
    font-size: 1rem;
}

.nav-menu {
    gap: 14px;
}

.nav-item,
.nav-item a {
    color: #7b8198;
    text-decoration: none;
}

.nav-item {
    border-radius: 9px;
    padding: 14px 18px;
    justify-content: flex-start;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.nav-item.active {
    background: var(--fidilio-purple-soft);
    color: var(--fidilio-purple);
}

.nav-item:hover {
    color: var(--fidilio-purple);
    background: #f7f5ff;
}

.header {
    align-items: flex-start;
    margin-bottom: 24px;
}

.header h1 {
    font-size: 1.35rem;
    line-height: 1.7;
}

.header p {
    color: var(--fidilio-muted);
    margin-top: 10px;
    font-size: 0.86rem;
}

.header-icons {
    flex-direction: row-reverse;
    align-items: center;
    color: #687087;
    background: transparent;
    font-size: 1.1rem;
}

.header-icons i {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--fidilio-border);
}

#cartCountBadgeDesktop {
    top: -5px;
    right: 46px;
    background: #ef1d5b;
}

.summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 0 0 28px;
}

.summary-card {
    min-height: 96px;
    border: 1px solid var(--fidilio-border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 22px rgba(35, 38, 67, 0.035);
    display: grid;
    grid-template-columns: 44px 1fr;
    align-content: center;
    gap: 4px 12px;
    padding: 18px;
}

.summary-card i {
    grid-row: span 2;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f6f3ff;
    color: var(--fidilio-purple);
    font-size: 1.15rem;
}

.summary-card span {
    color: var(--fidilio-muted);
    font-size: 0.75rem;
}

.summary-card strong {
    font-size: 1rem;
}

.summary-card:nth-child(1) strong,
.summary-card:nth-child(2) strong {
    color: var(--fidilio-green);
}

.summary-card:nth-child(4) strong {
    color: var(--fidilio-gold);
}

.week-switch {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--fidilio-border);
    margin-bottom: 18px;
}

.week-switch button {
    background: transparent;
    border: 0;
    color: #575d72;
    padding: 0 42px 14px;
    cursor: pointer;
    font-weight: 700;
}

.week-switch button.active {
    color: var(--fidilio-purple);
    border-bottom: 3px solid var(--fidilio-purple);
}

.week-switch .accordion-icon {
    display: none;
}

.date-filter {
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    padding: 0 0 8px;
    border-bottom: 0;
}

.list-tools {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.list-tools input {
    flex: 1;
    min-width: 220px;
    border: 1px solid var(--fidilio-border);
    border-radius: 9px;
    padding: 10px 12px;
    font-family: inherit;
    outline: none;
    color: var(--fidilio-text);
}

.list-tools input:focus {
    border-color: var(--fidilio-purple);
    box-shadow: 0 0 0 3px rgba(229, 70, 107, 0.1);
}

.export-btn {
    background: #e0f2e9;
    border: 1px solid #a9dfbf;
    border-radius: 9px;
    padding: 10px 14px;
    font-weight: 800;
    color: #166534;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.cart-export-btn {
    width: 100%;
    margin-top: 8px;
}

.date-item {
    min-width: 86px;
    border: 1px solid var(--fidilio-border);
    background: #fff;
    border-radius: 9px;
    color: #656b80;
    line-height: 1.8;
    box-shadow: 0 8px 18px rgba(31, 35, 75, 0.035);
    font-family: inherit;
}

.date-item.active {
    background: var(--fidilio-purple);
    color: #fff;
    box-shadow: 0 13px 22px rgba(229, 70, 107, 0.2);
}

.date-item small {
    display: block;
    font-size: 0.64rem;
    line-height: 1.5;
    margin-top: 2px;
}

.date-item.available {
    border-color: #f6cad4;
    color: var(--fidilio-purple);
}

.date-item.chosen {
    background: #e0f2e9;
    border-color: #a9dfbf;
    color: #166534;
    cursor: pointer;
}

.date-item.chosen.active {
    background: #188c54;
    border-color: #188c54;
    color: #fff;
    box-shadow: 0 13px 22px rgba(24, 140, 84, 0.18);
}

.date-item.unavailable {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

.date-item:disabled {
    opacity: 1;
}

.weekly-plan h3 {
    text-align: right;
    font-size: 1rem;
    margin-bottom: 18px;
}

.dashboard-products-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(130px, 1fr));
    gap: 18px;
}

.dashboard-product-card {
    border: 1px solid var(--fidilio-border);
    border-radius: 10px;
    background: #fff;
    padding: 12px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 22px rgba(31, 35, 75, 0.04);
}

.dashboard-product-card.is-disabled {
    opacity: 0.62;
    background: #f8fafc;
    cursor: not-allowed;
}

.dashboard-product-card.is-chosen {
    border-color: #a9dfbf;
    background: #fbfffd;
}

.dashboard-product-img {
    height: 112px;
    border-radius: 10px;
    overflow: hidden;
    background: #f6f7fb;
    margin-bottom: 12px;
}

.dashboard-product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dashboard-product-card h4 {
    font-size: 0.88rem;
    line-height: 1.7;
    margin-bottom: 2px;
}

.dashboard-product-card .vendor {
    color: #777f92;
    font-size: 0.72rem;
    margin-bottom: 8px;
}

.dashboard-product-card .description {
    color: #7d8496;
    font-size: 0.7rem;
    line-height: 1.8;
    height: 50px;
    overflow: hidden;
}

.dashboard-product-card .price {
    color: var(--fidilio-purple);
    margin: auto 0 10px;
    font-size: 0.84rem;
}

.quantity-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.quantity-control button {
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: #fff1f4;
    color: var(--fidilio-purple);
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(229, 70, 107, 0.08);
}

.quantity-control .select-product-btn {
    width: 100%;
    height: 34px;
    border-radius: 8px;
    background: var(--fidilio-purple);
    color: #fff;
    box-shadow: 0 8px 16px rgba(229, 70, 107, 0.14);
}

.quantity-control .select-product-btn.selected {
    background: #fff;
    color: #da2035;
    border: 1px solid #f1a7b5;
    box-shadow: none;
}

.dashboard-product-card.is-disabled .quantity-control button,
.add-to-cart-btn:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

.quantity-control span {
    min-width: 18px;
    text-align: center;
    font-weight: 700;
}

.quantity-control.chosen-product-control span {
    min-width: auto;
    background: #e0f2e9;
    color: #166534;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 0.75rem;
}

.quantity-control.chosen-product-control {
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.cancel-order-btn,
.cancel-order-modal-btn {
    border: 1px solid #f1a7b5;
    border-radius: 8px;
    background: #fff;
    color: #da2035;
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: 0.18s ease;
}

.cancel-order-btn {
    width: auto;
    height: auto;
    min-height: 32px;
    padding: 6px 12px;
    box-shadow: none;
    font-size: 0.72rem;
    line-height: 1.4;
}

.cancel-order-modal-btn {
    width: 100%;
    max-width: 260px;
    min-height: 44px;
    padding: 12px 18px;
    margin-top: 12px;
    font-size: 0.9rem;
}

.cancel-order-btn:hover,
.cancel-order-modal-btn:hover {
    background: #da2035;
    border-color: #da2035;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(218, 32, 53, 0.16);
}

.cancel-order-btn:active,
.cancel-order-modal-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.dashboard-empty {
    min-height: 220px;
    display: grid;
    place-items: center;
    color: var(--fidilio-muted);
    border: 1px dashed #dfe4ef;
    border-radius: 10px;
}

.cart-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    min-height: 42px;
}

.cart-toolbar strong {
    display: block;
    font-size: 0.92rem;
}

.cart-toolbar span {
    color: var(--fidilio-muted);
    font-size: 0.7rem;
}

.cart-toolbar i {
    color: var(--fidilio-purple);
}

.cart-items {
    padding: 0;
}

#cartSidebar .cart-item {
    border: 1px solid var(--fidilio-border);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 8px 18px rgba(31, 35, 75, 0.035);
}

.cart-item-title {
    color: var(--fidilio-text);
    font-size: 0.82rem;
}

.cart-item-meta {
    color: var(--fidilio-muted);
}

.cart-item-controls {
    justify-content: space-between;
    gap: 8px;
}

.cart-item-controls button {
    background: #f7f6ff;
    color: var(--fidilio-purple);
}

.cart-item-controls .removeItem {
    width: auto;
    padding: 0 10px;
    color: #e44b6b;
}

.cart-footer {
    border-top: 1px solid var(--fidilio-border);
    padding: 16px 0 0;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.88rem;
}

.cart-total-row strong {
    color: var(--fidilio-purple);
}

.clear-basket {
    background: #fff5f7;
    color: #e54868;
    border-radius: 8px;
    padding: 10px;
}

.checkout-btn {
    width: 100%;
    min-height: 46px;
    border: 0;
    border-radius: 9px;
    background: var(--fidilio-purple);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.empty-cart {
    color: var(--fidilio-muted);
    text-align: center;
    padding: 28px 8px;
    border: 1px dashed #dfe4ef;
    border-radius: 10px;
}

.products-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.product-card,
.wide-modal,
.modal-card {
    border-radius: 12px;
}

.add-to-cart-btn {
    background: var(--fidilio-purple);
    color: #fff;
    border-radius: 8px;
}

.single-product-modal {
    display: grid;
    grid-template-columns: minmax(240px, 42%) 1fr;
    gap: 24px;
    align-items: stretch;
    min-height: 360px;
}

.single-product-image {
    border-radius: 12px;
    overflow: hidden;
    background: #f7f7fb;
}

.single-product-image img {
    width: 100%;
    height: 100%;
    min-height: 360px;
    object-fit: cover;
    display: block;
}

.single-product-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 0;
}

.single-product-info h3 {
    font-size: 1.35rem;
    line-height: 1.8;
    margin-bottom: 10px;
}

.single-product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.single-product-meta span {
    background: var(--fidilio-purple-soft);
    color: var(--fidilio-purple-dark);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.76rem;
}

.single-product-info p {
    color: #73798d;
    line-height: 2;
    font-size: 0.9rem;
    margin-bottom: 22px;
}

.single-product-info strong {
    color: var(--fidilio-purple);
    font-size: 1.08rem;
    margin: auto 0 18px;
}

.single-product-info .add-to-cart-btn {
    min-width: 190px;
    padding: 12px 18px;
}

.single-product-info .add-to-cart-btn.added-to-cart {
    background: #188c54;
}

.single-product-info .add-to-cart-btn.remove-selection-btn {
    background: #fff;
    color: #da2035;
    border: 1px solid #f1a7b5;
}

.calendar-actions {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}

@media (max-width: 1180px) {
    .app-container {
        grid-template-columns: 230px minmax(0, 1fr);
    }

    #cartSidebar {
        display: none;
    }

    .dashboard-products-grid {
        grid-template-columns: repeat(3, minmax(150px, 1fr));
    }
}

@media (max-width: 820px) {
    body {
        padding: 0;
        align-items: stretch;
    }

    .app-container {
        height: 100vh;
        border-radius: 0;
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: 3;
    }

    .main-content {
        order: 1;
        padding: 18px;
        margin-bottom: 76px;
    }

    .summary-strip,
    .dashboard-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-card {
        display: none;
    }

    .week-switch button {
        padding: 0 24px 12px;
    }

    .list-tools input,
    .export-btn {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .dashboard-products-grid {
        grid-template-columns: 1fr;
    }

    .summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .summary-card {
        min-height: 88px;
        grid-template-columns: 34px 1fr;
        padding: 12px;
        gap: 4px 8px;
    }

    .summary-card i {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }

    .summary-card span {
        font-size: 0.68rem;
    }

    .summary-card strong {
        font-size: 0.78rem;
        line-height: 1.6;
    }

    .date-item {
        min-width: 78px;
    }

    .single-product-modal {
        grid-template-columns: 1fr;
    }

    .single-product-image img {
        min-height: 220px;
    }
}
