/*
 * syndic-components-v4.css — ADDITIONS for handoff v4 (Batch 1), lifted from
 * docs/design/handoff/v4/project/css/syndic-components-v4.css (SYN-170).
 * N1–N10 are new class names, verbatim. The bundle's FIX rules and its phone
 * rule changed every page; here they are scoped to pages that opt in with
 * class="page v4" (docs/design/handoff/v4/DEVIATIONS.md).
 * Everything here is NEW. Nothing in syndic-tokens.css / app.css / shell.css /
 * syndic-components.css is changed. Intended home: syndic-components.css §3
 * ("New primitives"), appended — listed one by one in "Batch 1 — Index".
 * Uses existing tokens only; no new token is introduced.
 */

/* N1 — AmountOwed: the one "Montant dû" figure. Same markup on the ledger,
   the payment drawer, the receipt and My space, so it cannot drift. */
.owed{display:flex;flex-direction:column;gap:2px}
.owed-label{font-size:10.5px;text-transform:uppercase;letter-spacing:.09em;color:var(--ink-3);font-weight:600}
.owed-value{font-family:var(--f-serif);font-size:30px;line-height:1.05;letter-spacing:-.02em;color:var(--ink);font-variant-numeric:tabular-nums}
.owed-value .ccy{font-family:var(--f-sans);font-size:13px;color:var(--ink-3);margin-inline-start:4px}
.owed-value.is-due{color:var(--crit)}
.owed-value.is-credit{color:var(--syndic-teal-deep)}
[data-theme="dark"] .owed-value.is-credit{color:oklch(80% .1 180)}
.owed-meta{font-size:11.5px;color:var(--ink-3)}
.owed-sm .owed-value{font-size:20px;font-family:var(--f-sans);font-weight:600;letter-spacing:-.01em}

/* N2 — Allocation list: designate which open charges a payment settles.
   Rows are checkable; the foot shows what is allocated and what is left as credit. */
.alloc{border:1px solid var(--line);border-radius:var(--r-md);overflow:hidden;background:var(--surface)}
.alloc-row{display:grid;grid-template-columns:20px 1fr auto;gap:10px;align-items:center;padding:10px 12px;border-bottom:1px solid var(--line);cursor:pointer;font-size:13px}
.alloc-row:last-of-type{border-bottom:none}
.alloc-row input{width:16px;height:16px;accent-color:var(--syndic-blue);margin:0}
.alloc-row.is-on{background:var(--tint-blue)}
.alloc-row .alloc-sub{display:block;font-size:11.5px;color:var(--ink-3);margin-top:1px}
.alloc-row .alloc-amt{font-variant-numeric:tabular-nums;font-weight:600;text-align:end;white-space:nowrap}
.alloc-row .alloc-amt small{display:block;font-weight:400;font-size:11px;color:var(--ink-3)}
.alloc-foot{display:flex;flex-direction:column;gap:6px;padding:10px 12px;background:var(--bg-2);border-top:1px solid var(--line);font-size:12.5px}
.alloc-foot .between span:last-child{font-variant-numeric:tabular-nums;font-weight:600}

/* N3 — Reversed / cancelled row: stays in the list (append-only), visibly void. */
.tbl tbody tr.is-void td{color:var(--ink-3)}
.tbl tbody tr.is-void td .money,.tbl tbody tr.is-void td.strike{text-decoration:line-through;text-decoration-color:var(--ink-4)}
.void-note{display:block;font-size:11px;color:var(--ink-3);margin-top:2px;text-decoration:none}

/* N4 — Preview box: the result of a dry-run shown before an irreversible confirm.
   .is-stale = the input changed after preview; Confirm is disabled. */
.preview-box{border:1px solid var(--line-2);border-radius:var(--r-md);background:var(--bg-2);padding:14px;display:grid;gap:8px}
.preview-box.is-stale{border-style:dashed;opacity:.6}
.from-to{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;font-variant-numeric:tabular-nums}
.from-to .from{color:var(--ink-3);text-decoration:line-through;text-decoration-color:var(--ink-4)}
.from-to .to{font-family:var(--f-serif);font-size:26px;letter-spacing:-.02em;color:var(--ink)}
.from-to .arrow{color:var(--ink-4)}
[dir="rtl"] .from-to .arrow{transform:scaleX(-1)}

/* N5 — Placeholder chip (reminder template editor). .is-bad = refused by the API. */
.ph-chip{display:inline-flex;align-items:center;gap:4px;font-family:var(--f-mono);font-size:11px;padding:2px 7px;border-radius:var(--r-xs);background:var(--bg-3);color:var(--ink-2);border:1px solid transparent;cursor:pointer;white-space:nowrap}
.ph-chip:hover{border-color:var(--line-2);color:var(--ink)}
.ph-chip.is-bad{background:var(--tint-crit);color:var(--crit);cursor:default}
.ph-list{display:flex;flex-wrap:wrap;gap:6px}
mark.ph-bad{background:var(--tint-crit);color:var(--crit);border-radius:2px;padding:0 2px}

/* N6 — Mail frame (template preview): envelope header + body. */
.mail-frame{border:1px solid var(--line);border-radius:var(--r-md);overflow:hidden;background:var(--surface)}
.mail-head{padding:10px 14px;background:var(--bg-2);border-bottom:1px solid var(--line);font-size:11.5px;display:grid;gap:2px}
.mail-head .k{color:var(--ink-3)}
.mail-body{padding:18px;font-size:13px;line-height:1.6;color:var(--ink-2)}
.mail-subject{font-weight:600;font-size:15px;color:var(--ink);margin-bottom:4px}
.mail-pre{font-size:12px;color:var(--ink-3);font-style:italic;margin-bottom:14px}
.mail-foot{margin-top:16px;padding-top:12px;border-top:1px solid var(--line);font-size:11px;color:var(--ink-3)}

/* N7 — Receipt (reçu / quittance): printable A5 document, rendered from stored rows. */
.receipt{background:#fff;color:oklch(18% .02 250);border:1px solid var(--line);border-radius:var(--r-md);box-shadow:var(--shadow-md);padding:28px 30px;max-width:560px;font-size:12.5px;line-height:1.5}
.receipt-head{display:flex;justify-content:space-between;gap:16px;padding-bottom:14px;border-bottom:2px solid oklch(18% .02 250)}
.receipt-title{font-family:var(--f-serif);font-size:28px;letter-spacing:-.02em;line-height:1}
.receipt-no{font-family:var(--f-mono);font-size:11px;color:oklch(52% .02 250);margin-top:4px}
.receipt-amount{font-family:var(--f-serif);font-size:34px;letter-spacing:-.02em;font-variant-numeric:tabular-nums;margin:14px 0 2px}
.receipt .dl{font-size:12.5px}
.receipt .dl dt{color:oklch(52% .02 250)}
.receipt .dl dd{color:oklch(18% .02 250)}
.receipt-foot{margin-top:16px;padding-top:10px;border-top:1px solid oklch(90% .008 75);font-size:10.5px;color:oklch(52% .02 250);display:flex;justify-content:space-between;gap:12px}
.receipt.is-void{position:relative}
.receipt.is-void::after{content:attr(data-void);position:absolute;inset:0;display:grid;place-items:center;font-family:var(--f-serif);font-size:64px;color:oklch(52% .17 25 / .22);transform:rotate(-14deg);pointer-events:none}

/* N8 — Ledger row kind marker (charge / payment / credit / late fee / waiver). */
.lk{display:inline-grid;place-items:center;width:22px;height:22px;border-radius:50%;font-size:11px;font-weight:700;flex-shrink:0}
.lk.charge{background:var(--bg-3);color:var(--ink-2)}
.lk.payment{background:var(--tint-teal);color:var(--syndic-teal-deep)}
.lk.credit{background:var(--tint-blue);color:var(--syndic-blue)}
.lk.fee{background:var(--tint-crit);color:var(--crit)}
.lk.waiver{background:var(--tint-warn);color:var(--warn)}
[data-theme="dark"] .lk.payment{color:oklch(80% .1 180)}
[data-theme="dark"] .lk.credit{color:oklch(75% .1 250)}

/* N9 — Access denied / no-permission card (lifted from AccessDenied.razor's inline styles). */
.denied{max-width:480px;margin:40px auto 0;padding:40px 32px;text-align:center}
.denied-mark{width:56px;height:56px;border-radius:50%;background:var(--tint-warn);color:var(--warn);display:grid;place-items:center;margin:0 auto 16px}
.denied-title{font-family:var(--f-serif);font-size:22px;letter-spacing:-.01em}
.denied-text{font-size:13px;color:var(--ink-3);margin-top:8px;line-height:1.5;text-wrap:pretty}

/* N10 — Roster presence: row tone follows the attendance state. */
.tbl tbody tr.att-present td:first-child{box-shadow:inset 3px 0 0 var(--syndic-teal)}
.tbl tbody tr.att-proxy td:first-child{box-shadow:inset 3px 0 0 var(--syndic-blue)}
[dir="rtl"] .tbl tbody tr.att-present td:first-child{box-shadow:inset -3px 0 0 var(--syndic-teal)}
[dir="rtl"] .tbl tbody tr.att-proxy td:first-child{box-shadow:inset -3px 0 0 var(--syndic-blue)}
.seg-sm .seg-item{padding:3px 9px;font-size:11.5px}

/* FIX (not new), scoped to .v4 pages: grid tracks in .split-main/.split-side/
   .split-even take the min-content width of a nowrap table and push the page sideways. */
.v4 .split-main>*,.v4 .split-side>*,.v4 .split-even>*,.v4 .grid-2>*,.v4 .grid-3>*{min-width:0}

/* FIX (not new), scoped to .v4 pages: numerals inside RTL. Big figures and stat
   values keep LTR digit order and sit on the reading-start side. Refs never wrap mid-code. */
[dir="rtl"] .owed-value,[dir="rtl"] .v4 .stat-value,[dir="rtl"] .from-to .to{direction:ltr;text-align:right;unicode-bidi:isolate}
[dir="rtl"] .owed-value .ccy{margin-inline-start:0;margin-left:4px}
.v4 .tbl .mono{white-space:nowrap}

/* Phone width: drawers go full-screen, tables scroll inside their card. */
@media (max-width:767px){
  .v4 .drawer{width:100vw;max-width:100vw}
  .from-to .to{font-size:22px}
  .owed-value{font-size:26px}
  .receipt{padding:20px}
}
