.delivery-mobile {
    direction: rtl;
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px;
}

    .delivery-mobile *,
    .delivery-mobile *::before,
    .delivery-mobile *::after {
        box-sizing: border-box;
    }

.delivery-header,
.delivery-toolbar,
.provider-switch,
.delivery-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.delivery-header {
    margin-bottom: 16px;
}

/*.provider-switch {
  justify-content: flex-start;
  overflow-x: auto;
  padding: 6px;
  border-radius: 18px;
  background: #eef6f1;
}

.provider-switch button {
  min-height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #385347;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.provider-switch button.active {
  background: #19734a;
  color: white;
  box-shadow: 0 5px 14px #19734a30;
}

.provider-switch button.warning {
  color: #9a5b00;
}*/

.provider-switch {
    justify-content: flex-start;
    overflow-x: auto;
    padding: 6px;
    border-radius: 16px;
    background: #f2f5f3;
    border: 1px solid #e3e8e5;
}

    .provider-switch button {
        min-height: 52px;
        padding: 0 20px;
        border: 0;
        border-radius: 12px;
        background: transparent;
        color: #3d4a44;
        font-weight: 600;
        white-space: nowrap;
        cursor: pointer;
        transition: all 0.25s ease;
    }

        .provider-switch button:hover:not(.active) {
            background: #e8eeea;
            color: #1f2a25;
        }

        .provider-switch button.active {
            background: #16804a;
            color: #fff;
            box-shadow: 0 2px 8px rgba(22, 128, 74, 0.25);
        }

            .provider-switch button.active.warning {
                background: #e07a00;
                color: #fff;
                box-shadow: 0 2px 8px rgba(224, 122, 0, 0.25);
            }

        .provider-switch button.warning:not(.active) {
            color: #9a5b00;
        }


.search-box {
    position: relative;
    /* position: fixed;*/
    display: flex;
    align-items: center;
    width: 100%;
}

    .search-box input {
        width: 100%;
        min-height: 48px;
        padding: 0 44px 0 16px;
        border: 1px solid #e3e8e5;
        border-radius: 12px;
        background: #fff;
        color: #1f2a25;
        font-size: 14px;
        font-weight: 500;
        outline: none;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

        .search-box input::placeholder {
            color: #8a948e;
            font-weight: 500;
        }

        /* هاور: بوردر کمی پررنگ‌تر */
        .search-box input:hover {
            border-color: #cfd8d3;
        }

        /* فوکوس: حلقه سبز ملایم هماهنگ با سوییچ‌ها */
        .search-box input:focus {
            border-color: #16804a;
            box-shadow: 0 0 0 3px rgba(22, 128, 74, 0.12);
        }

    .search-box .search-icon {
        position: absolute;
        right: 14px;
        width: 18px;
        height: 18px;
        color: #8a948e;
        pointer-events: none;
        transition: color 0.2s ease;
    }

    .search-box input:focus ~ .search-icon,
    .search-box:focus-within .search-icon {
        color: #16804a;
    }


/* کانتینر: سگمنتی رسمی */
.segment-tabs.mud-tabs-rounded .mud-tabs-tabbar {
    justify-content: flex-start;
    overflow-x: auto;
    padding: 6px;
    border-radius: 16px;
    background: #f2f5f3;
    border: 1px solid #e3e8e5;
    scrollbar-width: none;
}

    .segment-tabs.mud-tabs-rounded .mud-tabs-tabbar::-webkit-scrollbar {
        display: none;
    }

/* تب‌ها */
.segment-tabs .mud-tab {
    min-height: 52px;
    padding: 6px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: #3d4a44;
    font-weight: 600;
    white-space: nowrap;
    text-transform: none;
    cursor: pointer;
    transition: all 0.25s ease;
}

    .segment-tabs .mud-tab:hover:not(.mud-tab-active) {
        background: #e8eeea;
        color: #1f2a25;
    }

    /* تب فعال: سبز رسمی */
    .segment-tabs .mud-tab.mud-tab-active {
        background: #16804a;
        color: #fff;
        box-shadow: 0 2px 8px rgba(22, 128, 74, 0.25);
    }

/* خط انیمیشنی زیر تب حذف شود */
.segment-tabs .mud-tab-slider {
    display: none !important;
}

/* آیکون و متن داخل تب */
.segment-tabs .mud-tab .mud-tab-icon {
    color: inherit;
    margin-inline-end: 8px;
}

.segment-tabs .mud-tab .mud-tab-text {
    line-height: 1;
}


.delivery-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.delivery-card {
    border: 2px solid #e3ebe6;
    border-radius: 20px;
    padding: 16px;
    background: white;
    transition: 0.2s ease;
}

    .delivery-card:focus-within {
        border-color: #19734a;
        box-shadow: 0 0 0 4px #19734a20, 0 10px 24px #193d2b14;
        transform: translateY(-1px);
    }

    .delivery-card.not-provider {
        background: #f0faed;
    }

.delivery-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.delivery-card h3 {
    margin: 0;
    font-size: 18px;
    color: #193d2b;
}

.delivery-card small {
    color: #6b7e73;
}

.delivery-fields {
    display: grid;
    grid-template-columns: 1.2fr 1fr 0.8fr;
    gap: 10px;
    align-items: end;
}

.delivery-field label {
    display: block;
    margin-bottom: 6px;
    color: #607267;
    font-size: 13px;
    font-weight: 700;
}

.delivery-field input,
.delivery-field select {
    width: 100%;
    min-height: 48px;
    border: 1px solid #d5e1da;
    border-radius: 12px;
    padding: 8px 12px;
    font: inherit;
    background: #fbfdfb;
}

    .delivery-field input:focus,
    .delivery-field select:focus {
        outline: 3px solid #19734a30;
        border-color: #19734a;
    }

.count-input {
    font-size: 20px !important;
    font-weight: 800;
    text-align: center;
    color: #193d2b;
}

.difference {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-weight: 800;
}

    .difference.good {
        background: #e4f6e9;
        color: #21733e;
    }

    .difference.warn {
        background: #fff2d8;
        color: #9a5b00;
    }

    .difference.info {
        background: #e5f1fa;
        color: #22638b;
    }

.delivery-actions {
    justify-content: flex-start;
    margin-top: 20px;
}

    .delivery-actions button {
        min-height: 52px;
        border: 0;
        border-radius: 13px;
        padding: 0 24px;
        font: inherit;
        font-weight: 800;
        cursor: pointer;
    }

.save-button {
    background: #19734a;
    color: white;
}

.cancel-button {
    background: #f8e6e5;
    color: #a6403d;
}

.summary-box {
    width: 100%;
    overflow-x: auto;
    padding: 4px;
    border: 1px solid #e3ebe6;
    border-radius: 18px;
    background: #ffffff;
    -webkit-overflow-scrolling: touch;
}

    .summary-box .mud-table-container {
        overflow-x: auto;
        border-radius: 14px;
    }

    .summary-box .mud-table {
        min-width: 620px;
        background: #ffffff;
        color: #193d2b;
    }

        .summary-box .mud-table thead th {
            height: 52px;
            padding: 12px 14px;
            background: #eef6f1;
            color: #385347;
            font-size: 14px;
            font-weight: 800;
            white-space: nowrap;
        }

        .summary-box .mud-table tbody td {
            min-height: 52px;
            padding: 12px 14px;
            color: #42584c;
            font-size: 14px;
            white-space: nowrap;
        }

        .summary-box .mud-table tbody tr:nth-child(even) {
            background: #fbfdfb;
        }

        .summary-box .mud-table tbody tr:hover {
            background: #f0faed;
        }

@media (max-width: 720px) {
    .summary-box {
        padding: 3px;
        border-radius: 15px;
    }

        .summary-box .mud-table {
            min-width: 560px;
        }

            .summary-box .mud-table thead th,
            .summary-box .mud-table tbody td {
                padding: 11px 12px;
                font-size: 13px;
            }
}

@media (max-width: 420px) {
    .summary-box .mud-table {
        min-width: 500px;
    }

        .summary-box .mud-table thead th,
        .summary-box .mud-table tbody td {
            padding: 10px;
            font-size: 12px;
        }

    @media (max-width: 720px) {
        .delivery-mobile {
            padding: 10px;
        }

        .delivery-list {
            grid-template-columns: 1fr;
        }

        .delivery-fields {
            grid-template-columns: 1fr 1fr;
        }

            .delivery-fields .good-field {
                grid-column: 1 / -1;
            }
    }

    @media (max-width: 420px) {
        .delivery-fields {
            grid-template-columns: 1fr;
        }

        .delivery-header {
            align-items: stretch;
        }

            .delivery-header button {
                width: 100%;
            }
    }
}
