/* ==========================================================================
   Espart — Pre-list (پیش‌فهرست خرید همکاری) & quote tracking (requires main.css)
   Figma: ۰۶ › فروشنده ۴–۹ · ارسال پیش‌فهرست و پیش‌فاکتور — دسکتاپ (1440)
   Mobile has no Figma frame: stacked with the system's mobile patterns.
   ========================================================================== */
.prelist__top { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; padding-bottom: 24px; }
.prelist__title { font-weight: 700; font-size: 20px; line-height: 32px; color: var(--gray-900); }
.prelist__row { display: flex; flex-direction: column; gap: 16px; }
.prelist__aside { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.prelist__aside .card { gap: 14px; }
.prelist__aside .card__title { font-size: 16px; line-height: 26px; }

/* QuoteRequest */
.qr {
  display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: 16px;
  border: 1px solid var(--gray-300); border-radius: 12px; background: var(--white); box-shadow: var(--shadow-xs);
}
.qr__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.qr__intro { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.qr__title { font-weight: 700; font-size: 18px; line-height: 28px; color: var(--gray-900); }
.qr__desc { font-weight: 400; font-size: 13px; line-height: 22px; color: var(--gray-700); }
.qr__badge { flex: none; padding: 4px 10px; border-radius: 999px; background: var(--accent-50); color: var(--accent-900); font-weight: 700; font-size: 12px; line-height: 20px; white-space: nowrap; }

.qr__add { display: flex; flex-direction: column; gap: 8px; }
.qr__field {
  display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 12px;
  border: 1px solid var(--gray-500); border-radius: 8px; background: var(--white); color: var(--gray-900); cursor: text;
}
.qr__field .ic { flex: none; width: 18px; height: 18px; }
.qr__field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.qr__field input { flex: 1 1 auto; min-width: 0; padding: 0; border: 0; outline: 0; background: none; font-size: 14px; line-height: 24px; text-align: right; }
.qr__field input::placeholder { color: var(--gray-600); opacity: 1; }
.qr__excel { cursor: pointer; }

.qr__items { border: 1px solid var(--gray-300); border-radius: 8px; overflow: hidden; }
.qr__thead { display: none; }
.qr__tbody { counter-reset: qr; }
.qr__row {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) 36px; grid-template-areas: "idx name del" ". qty qty";
  align-items: center; gap: 8px 12px; padding: 8px 12px; border-top: 1px solid var(--gray-300);
}
.qr__tbody .qr__row:first-child { border-top: 0; }
.qr__row .qr__idx { grid-area: idx; font-weight: 500; font-size: 13px; line-height: 22px; color: var(--gray-600); }
.qr__row .qr__idx::before { counter-increment: qr; content: counter(qr, persian); }
.qr__row .qr__name { grid-area: name; display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.qr__name b { font-weight: 700; font-size: 13px; line-height: 22px; color: var(--gray-900); }
.qr__name span { font-weight: 400; font-size: 12px; line-height: 20px; color: var(--gray-600); }
.qr__row .qr__qty { grid-area: qty; justify-self: start; }
.qr__row .qr__del { grid-area: del; color: var(--gray-900); }
.qr__del .ic { width: 18px; height: 18px; }
.qr__row.is-new { animation: qr-in .3s ease-out; }
@keyframes qr-in { from { background: var(--primary-50); } }

.qr__pay { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.qr__label { padding: 0; font-weight: 500; font-size: 13px; line-height: 22px; color: var(--gray-700); }

.qr__foot { display: flex; flex-direction: column-reverse; gap: 12px; }
.qr__foot .btn { width: 100%; }
.qr__time { display: flex; align-items: center; gap: 4px; font-weight: 500; font-size: 12px; line-height: 20px; color: var(--gray-700); }
.qr__time .ic { width: 16px; height: 16px; }

/* After submit */
.prelist__after { padding-top: 0; padding-bottom: 24px; }
.done { display: flex; flex-direction: column; gap: 16px; padding: 16px; border: 1px solid var(--success-900); border-radius: 16px; background: var(--white); }
.done__head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; }
.done__icon { flex: none; width: 28px; height: 28px; color: var(--success-900); }
.done__text { display: flex; flex-direction: column; flex: 1 1 0; min-width: 0; }
.done__title { font-weight: 700; font-size: 16px; line-height: 26px; color: var(--gray-900); }
.done__desc { font-weight: 400; font-size: 13px; line-height: 22px; color: var(--gray-700); }
.done__actions { display: flex; gap: 8px; flex-basis: 100%; }
.done__actions .btn { flex: 1 1 0; padding-inline: 12px; }
.done .tracker { overflow-x: auto; }

@media (min-width: 600px) {
  .qr__add { flex-direction: row; }
  .qr__thead { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--gray-200); font-weight: 700; font-size: 12px; line-height: 20px; color: var(--gray-700); }
  .qr__thead .qr__idx { flex: 0 0 20px; }
  .qr__thead .qr__name { flex: 1 1 auto; }
  .qr__thead .qr__qty { flex: 0 0 120px; }
  .qr__thead .qr__del { flex: 0 0 36px; }
  .qr__tbody .qr__row:first-child { border-top: 1px solid var(--gray-300); }
  .qr__row { display: flex; gap: 12px; }
  .qr__row .qr__idx { flex: 0 0 20px; }
  .qr__row .qr__name { flex: 1 1 auto; }
  .qr__row .qr__qty { flex: 0 0 120px; }
  .qr__foot { flex-direction: row; align-items: center; justify-content: space-between; }
  .qr__foot .btn { width: auto; }
  .done__actions { flex-basis: auto; }
  .done__actions .btn { flex: none; padding-inline: 20px; }
  .done__head { flex-wrap: nowrap; align-items: center; }
}

@media (min-width: 1200px) {
  .prelist__top { gap: 16px; padding-top: 24px; padding-bottom: 40px; }
  .prelist__title { font-size: 28px; line-height: 42px; }
  .prelist__row { flex-direction: row; align-items: flex-start; gap: 32px; }
  .qr { flex: 1 1 auto; padding: 24px; }
  .prelist__aside { flex: 0 0 380px; }
  .prelist__aside .card { padding: 20px; }
  .prelist__after { padding-top: 8px; padding-bottom: 64px; }
  .done { gap: 16px; padding: 24px; }
  .done__title { font-size: 18px; line-height: 28px; white-space: nowrap; }
  .done .tracker { overflow: visible; }
}
.qr__label { float: none; margin-bottom: 8px; }
.qr__pay { gap: 0; }
.qr__thead .qr__idx { white-space: nowrap; }
/* stock table in the 380px aside: tighter columns, single-line rows */
.prelist__aside .c-qty { flex-basis: 96px; }
.prelist__aside .c-ship { flex-basis: 84px; }
.prelist__aside .c-wh { flex-wrap: wrap; }
@media (min-width: 1200px) { .prelist__aside .tbl__row, .prelist__aside .tbl__head { white-space: nowrap; } .prelist__aside .c-wh { flex-wrap: nowrap; } }
