.order-details-page .order-details-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: var(--space-5, 1.25rem);
}

.order-details-page .order-col-4 { grid-column: span 4; }
.order-details-page .order-col-8 { grid-column: span 8; }
.order-details-page .order-col-12 { grid-column: span 12; }

@media (max-width: 991px) {
    .order-details-page .order-col-4,
    .order-details-page .order-col-8 {
        grid-column: span 12;
    }
}

.order-details-card .content-card-header {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--surface-border, #e8ecf0);
}

.order-details-card .content-card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    margin: 0;
}

.order-details-card .content-card-title i {
    color: var(--primary);
}

.order-summary-totals {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.order-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    padding: 0.35rem 0;
}

.order-summary-row.order-summary-total {
    border-top: 1px solid var(--surface-border, #e8ecf0);
    margin-top: 0.35rem;
    padding-top: 0.75rem;
    font-weight: 700;
    font-size: 1.05rem;
}

.order-sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full, 999px);
    font-size: 0.8rem;
    font-weight: 600;
}

.order-sync-badge.synced {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
}

.order-sync-badge.failed {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.order-sync-badge.pending {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
}

.order-sync-badge.not-synced {
    background: rgba(107, 114, 128, 0.12);
    color: #4b5563;
}

.order-daftra-error {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md, 8px);
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #b91c1c;
    font-size: 0.875rem;
    word-break: break-word;
}

.order-items-table-wrap {
    overflow-x: auto;
}

.order-meta-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.order-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full, 999px);
    background: var(--surface-muted, #f3f4f6);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.delivery-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full, 999px);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.delivery-badge-received { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.delivery-badge-reviewed { background: rgba(99, 102, 241, 0.12); color: #4f46e5; }
.delivery-badge-in-progress { background: rgba(14, 165, 233, 0.14); color: #0284c7; }
.delivery-badge-executed { background: rgba(168, 85, 247, 0.14); color: #7c3aed; }
.delivery-badge-waiting-shipping { background: rgba(14, 165, 233, 0.14); color: #0284c7; }
.delivery-badge-assigned-shipping { background: rgba(99, 102, 241, 0.14); color: #4f46e5; }
.delivery-badge-out,
.delivery-badge-shipped { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.delivery-badge-delivered { background: rgba(16, 185, 129, 0.15); color: #059669; }
.delivery-badge-cancelled { background: rgba(239, 68, 68, 0.12); color: #dc2626; }

.order-warehouse-card {
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0.5rem;
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.order-warehouse-card.is-disabled {
    opacity: 0.65;
    cursor: not-allowed;
}
.order-warehouse-card.is-selected {
    border-color: var(--primary, #2563eb);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.order-warehouse-card-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
    justify-content: space-between;
}
.order-warehouse-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.85rem;
    font-size: 0.82rem;
    color: var(--text-muted, #6b7280);
}
.order-warehouse-items {
    margin-top: 0.75rem;
    overflow-x: auto;
}
.order-fulfillment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.order-delivery-update .form-label {
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.order-maps-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.products-table-wrap .delivery-status-badge {
    font-size: 0.72rem;
}

.order-local-status-badge,
.order-local-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full, 999px);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.order-local-status--pending-payment {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.order-local-status--created {
    background: rgba(99, 102, 241, 0.12);
    color: #4f46e5;
}

.order-local-status--processing {
    background: rgba(14, 165, 233, 0.12);
    color: #0284c7;
}

.order-local-status--completed {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.order-local-status--cancelled {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.order-payment-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full, 999px);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.order-payment-status--paid {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.order-payment-status--pending {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.order-payment-status--failed {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.order-payment-status--refunded {
    background: rgba(14, 165, 233, 0.12);
    color: #0284c7;
}

.order-payment-status--none {
    background: rgba(100, 116, 139, 0.12);
    color: #64748b;
}

.order-payment-block-hint {
    display: flex;
    align-items: flex-start;
    gap: 0.25rem;
    line-height: 1.4;
}

/* Sticky Actions stay visible; data columns keep horizontal scroll. */
.orders-daftra-page .categories-index-card,
.orders-daftra-page .categories-index-card-body {
    overflow: visible;
}

.orders-daftra-page .products-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.orders-daftra-page .products-table-wrap .data-table {
    border-collapse: separate;
    border-spacing: 0;
}

.orders-daftra-page .data-table th.order-actions-col,
.orders-daftra-page .data-table td.order-actions-col,
.orders-daftra-page .data-table th:last-child,
.orders-daftra-page .data-table td:last-child {
    position: sticky;
    inset-inline-end: 0;
    min-width: 3.5rem;
    width: 3.5rem;
    padding-inline: 0.5rem;
    background: var(--surface-card, #fff);
    border-inline-start: 1px solid var(--surface-border, #e2e8f0);
    box-shadow: -6px 0 10px -8px rgba(15, 23, 42, 0.18);
    z-index: 2;
    white-space: nowrap;
    vertical-align: middle;
}

.orders-daftra-page .data-table thead th.order-actions-col,
.orders-daftra-page .data-table thead th:last-child {
    background: var(--surface, #f8fafc);
    z-index: 3;
}

.orders-daftra-page .products-table-wrap .data-table tbody tr:hover td.order-actions-col,
.orders-daftra-page .products-table-wrap .data-table tbody tr:hover td:last-child {
    background: var(--surface-hover, #f1f5f9);
}

html[dir="rtl"] .orders-daftra-page .data-table th.order-actions-col,
html[dir="rtl"] .orders-daftra-page .data-table td.order-actions-col,
html[dir="rtl"] .orders-daftra-page .data-table th:last-child,
html[dir="rtl"] .orders-daftra-page .data-table td:last-child {
    box-shadow: 6px 0 10px -8px rgba(15, 23, 42, 0.18);
}

.orders-daftra-page .products-table-wrap .product-row-actions {
    display: flex;
    justify-content: center;
}

.orders-daftra-page .product-row-actions .dropdown-toggle::after {
    display: none;
}

.orders-daftra-page .product-row-actions .order-actions-menu {
    min-width: 15.5rem;
    max-width: 20rem;
    padding: 0.4rem 0;
    border: 1px solid var(--surface-border, #e2e8f0);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.orders-daftra-page .product-row-actions .order-actions-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: normal;
    line-height: 1.35;
    text-align: start;
    border: none;
    background: transparent;
    width: 100%;
}

.orders-daftra-page .product-row-actions .order-actions-menu .dropdown-item-label {
    flex: 1 1 auto;
    min-width: 0;
}

.orders-daftra-page .product-row-actions .order-actions-menu .dropdown-item-icon {
    flex: 0 0 auto;
    font-size: 1.05rem;
    opacity: 0.75;
    color: var(--text-secondary, #64748b);
}

.orders-daftra-page .product-row-actions .order-actions-menu .dropdown-item:hover,
.orders-daftra-page .product-row-actions .order-actions-menu .dropdown-item:focus {
    background: var(--surface-hover, #f1f5f9);
    color: var(--text-primary, #0f172a);
}

.orders-daftra-page .product-row-actions .order-actions-menu .dropdown-item.active,
.orders-daftra-page .product-row-actions .order-actions-menu .dropdown-item.active:hover,
.orders-daftra-page .product-row-actions .order-actions-menu .dropdown-item.active:focus {
    background-color: #0d6efd;
    color: #ffffff;
    font-weight: 600;
}

.orders-daftra-page .product-row-actions .order-actions-menu .dropdown-item.active .dropdown-item-icon {
    color: #ffffff;
    opacity: 1;
}

.orders-daftra-page .product-row-actions .order-actions-menu .dropdown-divider {
    margin: 0.35rem 0;
    border-color: #e2e8f0;
}

html[dir="rtl"] .orders-daftra-page .product-row-actions .order-actions-menu .dropdown-item {
    flex-direction: row;
    text-align: right;
}

html[dir="ltr"] .orders-daftra-page .product-row-actions .order-actions-menu .dropdown-item {
    flex-direction: row;
    text-align: left;
}

.fulfillment-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
}
.fulfillment-badge-delivery {
    background: #e8f1ff;
    color: #1d4ed8;
}
.fulfillment-badge-pickup {
    background: #ecfdf3;
    color: #067647;
}
