/* =========================================================
   Zeal Portal — the money workflows (Portal 2.0, lane D)
   /css/system/components/money-workflows.css

   The few classes money-workflows.js adds on top of finance.css
   (which every finance surface loads first). Colour, type and spacing
   come from the finance tokens; nothing here is a new component, only
   the arrangement of existing ones: a confirm panel, an income row, a
   plan editor row, a raise-invoice split, a due group line.
   ========================================================= */

.mw-money { font-variant-numeric: tabular-nums; }

/* confirming what an order was worth */
.mw-confirm { display: flex; flex-direction: column; gap: 14px; }
.mw-confirm__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.mw-lines { display: flex; flex-direction: column; }
.mw-line.is-child { padding-left: 24px; }
.mw-facts { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.mw-plan { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--fin-rule, rgba(0, 0, 0, 0.08)); }
.mw-plan__sentence { margin: 0; line-height: 1.5; }
.mw-blockers { padding: 10px 12px; border-radius: var(--r-soft, 4px); background: var(--fin-well, rgba(0, 0, 0, 0.03)); }
.mw-correct { padding-top: 10px; border-top: 1px solid var(--fin-rule, rgba(0, 0, 0, 0.08)); }

/* the plan editor */
.mw-plan-editor { gap: 8px; }
.mw-plan-editor__row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mw-plan-editor__row .fin-input { flex: 1 1 160px; }
.mw-plan-editor__pct, .mw-plan-editor__days { flex: 0 0 70px !important; }
.mw-plan-editor__amt { flex: 0 0 120px !important; }
/* snag round 6b (A5): a step is its labelled choices on one row, and the
   label made from them beneath */
.mw-plan-editor__step { gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--fin-rule-1); }
.mw-plan-editor__step .mw-plan-editor__row { align-items: flex-end; }
.mw-plan-editor__label { margin: 0; }

/* the finance tab's income */
.mw-project-income { display: flex; flex-direction: column; }
.mw-key { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.mw-income-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 20px; }
.mw-income-row__what { flex: 2 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mw-income-row__value { flex: 0 0 120px; text-align: right; font-weight: 700; font-size: var(--fin-t-amount, 1.25rem); }
.mw-income-row__state { flex: 1 1 240px; min-width: 0; line-height: 1.5; }
.mw-income-row__acts { flex: 0 0 auto; align-items: flex-end; }
.mw-note { margin-top: 6px; }
.mw-later { padding: 12px 14px; border-top: 1px dashed var(--fin-rule, rgba(0, 0, 0, 0.2)); }

/* raising an invoice */
.mw-raise { align-items: flex-start; }
.mw-raise__aside { flex: 1 1 320px; }
.mw-opt { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--fin-rule, rgba(0, 0, 0, 0.22)); border-radius: var(--r-soft, 4px); }
.mw-opt.is-on { border-color: var(--fin-ink, #000); }
/* snag3: the due presets, 7, 14, 28 and 30 days, beside the date */
.mw-due { display: flex; align-items: flex-end; gap: 6px; flex-wrap: wrap; }
.mw-sum { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.mw-ro { display: inline-block; padding: 10px 0; }
.mw-person { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--r-soft, 4px); background: var(--fin-well, rgba(0, 0, 0, 0.03)); }
.mw-person.is-new { background: transparent; border: 1px dashed var(--fin-rule, rgba(0, 0, 0, 0.38)); }
/* go-live 1.7: a line group per job on the raise form */
.mw-group { gap: 6px; padding: 8px 0 4px; border-top: 1px solid var(--fin-rule-2, rgba(0, 0, 0, 0.08)); }
.mw-check { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; }
.mw-dl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr); gap: 8px 14px; margin: 10px 0 0; }
.mw-dl dt { color: var(--fin-muted, rgba(0, 0, 0, 0.55)); margin: 0; }
.mw-dl dd { margin: 0; display: flex; flex-direction: column; gap: 2px; }

/* the second UI pass (16 Oct 2026): the income list with its modals
   (ProjectIncome in a host with zb-modal.js), a blocker's fix rows in the
   raise form, and a change answered in its own modal. The hooks are here
   so every host of the module defines them; the boards' dress for them
   is in boards.css under .zb-skin */
.mw-project-income--modal { width: 100%; }

/* snag round 4 (28 Oct 2026): a quote's invoices as links, the raise
   progress and the link dialog */
.mw-invoices { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.mw-invoice { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; line-height: 1.5; }
.mw-unlink { align-items: center; gap: 8px; margin-top: 4px; }
.mw-closed, .mw-suggest { margin-top: 6px; }
.mw-closing { gap: 8px; padding-top: 8px; border-top: 1px solid var(--fin-rule, rgba(0, 0, 0, 0.08)); }
.mw-progress { gap: 10px; min-height: 72px; }
.mw-progress__line { margin: 0; line-height: 1.5; font-variant-numeric: tabular-nums; }
.mw-ask { gap: 10px; }
.mw-modal .fin-stack { width: 100%; }
.mw-fixes { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.mw-fix { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.mw-fix__row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mw-fix__row .plx-ts { flex: 1 1 260px; }
.mw-fix.is-done { color: var(--fin-ok, inherit); }
.mw-answer { display: flex; flex-direction: column; gap: 12px; }

/* snag round 6b (30 Oct 2026): the link pop-up, one invoice across one or
   several quotes. The results list scrolls inside the modal */
.mw-link { gap: 10px; }
.mw-link__inv { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.mw-link__results { max-height: 320px; overflow-y: auto; gap: 6px; }
.mw-link__quotes { gap: 8px; }
.mw-link__quote { align-items: flex-end; gap: 8px 14px; }
.mw-link__name { flex: 1 1 240px; min-width: 0; padding-bottom: 10px; }

/* due to invoice */
.mw-due { gap: 14px; }
.mw-grp { margin-bottom: 6px; padding: 6px 8px; border-radius: var(--r-soft, 4px); background: var(--fin-well, rgba(0, 0, 0, 0.03)); }
.mw-change { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }

/* the booking panel and estimates */
.mw-booking .fin-filters { align-items: flex-end; }
/* Round 11 (B2): every field in the booking form reads as a field: its
   label above it, a border at 3:1 (v2's text-3, as v2's own inputs), a
   field ground set into the panel, and a focus ring outside the border. */
.mw-booking__fields { gap: 12px; align-items: stretch; }
/* boards.css's .zb-skin .fin-input (the board's 16% line) loads later at
   the same weight: named twice, so this wins wherever the panel sits */
.fin .mw-booking .fin-input, .zb-skin .mw-booking .fin-input, .mw-booking .fin-input.fin-input { border-color: var(--fin-muted); }
:root[data-v2] .fin .mw-booking .fin-input, :root[data-v2] .zb-skin .mw-booking .fin-input { border-color: var(--z-text-3); background-color: var(--z-bg-sunk); }
.mw-booking .fin-input:focus-visible { outline: 2px solid var(--fin-accent); outline-offset: 1px; }
.mw-estimate { align-items: center; }
