/* ===== Container ===== */
.orders-container {
  width: 100%;
  max-width: 370px;
  margin: 8px auto;
  padding: 6px;
  background-color: var(--light2);
  border-radius: 10px;
  height: calc(100% - 16px);
  overflow: auto;
}

/* ===== Title ===== */
.page-title {
  font-size: 14px;
  color: var(--dark1);
  margin: 6px 0 10px;
  text-align: center;
  direction: rtl;
  /* font-weight: 600; */
}

/* ===== Orders Page ===== */
.orders-root {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 14px 24px;
  font-family: "Segoe UI", Tahoma, sans-serif;
  direction: rtl;
}

/* ===== Header ===== */
.orders-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.orders-root .page-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark1);
  margin: 0;
}

.orders-badge {
  background: var(--primaryDark);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 20px;
  padding: 2px 10px;
  min-width: 28px;
  text-align: center;
  line-height: 1.6;
}

/* ===== Table Header ===== */
.orders-table-header {
  display: grid;
  grid-template-columns: 56px 80px 1fr 64px;
  gap: 4px;
  background: var(--light2);
  border-radius: 10px 10px 0 0;
  padding: 8px 12px;
  margin-bottom: 4px;
}

.orders-table-header span {
  font-size: 11px;
  color: var(--dark2);
  font-weight: 600;
  text-align: center;
}

.orders-table-header span:first-child {
  text-align: right;
}

/* ===== Rows List ===== */
.orders-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ===== Single Order Row ===== */
.order-row {
  display: grid;
  grid-template-columns: 56px 80px 1fr 64px;
  gap: 4px;
  align-items: center;
  background: var(--light1);
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid var(--light3);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    background 0.15s,
    border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

/* Right accent bar */
.order-row::before {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 0 10px 10px 0;
  transition: background 0.15s;
}

.order-row:active {
  background: var(--light2);
  border-color: var(--primary);
}

.order-row:active::before {
  background: var(--primaryDark);
}

/* ===== Order ID Cell — # and number on same line ===== */
.order-id-cell {
  display: flex;
  align-items: center;
  gap: 2px;
}

.order-hash {
  font-size: 11px;
  color: var(--informationColor);
  font-weight: 700;
  line-height: 1;
}

.order-id-num {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark1);
}

/* ===== Price Cell — amount and د.ع on same line ===== */
.order-price {
  font-size: 13px;
  font-weight: 600;
  color: var(--dark1);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.price-sub {
  font-size: 11px;
  color: var(--dark3);
  font-weight: 400;
}

/* ===== Date Cell — single line ===== */
.order-date {
  font-size: 11px;
  color: var(--dark3);
  text-align: center;
  white-space: nowrap;
}

/* ===== Status Cell ===== */
.order-status {
  display: flex;
  justify-content: center;
}

.status-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  display: inline-block;
}

.status-badge.pending {
  background-color: rgba(245, 158, 11, 0.13);
  color: #b45309;
}

.status-badge.confirmed {
  background-color: rgba(59, 130, 246, 0.13);
  color: #1d4ed8;
}

.status-badge.ready {
  background-color: rgba(168, 85, 247, 0.13);
  color: #7e22ce;
}

.status-badge.assigned {
  background-color: rgba(255, 122, 26, 0.15);
  color: var(--accentOrangeDark);
}

.status-badge.delivered {
  background-color: rgba(34, 197, 94, 0.13);
  color: #15803d;
}

.status-badge.cancelled {
  background-color: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

/* ===== Empty State ===== */
.orders-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--dark3);
  font-size: 13px;
}

/* ===== Pull-to-Refresh Spinner ===== */
.refresh-spinner {
  display: none;
  justify-content: center;
  align-items: center;
  padding: 12px;
}

.spinner-circle {
  width: 24px;
  height: 24px;
  border: 3px solid var(--light3);
  border-top-color: var(--primaryDark);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
