/* ============================================================================
   IOU Component Styles (Day 3-4 beachhead)
   ----------------------------------------------------------------------------
   Isolated from style.css so the primitives added during the beachhead are
   easy to find, roll back, or extend. When the two-week beachhead proves
   out and propagates, this file's contents merge into style.css.

   Rule: no hardcoded spacing or type. Everything reads from --sp-* / --tp-*
         / --st-* tokens defined in tokens.css.
   ============================================================================ */

/* ---- IOU card primitive (see templates/_iou_card.html) -------------------- */
.iou-card {
  /* Composes on top of .card from style.css. Only additions here. */
  display: flex;
  flex-direction: column;
  padding: 0;
}

.iou-card__head {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  background: var(--card-header-bg, transparent);
}

.iou-card__head h3 {
  margin: 0;
  font-size: var(--tp-subtitle);
  font-weight: 700;
  color: var(--text);
  line-height: var(--lh-normal);
}

.iou-card__body {
  padding: var(--sp-4);
  color: var(--text);
  font-size: var(--tp-body);
  line-height: var(--lh-normal);
}

.iou-card__body > p {
  margin: 0;
}

.iou-card__body > p + p {
  margin-top: var(--sp-3);
}

.iou-card__foot {
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-3);
}

.iou-card__action {
  font-size: var(--tp-meta);
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}

.iou-card__action:hover {
  text-decoration: underline;
}

/* ---- Compact modifier: tighter padding for dense lists ------------------- */
.iou-card--compact .iou-card__head,
.iou-card--compact .iou-card__foot {
  padding: var(--sp-2) var(--sp-3);
}

.iou-card--compact .iou-card__body {
  padding: var(--sp-3);
}

/* ---- Status accent stripes (left border, semantic) ----------------------- */
.iou-card--ok        { border-left: 4px solid var(--st-ok); }
.iou-card--attention { border-left: 4px solid var(--st-attention); }
.iou-card--warn      { border-left: 4px solid var(--st-warn); }
.iou-card--quiet     { border-left: 4px solid var(--st-quiet); }

/* ---- Small helpers a card body commonly uses ---------------------------- */

/* Progress bar inside a card. Matches the .td-foryou .td-bar shape but
   normalized to tokens. */
.iou-card-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  margin-top: var(--sp-3);
  overflow: hidden;
  max-width: 320px;
}

.iou-card-bar > div {
  height: 100%;
  background: var(--accent);
}
