/* طلبات البائع — فوق نمط الجدول الموحّد (seller-services.css) */

/* فلتر الحالة — قائمة مخصّصة دائمة الظهور (بدون خطوة «فتح القمع» لتفادي تعارض النقرات) */
.svc-filter {
  position: relative;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  min-width: min(220px, 56vw);
}

.svc-filter-status-dropdown {
  position: relative;
  width: 100%;
  min-width: 0;
  z-index: 5;
}

.svc-filter-status-trigger {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid #e4e4e7;
  background: #fafafa;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: #18181b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
  -webkit-tap-highlight-color: transparent;
}

.svc-filter-status-trigger:hover {
  background: #f4f4f5;
  border-color: #d4d4d8;
}

.svc-filter-status-trigger__label {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #71717a;
}

.svc-filter-status-trigger__text {
  flex: 1;
  min-width: 0;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.svc-filter-status-trigger__chev {
  flex-shrink: 0;
  display: inline-flex;
  color: #71717a;
  transition: transform 0.2s ease;
}

.svc-filter-status-dropdown.is-open .svc-filter-status-trigger__chev {
  transform: rotate(180deg);
}

.svc-filter-status-list {
  min-width: 100%;
  width: max-content;
  max-width: min(280px, calc(100vw - 24px));
}

.svc-filter-status-list .svc-filter-status-opt.is-current {
  background: var(--s-surface2, #f4f4f5);
  color: var(--s-text, #0a0a0a);
  font-weight: 700;
  border: 1px solid var(--s-chart-line, #3f3f46);
}

.svc-filter-status-list .svc-filter-status-opt.is-current:hover {
  background: var(--s-row-hover, #e4e4e7);
  color: var(--s-text, #0a0a0a);
}

/* عمود الطلب */
.svc-order-main {
  min-width: 0;
}

.svc-order-main .service-title--table {
  -webkit-line-clamp: 3;
}

.svc-table.svc-table--orders {
  min-width: 980px;
}

@media (max-width: 980px) {
  .svc-table.svc-table--orders {
    min-width: 880px;
  }
}

.svc-th--orders-actions {
  min-width: 188px;
  width: 16%;
  text-align: right !important;
}

/* رأس اللوحة فوق الجدول (thead sticky + عدم تعارض النقر) */
.svc-panel .svc-head {
  position: relative;
  z-index: 28;
}

.svc-panel .svc-head__tools {
  position: relative;
  z-index: 1;
}

/* أزرار الإجراءات والمحادثة فوق خلايا مجاورة وتحت thead المثبت */
.svc-td--order-actions {
  /* يتطابق td الطلبات مع .svc-td--actions من خدمات البائع (عرض 72px) — يفسد عمود الإجراءات */
  position: relative;
  z-index: 4;
  width: auto !important;
  min-width: 188px;
  max-width: none;
  text-align: right !important;
  vertical-align: middle;
}

.svc-td--order-actions.is-actions-open {
  z-index: 10050;
}

.service-table-row.svc-order-row--busy {
  opacity: 0.9;
}

.svc-order-unread-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin: 0;
  border-radius: 10px;
  border: 1px solid #e4e4e7;
  background: #fff;
  color: #52525b;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  line-height: 0;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
  box-sizing: border-box;
}

.svc-order-unread-btn:hover:not(:disabled) {
  background: #f5f5f6;
  border-color: #d4d4d8;
  color: #18181b;
}

.svc-order-unread-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.svc-order-unread-btn__inner {
  position: relative;
  display: grid;
  place-items: center;
}

.svc-order-unread-badge {
  position: absolute;
  top: -2px;
  inset-inline-end: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--s-btn, #0a0a0a);
  border: 2px solid var(--s-surface, #fff);
  box-sizing: content-box;
}

/* زر الحالة: سهم فقط — الحالة تظهر في عمود «الحالة» */
.svc-order-status-pop .svc-order-status-trigger {
  width: 38px;
  min-width: 38px;
  max-width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid #e4e4e7;
  background: #fafafa;
  color: #52525b;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  line-height: 0;
}

.svc-order-status-trigger:hover:not(:disabled) {
  background: #f4f4f5;
  border-color: #d4d4d8;
  color: #18181b;
}

.svc-order-status-trigger:disabled {
  opacity: 0.65;
  cursor: wait;
}

.svc-order-status-trigger.is-loading {
  cursor: wait;
  opacity: 1;
}

.svc-order-status-trigger.is-loading:disabled {
  opacity: 1;
}

@keyframes svc-order-status-spin {
  to {
    transform: rotate(360deg);
  }
}

.svc-order-status-trigger__spinner {
  display: inline-flex;
  color: inherit;
  animation: svc-order-status-spin 0.7s linear infinite;
}

.svc-order-status-trigger__chev {
  display: inline-flex;
  color: inherit;
  transition: transform 0.2s ease;
}

.svc-order-status-pop.is-open .svc-order-status-trigger__chev {
  transform: rotate(180deg);
}

.svc-order-status-list {
  min-width: 188px;
}

.svc-order-status-opt.is-current {
  background: #f4f4f5;
  font-weight: 800;
}

/* صف الإجراءات: في RTL تُرسَم من اليمين — أولًا ⋮+الحالة متجاورة، ثم الرسائل بجانبها (بدون فراغ كبير بينهما) */
.svc-order-actions-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.svc-order-actions-tail {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: 0;
}

.svc-order-actions-tail .service-menu {
  flex-shrink: 0;
}

.svc-order-actions-tail .svc-order-status-pop {
  flex: 0 0 auto;
  display: inline-flex;
  justify-content: flex-start;
  min-width: 0;
}

@media (max-width: 760px) {
  .svc-order-actions-row {
    flex-wrap: wrap;
  }

  .svc-order-status-pop .svc-order-status-trigger {
    flex: 0 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .svc-filter-status-dropdown.is-open .svc-filter-status-trigger__chev {
    transform: none !important;
  }

  .svc-order-status-pop.is-open .svc-order-status-trigger__chev {
    transform: none !important;
  }

  .svc-order-status-trigger__spinner {
    animation: none !important;
  }
}
