/* Screen styles: obligations group (Goals, Debts, Money Owed, Installments,
   Invoices). Uses the tokens in app.css. */

.ob-section-title { font-size: 20px; font-weight: 600; }
.ob-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.ob-grid-wide { grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); align-items: start; }
.ob-plain { background: none; border: 0; padding: 0; text-align: left; color: inherit; cursor: pointer; min-width: 0; border-radius: 8px; }
.ob-plain:hover .truncate:first-child, .ob-plain:hover .ob-goal-name { text-decoration: underline; text-decoration-color: var(--hair-2); }
.ob-on { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent-ring); }

/* Goal cards (MacGoalCard) */
.ob-goal-card { display: flex; flex-direction: column; gap: 12px; }
.ob-goal-head { display: flex; align-items: center; gap: 10px; }
.ob-disc { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.ob-goal-name { font-size: 17px; font-weight: 600; }
.ob-pct { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ob-figure-line { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.ob-figure { font-size: 22px; font-weight: 700; }

/* Money action sheet */
.ob-amount-input { font-size: 20px; font-weight: 700; }

/* History lists */
.ob-history { display: flex; flex-direction: column; }
.ob-hist-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.ob-hist-row + .ob-hist-row { border-top: 1px solid var(--hair); }
.ob-hist-row .amt { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

/* Debts: list beside detail (MacDebtsView's HSplitView) */
.ob-list { padding: 0; overflow: hidden; }
.ob-list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--hair); background: var(--fill-soft); }
.ob-list-total { font-size: 20px; font-weight: 700; }
.ob-list-also { padding: 6px 16px 0; }
.ob-list-group { display: flex; flex-direction: column; gap: 2px; padding: 10px 8px 8px; }
.ob-list-group > .section-label { padding: 0 8px 4px; font-size: 12px; }
.ob-list-row { display: flex; flex-direction: column; gap: 6px; width: 100%; text-align: left; border: 0; background: none; color: inherit; cursor: pointer; padding: 9px 10px; border-radius: 10px; }
.ob-list-row:hover { background: var(--fill-soft); }
.ob-list-row[aria-current="true"] { background: var(--sidebar-sel); }
.ob-row-title { font-size: 15px; font-weight: 600; }
.ob-row-amt { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ob-detail { min-width: 0; }
.ob-detail-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.ob-detail-title { font-size: 22px; }
.ob-kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0; }
.ob-kv dt { color: var(--text-2); font-weight: 500; }
.ob-kv dd { margin: 0; text-align: right; font-weight: 500; }

/* Money owed */
.ob-owed-tile { max-width: 360px; }
.ob-person-total { font-weight: 700; white-space: nowrap; }
.ob-owed-rows { display: flex; flex-direction: column; }
.ob-owed-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.ob-owed-row + .ob-owed-row { border-top: 1px solid var(--hair); }
.ob-owed-row.dim > :not(.ob-plain) { opacity: .5; }

/* Installment rows: progress spans the row under the text */
.ob-inst-row .grow .progress { margin-top: 6px; }

/* Invoice line items */
.ob-lines-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.ob-lines { display: flex; flex-direction: column; gap: 6px; min-width: 540px; }
.ob-line { display: grid; grid-template-columns: minmax(140px, 1fr) 92px 78px 100px 100px 28px; gap: 6px; align-items: center; }
.ob-line-head { font-size: 12px; font-weight: 600; color: var(--text-2); }
.ob-line-total { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-row.ob-overdue .tile { color: var(--expense); background: color-mix(in srgb, var(--expense) 13%, transparent); }

@media (max-width: 600px) {
  .ob-detail-head .row { width: 100%; }
  .ob-kv dd { text-align: left; }
  .ob-owed-row { flex-wrap: wrap; }
}

/* Print: only the invoice */
.ob-print { display: none; }
@media print {
  body.ob-printing > *:not(.ob-print) { display: none !important; }
  body.ob-printing { background: #fff; color: #000; }
  body.ob-printing .ob-print { display: block; padding: 24px; font-size: 13px; color: #000; }
  .ob-print-head { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
  .ob-print-biz { font-size: 20px; font-weight: 800; }
  .ob-print-meta { text-align: right; }
  .ob-print-title { font-size: 26px; font-weight: 800; letter-spacing: .08em; }
  .ob-print-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #555; margin-bottom: 4px; }
  .ob-print-bill { margin-bottom: 20px; }
  .ob-print-table { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
  .ob-print-table th, .ob-print-table td { padding: 7px 8px; border-bottom: 1px solid #ddd; text-align: left; }
  .ob-print-table .num { text-align: right; }
  .ob-print-table tfoot td { font-weight: 700; border-bottom: 0; }
  .ob-print-paid { font-size: 22px; font-weight: 800; color: #2E7D32; }
  .ob-pre { white-space: pre-wrap; }
}
