/* ─────────────────────────────────────────────────────────────────────
   HOMEi CRM & Leads reports — «لوحة الليدز» · «لوحة CRM» (LEADS-OPS-10,
   HO-3416; design approved by the Project Owner 04/10/2026 — «نفذ» — on the
   house design system v1).

   The design system's starter sheet with the prefix `rp`, the report bits
   of the approved mockup (§17), and an adapter (§18) that re-points the two
   pages' older skins (`.mktdash`, `.crm5`) and their lazy widgets onto the
   house tokens, so no screen carries two systems (the MKT-DS-2 pattern,
   marketing.css §17). Layout below the ruled card stays theirs.

   Colours: the house tokens only (--lm-d-*); the ratchet holds this sheet at
   zero. Text never under 12px. Logical properties only. Scoped by
   `.rp-page` (the page class) and `.rp`.

   Registered as a Filament asset — a change here ships NOTHING until
   `php artisan filament:assets` is run and public/css/app/ is committed in
   the same change.
   ──────────────────────────────────────────────────────────────────── */

/* ── 1. the ground and the head ── */
body:has(.rp-page) { background: var(--lm-d-page); }
body:has(.rp-page) .fi-main-ctn { background: transparent; }
.rp-page .fi-header-heading { font-size: 28px; font-weight: 700; line-height: 1.25; color: var(--lm-d-ink); }
.rp-page .fi-header-subheading { margin-block-start: 4px; font-size: 14px; color: var(--lm-d-muted); }

.rp { display: flex; flex-direction: column; gap: 14px; color: var(--lm-d-ink); }
.rp :focus-visible { outline: 2px solid var(--lm-d-info); outline-offset: 2px; }
.rp .rp-num { font-variant-numeric: tabular-nums; }
.rp bdi { unicode-bidi: isolate; }

/* the page's header actions (Filament): outline buttons, the main decision is the orange */
.rp-page .fi-header-actions-ctn .fi-btn {
    min-block-size: 44px;
    border-radius: 12px;
    padding-inline: 16px;
    background: var(--lm-d-surface);
    color: var(--lm-d-ink);
    box-shadow: inset 0 0 0 1px var(--lm-d-control-edge);
    font-weight: 700;
}
.rp-page .fi-header-actions-ctn .fi-btn .fi-icon { color: currentColor; }
.rp-page .fi-header-actions-ctn .fi-btn:is(.fi-color-primary, .fi-color-success) { background: var(--lm-d-accent); color: var(--lm-d-on-accent); box-shadow: 0 4px 12px var(--lm-d-accent-soft); }
.rp-page .fi-header-actions-ctn .fi-btn.fi-color-danger { color: var(--lm-d-danger); box-shadow: inset 0 0 0 1px var(--lm-d-gap-edge); }

/* ── 2. text tones (words and figures only) ── */
.rp .is-ink { color: var(--lm-d-ink); }
.rp .is-muted { color: var(--lm-d-muted); }
.rp .is-ok { color: var(--lm-d-ok); }
.rp .is-warn { color: var(--lm-d-warn); }
.rp .is-danger { color: var(--lm-d-danger); }
.rp .is-accent { color: var(--lm-d-accent-ink); }
.rp .is-info { color: var(--lm-d-info); }

/* ── 3. the numbers strip (KPI row): label · big figure · one line under it ── */
.rp-strip {
    display: grid;
    grid-template-columns: repeat(var(--rp-cols, 6), minmax(0, 1fr));
    background: var(--lm-d-surface);
    border: 1px solid var(--lm-d-border);
    border-radius: 16px;
    box-shadow: 0 1px 2px var(--lm-d-shadow);
}
.rp-strip-c { padding: 12px 18px; border-inline-start: 1px solid var(--lm-d-divider); min-inline-size: 0; }
.rp-strip-c:first-child { border-inline-start: 0; }
a.rp-strip-c, button.rp-strip-c { color: inherit; text-decoration: none; background: none; border-block: 0; border-inline-end: 0; text-align: start; font: inherit; cursor: pointer; }
a.rp-strip-c:hover, button.rp-strip-c:hover { background: var(--lm-d-hover); }
.rp-k-l { font-size: 13px; color: var(--lm-d-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-k-v { font-size: 26px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-k-s { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── 4. the card with the blue rule (the page's main surface) ── */
.rp-card {
    background: var(--lm-d-surface);
    border: 1px solid var(--lm-d-border);
    border-block-start: 3px solid var(--lm-d-info);
    border-radius: 16px;
    box-shadow: 0 1px 2px var(--lm-d-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.rp-card--plain { border-block-start-width: 1px; border-block-start-color: var(--lm-d-border); }
.rp-card-h {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    padding: 12px 18px;
    border-block-end: 1px solid var(--lm-d-divider);
}
.rp-card-t { font-size: 20px; font-weight: 700; margin: 0; }
.rp-card-t span { font-size: 14px; font-weight: 500; color: var(--lm-d-muted); }
.rp-card-b { padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; }

/* ── 5. view pills (the page's views / tabs): navy when on ── */
.rp-pills { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rp-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-block-size: 40px;
    padding-inline: 16px;
    border-radius: 20px;
    border: 1px solid var(--lm-d-border);
    background: var(--lm-d-surface);
    color: var(--lm-d-ink);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
}
.rp-pill:hover { border-color: var(--lm-d-control-edge); }
.rp-pill.is-on { background: var(--lm-d-tab-on-bg); border-color: var(--lm-d-tab-on-bg); color: var(--lm-d-tab-on-ink); }
.rp-pill-n { font-variant-numeric: tabular-nums; }
.rp-dot { inline-size: 7px; block-size: 7px; border-radius: 50%; background: var(--lm-d-info); flex: none; }
.rp-dot.is-accent { background: var(--lm-d-accent); }
.rp-dot.is-ok { background: var(--lm-d-ok); }
.rp-dot.is-danger { background: var(--lm-d-danger); }
.rp-pill.is-on .rp-dot { background: var(--lm-d-accent); }

/* ── 6. status chips with counts (filters on the list's toolbar row) ── */
.rp-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rp-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-block-size: 34px;
    padding-inline: 12px;
    border: 1px solid var(--lm-d-border);
    border-radius: 10px;
    background: var(--lm-d-page);
    color: var(--lm-d-muted);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}
.rp-chip b { color: var(--lm-d-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.rp-chip:hover { background: var(--lm-d-chip-bg); }
.rp-chip.is-on { background: var(--lm-d-info-soft); border-color: var(--lm-d-info-soft); color: var(--lm-d-info); }
.rp-chip.is-on b { color: var(--lm-d-info); }

/* ── 7. toolbar: search (the panel-wide dictation mic attaches itself) + a small segmented toggle ── */
.rp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 18px; border-block-end: 1px solid var(--lm-d-divider); }
.rp-search { margin-inline-start: auto; inline-size: min(320px, 100%); block-size: 38px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--lm-d-control-edge); border-radius: 10px; background: var(--lm-d-surface); color: var(--lm-d-muted); }
.rp-search .rp-ic { inline-size: 16px; block-size: 16px; flex: none; }
.rp-search input { flex: 1; min-inline-size: 0; block-size: 34px; border: 0; outline: 0; background: transparent; color: var(--lm-d-ink); font: inherit; font-size: 13.5px; }
.rp-search input::placeholder { color: var(--lm-d-muted); }
.rp-search:focus-within { border-color: var(--lm-d-accent); box-shadow: 0 0 0 3px var(--lm-d-accent-soft); }
.rp-seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--lm-d-border); border-radius: 10px; background: var(--lm-d-surface); }
.rp-seg button { block-size: 30px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--lm-d-muted); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.rp-seg button:hover { color: var(--lm-d-ink); }
.rp-seg button.is-on { background: var(--lm-d-chip-bg); color: var(--lm-d-ink); font-weight: 700; }

/* ── 8. the split: the list (start) and the item opened beside it (end) ── */
.rp-split { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
.rp-split.has-open { grid-template-columns: minmax(0, 1fr) 360px; }
.rp-split:not(.has-open) .rp-panel { display: none; }
.rp-list { min-inline-size: 0; }
.rp-split.has-open .rp-list { border-inline-end: 1px solid var(--lm-d-divider); }

/* a Filament table flattened into the card */
:is(.rp-list, .rp-doc-main) .fi-ta-ctn { border: 0; border-radius: 0; box-shadow: none; background: transparent; }
:is(.rp-list, .rp-doc-main) .fi-ta-header-ctn { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; padding-inline: 18px 12px; border-block-end: 1px solid var(--lm-d-divider); }
:is(.rp-list, .rp-doc-main) .fi-ta-header-ctn > * { border: 0; }
:is(.rp-list, .rp-doc-main) .fi-ta-header { padding: 10px 0; flex: 1 1 auto; min-inline-size: 0; }
:is(.rp-list, .rp-doc-main) .fi-ta-header-toolbar { padding: 8px 0; flex: 0 0 auto; border: 0; }
:is(.rp-list, .rp-doc-main) .fi-ta-search-field { max-inline-size: 260px; }
:is(.rp-list, .rp-doc-main) .fi-ta-header-cell { background: var(--lm-d-surface); color: var(--lm-d-ink); font-size: 13.5px; font-weight: 700; padding-inline: 8px; white-space: nowrap; }
:is(.rp-list, .rp-doc-main) .fi-ta-cell { padding-inline: 8px; color: var(--lm-d-ink); }
:is(.rp-list, .rp-doc-main) .fi-ta-row:hover > td { background: var(--lm-d-hover); }
.rp-list .fi-ta-row { cursor: pointer; }
.rp-list .fi-ta-row.rp-row-open > td { background: var(--lm-d-row-hl); }
.rp-list .fi-ta-row.rp-row-open > td:first-child { box-shadow: inset -3px 0 0 var(--lm-d-accent); }
[dir='ltr'] .rp-list .fi-ta-row.rp-row-open > td:first-child { box-shadow: inset 3px 0 0 var(--lm-d-accent); }
:is(.rp-list, .rp-doc-main) .fi-ta-actions .fi-btn:is(.fi-color-success, .fi-color-primary) { background: var(--lm-d-accent); color: var(--lm-d-on-accent); }

/* a hand-built table (when the list is not a Filament table) */
.rp-table { inline-size: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.rp-table th { text-align: start; padding: 10px 12px; color: var(--lm-d-ink); font-weight: 700; font-size: 13.5px; border-block-end: 1px solid var(--lm-d-border); white-space: nowrap; }
.rp-table td { padding: 10px 12px; border-block-end: 1px solid var(--lm-d-divider); color: var(--lm-d-ink); vertical-align: middle; }
.rp-table tbody tr { cursor: pointer; }
.rp-table tbody tr:hover > td { background: var(--lm-d-hover); }
.rp-table tbody tr.is-open > td { background: var(--lm-d-row-hl); }
.rp-table tbody tr.is-open > td:first-child { box-shadow: inset -3px 0 0 var(--lm-d-accent); }
[dir='ltr'] .rp-table tbody tr.is-open > td:first-child { box-shadow: inset 3px 0 0 var(--lm-d-accent); }
.rp-table td.is-name { font-weight: 700; }
.rp-table tfoot td { background: var(--lm-d-info-soft); font-weight: 700; border: 0; }
.rp-dim { color: var(--lm-d-muted); font-size: 12.5px; }

/* ── 9. the panel (the opened item): head · own scroll · buttons pinned at the foot ── */
.rp-panel { position: sticky; inset-block-start: 12px; display: flex; flex-direction: column; background: var(--lm-d-surface); max-block-size: calc(100dvh - 120px); min-block-size: 420px; }
.rp-p { display: flex; flex-direction: column; min-block-size: 0; flex: 1 1 auto; }
.rp-p-h { padding: 14px 18px 12px; border-block-end: 1px solid var(--lm-d-divider); }
.rp-p-t { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; }
.rp-p-x { margin-inline-start: auto; inline-size: 32px; block-size: 32px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--lm-d-border); background: var(--lm-d-surface); color: var(--lm-d-muted); font: inherit; font-size: 13px; cursor: pointer; }
.rp-p-s { margin-block-start: 2px; font-size: 13px; color: var(--lm-d-muted); }
.rp-p-b { flex: 1 1 auto; min-block-size: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; }
.rp-p-f { padding: 12px 18px; border-block-start: 1px solid var(--lm-d-divider); display: flex; gap: 8px; }
.rp-p-f > .rp-btn { flex: 1 1 0; justify-content: center; }

/* ── 10. status tag (a dot + a word) ── */
.rp-tag { display: inline-flex; align-items: center; gap: 6px; min-block-size: 26px; padding-inline: 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.rp-tag::before { content: ''; inline-size: 6px; block-size: 6px; border-radius: 50%; background: currentColor; }
.rp-tag.is-info { background: var(--lm-d-info-soft); color: var(--lm-d-info); }
.rp-tag.is-ok { background: var(--lm-d-ok-soft); color: var(--lm-d-ok); }
.rp-tag.is-warn { background: var(--lm-d-warn-soft); color: var(--lm-d-warn); }
.rp-tag.is-danger { background: var(--lm-d-danger-soft); color: var(--lm-d-danger); }
.rp-tag.is-accent { background: var(--lm-d-accent-soft); color: var(--lm-d-accent-ink); }
.rp-tag.is-quiet { background: var(--lm-d-quiet-bg); color: var(--lm-d-muted); }

/* ── 11. the stages of a record ── */
.rp-steps { display: flex; justify-content: space-between; position: relative; margin: 0; padding: 4px 0 0; list-style: none; }
.rp-steps::before { content: ''; position: absolute; inset-block-start: 12px; inset-inline: 14px; border-block-start: 2px solid var(--lm-d-divider); }
.rp-steps li { position: relative; flex: 1; text-align: center; font-size: 12px; color: var(--lm-d-muted); }
.rp-steps li i { display: block; inline-size: 16px; block-size: 16px; margin: 0 auto 4px; border-radius: 50%; background: var(--lm-d-surface); border: 2px solid var(--lm-d-control-edge); }
.rp-steps li.is-done i { background: var(--lm-d-ok); border-color: var(--lm-d-ok); }
.rp-steps li.is-now { color: var(--lm-d-ink); font-weight: 700; }
.rp-steps li.is-now i { background: var(--lm-d-accent); border-color: var(--lm-d-accent); box-shadow: 0 0 0 4px var(--lm-d-accent-soft); }
.rp-steps li.is-stop { color: var(--lm-d-danger); font-weight: 700; }
.rp-steps li.is-stop i { background: var(--lm-d-danger); border-color: var(--lm-d-danger); }

/* ── 12. figures inside a panel / card ── */
.rp-money { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rp-money > div { border: 1px solid var(--lm-d-border); border-radius: 10px; padding: 8px 10px; display: grid; min-inline-size: 0; }
.rp-money span { font-size: 12px; color: var(--lm-d-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-money b { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rp-net { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--lm-d-ok-soft); color: var(--lm-d-ok); font-size: 13.5px; font-weight: 700; }
.rp-net b { font-variant-numeric: tabular-nums; }
.rp-sec { font-size: 14px; font-weight: 700; margin-block-end: 6px; }
.rp-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-block-end: 1px solid var(--lm-d-divider); font-size: 13.5px; }
.rp-line:last-child { border-block-end: 0; }
.rp-line b { font-variant-numeric: tabular-nums; white-space: nowrap; flex: 0 0 auto; }
.rp-note { border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.6; border: 1px solid var(--lm-d-divider); }
.rp-note.is-info { background: var(--lm-d-info-soft); color: var(--lm-d-info); }
.rp-note.is-warn { background: var(--lm-d-warn-soft); color: var(--lm-d-warn); }
.rp-note.is-danger { background: var(--lm-d-danger-soft); color: var(--lm-d-danger); }
.rp-note.is-ok { background: var(--lm-d-ok-soft); color: var(--lm-d-ok); }

/* ── 13. buttons: one orange primary per area, the rest outline ── */
.rp-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-block-size: 42px;
    padding-inline: 16px;
    border-radius: 10px;
    border: 1px solid var(--lm-d-control-edge);
    background: var(--lm-d-surface);
    color: var(--lm-d-ink);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
}
.rp-btn:hover { background: var(--lm-d-hover); }
.rp-btn.is-primary { background: var(--lm-d-accent); border-color: var(--lm-d-accent); color: var(--lm-d-on-accent); }
.rp-btn.is-primary:hover { filter: brightness(0.96); }
.rp-btn.is-danger { color: var(--lm-d-danger); border-color: var(--lm-d-gap-edge); }
.rp-btn.is-sm { min-block-size: 36px; padding-inline: 14px; font-size: 13.5px; }
.rp-btn.is-icon { inline-size: 42px; padding: 0; justify-content: center; }
.rp-btn:disabled { opacity: .6; cursor: default; }
.rp-btn-ico, .rp-ic { inline-size: 18px; block-size: 18px; flex: none; }

/* ── 14. empty state ── */
.rp-empty { flex: 1 1 auto; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 32px 24px; text-align: center; color: var(--lm-d-muted); font-size: 13px; }
.rp-empty b { color: var(--lm-d-ink); font-size: 15px; }
.rp-empty-ico { inline-size: 36px; block-size: 36px; color: var(--lm-d-subtle); }

/* ── 15. a record page (Filament view/edit): ruled main card, tabs as pills ── */
.rp-doc-page .fi-page-content { gap: 16px; }
.rp-doc-page .fi-section { border-radius: 16px; box-shadow: 0 1px 2px var(--lm-d-shadow); }
.rp-doc-page .fi-section-header-heading { color: var(--lm-d-ink); font-weight: 700; }
.rp-doc-main {
    background: var(--lm-d-surface);
    border: 1px solid var(--lm-d-border);
    border-block-start: 3px solid var(--lm-d-info);
    border-radius: 16px;
    box-shadow: 0 1px 2px var(--lm-d-shadow);
}
.rp-doc-main .fi-tabs { gap: 8px; padding: 12px 16px; border-block-end: 1px solid var(--lm-d-divider); justify-content: flex-start; background: transparent; box-shadow: none; border-radius: 0; }
.rp-doc-main .fi-tabs .fi-tabs-item { min-block-size: 42px; padding-inline: 16px; border-radius: 21px; border: 1px solid var(--lm-d-border); background: var(--lm-d-surface); color: var(--lm-d-ink); font-weight: 700; }
.rp-doc-main .fi-tabs .fi-tabs-item .fi-tabs-item-label { color: inherit; }
.rp-doc-main .fi-tabs .fi-tabs-item .fi-icon { color: var(--lm-d-muted); }
.rp-doc-main .fi-tabs .fi-tabs-item.fi-active { background: var(--lm-d-tab-on-bg); border-color: var(--lm-d-tab-on-bg); color: var(--lm-d-tab-on-ink); }
.rp-doc-main .fi-tabs .fi-tabs-item.fi-active :is(.fi-tabs-item-label, .fi-icon) { color: var(--lm-d-tab-on-ink); }
.rp-doc-main .fi-sc-tabs-tab { padding: 16px; }
.rp-doc-main .fi-sc-tabs-tab .fi-section { box-shadow: none; }

/* ── 16. under 1024px: the page scrolls, the panel becomes a bottom sheet ── */
@media (max-width: 1023.98px) {
    .rp-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .rp-strip-c:nth-child(3n + 1) { border-inline-start: 0; }
    .rp-strip-c:nth-child(n + 4) { border-block-start: 1px solid var(--lm-d-divider); }
    .rp-split, .rp-split.has-open { grid-template-columns: minmax(0, 1fr); }
    .rp-split.has-open .rp-list { border-inline-end: 0; }
    .rp-panel { display: none; }
    .rp-split.has-open .rp-panel {
        display: flex;
        position: fixed;
        inset-inline: 0;
        inset-block: auto 0;
        z-index: 45;
        min-block-size: 0;
        max-block-size: 82dvh;
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -10px 40px var(--lm-d-sheet-shadow);
    }
    /* the first row opens beside the list on a wide screen; on a narrow one the sheet waits for a tap */
    .rp-split.has-open.is-auto .rp-panel { display: none; }
    .rp-split.is-auto .rp-table tbody tr.is-open > td { background: transparent; box-shadow: none; }
    .rp-card-h { align-items: stretch; }
    .rp-pills, .rp-doc-main .fi-tabs { flex-wrap: nowrap; overflow-x: auto; padding-block-end: 2px; scrollbar-width: none; }
    .rp-page .fi-header-heading { font-size: 22px; }
}
@media (max-width: 640px) {
    .rp-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rp-strip-c:nth-child(n) { border-inline-start: 0; border-block-start: 1px solid var(--lm-d-divider); }
    .rp-strip-c:nth-child(-n + 2) { border-block-start: 0; }
    .rp-strip-c:nth-child(2n) { border-inline-start: 1px solid var(--lm-d-divider); }
    .rp-k-v { font-size: 22px; }
    .rp-search { inline-size: 100%; margin-inline-start: 0; block-size: 44px; }
    .rp-money { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* touch: every control at least 44px tall on a phone */
    .rp-pill, .rp-chip, .rp-btn, .rp-seg button, .rp-p-x { min-block-size: 44px; }
    .rp-p-x { inline-size: 44px; }
    .rp-table thead { display: none; }
    .rp-table, .rp-table tbody, .rp-table tr, .rp-table td { display: block; inline-size: 100%; }
    .rp-table tbody tr { padding: 10px 12px; border-block-end: 1px solid var(--lm-d-divider); }
    .rp-table td { padding: 2px 0; border: 0; }
    .rp-table td[data-label]::before { content: attr(data-label) ' · '; color: var(--lm-d-muted); font-size: 12.5px; }
}

/* ── 17. the report bits of the approved mockup ── */
/* a share bar inside a table cell; its length is a custom property carrying a number (never a colour) */
.rp-bar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; min-inline-size: 140px; }
.rp-bar-track { block-size: 8px; border-radius: 999px; background: var(--lm-d-quiet-bg); overflow: hidden; }
.rp-bar-fill { block-size: 100%; inline-size: calc(var(--w, 0) * 1%); border-radius: 999px; background: var(--lm-d-info); }
.rp-bar-fill.is-warn { background: var(--lm-d-warn); }
.rp-bar-fill.is-danger { background: var(--lm-d-danger); }
.rp-bar-fill.is-ok { background: var(--lm-d-ok); }
.rp-bar-fill.is-accent { background: var(--lm-d-accent); }
/* three figures side by side at the top of a panel */
.rp-split3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rp-split3 > div { border: 1px solid var(--lm-d-border); border-radius: 10px; padding: 8px 10px; min-inline-size: 0; }
.rp-split3 b { display: block; font-size: 17px; }
.rp-split3 span { font-size: 12.5px; color: var(--lm-d-muted); }
.rp-src { font-size: 12.5px; color: var(--lm-d-muted); }
/* the period switch in the page head */
.rp-page .rp-head-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* rows of the report list are clickable like the house list */
.rp .rp-table tbody tr[wire\:click] { cursor: pointer; }
/* the section heading of the detailed analytics kept below the ruled card */
.rp-more-h { margin: 6px 0 0; font-size: 18px; font-weight: 700; color: var(--lm-d-ink); }
.rp-more-h span { font-size: 14px; font-weight: 500; color: var(--lm-d-muted); }

/* ── 18. the adapter — the older dashboard skins read the house tokens on a report page ──
   `.mktdash` (lead dashboard + its lazy widgets) and `.crm5` (CRM dashboard) paint through
   custom properties: re-point them. Specificity `.fi-page.rp-page …` beats the views' own
   `.dark …` patches whatever the order. Layout stays theirs. */
.fi-page.rp-page .mktdash {
    --blue: var(--lm-d-info); --card: var(--lm-d-surface); --line: var(--lm-d-border);
    --ink: var(--lm-d-ink); --mut: var(--lm-d-muted); --soft: var(--lm-d-page);
    --r: 16px; --shadow: 0 1px 2px var(--lm-d-shadow);
}
.fi-page.rp-page .crm5 {
    --card: var(--lm-d-surface); --line: var(--lm-d-border); --ink: var(--lm-d-ink);
    --mut: var(--lm-d-muted); --soft: var(--lm-d-page); --shadow: 0 1px 2px var(--lm-d-shadow);
    --tone-blue: var(--lm-d-info); --tone-blue-bg: var(--lm-d-info-soft);
    --tone-green: var(--lm-d-ok); --tone-green-bg: var(--lm-d-ok-soft);
    --tone-orange: var(--lm-d-accent-ink); --tone-orange-bg: var(--lm-d-accent-soft);
    --tone-amber: var(--lm-d-warn); --tone-amber-bg: var(--lm-d-warn-soft);
    --tone-red: var(--lm-d-danger); --tone-red-bg: var(--lm-d-danger-soft);
    --tone-violet: var(--lm-d-ai); --tone-violet-bg: var(--lm-d-ai-bg);
    --tone-indigo: var(--lm-d-ai); --tone-indigo-bg: var(--lm-d-ai-bg);
    --tone-sky: var(--lm-d-info); --tone-sky-bg: var(--lm-d-info-soft);
    --tone-slate: var(--lm-d-muted); --tone-slate-bg: var(--lm-d-quiet-bg);
}
.fi-page.rp-page :is(.mktdash-card, .mktdash-details, .crm5-card, .crm5-qa-card, .crm5-tile) { border-radius: 16px; }
.fi-page.rp-page .crm5-spark-bar { background: var(--lm-d-info); }
.fi-page.rp-page .crm5-ai-btn { background: var(--lm-d-surface); color: var(--lm-d-ink); box-shadow: inset 0 0 0 1px var(--lm-d-control-edge); }

/* ── 19. «لوحة الليدز» simple (LEADS-BOARD-DS-1, 08/10/2026, Kamal «خليه سهل وبسيط») ──
   four numbers · one list of what to do · «الأداء» in three tabs · the detailed analytics folded. */
.rp-owner { display: inline-flex; align-items: center; gap: 6px; block-size: 44px; padding-inline: 12px 4px; border: 1px solid var(--lm-d-control-edge); border-radius: 12px; background: var(--lm-d-surface); color: var(--lm-d-muted); }
.rp-owner select { block-size: 40px; border: 0; background: transparent; color: var(--lm-d-ink); font: inherit; font-size: 14px; font-weight: 700; padding-inline: 4px 28px; box-shadow: none; }
.rp-owner select:focus { outline: 0; box-shadow: none; }
.rp-owner:focus-within { border-color: var(--lm-d-accent); box-shadow: 0 0 0 3px var(--lm-d-accent-soft); }

/* the lead search: a box in the toolbar, its matches drop under it */
.rp-find { position: relative; margin-inline-start: auto; inline-size: min(340px, 100%); }
.rp-find .rp-search { margin-inline-start: 0; inline-size: 100%; }
.rp-found { position: absolute; z-index: 30; inset-inline: 0; inset-block-start: calc(100% + 6px); max-block-size: 320px; overflow-y: auto; background: var(--lm-d-surface); border: 1px solid var(--lm-d-border); border-radius: 12px; box-shadow: 0 10px 30px var(--lm-d-sheet-shadow); }
.rp-found-i { display: grid; gap: 2px; padding: 10px 14px; border-block-end: 1px solid var(--lm-d-divider); color: var(--lm-d-ink); text-decoration: none; }
.rp-found-i:last-child { border-block-end: 0; }
.rp-found-i:hover { background: var(--lm-d-hover); }
.rp-found-i b { font-size: 14px; }
.rp-found-i span { font-size: 12.5px; color: var(--lm-d-muted); }
.rp-found-none { padding: 14px; font-size: 13px; color: var(--lm-d-muted); text-align: center; }

/* what to do: icon · what + what it needs + who holds it · how many · open them */
.rp-todo { display: flex; flex-direction: column; }
.rp-todo-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 12px 18px; border-block-end: 1px solid var(--lm-d-divider); }
.rp-todo-row:last-child { border-block-end: 0; }
.rp-todo-ico { inline-size: 40px; block-size: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--lm-d-quiet-bg); color: var(--lm-d-muted); }
.rp-todo-ico svg { inline-size: 20px; block-size: 20px; }
.rp-todo-ico.is-danger { background: var(--lm-d-danger-soft); color: var(--lm-d-danger); }
.rp-todo-ico.is-warn { background: var(--lm-d-warn-soft); color: var(--lm-d-warn); }
.rp-todo-ico.is-info { background: var(--lm-d-info-soft); color: var(--lm-d-info); }
.rp-todo-ico.is-ok { background: var(--lm-d-ok-soft); color: var(--lm-d-ok); }
.rp-todo-ico.is-accent { background: var(--lm-d-accent-soft); color: var(--lm-d-accent-ink); }
.rp-todo-main { min-inline-size: 0; }
.rp-todo-t { font-size: 15px; font-weight: 700; color: var(--lm-d-ink); }
.rp-todo-s { margin-block-start: 3px; font-size: 13px; color: var(--lm-d-muted); }
.rp-todo-s b { color: var(--lm-d-ink); font-weight: 600; }
.rp-todo-who { white-space: nowrap; color: var(--lm-d-ink); }
.rp-todo-who + .rp-todo-who::before { content: '·'; margin-inline: 6px; color: var(--lm-d-muted); }
.rp-todo-n { font-size: 24px; font-weight: 700; min-inline-size: 64px; text-align: end; }
.rp-todo-n.is-quiet { color: var(--lm-d-muted); }
.rp-todo-clear { display: flex; align-items: center; gap: 8px; padding: 10px 18px; background: var(--lm-d-ok-soft); color: var(--lm-d-ink); font-size: 13.5px; }
.rp-todo-clear .rp-ic { color: var(--lm-d-ok); }
[dir='ltr'] .rp-flip { transform: scaleX(-1); }

/* «الأداء»: tables that are read, not clicked; the comparison as tiles */
.rp-after { margin-block-start: 0; }
.rp .rp-table--static tbody tr { cursor: default; }
.rp-link { color: var(--lm-d-ink); text-decoration: none; }
.rp-link:hover { color: var(--lm-d-info); text-decoration: underline; }
.rp-inline-bar { display: inline-flex; align-items: center; gap: 10px; }
.rp-inline-bar .rp-bar-track { display: inline-block; inline-size: 120px; }
.rp-inline-bar .rp-bar-fill { display: block; }
.rp-cmp { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; padding: 14px 18px; }
.rp-cmp > div { display: grid; gap: 2px; border: 1px solid var(--lm-d-border); border-radius: 12px; padding: 12px 14px; min-inline-size: 0; }
.rp-cmp span { font-size: 13px; color: var(--lm-d-muted); }
.rp-cmp b { font-size: 24px; font-weight: 700; }
.rp-cmp small { font-size: 12.5px; color: var(--lm-d-muted); }
.rp-skel { block-size: 220px; margin: 14px 18px; border-radius: 12px; background: var(--lm-d-quiet-bg); }

/* the detailed analytics, folded */
.rp-more { background: var(--lm-d-surface); border: 1px solid var(--lm-d-border); border-radius: 16px; box-shadow: 0 1px 2px var(--lm-d-shadow); }
.rp-more > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 18px; cursor: pointer; font-size: 16px; font-weight: 700; color: var(--lm-d-ink); }
.rp-more > summary::-webkit-details-marker { display: none; }
.rp-more > summary small { font-size: 13px; font-weight: 500; color: var(--lm-d-muted); }
.rp-more-chev { margin-inline-start: auto; color: var(--lm-d-muted); transition: transform .15s ease; }
.rp-more[open] .rp-more-chev { transform: rotate(180deg); }
.rp-more-b { padding: 0 18px 18px; border-block-start: 1px solid var(--lm-d-divider); }

@media (max-width: 1023.98px) {
    .rp-cmp { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .rp-page .fi-header-actions-ctn { flex-wrap: wrap; }
}
@media (max-width: 640px) {
    .rp-todo-row { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; padding: 12px 14px; }
    .rp-todo-row > .rp-btn { grid-column: 2 / -1; justify-self: start; }
    .rp-todo-n { font-size: 22px; min-inline-size: 0; }
    .rp-find { inline-size: 100%; }
    .rp-owner { inline-size: 100%; }
    .rp-owner select { flex: 1; }
    .rp-cmp { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rp-inline-bar .rp-bar-track { inline-size: 80px; }
}
