/* ─────────────────────────────────────────────────────────────────────────
   Day Matrix — per-house client × day compliance grid. View-specific layout
   built on the shared .leaf-ds token + primitive layer (leaf-ds.css).
   ───────────────────────────────────────────────────────────────────────── */

.leaf-ds .ds-mx-surface {
    background: var(--surface); box-sizing: border-box; padding: 24px;
    border-radius: 12px; border: 1px solid var(--line);
}
.leaf-ds .ds-mx-empty { padding: 24px; font-size: 13px; color: var(--ink-3); }

/* header: optional house identity (left) + always-on totals (right) */
.leaf-ds .ds-mx-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 18px; flex-wrap: wrap; }
.leaf-ds .ds-mx-totals { display: flex; gap: 22px; align-items: flex-end; flex-wrap: wrap; }
.leaf-ds .ds-mx-total { text-align: right; }
.leaf-ds .ds-mx-total-label { font-size: 10px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }
.leaf-ds .ds-mx-total-value { font-size: 22px; font-weight: 700; line-height: 1.1; margin-top: 2px; color: var(--ink-1); }
.leaf-ds .ds-mx-total-value--auth { color: var(--ink-3); }
.leaf-ds .ds-mx-total-value--sched { color: var(--ink-2); }
.leaf-ds .ds-mx-total-unit { font-size: 11px; color: var(--ink-3); font-weight: 600; margin-left: 3px; }
.leaf-ds .ds-mx-total-chip { padding-bottom: 3px; }

.leaf-ds .ds-mx-legend { margin-bottom: 16px; }

/* grid: name + 7 days + week (scrolls horizontally on narrow screens) */
.leaf-ds .ds-mx-grid-wrap { border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
.leaf-ds .ds-mx-grid { display: grid; grid-template-columns: 218px repeat(7, 88px) 182px; min-width: 1016px; }

.leaf-ds .ds-mx-colhead { padding: 10px 14px; font-size: 11px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.05em; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.leaf-ds .ds-mx-colhead--client { border-right: 1px solid var(--line); }
.leaf-ds .ds-mx-colhead--week { text-align: right; }
.leaf-ds .ds-mx-dayhead { padding: 8px 6px; text-align: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.leaf-ds .ds-mx-dayhead-dow { font-size: 10px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; }
.leaf-ds .ds-mx-dayhead-date { font-size: 12.5px; font-weight: 600; color: var(--ink-1); margin-top: 1px; }

.leaf-ds .ds-mx-name { padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; justify-content: center; }
.leaf-ds .ds-mx-name-text { font-size: 13.5px; font-weight: 700; letter-spacing: -0.005em; }
.leaf-ds .ds-mx-name-meta { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.leaf-ds .ds-mx-name-meta b { font-weight: 700; color: var(--ink-2); }

.leaf-ds .ds-mx-cell { border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 11px 10px 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.leaf-ds .ds-mx-cell--problem { background: var(--st-tint); }
.leaf-ds .ds-mx-weekend { background: var(--surface-2); }
.leaf-ds .ds-mx-cell-num { font-size: 15.5px; font-weight: 700; line-height: 1; color: var(--ink-1); }
.leaf-ds .ds-mx-cell.ds-st-none .ds-mx-cell-num { color: var(--ink-4); }
.leaf-ds .ds-mx-cell--problem .ds-mx-cell-num { color: var(--st-ink); }
.leaf-ds .ds-mx-cell-bar { width: 58px; }
.leaf-ds .ds-mx-cell-cap { font-size: 9.5px; height: 11px; color: var(--ink-3); font-weight: 500; }
.leaf-ds .ds-mx-cell--problem .ds-mx-cell-cap { color: var(--st-ink); font-weight: 700; }

.leaf-ds .ds-mx-week { padding: 12px 14px; border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 6px; }
.leaf-ds .ds-mx-week-nums { display: flex; align-items: baseline; gap: 4px; }
.leaf-ds .ds-mx-week-deliv { font-size: 18px; font-weight: 700; color: var(--ink-1); }
.leaf-ds .ds-mx-week.ds-st-under .ds-mx-week-deliv,
.leaf-ds .ds-mx-week.ds-st-over .ds-mx-week-deliv,
.leaf-ds .ds-mx-week.ds-st-missed .ds-mx-week-deliv { color: var(--st-ink); }
.leaf-ds .ds-mx-week-sched { font-size: 11px; color: var(--ink-3); }
.leaf-ds .ds-mx-week-ok { font-size: 10.5px; color: var(--ink-3); font-weight: 600; }

.leaf-ds .ds-mx-foot { margin-top: 12px; font-size: 11px; color: var(--ink-3); }
