/* ══════════════════════════════════════════════════
   ALTERATIONS — the ALT line on the invoice, and
   "ALT - Trousers" on the Orders tab (js/19-alter.js)
   ══════════════════════════════════════════════════ */

/* the two ways to start a line */
.inv-add-row { display: flex; gap: 8px; margin-top: 4px; }
.inv-add-row > .btn { flex: 1; }
html.role-counter #invoice-modal .inv-add-row { gap: 18px; flex-wrap: wrap; }
html.role-counter #invoice-modal .inv-add-row > .link-btn { flex: none; }

/* a line's own buttons, top right */
.inv-line-acts { display: flex; align-items: center; gap: 8px; flex: none; }

/* ALT: off on an ordinary line, gold when the line is an alteration */
.alt-toggle {
  flex: none; height: 32px; min-width: 46px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  font: inherit; font-size: 11px; font-weight: 600; letter-spacing: .12em; color: var(--faint);
  cursor: pointer; touch-action: manipulation;
}
.alt-toggle:hover { border-color: var(--gold-line); color: var(--gold); }
.alt-toggle.on { background: var(--gold-soft); border-color: var(--gold); color: var(--gold); }
.ctr-line .alt-toggle { height: 42px; min-width: 52px; }

/* the alteration card */
.inv-alt { border-color: var(--gold-line) !important; }
.inv-alt .cloth-name, .alt-tag { color: var(--gold) !important; }
.alt-tag { display: block; margin-top: 10px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 500; }

.alt-garments { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.alt-chip { touch-action: manipulation; }
.ctr-alt .alt-chip { min-height: 42px; padding: 0 15px; font-size: 14px; }
.inv-alt .alt-chip.on, .ctr-alt .alt-chip.on { background: var(--gold); border-color: var(--gold); color: #fff; }

/* Qty · Areas · S$ / area · Total */
.alt-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 7px; }
.alt-nums .field { height: 40px; text-align: right; min-width: 0; width: 100%; }
.alt-amt { display: flex; align-items: center; justify-content: flex-end; background: var(--card-2); color: var(--muted); }

/* the counter's version: two steppers, the price, the total */
.ctr-alt-nums { grid-template-columns: auto auto 170px minmax(110px, 1fr); gap: 12px; align-items: end; margin-top: 4px; }
.alt-num { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.alt-k { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.ctr-alt .qty-step { width: 148px; }
html.role-counter #invoice-modal .ctr-alt .qty-step .field,
html.role-counter #invoice-modal .ctr-alt .alt-rate { height: 46px !important; }
.alt-total { align-items: flex-end; min-width: 110px; }
.alt-total .ctr-line-amt { line-height: 46px; }

/* ── Orders tab ── */
.g-alt { color: var(--gold); font-weight: 600; letter-spacing: .06em; }

/* the edit-order form */
.modal-add-row { display: flex; gap: 8px; margin-top: 4px; }
.modal-add-row > .btn { flex: 1; }
.modal-alt { border-color: var(--gold-line) !important; }
.alt-badge {
  flex: none; margin-right: 9px; padding: 3px 9px; border-radius: 999px;
  background: var(--gold-soft); border: 1px solid var(--gold); color: var(--gold);
  font-size: 11px; font-weight: 600; letter-spacing: .12em;
}

/* ── Phones ── */
@media (max-width: 620px) {
  .alt-nums { grid-template-columns: 1fr 1fr; }
  .ctr-alt-nums { grid-template-columns: 1fr 1fr; gap: 10px 12px; }
  .ctr-alt .qty-step { width: 100%; }
  .alt-total { min-width: 0; }
  .inv-add-row { flex-wrap: wrap; }
}
