.replybridge-order-picker {
    border: none;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    margin-bottom: 24px;
}

.replybridge-order-picker--manual-only {
    max-width: 720px;
}

.rb-order-picker__summary {
    margin-bottom: 20px;
}

.rb-order-summary-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-radius: 16px;
    background: var(--rb-kb-surface, #ffffff);
    border: 1px solid var(--rb-kb-border, rgba(15,23,42,0.08));
}

.rb-order-summary-card__label {
    font-weight: 600;
    color: var(--rb-kb-text, #0f172a);
}

.rb-order-summary-card__meta,
.rb-order-summary-card__items {
    font-size: 0.9rem;
    color: var(--rb-kb-muted, #475569);
}

.rb-order-picker__header h3 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--rb-kb-text, #0f172a);
}

.rb-order-picker__header p {
    margin: 4px 0 0;
    color: var(--rb-kb-muted, #475569);
}

.rb-order-picker__search-row {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
}

.rb-order-search {
    position: relative;
    flex: 1 1 320px;
}

.rb-order-search__icon {
    position: absolute;
    left: 12px;
    top: 50%;
    width: 16px;
    height: 16px;
    background: url('data:image/svg+xml,%3Csvg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%2394a3b8" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"%3E%3Ccircle cx="11" cy="11" r="8"/%3E%3Cpath d="m21 21-4.3-4.3"/%3E%3C/svg%3E') no-repeat center;
    transform: translateY(-50%);
    pointer-events: none;
}

.rb-order-search input {
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--rb-kb-border, rgba(15,23,42,0.12));
    padding: 10px 14px 10px 34px;
    font-size: 0.95rem;
    background: var(--rb-kb-surface, #fff);
    box-shadow: inset 0 1px 2px rgba(15,23,42,0.05);
}

.rb-order-link {
    background: none;
    border: none;
    color: var(--rb-kb-interactive-text, #0369a1);
    font-weight: 500;
    cursor: pointer;
    padding: 0;
}

.rb-order-filter {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.rb-order-filter select {
    border-radius: 14px;
    border: 1px solid var(--rb-kb-border, rgba(15,23,42,0.12));
    padding: 10px 14px;
    min-width: 200px;
    font-size: 0.95rem;
    background: var(--rb-kb-surface, #fff);
    box-shadow: inset 0 1px 2px rgba(15,23,42,0.05);
    height: 44px;
    line-height: 1.2;
}

.rb-order-picker__manual-row {
    margin-top: 4px;
    text-align: right;
}

.rb-order-picker__load-more {
    margin-top: 16px;
    text-align: center;
}

.rb-order-picker__load-more .rb-order-btn {
    min-width: 220px;
}

.rb-order-cards {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.rb-order-cards.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

.rb-order-card {
    border: 1px solid var(--rb-kb-border, rgba(15,23,42,0.08));
    border-radius: 20px;
    background: color-mix(in srgb, var(--rb-kb-surface, #ffffff) 95%, transparent);
    padding: 18px;
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.rb-order-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--rb-kb-primary, #2563eb) 40%, transparent);
    box-shadow: 0 12px 30px rgba(15,23,42,0.12);
}

.rb-order-card__top {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 10px;
}

.rb-order-card__thumbs {
    display: flex;
    gap: 0;
    position: relative;
    flex-wrap: nowrap;
}

.rb-order-card__thumbs img {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 4px 12px rgba(15,23,42,0.2);
    margin-left: -14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rb-order-card__thumbs img[hidden] {
    display: none !important;
}

.rb-order-card__thumbs img:first-child {
    margin-left: 0;
}

.rb-order-card__body > .rb-order-status {
    align-self: flex-start;
    margin-bottom: 6px;
}

.rb-order-card__thumbs img:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15,23,42,0.25);
}

.rb-order-status {
    font-size: 0.75rem;
    border-radius: 999px;
    padding: 4px 10px;
    font-weight: 600;
    border: 1px solid transparent;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.rb-order-status--delivered { background: #ecfdf5; color: #047857; border-color: rgba(16,185,129,0.3); }
.rb-order-status--shipped { background: #f0f9ff; color: #0369a1; border-color: rgba(14,165,233,0.3); }
.rb-order-status--processing { background: #fffbeb; color: #b45309; border-color: rgba(251,191,36,0.4); }
.rb-order-status--cancelled { background: #fef2f2; color: #b91c1c; border-color: rgba(248,113,113,0.4); }
.rb-order-status--completed { background: #ecfdf5; color: #047857; border-color: rgba(16,185,129,0.3); }
.rb-order-status--pending { background: #fdf4ff; color: #a21caf; border-color: rgba(219,39,119,0.3); }
.rb-order-status--on-hold { background: #e0f2fe; color: #0369a1; border-color: rgba(14,165,233,0.3); }

.rb-order-card__body {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rb-order-card__label {
    font-size: 0.95rem;
    color: var(--rb-kb-muted, #475569);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rb-order-card__total {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--rb-kb-text, #0f172a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rb-order-card__date {
    font-size: 0.85rem;
    color: color-mix(in srgb, var(--rb-kb-muted, #475569) 60%, #ffffff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rb-order-card__products {
    font-size: 0.85rem;
    color: color-mix(in srgb, var(--rb-kb-muted, #475569) 80%, #ffffff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rb-order-card__cta {
    margin-top: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--rb-kb-interactive-text, #0ea5e9);
}

.rb-order-picker__detail,
.rb-order-picker__manual {
    margin-top: 20px;
}

.rb-order-picker__manual--standalone .rb-order-link {
    display: none;
}

.rb-order-panel {
    border: none;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.rb-order-panel__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.rb-order-panel__title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--rb-kb-text, #0f172a);
}

.rb-order-panel__subtitle,
.rb-order-panel__meta {
    color: var(--rb-kb-muted, #475569);
    margin-top: 4px;
}

.rb-order-panel__status {
    margin-top: 14px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border: 1px solid transparent;
    background: color-mix(in srgb, var(--rb-kb-primary, #0369a1) 10%, var(--rb-kb-surface, #fff));
    color: var(--rb-kb-interactive-text, #0369a1);
    border-color: color-mix(in srgb, var(--rb-kb-primary, #0369a1) 35%, transparent);
}

.rb-order-panel__status.has-warning {
    color: color-mix(in srgb, #b91c1c 90%, var(--rb-kb-text, #0f172a));
    background: color-mix(in srgb, #fef2f2 90%, var(--rb-kb-surface, #fff));
    border-color: color-mix(in srgb, #f87171 60%, transparent);
}

.rb-order-panel__modes {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.rb-order-panel__modes[hidden] {
    display: none !important;
}

.rb-order-mode {
    border: 1px solid var(--rb-kb-border, rgba(15,23,42,0.1));
    border-radius: 16px;
    padding: 12px;
    text-align: left;
    background: var(--rb-kb-surface, #fff);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rb-order-mode.is-active {
    border-color: color-mix(in srgb, var(--rb-kb-primary, #2563eb) 60%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--rb-kb-primary, #2563eb) 25%, transparent);
}

.rb-order-mode__title {
    font-weight: 600;
    color: var(--rb-kb-text, #0f172a);
}

.rb-order-mode__desc {
    font-size: 0.85rem;
    color: var(--rb-kb-muted, #64748b);
}

.rb-order-items {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.rb-order-item {
    position: relative;
    border: 1px solid var(--rb-kb-border, rgba(15,23,42,0.1));
    border-radius: 16px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    background: var(--rb-kb-surface, #fff);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    width: 100%;
    text-align: left;
    font: inherit;
}

.rb-order-item:hover {
    border-color: color-mix(in srgb, var(--rb-kb-primary, #2563eb) 50%, transparent);
    box-shadow: 0 10px 20px rgba(15,23,42,0.12);
    transform: translateY(-2px);
}

.rb-order-item:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--rb-kb-primary, #2563eb) 45%, transparent);
    outline-offset: 2px;
}
.rb-order-item__thumb {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(15,23,42,0.15);
}

.rb-order-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rb-order-item__details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.rb-order-item__details strong {
    font-weight: 600;
    color: var(--rb-kb-text, #0f172a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rb-order-item__details small {
    font-size: 0.8rem;
    color: var(--rb-kb-muted, #64748b);
}

@media (max-width: 900px) {
    .rb-order-items {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 560px) {
    .rb-order-items {
        grid-template-columns: 1fr;
    }

    .rb-order-item {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px;
    }

    .rb-order-item__details strong {
        white-space: normal;
    }
}

.rb-order-item.is-selected {
    border-color: color-mix(in srgb, var(--rb-kb-primary, #2563eb) 70%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--rb-kb-primary, #2563eb) 25%, transparent);
    transform: translateY(-1px);
}

.rb-order-item.is-locked {
    cursor: default;
    opacity: 0.85;
    box-shadow: none;
    transform: none;
}

.rb-order-item--show-more {
    border-style: dashed;
    justify-content: center;
}

.rb-order-item--show-more .rb-order-item__details {
    align-items: center;
    text-align: center;
}

.rb-order-item--show-more .rb-order-item__details strong {
    white-space: normal;
}

.rb-order-inline-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.rb-order-inline-btn {
    border-radius: 999px;
    padding: 10px 20px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
}

.rb-order-inline-btn--ghost {
    border-color: var(--rb-kb-border, rgba(15,23,42,0.15));
    background: var(--rb-kb-surface, #fff);
    color: var(--rb-kb-text, #0f172a);
}

.rb-order-inline-btn--primary {
    background: linear-gradient(135deg, var(--rb-kb-primary, #0284c7), var(--rb-kb-accent, #0ea5e9));
    color: #fff;
    border: none;
}

.rb-order-btn {
    border-radius: 999px;
    padding: 10px 20px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
}

.rb-order-btn--ghost {
    border-color: var(--rb-kb-border, rgba(15,23,42,0.15));
    background: var(--rb-kb-surface, #fff);
    color: var(--rb-kb-text, #0f172a);
}

.rb-order-btn--primary {
    background: linear-gradient(135deg, var(--rb-kb-primary, #0284c7), var(--rb-kb-accent, #0ea5e9));
    color: #fff;
    border: none;
}

.rb-order-panel__grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    width: 100%;
}

.rb-order-field {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    color: var(--rb-kb-text, #0f172a);
}

.rb-order-field input,
.rb-order-field textarea {
    margin-top: 6px;
    border-radius: 12px;
    border: 1px solid var(--rb-kb-border, rgba(15,23,42,0.12));
    padding: 10px 12px;
    font-size: 0.95rem;
    width: 100%;
    box-sizing: border-box;
}

.rb-order-field--full {
    grid-column: 1 / -1;
}

.rb-order-field textarea {
    min-height: 120px;
    resize: vertical;
}

.rb-order-panel__error {
    margin-top: 12px;
    font-size: 0.85rem;
    color: color-mix(in srgb, #b91c1c 90%, var(--rb-kb-text, #0f172a));
}

.rb-field-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--rb-kb-muted, #6b7280);
}

.rb-order-picker__empty {
    margin-top: 20px;
    padding: 16px;
    text-align: center;
    border: 1px dashed var(--rb-kb-border, rgba(15,23,42,0.2));
    border-radius: 16px;
    color: var(--rb-kb-muted, #475569);
}

@media (max-width: 900px) {
    .rb-order-panel__grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 560px) {
    .rb-order-panel__grid {
        grid-template-columns: 1fr;
    }

    .rb-order-field--full {
        grid-column: auto;
    }
}

@media (max-width: 640px) {
    .replybridge-order-picker {
        padding: 0;
    }

    .rb-order-card__top {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .rb-order-panel__header,
    .rb-order-picker__search-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .rb-order-picker__manual-row {
        text-align: left;
    }

    .rb-order-filter {
        width: 100%;
    }

    .rb-order-filter select {
        width: 100%;
    }
}
