
html, body {
    overflow-x: hidden;
    position: relative;
    width: 100%;
    -webkit-text-size-adjust: 100%;
    touch-action: pan-y; /* يسمح بالتمرير الرأسي فقط */
    -webkit-tap-highlight-color: transparent;
}

input, textarea, select {
    font-size: 16px !important;
}

@media (min-width: 641px) {
    input, textarea, select {
        font-size: 14px !important;
    }
}

/* منع double-tap zoom على كل العناصر التفاعلية */
button, input, select, textarea, a, [onclick], .product-card, .size-chip, .color-dot, .gallery-thumb {
    touch-action: manipulation;
}

/* تأكد إن الصور والكارتات ما تطلع عن الشاشة */
img, video, iframe {
    max-width: 100%;
    height: auto;
}

/* منع التحديد الغير مقصود */
* {
    -webkit-user-select: none;
    user-select: none;
}

/* نرجع التحديد على الحقول النصية فقط */
input, textarea {
    -webkit-user-select: auto;
    user-select: auto;
}
/* ─── Product Grid & Cards (Admin Dashboard) ─── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.product-card {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    cursor: pointer;
}

    .product-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.06), 0 16px 32px rgba(0,0,0,0.09);
    }

.add-card {
    display: flex;
    flex-direction: column;
    border: 2px dashed #e8e8e8;
    background: #fafafa;
}

.add-card__image {
    aspect-ratio: 4 / 5;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

    .add-card__image input[type="file"] {
        display: none;
    }

.add-card__plus {
    font-size: 36px;
    color: #aaa;
    font-weight: 300;
}

.add-card__preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.add-card__image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-card__label {
    text-align: center;
    padding: 10px;
    font-weight: 700;
    font-size: 14px;
    color: #00A4A6;
}

.modal-new-image-label {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 2;
    background: #f8f8f8;
}

    .modal-new-image-label input[type="file"] {
        display: none;
    }

.modal-new-image-text {
    font-size: 12px;
    font-weight: 600;
    color: #888;
}

.product-card__body {
    padding: 16px;
}

/* ─── Product Card Image Overlay ─── */
.product-card__image-wrap {
    position: relative;
    aspect-ratio: 4 / 5;
    background: #f5f5f5;
    overflow: hidden;
}

.product-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-card__code-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}

.product-card__overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 26px 10px 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.45), rgba(0,0,0,0));
}

.product-card__overlay-name {
    color: #fff;
    font-weight: 400;
    padding: 3px 8px;
    font-size: 11px;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.product-card__overlay-price {
    color: #7CE8E5;
    font-weight: 700;
    font-size: 13px;
    margin-top: 2px;
}

/* ─── Sizes (below image) ─── */
.product-card__sizes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
}

.size-chip {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 26px;
    padding: 0 8px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #2b2b2b;
    background: #fafafa;
}

.size-chip__badge {
    position: absolute;
    top: -8px;
    right: -6px;
    background: #00A4A6;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
}

.size-chip--no-size {
    min-width: 26px;
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: #00A4A6;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}


    .color-dot {
        width: 22px;
        height: 22px;
        border-radius: 50%;
        border: 2px solid #e8e8e8;
        display: inline-block;
        cursor: pointer;
        transition: transform 0.15s;
    }

        .color-dot:hover {
            transform: scale(1.15);
        }

    .color-dot--empty {
        background: repeating-conic-gradient(#ddd 0% 25%, #fff 0% 50%) 50% / 8px 8px;
    }

    .color-dot--add {
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f8f8f8;
        font-weight: 700;
        color: #00A4A6;
        border-style: dashed;
        font-size: 14px;
    }

    .color-dot--active {
        border-color: #00A4A6;
        box-shadow: 0 0 0 2px rgba(0, 164, 166, 0.25);
    }
    /* ─── Modal ─── */
.modal-overlay {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overscroll-behavior: contain;
}

    body.modal-open {
        overflow: hidden;
    }

    .modal-overlay.open {
        display: flex;
    }

.modal-box {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    max-width: 520px;
    width: 100%;
    max-height: 92vh;
    max-height: calc(100dvh - 64px - 40px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    position: relative;
    box-shadow: 0 24px 48px rgba(0,0,0,0.2);
}

    .modal-close {
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f5f5f5;
        border: none;
        border-radius: 50%;
        font-size: 18px;
        line-height: 1;
        color: #333;
        cursor: pointer;
        transition: background 0.15s;
        flex-shrink: 0;
    }

    .modal-header-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 12px;
    }

    .modal-header-actions {
        display: flex;
        gap: 8px;
    }

    .modal-header-btn {
        border: none;
        border-radius: 8px;
        padding: 7px 14px;
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
        transition: opacity 0.15s;
    }

        .modal-header-btn:hover {
            opacity: 0.85;
        }

    .modal-header-btn--exit {
        background: #f5f5f5;
        color: #6b6b6b;
    }

    .modal-header-btn--save-exit {
        background: #00A4A6;
        color: #fff;
    }
.vis-toggle {
    display: inline-flex;
    background: #f1f1f1;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.vis-btn {
    flex: none;
    display: flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: none;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #8a8a8a;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.vis-btn--selected {
    background: #fff;
    color: #2b2b2b;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

    /* نشط = نص تركوازي + نقطة */
    .vis-btn--selected[data-active="1"] {
        color: #00A4A6;
    }

        .vis-btn--selected[data-active="1"]::before {
            content: "";
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: #00A4A6;
        }
    /* ─── Exit Confirm Dialog ─── */
    .exit-confirm-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1100;
        align-items: center;
        justify-content: center;
        padding: 20px;
    }

        .exit-confirm-overlay.open {
            display: flex;
        }

    .exit-confirm-box {
        background: #fff;
        border-radius: 12px;
        padding: 20px;
        max-width: 360px;
        width: 100%;
        box-shadow: 0 24px 48px rgba(0,0,0,0.25);
        text-align: center;
    }

    .exit-confirm-box__msg {
        font-size: 14px;
        color: #2b2b2b;
        margin: 0 0 16px;
        line-height: 1.6;
    }

    .exit-confirm-box__actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .exit-confirm-btn {
        border: none;
        border-radius: 8px;
        padding: 10px;
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
        width: 100%;
    }

    .exit-confirm-btn--save {
        background: #00A4A6;
        color: #fff;
    }

    .exit-confirm-btn--discard {
        background: #f5f5f5;
        color: #e53935;
    }

    .modal-header-bar__qty {
        font-size: 13px;
        font-weight: 700;
        color: #6b6b6b;
    }

    .modal-close:hover {
        background: #e8e8e8;
    }

    .modal-media-row {
        display: flex;
        gap: 10px;
        margin-bottom: 12px;
        border: 1px solid #e8e8e8;
        border-radius: 10px;
        background: #fafafa;
        padding: 10px;
        box-sizing: border-box;
        height: 260px;
    }

    .modal-image-wrap {
        position: relative;
        flex: 1;
        min-width: 0;
        height: 100%;
        overflow: hidden;
        border-radius: 10px;
        background: #f8f8f8;
        touch-action: none;
    }

        .modal-image-wrap img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            display: block;
            position: absolute;
            top: 0;
            left: 0;
        }

    .crop-box {
        position: absolute;
        border: 2px dashed #fff;
        border-radius: 50%;
        box-shadow: 0 0 0 9999px rgba(0,0,0,0.35);
        cursor: move;
        touch-action: none;
    }

    .crop-handle {
        position: absolute;
        width: 18px;
        height: 18px;
        background: #fff;
        border: 2px solid #00A4A6;
        border-radius: 50%;
        touch-action: none;
    }

    .crop-handle--tl {
        top: 14.6%;
        left: 14.6%;
        transform: translate(-50%, -50%);
        cursor: nwse-resize;
    }

    .crop-handle--tr {
        top: 14.6%;
        right: 14.6%;
        transform: translate(50%, -50%);
        cursor: nesw-resize;
    }

    .crop-handle--bl {
        bottom: 14.6%;
        left: 14.6%;
        transform: translate(-50%, 50%);
        cursor: nesw-resize;
    }

    .crop-handle--br {
        bottom: 14.6%;
        right: 14.6%;
        transform: translate(50%, 50%);
        cursor: nwse-resize;
    }

    #eyedropper-hint {
        position: absolute;
        bottom: 8px;
        right: 8px;
        background: rgba(0,0,0,0.7);
        color: #fff;
        padding: 4px 10px;
        border-radius: 6px;
        font-size: 12px;
    }

    .modal-colors {
        display: flex;
        gap: 8px;
        margin-top: 10px;
        margin-bottom: 16px;
        flex-wrap: wrap;
        align-items: center;
        border: 1px solid #e8e8e8;
        border-radius: 8px;
        padding: 8px 10px;
        background: #fff;
        min-height: 42px;
        box-sizing: border-box;
    }

    .modal-form {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 16px;
    }

        .modal-form label {
            font-size: 13px;
            font-weight: 700;
            color: #2b2b2b;
        }

        .modal-form input,
        .modal-form select,
        .modal-form textarea {
            padding: 10px 14px;
            border: 1px solid #e8e8e8;
            border-radius: 8px;
            font-family: inherit;
            font-size: 14px;
            font-weight: 400;
            color: #2b2b2b;
            background: #fff;
            transition: border-color 0.2s, box-shadow 0.2s;
        }

            /* توحيد حجم كل نصوص فورم الإضافة/التعديل — يفرض نفس الرقم بكل الشاشات */
            .modal-form label,
            .modal-field__label,
            .modal-form input,
            .modal-form select,
            .modal-form textarea,
            .modal-form input::placeholder,
            .modal-form textarea::placeholder {
                font-size: 12px !important;
            }

            .modal-form input:focus,
            .modal-form select:focus,
            .modal-form textarea:focus {
                outline: none;
                border-color: #00A4A6;
                box-shadow: 0 0 0 3px rgba(0, 164, 166, 0.1);
            }

    .description-word-count {
        font-size: 11px;
        color: #9b9b9b;
        text-align: left;
    }

    .modal-save-btn {
        background: #00A4A6;
        color: #fff;
        border: none;
        padding: 12px;
        border-radius: 8px;
        font-weight: 700;
        font-size: 14px;
        cursor: pointer;
        transition: background 0.2s;
    }

        .modal-save-btn:hover {
            background: #008B8D;
        }

    .modal-cancel-btn {
        background: none;
        border: 1px solid #e8e8e8;
        padding: 10px;
        border-radius: 8px;
        cursor: pointer;
        width: 100%;
        margin-top: 6px;
        font-family: inherit;
        font-size: 14px;
        font-weight: 600;
        color: #6b6b6b;
        transition: all 0.2s;
    }

        .modal-cancel-btn:hover {
            background: #f5f5f5;
            border-color: #ccc;
        }

    .modal-delete-btn {
        background: #fff;
        color: #dc2626;
        border: 1px solid #dc2626;
        padding: 12px;
        border-radius: 8px;
        font-weight: 700;
        font-size: 14px;
        cursor: pointer;
        width: 100%;
        transition: all 0.2s;
    }

        .modal-delete-btn:hover {
            background: #fdecec;
        }

    .modal-actions-row {
        display: flex;
        gap: 10px;
        margin-top: 4px;
    }

        .modal-actions-row .modal-save-btn,
        .modal-actions-row .modal-delete-btn,
        .modal-actions-row .modal-cancel-btn {
            flex: 1;
            width: auto;
            padding: 10px 14px;
        }

    .eyedropper-row {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 10px;
    }

    .modal-gallery {
        width: 70px;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        min-height: 0;
        height: 100%;
    }

    .modal-gallery__count {
        font-size: 11px;
        font-weight: 600;
        color: #6b6b6b;
    }

    .modal-gallery__scroll {
        display: flex;
        flex-direction: column;
        gap: 8px;
        overflow-y: auto;
        overflow-x: hidden;
        flex: 1;
        min-height: 0;
    }

    .gallery-thumb {
        position: relative;
        flex: 0 0 auto;
        width: 100%;
        height: 70px;
        border-radius: 8px;
        overflow: hidden;
        border: 1px solid #e8e8e8;
        background: #f5f5f5;
        cursor: pointer;
        box-sizing: border-box;
    }

    .gallery-thumb--active {
        border: 2px solid #00A4A6;
    }

    .gallery-thumb img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
    }

    .gallery-thumb__actions {
        position: absolute;
        top: 2px;
        left: 2px;
        right: 2px;
        display: flex;
        justify-content: space-between;
    }

        .gallery-thumb__actions form {
            display: inline;
        }

        .gallery-thumb__actions .icon-btn {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            padding: 0;
            border: 2px solid #fff;
            box-shadow: 0 1px 3px rgba(0,0,0,0.25);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
        }

        .gallery-thumb__actions .icon-btn--danger {
            background: #dc2626;
        }

            .gallery-thumb__actions .icon-btn--danger:hover {
                background: #b91c1c;
            }



    .gallery-thumb--add {
        display: flex;
        align-items: center;
        justify-content: center;
        border-style: dashed;
        cursor: pointer;
        width: 100%;
        box-sizing: border-box;
    }

    .gallery-thumb__add-label {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

        .gallery-thumb__add-label input {
            display: none;
        }

        .gallery-thumb__add-label span {
            font-size: 24px;
            font-weight: 700;
            color: #00A4A6;
        }
    /* ─── Sizes Editor ─── */


    .sizes-section-header {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-top: 4px;
        margin-bottom: 4px;
    }

    .sizes-mode-toggle {
        display: inline-flex;
        background: #f1f1f1;
        border-radius: 8px;
        padding: 3px;
        gap: 2px;
    }

    .sizes-mode-btn {
        flex: none;
        background: transparent;
        border: none;
        border-radius: 6px;
        padding: 6px 16px;
        font-size: 12px;
        font-weight: 700;
        color: #8a8a8a;
        cursor: pointer;
        font-family: inherit;
        transition: all 0.2s;
    }

    .sizes-mode-btn--active {
        background: #fff;
        color: #2b2b2b;
        box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    }

    .sizes-editor {
        display: flex;
        gap: 10px;
        margin-bottom: 6px;
        flex-wrap: wrap;
        border: 1px solid #e8e8e8;
        border-radius: 10px;
        background: #fafafa;
        padding: 10px;
    }

    .size-col {
        position: relative;
        display: flex;
        flex-direction: column;
        gap: 5px;
    }

    .size-col__remove {
        position: absolute;
        top: -6px;
        left: -6px;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        background: #dc2626;
        color: #fff;
        border: none;
        font-size: 10px;
        line-height: 1;
        cursor: pointer;
        z-index: 2;
    }

    .size-box {
        width: 46px;
        height: 46px;
        border: 1px solid #e8e8e8;
        border-radius: 8px;
        text-align: center;
        background: transparent;
        font-family: inherit;
        transition: border-color 0.2s;
    }

        .size-box:focus {
            outline: none;
            border-color: #00A4A6;
        }

    .size-box--name {
        font-size: 13px;
        font-weight: 700;
    }

    .size-box--qty {
        font-size: 12px;
        color: #6b6b6b;
    }

    .size-col--add {
        justify-content: center;
    }

    .size-box--add {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #00A4A6;
        font-size: 24px;
        font-weight: 700;
        cursor: pointer;
        background: transparent;
        border-radius: 7px;
        transition: all 0.2s;
    }

        .size-box--add:hover {
            background: #E6F7F7;
        }

    .single-qty-box {
        display: flex;
        align-items: center;
        margin-bottom: 4px;
    }

    .size-col--single {
        width: 140px;
        flex: 0 0 140px;
    }

.size-card__name--single {
    font-size: 17px;
    font-weight: 800;
    color: #fff;
}
.size-qty-row--single {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 8px;
}

.qty-stepper-btn {
        width: 26px;
        height: 26px;
        flex-shrink: 0;
        border: 1px solid #e8e8e8;
        border-radius: 8px;
        background: #fff;
        color: #2b2b2b;
        font-size: 14px;
        font-weight: 700;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s;
        font-family: inherit;
    }

        .qty-stepper-btn:hover {
            border-color: #00A4A6;
            color: #00A4A6;
        }

.size-qty-row .size-box--qty--single {
    width: 30px;
    height: auto;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 800;
    text-align: center;
    padding: 0;
    flex: 0 0 30px;
}
/* ─── View Toggle ─── */
    .excel-trigger-btn {
        font-size: 11px;
        font-weight: 700;
        font-family: inherit;
    }

    .excel-menu-wrap {
        position: relative;
    }

    .excel-menu {
        position: absolute;
        top: 4px;
        left: 0;
        z-index: 30;
        display: flex;
        flex-direction: column;
        gap: 4px;
        min-width: 220px;
        background: #fff;
        border: 1px solid #e8e8e8;
        border-radius: 10px;
        box-shadow: 0 4px 14px rgba(0,0,0,0.12);
        padding: 6px;
    }

    .excel-menu-btn {
        display: block;
        width: 100%;
        box-sizing: border-box;
        background: #f8f8f8;
        border: 1px solid #e8e8e8;
        border-radius: 8px;
        padding: 9px 10px;
        font-size: 12px;
        font-weight: 600;
        color: #2b2b2b;
        cursor: pointer;
        font-family: inherit;
        text-align: right;
        text-decoration: none;
        transition: all 0.2s;
    }

        .excel-menu-btn:hover {
            background: #eef7f7;
            border-color: #00A4A6;
            color: #00A4A6;
        }

    .view-toggle {
        display: flex;
        gap: 4px;
        order: 1;
    }

    .view-menu-option {
        display: flex !important;
        align-items: center;
        gap: 8px;
    }

    .view-menu-option--active {
        background: #eef7f7;
        border-color: #00A4A6;
        color: #00A4A6;
    }

    .view-toggle__btn {
        width: 36px;
        height: 36px;
        border: 1px solid #e8e8e8;
        background: #fff;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #6b6b6b;
        cursor: pointer;
        transition: all 0.2s;
    }

        .view-toggle__btn:hover {
            border-color: #ccc;
            background: #f8f8f8;
        }

    .view-toggle__btn--active {
        background: #00A4A6;
        border-color: #00A4A6;
        color: #fff;
    }

    .section-tabs {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding: 4px 2px 10px;
        margin-bottom: 4px;
    }

    .section-tab {
        flex-shrink: 0;
        padding: 7px 16px;
        border-radius: 8px;
        border: 1px solid var(--gd-border,#e8e8e8);
        background: #fff;
        color: var(--gd-muted,#6b6b6b);
        font-size: 13px;
        font-weight: 600;
        cursor: pointer;
        white-space: nowrap;
        font-family: inherit;
    }

    .section-tab--active {
        background: var(--gd-primary,#00A4A6);
        border-color: var(--gd-primary,#00A4A6);
        color: #fff;
    }
    /* ─── Compact Grid ─── */
    .product-grid--compact {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
        gap: 10px !important;
    }

        .product-grid--compact .product-card__overlay-name {
            display: none;
        }

        .product-grid--compact .product-card__overlay-price {
            position: absolute;
            bottom: 4px;
            left: 6px;
            right: 6px;
            color: #fff;
            font-size: 10px;
            text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
        }

        .product-grid--compact .product-card__overlay-price {
            font-size: 10px;
        }

        .product-grid--compact .product-card__code-badge {
            display: none;
        }

        .product-grid--compact .product-card__sizes {
            padding: 6px;
            gap: 6px;
        }

        .product-grid--compact .size-chip {
            width: calc(25% - 5px);
            min-width: 0;
            height: 16px;
            font-size: 8px;
            padding: 0;
            justify-content: center;
        }

        .product-grid--compact .size-chip__badge {
            display: none;
        }

        .product-grid--compact .add-card__label {
            font-size: 10px;
            padding: 6px;
        }

        .product-grid--compact .add-card__plus {
            font-size: 22px;
        }
    /* ─── Tiny Grid (صور فقط) ─── */
    .product-grid--tiny {
        grid-template-columns: repeat(auto-fill, minmax(65px, 1fr)) !important;
        gap: 6px !important;
    }

        .product-grid--tiny .product-card__overlay,
        .product-grid--tiny .product-card__code-badge,
        .product-grid--tiny .product-card__sizes,
        .product-grid--tiny .add-card__label {
            display: none;
        }

        .product-grid--tiny .add-card__plus {
            font-size: 18px;
        }
    /* ─── Product Table ─── */

    .product-table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        border-radius: 12px;
        box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
    }

    .product-table {
        width: 100%;
        border-collapse: collapse;
        background: #ffffff;
        font-size: 14px;
    }

        .product-table th {
            text-align: right;
            padding: 14px 16px;
            background: #f8f8f8;
            font-weight: 700;
            font-size: 13px;
            color: #6b6b6b;
            border-bottom: 1px solid #e8e8e8;
            white-space: nowrap;
        }

            .product-table th.sortable {
                cursor: pointer;
                user-select: none;
            }

                .product-table th.sortable:hover {
                    color: #2b2b2b;
                }

                .product-table th.sortable .sort-arrow {
                    display: inline-block;
                    width: 10px;
                    margin-right: 4px;
                    opacity: 0.35;
                }

                    .product-table th.sortable .sort-arrow::after {
                        content: "↕";
                        font-size: 11px;
                    }

                .product-table th.sortable.sort-asc .sort-arrow,
                .product-table th.sortable.sort-desc .sort-arrow {
                    opacity: 1;
                    color: #00A4A6;
                }

                    .product-table th.sortable.sort-asc .sort-arrow::after {
                        content: "↑";
                    }

                    .product-table th.sortable.sort-desc .sort-arrow::after {
                        content: "↓";
                    }

    .product-table__th--num {
        width: 36px;
        text-align: center;
    }

    .product-table__th--img {
        width: 64px;
    }

    .product-table td {
        padding: 12px 16px;
        border-bottom: 1px solid #e8e8e8;
        vertical-align: middle;
    }

    .product-table tr {
        cursor: pointer;
    }

    .product-table tbody tr:hover {
        background: #fafafa;
    }

    .product-table tbody tr:last-child td {
        border-bottom: none;
    }

    .product-table__num {
        text-align: center;
        color: #9a9a9a;
        font-size: 13px;
        font-weight: 600;
    }

    .product-table__thumb {
        width: 40px;
        height: 40px;
        border-radius: 8px;
        overflow: hidden;
        background: #f0f0f0;
    }

        .product-table__thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

    .product-table__sizes {
        display: flex;
        gap: 4px;
        flex-wrap: wrap;
    }

    .size-pill {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 20px;
        padding: 0 8px;
        border-radius: 999px;
        background: #e8f7ee;
        font-size: 10px;
        font-weight: 700;
        color: #16a34a;
        gap: 3px;
    }

    .size-pill__qty {
        font-weight: 800;
    }

.size-pill__name {
    opacity: 0.85;
}

.size-pill--no-size {
    width: 20px;
    height: 20px;
    padding: 0;
    border-radius: 6px;
    background: #00A4A6;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
}

/* ─── Search ─── */    .product-search {
        width: auto;
        flex: 0 1 320px;
        min-width: 220px;
        max-width: 320px;
        order: 2;
        height: 36px;
        padding: 0 14px;
        border: 1px solid #e8e8e8;
        border-radius: 8px;
        font-family: inherit;
        font-size: 13px;
        background: #fff;
        transition: border-color 0.2s, box-shadow 0.2s;
        box-sizing: border-box;
    }

        .product-search:focus {
            outline: none;
            border-color: #00A4A6;
            box-shadow: 0 0 0 3px rgba(0, 164, 166, 0.1);
        }
    /* ─── Admin Toolbar (search + view toggle) ─── */
    .admin-toolbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        direction: ltr;
        gap: 12px;
        margin-bottom: 16px;
        flex-wrap: nowrap;
    }

    .admin-toolbar__controls {
        display: flex;
        align-items: center;
        gap: 60px;
        justify-content: flex-end;
        flex-wrap: nowrap;
    }

    .page__header--tight {
        margin-bottom: 12px;
    }
    /* ─── Header counts badge ─── */
    .page__header--with-badge {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        flex-wrap: nowrap;
    }

    .admin-toolbar__counts {
        font-size: 13px;
        font-weight: 700;
        color: #00A4A6;
        background: rgba(0, 164, 166, 0.08);
        padding: 6px 14px;
        border-radius: 999px;
        white-space: nowrap;
    }
    /* ─── Modal Form Row ─── */
    .modal-form-row {
        display: flex;
        gap: 10px;
    }

        .modal-form-row .modal-field:first-child {
            flex: 2;
        }

        .modal-form-row .modal-field:last-child {
            flex: 1;
        }

    .modal-field {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .modal-field__label {
        font-size: 11px;
        font-weight: 600;
        color: #6b6b6b;
    }
    /* ─── Modal Form Row: Prices ─── */
    .modal-form-row--prices {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
    }

        .modal-form-row--prices .modal-field:first-child,
        .modal-form-row--prices .modal-field:last-child {
            flex: 1 1 0 !important;
            min-width: 0 !important;
        }

@media (max-width: 480px) {
    .modal-form-row--prices .modal-field__label {
        font-size: 10px;
    }

    .modal-form-row--prices input {
        font-size: 12px;
        padding: 8px 6px !important;
    }

    .modal-actions-row .modal-save-btn,
    .modal-actions-row .modal-delete-btn {
        padding: 8px 6px;
        font-size: 12px;
    }

    .modal-name-row .modal-field__label,
    .sizes-section-header .modal-field__label,
    .modal-photos-label {
        font-size: 10px;
    }

    .modal-name-row input {
        font-size: 12px;
        padding: 8px 6px !important;
    }

    .modal-name-row .color-dot {
        width: 18px;
        height: 18px;
    }

    .modal-header-bar {
        flex-wrap: wrap;
        row-gap: 8px;
    }

    .modal-header-actions {
        flex-wrap: wrap;
        gap: 6px;
    }

    .modal-header-btn {
        padding: 5px 10px;
        font-size: 11px;
        border-radius: 6px;
    }

    .vis-toggle {
        padding: 2px;
    }

    .vis-btn {
        padding: 4px 9px;
        font-size: 11px;
    }

    .modal-header-bar__info {
        width: 100%;
        justify-content: flex-start;
        gap: 10px;
    }
}
/* ─── Size Card Layout ─── */
    .size-col {
        flex: 0 0 auto;
        min-width: 0;
        height: 70px;
        gap: 0;
        border: 1px solid #e8e8e8;
        border-radius: 8px;
        background: #fff;
    }

    .size-col--add {
        width: 62px;
        flex: 0 0 62px;
        min-width: 62px;
    }

    .size-card__name .size-box--name {
        box-sizing: border-box;
        height: auto;
        border: none;
        background: transparent;
        padding: 0;
        font-size: 17px;
        font-weight: 800;
        color: #fff;
        width: 100%; /* ← جديد */
        text-align: center; /* ← جديد */
    }

    .size-card__name {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 4px;
        background: #00A4A6;
        border-bottom: 0.1px solid #e8e8e8;
        border-radius: 7px 7px 0 0;
    }



    .size-qty-row {
        display: flex;
        direction: ltr;
        flex: 1;
    }

    .size-qty-stepper {
        width: 18px;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        border-right: 1px solid #e8e8e8;
    }

    .size-qty-stepper__btn {
        flex: 1;
        border: none;
        background: transparent;
        font-size: 10px;
        font-weight: 800;
        line-height: 1;
        padding: 0;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .size-qty-stepper__btn:hover {
            background: #fafafa;
        }

    .size-qty-stepper__btn--plus {
        color: #6b6b6b;
        border-bottom: 1px solid #e8e8e8;
    }

    .size-qty-stepper__btn--minus {
        color: #6b6b6b;
    }

    .size-qty-row .size-box--qty {
        flex: 1;
        min-width: 0;
        height: auto;
        border: none;
        background: transparent;
        text-align: center;
        direction: ltr;
        padding: 0;
        font-size: 16px;
        font-weight: 800;
        box-sizing: border-box;
    }

    .size-qty-row .size-box--qty--zero {
        background: #fdecec;
        color: #dc2626;
    }
    /* ─── Size Preset Panel ─── */
    .size-preset-panel {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        align-items: center;
        justify-content: center;
        z-index: 999;
    }

    .size-preset-modal {
        background: #fff;
        border-radius: 12px;
        padding: 16px;
        width: 440px;
        max-width: 90vw;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .size-preset-modal__title {
        font-size: 14px;
        font-weight: 800;
        text-align: center;
    }

    .size-preset-modal__footer {
        display: flex;
        justify-content: center;
        gap: 10px;
    }

    .size-preset-cancel-btn {
        background: #fff;
        color: #6b6b6b;
        border: 1px solid #e8e8e8;
        padding: 10px 28px;
        border-radius: 8px;
        font-weight: 700;
        font-size: 13px;
        font-family: inherit;
        cursor: pointer;
    }

        .size-preset-cancel-btn:hover {
            background: #fafafa;
        }

    .size-preset-grid {
        display: flex;
        flex-direction: column;
        gap: 14px;
        overflow-y: auto;
        scroll-behavior: smooth;
        padding-inline-end: 4px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }


    .size-preset-category {
        display: flex;
        flex-direction: column;
        gap: 10px;
        border: 1px solid #eee;
        border-radius: 10px;
        padding: 10px 12px 12px;
        background: #fafafa;
        position: relative;
        margin-top: 0;
        scroll-margin-top: 42px;
        transition: border-color 0.25s, box-shadow 0.25s;
    }

    .size-preset-row {
        display: flex;
        gap: 10px;
    }

    .size-preset-row--scroll {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-top: 10px;
        padding-bottom: 6px;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .size-preset-row .size-preset-btn,
    .size-preset-row .size-preset-custom {
        flex-shrink: 0;
    }

    .size-preset-divider {
        width: 100%;
        height: 1px;
        background: #eee;
        margin: 2px 0;
    }

    .size-preset-section-label {
        font-size: 13px;
        font-weight: 800;
        color: #00A4A6;
    }

    .size-preset-grid::-webkit-scrollbar,
    .size-preset-row--scroll::-webkit-scrollbar {
        display: none;
    }

    .size-preset-category--flash {
        border-color: #00A4A6;
        box-shadow: 0 0 0 2px rgba(0, 164, 166, 0.25);
    }
    /* مساحة بالنهاية حتى آخر فريم يقدر ينزل لفوق مضبوط */
    .size-preset-grid::after {
        content: "";
        flex-shrink: 0;
        height: 40vh;
    }

    .size-shoe-nav {
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
    }

    .size-preset-head {
        position: sticky;
        top: 0;
        z-index: 2;
        background: #fff;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px;
        padding: 2px 0 6px;
    }

        .size-preset-head .size-preset-section-label {
            white-space: nowrap;
        }

    .size-shoe-nav__chip {
        border: 1px solid #00A4A6;
        color: #00A4A6;
        background: #fff;
        border-radius: 20px;
        padding: 4px 12px;
        font-size: 12px;
        font-weight: 700;
        font-family: inherit;
        cursor: pointer;
        transition: all 0.2s;
    }

        .size-shoe-nav__chip:hover {
            background: #00A4A6;
            color: #fff;
        }

    .size-preset-btn {
        position: relative;
        width: 54px;
        height: 46px;
        box-sizing: border-box;
        border: 1px solid #e8e8e8;
        border-radius: 8px;
        background: #fff;
        color: #2b2b2b;
        font-size: 13px;
        font-weight: 700;
        font-family: inherit;
        cursor: pointer;
        transition: all 0.2s;
    }

    .size-preset-grid {
        max-height: 62vh;
    }

    .size-shoe-nav__chip {
        padding: 3px 10px;
        font-size: 11px;
    }

    .size-preset-btn:hover {
        border-color: #00A4A6;
        color: #00A4A6;
    }

    .size-preset-btn--selected {
        border-color: #00A4A6;
        background: #E6F7F7;
        color: #00A4A6;
    }

        .size-preset-btn--selected::after {
            content: "✓";
            position: absolute;
            top: -7px;
            left: -7px;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: #00A4A6;
            color: #fff;
            font-size: 10px;
            line-height: 16px;
            text-align: center;
        }

    .size-preset-done-btn {
        background: #00A4A6;
        color: #fff;
        border: none;
        padding: 10px 28px;
        border-radius: 8px;
        font-weight: 700;
        font-size: 13px;
        font-family: inherit;
        cursor: pointer;
        transition: background 0.2s;
    }

        .size-preset-done-btn:hover {
            background: #008B8D;
        }

    .size-preset-custom {
        position: relative;
        min-width: 68px;
        width: auto;
        height: 46px;
        box-sizing: border-box;
        border: 1px dashed #00A4A6;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #fff;
        padding: 0 10px;
        flex-shrink: 0;
    }

    .size-preset-custom--selected {
        border-style: solid;
        background: #E6F7F7;
    }

        .size-preset-custom--selected::after {
            content: "✓";
            position: absolute;
            top: -7px;
            left: -7px;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: #00A4A6;
            color: #fff;
            font-size: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
        }

    .size-preset-custom__input {
        box-sizing: border-box;
        border: none;
        outline: none;
        background: transparent;
        text-align: center;
        font-family: inherit;
        font-size: 13px;
        font-weight: 700;
        color: #00A4A6;
        flex-shrink: 0;
    }
    /* الكارتات الصغيره: 10 بالحاسبة الكبيرة */
    .product-grid--compact {
        grid-template-columns: repeat(10, 1fr) !important;
    }
    /* شاشات كبيرة متوسطة (لابتوب/حاسبة عادية) */
    @media (max-width: 1600px) {
        .product-grid--compact {
            grid-template-columns: repeat(8, 1fr) !important;
            gap: 8px !important;
        }
    }
    /* آيباد وتابلت */
    @media (max-width: 1100px) {
        .product-grid--compact {
            grid-template-columns: repeat(5, 1fr) !important;
            gap: 8px !important;
        }
    }

    @media (max-width: 800px) {
        .product-grid--compact {
            grid-template-columns: repeat(3, 1fr) !important;
            gap: 8px !important;
        }
    }
    /* ─── Responsive ─── */
    @media (max-width: 640px) {
        .product-grid {
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
        }

        .product-grid--compact {
            grid-template-columns: repeat(4, 1fr) !important;
            gap: 6px !important;
        }

        .product-grid--tiny {
            grid-template-columns: repeat(8, 1fr) !important;
            gap: 5px !important;
        }

        .product-table {
            font-size: 12px;
        }

        .product-table-scroll {
            -webkit-overflow-scrolling: touch;
            scroll-behavior: smooth;
            touch-action: pan-x pan-y;
        }

        .product-table th,
        .product-table td {
            padding: 8px 6px;
        }

        .product-table__th--num {
            width: 26px;
        }

        .product-table__thumb {
            width: 32px;
            height: 32px;
        }

        .modal-box {
            padding: 16px;
            max-height: calc(100vh - 64px - 32px);
            max-height: calc(100dvh - 64px - 32px);
        }
        
        .modal-overlay {
            align-items: flex-start;
            padding-top: 16px;
        }
        .modal-form-row {
            flex-direction: column;
        }

        .modal-name-row {
            flex-direction: row !important;
        }

            .modal-name-row .modal-colors {
                flex-wrap: nowrap;
                overflow-x: auto;
                min-height: 0;
            }

            .modal-name-row .color-dot {
                width: 18px;
                height: 18px;
                flex-shrink: 0;
            }
        /* بدل ما نصغر الكارتات، نخليهم بحجمهم الطبيعي وسكرول أفقي إذا زادوا عن الشاشة */
        .sizes-editor {
            flex-wrap: nowrap;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }

        .size-col,
        .size-col--add {
            flex-shrink: 0;
        }



        .size-preset-btn {
            width: 54px;
        }

        .admin-toolbar {
            flex-wrap: wrap;
        }

        .admin-toolbar__controls {
            gap: 10px;
            flex-wrap: wrap;
            justify-content: flex-start;
            width: 100%;
        }

        .product-search {
            flex: 1 1 100%;
            max-width: 100%;
            min-width: 0;
        }
    }
    /* ============ منقول من base.html (كان inline) — نُقل هنا عشان يستفيد من الكاش ============ */
    /* ════════════════════════════════════════
           GoDaddy-Style Design System
           ════════════════════════════════════════ */
    :root {
        --gd-header: #111111;
        --gd-header-text: #ffffff;
        --gd-header-muted: #a0a0a0;
        --gd-primary: #00A4A6;
        --gd-primary-hover: #008B8D;
        --gd-primary-tint: #E6F7F7;
        --gd-surface: #ffffff;
        --gd-surface-alt: #f8f8f8;
        --gd-border: #e8e8e8;
        --gd-text: #2b2b2b;
        --gd-muted: #6b6b6b;
        --gd-danger: #dc2626;
        --gd-danger-tint: #fdecec;
        --gd-success: #16a34a;
        --gd-success-tint: #e8f7ee;
        --gd-warning: #f59e0b;
        --radius-sm: 8px;
        --radius-md: 12px;
        --radius-lg: 16px;
        --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
        --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
        --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
    }

    * {
        box-sizing: border-box;
    }

    html {
        scroll-behavior: smooth;
    }

    body {
        font-family: 'Tajawal', 'IBM Plex Sans Arabic', sans-serif;
        background: #f6f6f6;
        color: var(--gd-text);
        margin: 0;
        font-size: 15px;
        line-height: 1.6;
        -webkit-font-smoothing: antialiased;
        padding-top: 64px;
    }

    h1, h2, h3, h4, .display {
        font-family: 'IBM Plex Sans Arabic', sans-serif;
        font-weight: 700;
        letter-spacing: -0.01em;
        margin: 0;
    }

    a {
        color: inherit;
        text-decoration: none;
    }

    img {
        max-width: 100%;
        display: block;
    }
    /* ─── Header ─── */
    .topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1100;
        background: var(--gd-header);
        color: var(--gd-header-text);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 24px;
        height: 64px;
        box-shadow: none;
    }

    .topbar__left {
        display: flex;
        align-items: center;
        gap: 32px;
    }

    .topbar__logo {
        font-family: 'IBM Plex Sans Arabic', sans-serif;
        font-weight: 700;
        font-size: 24px;
        color: var(--gd-header-text);
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 10px;
        letter-spacing: -0.02em;
    }

        .topbar__logo svg {
            width: 30px;
            height: 30px;
            color: var(--gd-primary);
        }

    .nav-icon {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
        color: var(--gd-primary);
    }

    .sidebar__link-label {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .topbar__nav {
        display: flex;
        align-items: center;
        gap: 4px;
    }

    .topbar__nav-link {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        color: var(--gd-header-muted);
        text-decoration: none;
        font-size: 14px;
        font-weight: 600;
        padding: 8px 16px;
        border-radius: var(--radius-sm);
        transition: all 0.2s ease;
        white-space: nowrap;
    }

        .topbar__nav-link:hover {
            color: var(--gd-header-text);
            background: rgba(255,255,255,0.08);
        }

        .topbar__nav-link.active {
            display: none;
        }

    .topbar__nav-link--soon {
        opacity: 0.45;
        pointer-events: none;
        cursor: default;
    }

        .topbar__nav-link--soon span {
            font-size: 9px;
            background: rgba(255,255,255,0.2);
            color: #fff;
            padding: 2px 6px;
            border-radius: 8px;
            margin-right: 4px;
            font-weight: 700;
        }

    .topbar__right {
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .topbar__menu-btn {
        display: none;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        width: 28px;
        height: 28px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
    }

        .topbar__menu-btn span {
            display: block;
            width: 100%;
            height: 2.5px;
            background: var(--gd-header-text);
            border-radius: 2px;
            transition: 0.2s;
        }

    .topbar__profile {
        position: relative;
    }

    .profile-btn {
        display: flex;
        align-items: center;
        gap: 10px;
        background: none;
        border: 1px solid rgba(255,255,255,0.15);
        cursor: pointer;
        padding: 6px 14px;
        border-radius: 20px;
        transition: all 0.2s;
    }

        .profile-btn:hover {
            background: rgba(255,255,255,0.08);
            border-color: rgba(255,255,255,0.3);
        }

    .profile-btn__avatar {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: var(--gd-primary);
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        flex-shrink: 0;
        color: #fff;
        font-size: 13px;
        font-weight: 700;
        font-family: 'IBM Plex Sans Arabic', sans-serif;
    }

        .profile-btn__avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

    .profile-btn__store {
        font-size: 13px;
        font-weight: 600;
        color: var(--gd-header-text);
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .profile-menu {
        display: none;
        position: absolute;
        top: calc(100% + 10px);
        left: 0;
        background: var(--gd-header);
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-lg);
        min-width: 220px;
        z-index: 600;
        overflow: hidden;
        padding: 6px 0;
    }

        .profile-menu.open {
            display: block;
        }

    .profile-menu__link {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 18px;
        font-size: 14px;
        font-weight: 600;
        color: var(--gd-header-text);
        text-decoration: none;
        transition: background 0.15s;
    }

        .profile-menu__link .nav-icon {
            color: var(--gd-primary);
        }

        .profile-menu__link:hover {
            background: rgba(255,255,255,0.08);
            color: var(--gd-primary);
        }

    .profile-menu__divider {
        height: 1px;
        background: rgba(255,255,255,0.12);
        margin: 6px 12px;
    }
    /* ─── Sidebar ─── */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 998;
    }

        .sidebar-overlay.open {
            display: block;
        }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: 240px;
        max-width: 85%;
        background: var(--gd-surface);
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
        box-shadow: 8px 0 32px rgba(0,0,0,0.12);
        display: flex;
        flex-direction: column;
    }

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

    .sidebar__header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 18px 20px;
        font-weight: 700;
        font-size: 16px;
        color: var(--gd-text);
    }

    .sidebar__close {
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        color: var(--gd-muted);
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: background 0.15s;
    }

        .sidebar__close:hover {
            background: #f5f5f5;
        }

    .sidebar__nav {
        display: flex;
        flex-direction: column;
        padding: 8px 0;
    }

    .sidebar__link {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 14px 20px;
        text-decoration: none;
        color: var(--gd-text);
        font-weight: 600;
        font-size: 17px;
        transition: background 0.15s;
    }

        .sidebar__link:hover {
            background: #f5f5f5;
            color: var(--gd-primary);
        }

    .sidebar__link--active {
        color: var(--gd-primary);
        background: rgba(0, 164, 166, 0.06);
        border-right: 3px solid var(--gd-primary);
    }

    .sidebar__link--soon {
        color: #bbb;
        pointer-events: none;
    }

        .sidebar__link--soon span {
            font-size: 11px;
            background: #eee;
            padding: 2px 8px;
            border-radius: 10px;
            font-weight: 700;
        }

    .sidebar__section-title {
        font-size: 11px;
        font-weight: 700;
        color: var(--gd-muted);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        padding: 16px 20px 8px;
    }

    .sidebar__section-title--toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        background: none;
        border: none;
        cursor: pointer;
        font-family: inherit;
    }

    .sidebar__nav--collapsible {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.25s ease;
        padding: 0;
    }

        .sidebar__nav--collapsible.open {
            max-height: 300px;
            padding: 8px 0;
        }
    /* ─── Main Content ─── */
    main {
        max-width: 1200px;
        margin: 0 auto;
        padding: 32px 24px;
    }
    /* ─── Page Layout ─── */
    .page {
        max-width: 1080px;
        margin: 0 auto;
        padding: 32px 24px 80px;
    }

    .page__header {
        margin-bottom: 32px;
    }

        .page__header h1 {
            font-size: 28px;
            margin-bottom: 8px;
            color: var(--gd-text);
        }

        .page__header p {
            color: var(--gd-muted);
            margin: 0;
            font-size: 15px;
        }
    /* ─── Cards ─── */
    .card {
        background: var(--gd-surface);
        border: 1px solid var(--gd-border);
        border-radius: var(--radius-md);
        padding: 24px;
        box-shadow: var(--shadow-sm);
    }

    .card--hover:hover {
        box-shadow: var(--shadow-md);
        transform: translateY(-2px);
        transition: all 0.2s ease;
    }
    /* ─── Forms ─── */
    .form-group {
        margin-bottom: 18px;
    }

    .form-label {
        display: block;
        font-size: 14px;
        font-weight: 700;
        margin-bottom: 8px;
        color: var(--gd-text);
    }

    .form-input,
    .form-select {
        width: 100%;
        padding: 12px 14px;
        border: 1px solid var(--gd-border);
        border-radius: var(--radius-sm);
        font-family: inherit;
        font-size: 15px;
        background: var(--gd-surface);
        color: var(--gd-text);
        transition: border-color 0.2s, box-shadow 0.2s;
    }

        .form-input:focus,
        .form-select:focus {
            outline: none;
            border-color: var(--gd-primary);
            box-shadow: 0 0 0 3px rgba(0, 164, 166, 0.1);
        }

        .form-input::placeholder {
            color: #aaa;
        }
    /* ─── Buttons ─── */
    .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 12px 24px;
        border-radius: var(--radius-sm);
        font-family: inherit;
        font-size: 15px;
        font-weight: 700;
        cursor: pointer;
        border: none;
        transition: all 0.2s ease;
        white-space: nowrap;
    }

    .btn--primary {
        background: var(--gd-primary);
        color: #fff;
    }

        .btn--primary:hover {
            background: var(--gd-primary-hover);
            transform: translateY(-1px);
            box-shadow: var(--shadow-md);
        }

    .btn--secondary {
        background: var(--gd-surface);
        color: var(--gd-text);
        border: 1px solid var(--gd-border);
    }

        .btn--secondary:hover {
            background: var(--gd-surface-alt);
            border-color: #ccc;
        }

    .btn--danger {
        background: #fff;
        color: var(--gd-danger);
        border: 1px solid var(--gd-danger);
    }

        .btn--danger:hover {
            background: var(--gd-danger-tint);
        }

    .btn--block {
        width: 100%;
    }

    .btn--lg {
        padding: 14px 32px;
        font-size: 16px;
    }
    /* ─── Alerts ─── */
    .alert {
        padding: 14px 18px;
        border-radius: var(--radius-sm);
        margin-bottom: 20px;
        font-size: 14px;
        font-weight: 600;
    }

    .alert--error {
        background: var(--gd-danger-tint);
        color: var(--gd-danger);
        border: 1px solid rgba(220, 38, 38, 0.15);
    }

    .alert--success {
        background: var(--gd-success-tint);
        color: var(--gd-success);
        border: 1px solid rgba(22, 163, 74, 0.15);
    }
    /* ─── Auth Pages ─── */
    .auth-page {
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 24px;
        background: linear-gradient(135deg, #f6f6f6 0%, #e8e8e8 100%);
    }

    .auth-card {
        background: var(--gd-surface);
        border: 1px solid var(--gd-border);
        border-radius: var(--radius-lg);
        padding: 40px 32px;
        width: 100%;
        max-width: 420px;
        box-shadow: var(--shadow-lg);
    }

    .auth-card__header {
        text-align: center;
        margin-bottom: 32px;
    }

        .auth-card__header h1 {
            font-size: 26px;
            margin-bottom: 8px;
        }

        .auth-card__header p {
            color: var(--gd-muted);
            font-size: 15px;
            margin: 0;
        }

    .auth-card__logo {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        margin-bottom: 24px;
        font-family: 'IBM Plex Sans Arabic', sans-serif;
        font-weight: 700;
        font-size: 24px;
        color: var(--gd-text);
    }

        .auth-card__logo svg {
            width: 32px;
            height: 32px;
            color: var(--gd-primary);
        }

    .auth-footer {
        text-align: center;
        margin-top: 24px;
        font-size: 14px;
        color: var(--gd-muted);
    }

        .auth-footer a {
            color: var(--gd-primary);
            font-weight: 700;
        }

            .auth-footer a:hover {
                text-decoration: underline;
            }
    /* ─── Landing Page ─── */
    .hero {
        text-align: center;
        padding: 100px 24px 60px;
        max-width: 720px;
        margin: 0 auto;
    }

        .hero h1 {
            font-size: 42px;
            margin-bottom: 16px;
            line-height: 1.2;
        }

        .hero p {
            color: var(--gd-muted);
            font-size: 18px;
            margin-bottom: 40px;
            line-height: 1.7;
        }

    .steps {
        display: flex;
        justify-content: center;
        align-items: flex-start;
        margin-top: 64px;
        gap: 16px;
    }

    .step {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 180px;
    }

    .step__circle {
        width: 52px;
        height: 52px;
        border-radius: 50%;
        background: var(--gd-primary-tint);
        color: var(--gd-primary);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 20px;
        font-weight: 700;
        font-family: 'IBM Plex Sans Arabic', sans-serif;
        margin-bottom: 16px;
    }

    .step__label {
        font-size: 14px;
        color: var(--gd-muted);
        text-align: center;
        line-height: 1.5;
    }

    .step__arrow {
        flex-shrink: 0;
        margin-top: 18px;
        color: var(--gd-border);
    }
    /* ─── Responsive ─── */
    @media (max-width: 768px) {
        .topbar__nav {
            display: none;
        }

        .topbar__menu-btn {
            display: flex;
        }

        .topbar__left {
            gap: 12px;
        }

        .profile-btn__store {
            display: none;
        }

        .profile-btn {
            padding: 4px;
            border: none;
        }

        main {
            padding: 20px 16px;
        }

        .page {
            padding: 20px 16px 60px;
        }

        .page__header h1 {
            font-size: 22px;
        }

        .hero {
            padding: 60px 20px 40px;
        }

            .hero h1 {
                font-size: 28px;
            }

            .hero p {
                font-size: 16px;
            }

        .steps {
            flex-direction: column;
            align-items: center;
            gap: 24px;
        }

        .step {
            width: 100%;
            flex-direction: row;
            justify-content: center;
            gap: 16px;
        }

        .step__label {
            margin: 0;
            text-align: right;
            max-width: 200px;
        }

        .step__arrow {
            transform: rotate(90deg);
            width: 30px;
            height: 40px;
            margin: 0;
        }

        .auth-card {
            padding: 32px 24px;
        }
    }

@media (max-width: 640px) {
    .topbar {
        padding: 0 16px;
        height: 56px;
    }

    .modal-overlay {
        top: 56px;
    }

    .topbar__logo {
        font-size: 18px;
    }

        .topbar__logo svg {
            width: 24px;
            height: 24px;
        }
}
    .page-wrap {
        max-width: 900px;
        margin: 0 auto;
        padding: 20px 16px 60px;
    }

    .page-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 16px;
        flex-wrap: wrap;
        gap: 10px;
    }

        .page-header h1 {
            margin: 0;
            font-size: 22px;
        }

    .staff-list {
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    .staff-card {
        background: var(--gd-surface);
        border: 1px solid var(--gd-border);
        border-radius: var(--radius-md);
        padding: 16px 18px;
        box-shadow: var(--shadow-sm);
    }

    .staff-card__info {
        display: flex;
        flex-direction: column;
        gap: 4px;
        margin-bottom: 14px;
        padding-bottom: 12px;
        border-bottom: 1px solid var(--gd-border);
    }

    .staff-card__name {
        font-weight: 700;
        font-size: 16px;
        color: var(--gd-text);
    }

    .staff-card__email {
        color: var(--gd-muted);
        font-size: 13px;
        direction: ltr;
        text-align: right;
    }

    .staff-card__actions {
        display: flex;
        gap: 8px;
    }

    .perm-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        font-size: 14px;
        color: var(--gd-text);
        cursor: pointer;
        margin-bottom: 10px;
    }

        .perm-toggle input[type="checkbox"] {
            -webkit-appearance: none;
            appearance: none;
            width: 38px;
            height: 22px;
            border-radius: 999px;
            background: #d1d5db;
            border: none;
            position: relative;
            cursor: pointer;
            flex-shrink: 0;
            transition: background .2s ease;
        }

            .perm-toggle input[type="checkbox"]::after {
                content: "";
                position: absolute;
                top: 3px;
                left: 3px;
                width: 16px;
                height: 16px;
                border-radius: 50%;
                background: #fff;
                box-shadow: 0 1px 3px rgba(0,0,0,.3);
                transition: left .2s ease;
            }

            .perm-toggle input[type="checkbox"]:checked {
                background: var(--gd-primary);
            }

                .perm-toggle input[type="checkbox"]:checked::after {
                    left: 19px;
                }


    .btn--sm {
        padding: 7px 14px;
        font-size: 13px;
    }

    .empty-state {
        color: var(--gd-muted);
        text-align: center;
        padding: 40px 0;
    }

    .flash-box {
        background: var(--gd-primary-tint);
        color: var(--gd-primary-hover);
        padding: 10px 14px;
        border-radius: var(--radius-sm);
        margin-bottom: 14px;
        font-size: 14px;
        text-align: center;
    }

    .product-card__reserved-badge {
        position: absolute;
        top: 6px;
        left: 6px;
        padding: 3px 8px;
        border-radius: 20px;
        background: var(--gd-primary, #00A4A6);
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        white-space: nowrap;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 1px 4px rgba(0,0,0,.3);
        z-index: 2;
    }

    .product-card__reserved-badge--sm {
        top: 3px;
        left: 3px;
        padding: 2px 6px;
        font-size: 9px;
    }

    .size-chip--reserved, .size-pill--reserved {
        position: relative;
        border-radius: 8px;
        box-shadow: 0 0 0 1.5px var(--gd-primary, #00A4A6) inset;
    }

    .inv-stepper__qty--reserved {
        border: 1.5px solid var(--gd-primary, #00A4A6);
        border-radius: 6px;
        padding: 1px 4px;
    }

    .product-card__return-badge {
        position: absolute;
        top: 6px;
        left: 6px;
        padding: 3px 8px;
        border-radius: 20px;
        background: #f0a500;
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        white-space: nowrap;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 1px 4px rgba(0,0,0,.3);
        z-index: 2;
    }

    .product-card__return-badge--sm {
        top: 3px;
        left: 3px;
        padding: 2px 6px;
        font-size: 9px;
    }

    .size-chip--returning {
        border: 1.5px solid #f0a500 !important;
        background: rgba(240, 165, 0, .12) !important;
    }

    .size-pill--returning {
        box-shadow: 0 0 0 1.5px #f0a500 inset;
        background: rgba(240, 165, 0, .22) !important;
        color: #935800 !important;
    }
    /* ===== مودالات (الفاتورة السريعة / اختيار موديل / اختيار قياس) ===== */
    .qi-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .45);
        z-index: 1000;
        align-items: center;
        justify-content: center;
        padding: 16px;
    }

        .qi-overlay.open {
            display: flex;
        }

    body.qi-locked {
        position: fixed;
        left: 0;
        right: 0;
        width: 100%;
        overflow: hidden;
    }

    .qi-sheet {
        background: var(--gd-bg, #fff);
        width: 100%;
        max-width: 420px;
        max-height: 85vh;
        border-radius: 16px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .qi-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px;
        border-bottom: 1px solid var(--gd-border);
        flex-shrink: 0;
        gap: 8px;
    }

        .qi-header h3 {
            margin: 0;
            font-size: 15px;
            font-weight: 800;
            flex: 1;
            text-align: center;
        }

    .qi-close {
        background: none;
        border: none;
        font-size: 18px;
        cursor: pointer;
        color: var(--gd-muted);
        line-height: 1;
        padding: 4px;
    }

    .qi-back {
        background: none;
        border: none;
        font-size: 12.5px;
        font-weight: 700;
        cursor: pointer;
        color: var(--gd-text, #111);
        padding: 4px 2px;
        white-space: nowrap;
    }

    .qi-row-2 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 10px;
        align-items: stretch;
    }

        .qi-row-2 .qi-input,
        .qi-row-2 .qi-pick-btn {
            margin-bottom: 0;
        }

        .qi-row-2 .qi-pick-btn {
            padding: 10px 6px;
            font-size: 12.5px;
        }

    .qi-barcode-box {
        display: flex;
        align-items: center;
        gap: 6px;
        border: 1px solid var(--gd-border);
        border-radius: 10px;
        padding: 0 10px;
        background: var(--gd-surface);
    }

    .qi-barcode-box__icon {
        color: var(--gd-muted);
        flex-shrink: 0;
        line-height: 1;
        display: flex;
        align-items: center;
    }

        .qi-barcode-box__icon svg {
            width: 16px;
            height: 16px;
        }

    .qi-barcode-box__input {
        border: none;
        background: transparent;
        outline: none;
        width: 100%;
        padding: 10px 0;
        font-size: 13px;
        color: inherit;
        box-sizing: border-box;
    }

    .qi-barcode-wrap {
        position: relative;
    }

    .qi-barcode-dropdown {
        display: none;
        position: fixed;
        z-index: 1100;
        background: var(--gd-surface);
        border: 1px solid var(--gd-border);
        border-radius: 10px;
        max-height: 220px;
        overflow-y: auto;
        box-shadow: 0 6px 18px rgba(0,0,0,.18);
    }

    .qi-receipt-card {
        background: #fff;
        border: 1px solid var(--gd-border);
        border-radius: 12px;
        padding: 14px;
        box-shadow: 0 10px 28px rgba(0,0,0,.22);
    }

    .qi-receipt-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 6px;
        padding-bottom: 10px;
        margin-bottom: 10px;
        border-bottom: 1px dashed var(--gd-border);
    }

    .qi-receipt-hint {
        text-align: center;
        font-size: 11.5px;
        color: var(--gd-muted);
        padding: 6px 16px 0;
    }

    .qi-receipt-logo {
        width: 42px;
        height: 42px;
        border-radius: 50%;
        object-fit: cover;
        flex-shrink: 0;
    }

    .qi-receipt-logo--fallback {
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--gd-primary);
        color: #fff;
        font-weight: 800;
        font-size: 17px;
    }

    .qi-receipt-customer {
        display: flex;
        flex-direction: column;
        gap: 2px;
        margin-bottom: 10px;
        font-size: 12.5px;
        text-align: right;
    }

        .qi-receipt-customer span {
            color: var(--gd-muted);
            font-size: 11px;
        }

    .qi-receipt-item__price {
        font-size: 12px;
        font-weight: 700;
        flex-shrink: 0;
    }

    .qi-fee-input::-webkit-outer-spin-button,
    .qi-fee-input::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

    .qi-fee-input[type="number"] {
        -moz-appearance: textfield;
    }



    .qi-fee-box__input[type="number"] {
        -moz-appearance: textfield;
    }

    .qi-barcode-dropdown.open {
        display: block;
    }

    .qi-barcode-dropdown__item {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 7px 10px;
        cursor: pointer;
        border-bottom: 1px solid var(--gd-border);
    }

        .qi-barcode-dropdown__item:last-child {
            border-bottom: none;
        }

        .qi-barcode-dropdown__item:active {
            background: var(--gd-border);
        }

    .qi-barcode-dropdown__img {
        width: 30px;
        height: 30px;
        border-radius: 6px;
        object-fit: cover;
        background: var(--gd-border);
        flex-shrink: 0;
    }

    .qi-barcode-dropdown__info {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 1px;
    }

        .qi-barcode-dropdown__info b {
            font-size: 12px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

    .qi-barcode-dropdown__code {
        font-size: 10.5px;
        color: var(--gd-muted);
        font-weight: 700;
    }

    .qi-barcode-dropdown__empty {
        padding: 10px;
        font-size: 12px;
        color: var(--gd-muted);
        text-align: center;
    }

    .qi-header__spacer {
        visibility: hidden;
    }

    .qi-body {
        padding: 14px 16px;
        overflow-y: auto;
        flex: 1;
    }

    .qi-footer {
        padding: 12px 16px;
        border-top: 1px solid var(--gd-border);
        flex-shrink: 0;
    }

    .qi-input {
        width: 100%;
        border: 1px solid var(--gd-border);
        border-radius: 10px;
        padding: 10px 12px;
        font-size: 13px;
        margin-bottom: 10px;
        background: var(--gd-surface);
        color: inherit;
        box-sizing: border-box;
    }

    .qi-pick-btn {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        border: none;
        border-radius: 10px;
        padding: 12px;
        font-size: 13px;
        font-weight: 700;
        background: var(--gd-primary, #00A4A6);
        color: #000;
        cursor: pointer;
        margin-bottom: 12px;
    }

    .qi-pick-btn__icon {
        font-size: 15px;
        line-height: 1;
        color: #000;
    }

    .qi-items {
        display: flex;
        flex-direction: column;
        gap: 6px;
        margin-bottom: 10px;
    }

    .qi-item {
        display: flex;
        align-items: center;
        gap: 8px;
        border: 1px solid var(--gd-border);
        border-radius: 10px;
        padding: 8px 10px;
        font-size: 12px;
    }

    .qi-item__img {
        width: 36px;
        height: 36px;
        border-radius: 8px;
        object-fit: cover;
        background: var(--gd-border);
        flex-shrink: 0;
    }

    .qi-item__info {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 1px;
    }

        .qi-item__info b {
            font-size: 12.5px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

    .qi-item__meta {
        font-size: 10.5px;
        color: var(--gd-muted);
    }

    .qi-item__size {
        font-size: 10.5px;
        font-weight: 700;
    }

    .qi-item__remove {
        background: none;
        border: none;
        color: var(--gd-danger);
        font-size: 15px;
        cursor: pointer;
        flex-shrink: 0;
    }

    .qi-total {
        display: flex;
        justify-content: space-between;
        font-weight: 800;
        font-size: 14px;
        margin-bottom: 10px;
        padding-top: 10px;
        border-top: 1px solid var(--gd-border);
    }

    .qi-receipt-row {
        display: flex;
        justify-content: space-between;
        font-size: 12px;
        color: var(--gd-muted);
        margin-bottom: 4px;
    }

    .qi-submit {
        width: 100%;
        border: none;
        border-radius: 10px;
        padding: 13px;
        font-size: 14px;
        font-weight: 800;
        background: var(--gd-primary, #111);
        color: #fff;
        cursor: pointer;
    }

        .qi-submit:disabled {
            opacity: .5;
            cursor: not-allowed;
        }

    .qi-error {
        color: var(--gd-danger);
        font-size: 12px;
        margin-bottom: 8px;
        display: none;
    }
    /* اختيار موديل */
    .qi-search-row {
        display: flex;
        gap: 8px;
        margin-bottom: 10px;
    }

        .qi-search-row .qi-input {
            margin-bottom: 0;
        }

    .qi-sections {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 8px;
        margin-bottom: 10px;
    }

    .qi-chip {
        flex: 0 0 auto;
        border: 1px solid var(--gd-border);
        background: var(--gd-surface);
        border-radius: 999px;
        padding: 6px 12px;
        font-size: 11px;
        cursor: pointer;
        white-space: nowrap;
    }

        .qi-chip.active {
            background: var(--gd-primary, #111);
            color: #fff;
            border-color: transparent;
        }

    .qi-model-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .qi-model-card {
        border: 1px solid var(--gd-border);
        border-radius: 10px;
        overflow: hidden;
        cursor: pointer;
        background: var(--gd-surface);
        text-align: center;
    }

        .qi-model-card img {
            width: 100%;
            aspect-ratio: 1;
            object-fit: cover;
            display: block;
            background: var(--gd-border);
        }

    .qi-model-card__name {
        font-size: 10.5px;
        font-weight: 700;
        padding: 4px 4px 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .qi-model-card__price {
        font-size: 10px;
        color: var(--gd-muted);
        padding: 0 4px 6px;
    }

    .qi-empty {
        font-size: 12px;
        color: var(--gd-muted);
        text-align: center;
        padding: 20px 0;
    }
    /* اختيار قياس */
    .qi-size-header {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 12px;
    }

        .qi-size-header img {
            width: 48px;
            height: 48px;
            object-fit: cover;
            border-radius: 8px;
            background: var(--gd-border);
        }

        .qi-size-header b {
            font-size: 13px;
            display: block;
        }

    .qi-back-btn {
        background: none;
        border: none;
        font-size: 13px;
        cursor: pointer;
        color: var(--gd-muted);
        padding: 4px 0;
    }

    .qi-size-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .qi-size-box {
        border: 1px solid var(--gd-border);
        border-radius: 10px;
        padding: 10px 4px;
        text-align: center;
        cursor: pointer;
        background: var(--gd-surface);
    }

        .qi-size-box b {
            display: block;
            font-size: 13px;
        }

        .qi-size-box span {
            display: block;
            font-size: 10px;
            color: var(--gd-muted);
            margin-top: 2px;
        }

        .qi-size-box.disabled {
            opacity: .4;
            cursor: not-allowed;
        }

    .qi-size-box--reserved {
        opacity: 1 !important;
        cursor: pointer !important;
        background: rgba(0,164,166,.12);
        border-color: var(--gd-primary, #00A4A6);
    }

        .qi-size-box--reserved span {
            color: var(--gd-primary, #00A4A6);
            font-weight: 700;
        }

    .qi-receipt-footer {
        margin-top: 2px;
        text-align: center;
        font-size: 12px;
        line-height: 1.7;
        color: var(--gd-muted);
        white-space: pre-line;
    }

    .qi-receipt-meta {
        display: flex;
        justify-content: space-between;
        font-size: 12px;
        color: var(--gd-muted);
        margin-bottom: 10px;
    }

        .qi-receipt-meta #qi-receipt-number {
            font-weight: 700;
            color: var(--gd-text);
        }

    .qi-pdf-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 7px 12px;
        border: 1px solid var(--gd-border);
        border-radius: 8px;
        background: #fff;
        font-family: inherit;
        font-size: 12.5px;
        font-weight: 700;
        cursor: pointer;
    }

        .qi-pdf-btn:disabled {
            opacity: .6;
            cursor: default;
        }
    /* سكرول خفيف يظهر بس على الحاسبة (ماوس). الجوال يبقى مخفي */
@media (hover: hover) and (pointer: fine) {
    .size-preset-grid,
    .size-preset-row--scroll {
        scrollbar-width: thin;
        scrollbar-color: #d0d0d0 transparent;
    }

        .size-preset-grid::-webkit-scrollbar,
        .size-preset-row--scroll::-webkit-scrollbar {
            display: block;
            width: 5px;
            height: 5px;
        }

        .size-preset-grid::-webkit-scrollbar-track,
        .size-preset-row--scroll::-webkit-scrollbar-track {
            background: transparent;
        }

        .size-preset-grid::-webkit-scrollbar-thumb,
        .size-preset-row--scroll::-webkit-scrollbar-thumb {
            background: #d0d0d0;
            border-radius: 10px;
        }

            .size-preset-grid::-webkit-scrollbar-thumb:hover,
            .size-preset-row--scroll::-webkit-scrollbar-thumb:hover {
                background: #b5b5b5;
            }
}
    .cost-card {
        position: relative;
        cursor: default;
        min-height: 92px;
        padding-top: 26px;
    }

    .cost-card__btn {
        position: absolute;
        top: 5px;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        border: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding: 0;
        font-size: 10px;
        line-height: 1;
    }

        .cost-card__btn svg {
            width: 11px;
            height: 11px;
        }


    .cost-card__btn--edit {
        right: 5px;
        background: #e6f6f6;
        color: #00A4A6;
    }

    .cost-card--add {
        border: 2px dashed #e8e8e8;
        background: #fafafa;
        cursor: pointer;
        padding-top: 10px;
    }

    .cost-card__plus {
        font-size: 28px;
        color: #aaa;
        font-weight: 300;
    }

    .cost-type-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 16px 8px;
        border: 1px solid #e8e8e8;
        border-radius: 10px;
        background: #fff;
        cursor: pointer;
        font-family: inherit;
        font-size: 13px;
        font-weight: 700;
        color: #2b2b2b;
        transition: all 0.2s;
    }

        .cost-type-btn:hover {
            border-color: #00A4A6;
            color: #00A4A6;
        }

        .cost-type-btn span {
            font-size: 10px;
            font-weight: 400;
            color: #999;
        }

    .cost-today-total {
        padding: 10px 4px 0;
        font-size: 13px;
        color: #6b6b6b;
    }

    .cost-input {
        width: 100%;
        box-sizing: border-box;
        border: 1px solid var(--gd-border, #e8e8e8);
        border-radius: 10px;
        padding: 10px 12px;
        font-size: 14px;
        font-family: inherit;
        background: var(--gd-surface, #fff);
        color: inherit;
        outline: none;
        transition: border-color 0.2s;
    }

        .cost-input:focus {
            border-color: #00A4A6;
        }

    #cost-name-input::-webkit-calendar-picker-indicator {
        display: none !important;
    }

    .cost-modal-actions {
        display: flex;
        gap: 10px;
        margin-top: 18px;
    }

    .cost-save-btn,
    .cost-delete-btn {
        flex: 1;
        border: none;
        border-radius: 10px;
        padding: 12px;
        font-size: 14px;
        font-weight: 700;
        font-family: inherit;
        cursor: pointer;
        transition: background 0.2s;
    }

    .cost-save-btn {
        background: #00A4A6;
        color: #fff;
    }

        .cost-save-btn:hover {
            background: #008B8D;
        }

    .cost-delete-btn {
        background: #fdecea;
        color: #e53935;
    }

        .cost-delete-btn:hover {
            background: #fbd5d1;
        }
