/* ── Wholesale POS: step-by-step register (RendersWholesaleFlow) ────────────
   Scoped component classes only — the admin panel compiles no Tailwind
   utilities, so every rule here carries its own layout, colour and dark-mode
   pair (AGENTS.md "Utility CSS on admin panel surfaces"). Any element with a
   hard background sets its own text colour so it reads in both themes. */

.erp-wpos-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Hero: a self-contained navy band (background + text pair), same in both themes. */
.erp-wpos-hero {
  border-radius: 1rem;
  padding: 1.25rem 1.25rem 1rem;
  background: linear-gradient(135deg, #0b1f45 0%, #16336b 100%);
  color: #ffffff;
}

.erp-wpos-hero__top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
}

.erp-wpos-hero__brand {
  font-weight: 700;
  font-size: 0.95rem;
}

.erp-wpos-hero__badge {
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.erp-wpos-hero__title {
  margin: 0.85rem 0 0.15rem;
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 700;
  color: #ffffff;
}

.erp-wpos-hero__subtitle {
  margin: 0;
  font-size: 0.9rem;
  color: #c9d6f2;
}

.erp-wpos-hero__meta {
  margin: 0.6rem 0 0;
  font-size: 0.75rem;
  color: #c9d6f2;
  word-break: break-word;
}

.erp-wpos-hero__warning {
  display: inline-block;
  margin-top: 0.5rem;
  border-radius: 0.5rem;
  padding: 0.3rem 0.6rem;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.erp-wpos-progress {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}

.erp-wpos-progress__step {
  height: 0.3rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.erp-wpos-progress__step.is-done,
.erp-wpos-progress__step.is-current {
  background: #5eb3ff;
}

/* Customer card (header + search results). Text inherits the theme. */
.erp-wpos-customer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.erp-wpos-avatar {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e40af;
  font-weight: 700;
}

.erp-wpos-customer__body {
  flex: 1 1 10rem;
  min-width: 0;
}

.erp-wpos-customer__name {
  font-weight: 700;
  font-size: 1rem;
  word-break: break-word;
}

.erp-wpos-customer__meta {
  font-size: 0.8rem;
  opacity: 0.7;
  word-break: break-word;
}

.erp-wpos-customer__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.erp-wpos-chip {
  display: inline-block;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  background: #e0e7ff;
  color: #1e3a8a;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.erp-wpos-chip--due {
  background: #dcfce7;
  color: #166534;
}

.erp-wpos-chip--courier {
  background: #fef3c7;
  color: #92400e;
}

.erp-wpos-match {
  align-items: center;
  border: 1px solid rgba(100, 116, 139, 0.3);
  border-radius: 0.75rem;
  padding: 0.75rem;
}

.erp-wpos-kicker {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.65;
}

.erp-wpos-empty {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.75;
}

.erp-wpos-note {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  opacity: 0.75;
}

.erp-wpos-note--info,
.erp-wpos-note--warning,
.erp-wpos-note--danger {
  border-radius: 0.6rem;
  padding: 0.6rem 0.75rem;
  opacity: 1;
}

.erp-wpos-note--info {
  background: #e8f0fe;
  color: #1e3a8a;
}

.erp-wpos-note--warning {
  background: #fff7e6;
  color: #92400e;
}

.erp-wpos-note--danger {
  background: #fee2e2;
  color: #991b1b;
}

.erp-wpos-link {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}

/* Totals rows */
.erp-wpos-totals {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.erp-wpos-totals + .erp-wpos-totals {
  margin-top: 0.75rem;
}

.erp-wpos-row {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.35rem 0;
  font-size: 0.9rem;
}

.erp-wpos-row > span:first-child {
  min-width: 0;
}

.erp-wpos-num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.erp-wpos-row--strong {
  font-weight: 700;
}

.erp-wpos-row--due .erp-wpos-num {
  color: #b45309;
}

.dark .erp-wpos-row--due .erp-wpos-num {
  color: #fbbf24;
}

.erp-wpos-row--discount .erp-wpos-num {
  color: #b91c1c;
}

.dark .erp-wpos-row--discount .erp-wpos-num {
  color: #f87171;
}

.erp-wpos-row--band,
.erp-wpos-row--collectible {
  border-radius: 0.6rem;
  padding: 0.6rem 0.75rem;
  font-weight: 700;
}

.erp-wpos-row--band {
  background: #e8f0fe;
  color: #1e3a8a;
}

.erp-wpos-row--collectible {
  background: #dcfce7;
  color: #166534;
  font-size: 1rem;
}

/* Scan step mini cart */
.erp-wpos-mini-cart {
  margin: 0;
  padding: 0;
  list-style: none;
}

.erp-wpos-mini-cart li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(100, 116, 139, 0.2);
  font-size: 0.85rem;
}

.erp-wpos-mini-cart__total {
  margin: 0.5rem 0 0;
  font-weight: 700;
  text-align: right;
}

/* Add Product panel */
.erp-wpos-product {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

.erp-wpos-product__image {
  flex: 0 0 auto;
  width: 5.5rem;
  max-width: 30%;
  border-radius: 0.75rem;
  background: #ffffff;
  overflow: hidden;
}

.erp-wpos-product__image img {
  display: block;
  width: 100%;
  height: auto;
}

.erp-wpos-product__body {
  min-width: 0;
}

.erp-wpos-product__name {
  margin-top: 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  word-break: break-word;
}

.erp-wpos-product__meta {
  font-size: 0.8rem;
  opacity: 0.7;
}

.erp-wpos-product__price {
  margin-top: 0.25rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.erp-wpos-product__price small {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.7;
}

.erp-wpos-qty-input {
  text-align: center;
  font-size: 1.4rem !important;
  font-weight: 700;
}

/* Payment method cards: Filament ToggleButtons in a grid, made taller. */
.erp-wpos-method-cards label.fi-btn {
  width: 100%;
  min-height: 4.5rem;
  flex-direction: column;
  gap: 0.35rem;
  justify-content: center;
}

/* Confirm table */
.erp-wpos-table-wrap {
  overflow-x: auto;
  margin-bottom: 0.75rem;
}

.erp-wpos-table {
  width: 100%;
  min-width: 28rem;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.erp-wpos-table th,
.erp-wpos-table td {
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid rgba(100, 116, 139, 0.25);
  text-align: left;
}

.erp-wpos-table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
}

.erp-wpos-table .erp-wpos-num {
  text-align: right;
}

.erp-wpos-totals--plain .erp-wpos-row {
  border-bottom: 1px solid rgba(100, 116, 139, 0.15);
}

/* Bill success */
.erp-wpos-success {
  text-align: center;
  padding: 0.5rem 0 0.75rem;
}

.erp-wpos-success__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-size: 1.5rem;
  font-weight: 700;
}

.erp-wpos-success__icon--pending_approval {
  background: #fef3c7;
  color: #92400e;
}

.erp-wpos-success__title {
  margin: 0.6rem 0 0.15rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.erp-wpos-success__sub {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  opacity: 0.75;
}

.erp-wpos-status {
  display: inline-block;
  border-radius: 0.5rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #dcfce7;
  color: #166534;
}

.erp-wpos-status--partially_paid,
.erp-wpos-status--credit_sale,
.erp-wpos-status--pending_approval {
  background: #fef3c7;
  color: #92400e;
}

.erp-wpos-status--courier_pending {
  background: #e0e7ff;
  color: #1e3a8a;
}

.erp-wpos-bill__head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  margin: 0.5rem 0 0.25rem;
}

.erp-wpos-bill__head h4 {
  margin: 0;
  font-weight: 700;
}

/* Step footer: Back / Continue. Stacked full-width on phones. */
.erp-wpos-footer .fi-ac {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
}

.erp-wpos-footer .fi-ac > * {
  width: 100%;
}

@media (min-width: 640px) {
  .erp-wpos-hero {
    padding: 1.5rem 1.75rem 1.25rem;
  }

  .erp-wpos-hero__title {
    font-size: 1.85rem;
  }

  .erp-wpos-footer .fi-ac {
    flex-direction: row;
    justify-content: flex-end;
  }

  .erp-wpos-footer .fi-ac > * {
    width: auto;
  }
}
