/* Dispatch Board — credit limits and collections (backlog #28). Everything here is scoped to .credit-* / .ar-*
   and uses the app's tokens, so light and dark themes follow along. */

/* The red warning above a form (load drawer, order review, customer drawer). */
.credit-banner {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  margin: 0 0 12px;
  border-radius: 8px;
  background: var(--status-critical-soft);
  border: 1px solid transparent;
  color: var(--ink);
  font-size: var(--fs-md);
}
.credit-banner.near { background: var(--status-risk-soft); }
.credit-banner div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.credit-banner strong { font-size: 13px; }
.credit-banner span { color: var(--ink-muted); }
.credit-dot {
  flex: none;
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--status-critical);
}
.credit-banner.near .credit-dot { background: var(--status-risk); }

/* The badge on a board card, an unassigned chip or a loads table row. */
.credit-badge {
  background: var(--status-critical) !important;
  color: var(--on-status) !important;
}
.chip-unassigned .credit-badge,
table.loads .credit-badge { display: inline-block; }
.credit-late { color: var(--status-critical); }

/* Customer drawer credit box. */
.credit-summary { margin: 0 0 10px; }
.credit-summary .history-list { margin-top: -4px; }

/* Collections KPI strip: the tiles are the board's KPI tiles. .credit-kpis / .credit-kpi sit in the .kpi-strip / .kpi-card
   selector lists in css/app.css, css/polish.css and css/looks.css; only the spacing under the strip is set here. */
.credit-kpis { margin: 0 0 12px; }

/* Email preview inside the draft drawer. */
.ar-preview {
  width: 100%;
  height: 340px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

@media (max-width: 640px) {
  .credit-kpi { flex: 1 1 44%; min-width: 0; }
  .ar-preview { height: 260px; }
}
