/* Square Ibis — customer self-service (tracking page actions, rating, customer requests) (v2.2) */

/* ---------- tracking page: manage my delivery ---------- */

.tr-self, .tr-rate { gap: 12px; }
.tr-self .card-title svg, .tr-rate .card-title svg { width: 17px; height: 17px; color: var(--accent); }
.tr-self > .muted, .tr-rate > .muted { font-size: 13px; margin-top: -4px; }
.tr-self-acts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.tr-self-act {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 12px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-align: start;
  cursor: pointer;
  transition: border-color var(--dur-2), background var(--dur-2), transform var(--dur-2) var(--ease);
}
.tr-self-act:hover { border-color: var(--border-strong); background: var(--surface-2); }
.tr-self-act:active { transform: scale(.985); }
.tr-self-act.is-loading { opacity: .6; pointer-events: none; }
.tr-self-icon { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; background: rgba(var(--a1-rgb), .12); color: var(--accent); }
.tr-self-icon svg { width: 19px; height: 19px; }
.tr-self-act.is-done .tr-self-icon { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.tr-self-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.tr-self-text b { font-size: 14px; font-weight: 600; }
.tr-self-text small { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-self-chev { width: 16px; height: 16px; color: var(--text-3); flex: none; }
:root[dir="rtl"] .tr-self-chev { transform: scaleX(-1); }

.tr-verify { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r); border: 1px dashed var(--border-strong); background: var(--surface); }
.tr-verify p { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; }
.tr-verify p svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--accent); }
.tr-verify-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tr-verify-input { width: 150px; flex: none; font-family: var(--mono); font-size: 20px; letter-spacing: .3em; text-align: center; }
.tr-verify small { font-size: 12px; }

.tr-reqs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tr-reqs li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--border); font-size: 13px; }
.tr-req-type { font-weight: 600; flex: 1; min-width: 140px; }

.tr-windows { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tr-windows::-webkit-scrollbar { display: none; }
.tr-windows > button { flex: none; white-space: nowrap; }

.tr-desks { display: flex; flex-direction: column; gap: 8px; }
.tr-desk-opt { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); color: var(--text); text-align: start; cursor: pointer; }
.tr-desk-opt svg { width: 18px; height: 18px; flex: none; color: var(--accent); margin-top: 2px; }
.tr-desk-opt span { display: flex; flex-direction: column; gap: 2px; }
.tr-desk-opt small { color: var(--text-3); font-size: 12px; }
.tr-desk-opt[aria-checked="true"] { border-color: var(--accent); background: rgba(var(--a1-rgb), .08); box-shadow: 0 0 0 1px var(--accent) inset; }

/* ---------- tracking page: rating ---------- */

.tr-stars { display: flex; gap: 6px; }
.tr-star { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text-3); cursor: pointer; transition: transform var(--dur-2) var(--spring), color var(--dur-2); }
.tr-star svg { width: 24px; height: 24px; }
.tr-star.on { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 45%, transparent); background: color-mix(in srgb, var(--amber) 12%, transparent); }
.tr-star.on svg { fill: currentColor; }
button.tr-star:hover { transform: scale(1.08); }
.tr-stars.is-static .tr-star { width: 34px; height: 34px; border-radius: 10px; cursor: default; }
.tr-stars.is-static .tr-star svg { width: 18px; height: 18px; }
.tr-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tr-tag { height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13px; cursor: pointer; }
.tr-tag.on { border-color: var(--accent); color: var(--text); background: rgba(var(--a1-rgb), .12); }
.tr-rate-comment { font-size: 14px; color: var(--text-2); font-style: italic; }
.tr-rate-foot { display: flex; justify-content: flex-end; }

/* ---------- customer requests inbox (staff & merchants) ---------- */

.rq-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rq-filters .select { width: auto; min-width: 170px; }
.rq-list { display: flex; flex-direction: column; gap: 10px; }
.rq-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm); }
.rq-item.is-pending { border-color: color-mix(in srgb, var(--amber) 45%, var(--border)); }
.rq-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: rgba(var(--a1-rgb), .12); color: var(--accent); }
.rq-icon svg { width: 19px; height: 19px; }
.rq-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rq-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rq-head b { font-size: 14.5px; }
.rq-parcel { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 12.5px; color: var(--text-3); }
.rq-parcel a { font-family: var(--mono); color: var(--accent); }
.rq-detail { font-size: 13.5px; color: var(--text-2); overflow-wrap: anywhere; }
.rq-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.rq-side small { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.rq-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.rq-pager { display: flex; justify-content: center; align-items: center; gap: 10px; }

/* drawer section */
.cr-list { display: flex; flex-direction: column; gap: 8px; }
.cr-row { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); font-size: 13px; }
.cr-row .rq-head b { font-size: 13.5px; }
.cr-note { display: flex; align-items: flex-start; gap: 8px; }

@media (max-width: 640px) {
  .tr-self-acts { grid-template-columns: minmax(0, 1fr); }
  .tr-star { width: 52px; height: 52px; }
  .rq-item { grid-template-columns: auto minmax(0, 1fr); }
  .rq-side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
}
