/* ============================================================
   assets/customer-returns.css — Resi e Garanzie (area cliente).
   Riusa i token del portale (--accent, --border, --text-muted, ...):
   qui stanno solo le poche regole specifiche della sezione.
   ============================================================ */

.rma-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.rma-empty {
  padding: 28px 20px;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.6;
}

/* --- elenco pratiche --- */
.rma-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.rma-card:hover,
.rma-card:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  outline: none;
}
.rma-card + .rma-card { margin-top: 10px; }

.rma-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.rma-number {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.3px;
}
.rma-card-label { font-weight: 600; font-size: 14px; }
.rma-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.rma-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
}

/* --- pill stato e categoria: colore solo come aiuto di lettura,
       nessun significato economico --- */
.rma-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-muted);
  white-space: nowrap;
}
.rma-pill.is-open { background: var(--accent-soft); color: var(--accent-dark); border-color: var(--accent); }
.rma-pill.is-wait { background: var(--warning-bg); color: var(--warning); border-color: rgba(178,106,0,0.25); }
.rma-pill.is-cat  { background: transparent; }

/* --- ricerca storico acquisti --- */
.rma-search-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.rma-search-row .form-input { flex: 1 1 260px; margin: 0; }

.rma-source {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}
.rma-source + .rma-source { margin-top: 10px; }
.rma-source.is-unavailable { opacity: 0.7; background: var(--bg-soft); }
.rma-source-title { font-weight: 600; font-size: 14px; }
.rma-source-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.rma-source-qty { font-size: 12px; margin-top: 6px; }
.rma-source-qty strong { font-family: 'JetBrains Mono', monospace; }
.rma-unavailable-note { font-size: 12px; color: var(--text-muted); }

/* --- form nuova richiesta --- */
.rma-step { margin-bottom: 22px; }
.rma-step-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 10px;
}
.rma-choices { display: flex; flex-direction: column; gap: 8px; }
.rma-choice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  background: #fff;
}
.rma-choice:hover { border-color: var(--accent); }
.rma-choice input { margin-top: 3px; flex: none; }
.rma-choice-text strong { display: block; font-size: 14px; }
.rma-choice-text span { font-size: 12px; color: var(--text-muted); }

.rma-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.rma-qty-input { max-width: 140px; }

.rma-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  background: var(--bg-soft);
  border-radius: 8px;
  padding: 10px 12px;
}
.rma-error {
  font-size: 13px;
  line-height: 1.6;
  background: var(--error-bg, #fee2e2);
  color: var(--error, #b91c1c);
  border: 1px solid rgba(185,28,28,0.25);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.rma-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.rma-actions .btn { width: auto; padding: 10px 18px; font-size: 14px; }

/* --- dettaglio --- */
.rma-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 20px;
  font-size: 14px;
}
.rma-detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.rma-detail-row .lab { color: var(--text-muted); }
.rma-detail-row .val { font-weight: 600; text-align: right; }

.rma-timeline { list-style: none; margin: 0; padding: 0; }
.rma-timeline li {
  position: relative;
  padding: 0 0 14px 18px;
  border-left: 2px solid var(--border);
  font-size: 13px;
}
.rma-timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.rma-timeline li::before {
  content: '';
  position: absolute;
  left: -5px; top: 4px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.rma-timeline .when { color: var(--text-muted); font-size: 12px; }

.rma-message {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
}
.rma-message + .rma-message { margin-top: 8px; }
.rma-message .who {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 4px;
}

/* --- mobile --- */
@media (max-width: 640px) {
  .rma-source { grid-template-columns: 1fr; }
  .rma-source .rma-source-action { justify-self: stretch; }
  .rma-source .rma-source-action .btn { width: 100%; }
  .rma-toolbar { align-items: stretch; }
  .rma-toolbar .btn { width: 100%; }
  .rma-detail-row { flex-direction: column; gap: 2px; }
  .rma-detail-row .val { text-align: left; }
}
