/* ==========================================================================
   سفارش‌ها: لیست، جزئیات، تایم‌لاین، مرجوعی
   ========================================================================== */

/* ----------------------------- لیست سفارش‌ها ----------------------------- */
.order-row {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(24px) saturate(135%);
  -webkit-backdrop-filter: blur(24px) saturate(135%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  transition: background var(--dur-2) var(--ease), transform var(--dur-1) var(--ease);
}
.order-row:hover {
  background: rgba(255, 255, 255, 0.75);
}
.order-row:active {
  transform: scale(0.99);
}
.order-row__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}
.order-row__id {
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--ink);
  direction: ltr;
}
.order-row__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--ink-3);
}
.order-row__meta strong {
  color: var(--ink-2);
  font-weight: 600;
}
.order-row__total {
  font-weight: 800;
  color: var(--ink);
  font-size: var(--fs-sm);
}

/* ----------------------------- سربرگ جزئیات ------------------------------ */
.od-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(24px) saturate(135%);
  -webkit-backdrop-filter: blur(24px) saturate(135%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}
.od-head__id {
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--ink);
  direction: ltr;
}
.od-head__date {
  font-size: var(--fs-xs);
  color: var(--ink-3);
  margin-top: 2px;
}

/* دکمه کپی (کد سفارش / رهگیری) */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  height: 34px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-050);
  transition: background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.copy-btn:hover {
  background: var(--brand-100);
}
.copy-btn:active {
  transform: scale(0.95);
}
.copy-btn svg {
  width: 15px;
  height: 15px;
}

/* ----------------------------- تایم‌لاین وضعیت --------------------------- */
.timeline {
  display: flex;
  flex-direction: column;
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(24px) saturate(135%);
  -webkit-backdrop-filter: blur(24px) saturate(135%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}
.tl-step {
  position: relative;
  display: flex;
  gap: var(--sp-3);
  padding-bottom: var(--sp-4);
}
.tl-step:last-child {
  padding-bottom: 0;
}
/* خط اتصال عمودی */
.tl-step::before {
  content: '';
  position: absolute;
  inset-inline-start: 11px;
  top: 24px;
  bottom: 0;
  width: 2px;
  border-radius: var(--r-full);
  background: rgba(28, 16, 36, 0.1);
}
.tl-step:last-child::before {
  display: none;
}
.tl-step--done::before {
  background: var(--brand-300);
}
.tl-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.8);
  color: transparent;
  box-shadow: inset 0 0 0 2px var(--line-strong);
  z-index: 1;
}
.tl-dot svg {
  width: 13px;
  height: 13px;
}
.tl-step--done .tl-dot {
  background: linear-gradient(135deg, rgba(160, 30, 200, 0.9), rgba(113, 1, 147, 0.95));
  color: #fff;
  box-shadow: 0 4px 12px rgba(113, 1, 147, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.5);
}
.tl-step--current .tl-dot {
  animation: pulse-dot 2s var(--ease) infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 4px 12px rgba(113, 1, 147, 0.35), 0 0 0 0 rgba(160, 30, 200, 0.35); }
  50% { box-shadow: 0 4px 12px rgba(113, 1, 147, 0.35), 0 0 0 7px rgba(160, 30, 200, 0); }
}
.tl-step--bad .tl-dot {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 4px 12px rgba(214, 69, 69, 0.35);
}
.tl-step--bad::before {
  background: rgba(214, 69, 69, 0.3);
}
.tl-body {
  padding-top: 1px;
  min-width: 0;
}
.tl-label {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink-3);
}
.tl-step--done .tl-label,
.tl-step--bad .tl-label {
  color: var(--ink);
}
.tl-date {
  font-size: var(--fs-xs);
  color: var(--ink-3);
  margin-top: 1px;
}
.tl-extra {
  margin-top: var(--sp-2);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  font-size: var(--fs-xs);
  color: var(--ink-2);
}
.tl-extra code {
  font-family: inherit;
  font-weight: 800;
  direction: ltr;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  padding: 3px var(--sp-2);
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 1px rgba(28, 16, 36, 0.08);
}

/* ----------------------------- آیتم‌های سفارش ---------------------------- */
.od-item {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
}
.od-item + .od-item {
  box-shadow: inset 0 1px 0 rgba(28, 16, 36, 0.06);
}
.od-item__name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.5;
}
.od-item__variant {
  font-size: var(--fs-xs);
  color: var(--ink-3);
}
.od-item__price {
  text-align: end;
  flex-shrink: 0;
}
.od-item__price strong {
  font-size: var(--fs-sm);
  color: var(--ink);
  display: block;
}
.od-item__price small {
  font-size: 11px;
  color: var(--ink-3);
}

/* ----------------------------- مرجوعی / لغو ------------------------------ */
.od-alert {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-lg);
  font-size: var(--fs-xs);
  line-height: 1.7;
}
.od-alert--info {
  color: #1d5fb8;
  background: #e3eefc;
  box-shadow: inset 0 0 0 1px rgba(29, 95, 184, 0.15);
}
.od-alert--warn {
  color: #9a6a08;
  background: var(--warning-soft);
  box-shadow: inset 0 0 0 1px rgba(217, 138, 31, 0.2);
}
.od-alert--muted {
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.65);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

/* فرم مرجوعی */
.return-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9),
    inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}
.textarea {
  width: 100%;
  min-height: 96px;
  padding: var(--sp-3) var(--sp-4);
  background: rgba(255, 255, 255, 0.6);
  border: none;
  border-radius: var(--r-lg);
  font-family: inherit;
  font-size: var(--fs-sm);
  color: var(--ink);
  line-height: 1.7;
  resize: vertical;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.8),
    inset 0 0 0 1px rgba(28, 16, 36, 0.08);
  transition: box-shadow var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
.textarea:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9),
    0 0 0 3.5px rgba(166, 63, 199, 0.35);
}

/* آپلود مستندات */
.file-add {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  height: 44px;
  padding: 0 var(--sp-4);
  border-radius: var(--r-full);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-050);
  cursor: pointer;
  align-self: flex-start;
  transition: background var(--dur-1) var(--ease);
}
.file-add:hover {
  background: var(--brand-100);
}
.file-chiplist {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  max-width: 100%;
  height: 32px;
  padding: 0 var(--sp-2) 0 var(--sp-1);
  border-radius: var(--r-full);
  font-size: 11px;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 0 0 1px rgba(28, 16, 36, 0.08);
}
.file-chip span {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
}
.file-chip button {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--danger);
}
.file-chip button svg {
  width: 12px;
  height: 12px;
}

/* وضعیت درخواست مرجوعی */
.return-status {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  background: var(--warning-soft);
  box-shadow: inset 0 0 0 1px rgba(217, 138, 31, 0.2);
}
.return-status--approved {
  background: var(--success-soft);
  box-shadow: inset 0 0 0 1px rgba(30, 158, 106, 0.2);
}
.return-status--rejected {
  background: var(--danger-soft);
  box-shadow: inset 0 0 0 1px rgba(214, 69, 69, 0.2);
}
.return-status__icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.7);
  color: #9a6a08;
}
.return-status--approved .return-status__icon { color: var(--success); }
.return-status--rejected .return-status__icon { color: var(--danger); }
.return-status__title {
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--ink);
}
.return-status__desc {
  font-size: var(--fs-xs);
  color: var(--ink-2);
  line-height: 1.7;
  margin-top: 2px;
}

/* دکمه‌های اکشن پایین جزئیات */
.od-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.btn--danger-ghost {
  color: var(--danger);
  background: var(--danger-soft);
}
.btn--danger-ghost:hover:not(:disabled) {
  background: #f6d5d5;
}
