/* ─────────────────────────────────────────────────────────────────────
   HOMEi «مراجعة الهوية» — the numbers that several contacts share
   (IDR-1, HO-3511; mockup v1 approved by the Project Owner 11/10/2026 —
   «موافق على التلاتة، نفّذ» — on the house design system v1).

   The design system's starter sheet with the prefix `idr` (§1–16) and the
   screen's own bits from the approved mockup (§17): the contact cards with
   the main marked, the three-way decision, and the compare modal.

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

   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(.idr-page) { background: var(--lm-d-page); }
body:has(.idr-page) .fi-main-ctn { background: transparent; }
.idr-page .fi-header-heading { font-size: 28px; font-weight: 700; line-height: 1.25; color: var(--lm-d-ink); }
.idr-page .fi-header-subheading { margin-block-start: 4px; font-size: 14px; color: var(--lm-d-muted); }

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

/* the page's header actions (Filament): outline buttons, the main decision is the orange */
.idr-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;
}
.idr-page .fi-header-actions-ctn .fi-btn .fi-icon { color: currentColor; }
.idr-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); }
.idr-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) ── */
.idr .is-ink { color: var(--lm-d-ink); }
.idr .is-muted { color: var(--lm-d-muted); }
.idr .is-ok { color: var(--lm-d-ok); }
.idr .is-warn { color: var(--lm-d-warn); }
.idr .is-danger { color: var(--lm-d-danger); }
.idr .is-accent { color: var(--lm-d-accent-ink); }
.idr .is-info { color: var(--lm-d-info); }

/* ── 3. the numbers strip (KPI row): label · big figure · one line under it ── */
.idr-strip {
    display: grid;
    grid-template-columns: repeat(var(--idr-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);
}
.idr-strip-c { padding: 12px 18px; border-inline-start: 1px solid var(--lm-d-divider); min-inline-size: 0; }
.idr-strip-c:first-child { border-inline-start: 0; }
a.idr-strip-c, button.idr-strip-c { color: inherit; text-decoration: none; background: none; border-block: 0; border-inline-end: 0; text-align: start; font: inherit; cursor: pointer; }
a.idr-strip-c:hover, button.idr-strip-c:hover { background: var(--lm-d-hover); }
.idr-k-l { font-size: 13px; color: var(--lm-d-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.idr-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; }
.idr-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) ── */
.idr-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;
}
.idr-card--plain { border-block-start-width: 1px; border-block-start-color: var(--lm-d-border); }
.idr-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);
}
.idr-card-t { font-size: 20px; font-weight: 700; margin: 0; }
.idr-card-t span { font-size: 14px; font-weight: 500; color: var(--lm-d-muted); }
.idr-card-b { padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; }

/* ── 5. view pills (the page's views / tabs): navy when on ── */
.idr-pills { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.idr-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;
}
.idr-pill:hover { border-color: var(--lm-d-control-edge); }
.idr-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); }
.idr-pill-n { font-variant-numeric: tabular-nums; }
.idr-dot { inline-size: 7px; block-size: 7px; border-radius: 50%; background: var(--lm-d-info); flex: none; }
.idr-dot.is-accent { background: var(--lm-d-accent); }
.idr-dot.is-ok { background: var(--lm-d-ok); }
.idr-dot.is-danger { background: var(--lm-d-danger); }
.idr-pill.is-on .idr-dot { background: var(--lm-d-accent); }

/* ── 6. status chips with counts (filters on the list's toolbar row) ── */
.idr-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.idr-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;
}
.idr-chip b { color: var(--lm-d-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.idr-chip:hover { background: var(--lm-d-chip-bg); }
.idr-chip.is-on { background: var(--lm-d-info-soft); border-color: var(--lm-d-info-soft); color: var(--lm-d-info); }
.idr-chip.is-on b { color: var(--lm-d-info); }

/* ── 7. toolbar: search (the panel-wide dictation mic attaches itself) + a small segmented toggle ── */
.idr-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 18px; border-block-end: 1px solid var(--lm-d-divider); }
.idr-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); }
.idr-search .idr-ic { inline-size: 16px; block-size: 16px; flex: none; }
.idr-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; }
.idr-search input::placeholder { color: var(--lm-d-muted); }
.idr-search:focus-within { border-color: var(--lm-d-accent); box-shadow: 0 0 0 3px var(--lm-d-accent-soft); }
.idr-seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--lm-d-border); border-radius: 10px; background: var(--lm-d-surface); }
.idr-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; }
.idr-seg button:hover { color: var(--lm-d-ink); }
.idr-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) ── */
.idr-split { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
.idr-split.has-open { grid-template-columns: minmax(0, 1fr) 360px; }
.idr-split:not(.has-open) .idr-panel { display: none; }
.idr-list { min-inline-size: 0; }
.idr-split.has-open .idr-list { border-inline-end: 1px solid var(--lm-d-divider); }

/* a Filament table flattened into the card */
:is(.idr-list, .idr-doc-main) .fi-ta-ctn { border: 0; border-radius: 0; box-shadow: none; background: transparent; }
:is(.idr-list, .idr-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(.idr-list, .idr-doc-main) .fi-ta-header-ctn > * { border: 0; }
:is(.idr-list, .idr-doc-main) .fi-ta-header { padding: 10px 0; flex: 1 1 auto; min-inline-size: 0; }
:is(.idr-list, .idr-doc-main) .fi-ta-header-toolbar { padding: 8px 0; flex: 0 0 auto; border: 0; }
:is(.idr-list, .idr-doc-main) .fi-ta-search-field { max-inline-size: 260px; }
:is(.idr-list, .idr-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(.idr-list, .idr-doc-main) .fi-ta-cell { padding-inline: 8px; color: var(--lm-d-ink); }
:is(.idr-list, .idr-doc-main) .fi-ta-row:hover > td { background: var(--lm-d-hover); }
.idr-list .fi-ta-row { cursor: pointer; }
.idr-list .fi-ta-row.idr-row-open > td { background: var(--lm-d-row-hl); }
.idr-list .fi-ta-row.idr-row-open > td:first-child { box-shadow: inset -3px 0 0 var(--lm-d-accent); }
[dir='ltr'] .idr-list .fi-ta-row.idr-row-open > td:first-child { box-shadow: inset 3px 0 0 var(--lm-d-accent); }
:is(.idr-list, .idr-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) */
.idr-table { inline-size: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.idr-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; }
.idr-table td { padding: 10px 12px; border-block-end: 1px solid var(--lm-d-divider); color: var(--lm-d-ink); vertical-align: middle; }
.idr-table tbody tr { cursor: pointer; }
.idr-table tbody tr:hover > td { background: var(--lm-d-hover); }
.idr-table tbody tr.is-open > td { background: var(--lm-d-row-hl); }
.idr-table tbody tr.is-open > td:first-child { box-shadow: inset -3px 0 0 var(--lm-d-accent); }
[dir='ltr'] .idr-table tbody tr.is-open > td:first-child { box-shadow: inset 3px 0 0 var(--lm-d-accent); }
.idr-table td.is-name { font-weight: 700; }
.idr-table tfoot td { background: var(--lm-d-info-soft); font-weight: 700; border: 0; }
.idr-dim { color: var(--lm-d-muted); font-size: 12.5px; }

/* ── 9. the panel (the opened item): head · own scroll · buttons pinned at the foot ── */
.idr-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; }
.idr-p { display: flex; flex-direction: column; min-block-size: 0; flex: 1 1 auto; }
.idr-p-h { padding: 14px 18px 12px; border-block-end: 1px solid var(--lm-d-divider); }
.idr-p-t { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; }
.idr-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; }
.idr-p-s { margin-block-start: 2px; font-size: 13px; color: var(--lm-d-muted); }
.idr-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; }
.idr-p-f { padding: 12px 18px; border-block-start: 1px solid var(--lm-d-divider); display: flex; gap: 8px; }
.idr-p-f > .idr-btn { flex: 1 1 0; justify-content: center; }

/* ── 10. status tag (a dot + a word) ── */
.idr-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; }
.idr-tag::before { content: ''; inline-size: 6px; block-size: 6px; border-radius: 50%; background: currentColor; }
.idr-tag.is-info { background: var(--lm-d-info-soft); color: var(--lm-d-info); }
.idr-tag.is-ok { background: var(--lm-d-ok-soft); color: var(--lm-d-ok); }
.idr-tag.is-warn { background: var(--lm-d-warn-soft); color: var(--lm-d-warn); }
.idr-tag.is-danger { background: var(--lm-d-danger-soft); color: var(--lm-d-danger); }
.idr-tag.is-accent { background: var(--lm-d-accent-soft); color: var(--lm-d-accent-ink); }
.idr-tag.is-quiet { background: var(--lm-d-quiet-bg); color: var(--lm-d-muted); }

/* ── 11. the stages of a record ── */
.idr-steps { display: flex; justify-content: space-between; position: relative; margin: 0; padding: 4px 0 0; list-style: none; }
.idr-steps::before { content: ''; position: absolute; inset-block-start: 12px; inset-inline: 14px; border-block-start: 2px solid var(--lm-d-divider); }
.idr-steps li { position: relative; flex: 1; text-align: center; font-size: 12px; color: var(--lm-d-muted); }
.idr-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); }
.idr-steps li.is-done i { background: var(--lm-d-ok); border-color: var(--lm-d-ok); }
.idr-steps li.is-now { color: var(--lm-d-ink); font-weight: 700; }
.idr-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); }
.idr-steps li.is-stop { color: var(--lm-d-danger); font-weight: 700; }
.idr-steps li.is-stop i { background: var(--lm-d-danger); border-color: var(--lm-d-danger); }

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

/* ── 13. buttons: one orange primary per area, the rest outline ── */
.idr-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;
}
.idr-btn:hover { background: var(--lm-d-hover); }
.idr-btn.is-primary { background: var(--lm-d-accent); border-color: var(--lm-d-accent); color: var(--lm-d-on-accent); }
.idr-btn.is-primary:hover { filter: brightness(0.96); }
.idr-btn.is-danger { color: var(--lm-d-danger); border-color: var(--lm-d-gap-edge); }
.idr-btn.is-sm { min-block-size: 36px; padding-inline: 14px; font-size: 13.5px; }
.idr-btn.is-icon { inline-size: 42px; padding: 0; justify-content: center; }
.idr-btn:disabled { opacity: .6; cursor: default; }
.idr-btn-ico, .idr-ic { inline-size: 18px; block-size: 18px; flex: none; }

/* ── 14. empty state ── */
.idr-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; }
.idr-empty b { color: var(--lm-d-ink); font-size: 15px; }
.idr-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 ── */
.idr-doc-page .fi-page-content { gap: 16px; }
.idr-doc-page .fi-section { border-radius: 16px; box-shadow: 0 1px 2px var(--lm-d-shadow); }
.idr-doc-page .fi-section-header-heading { color: var(--lm-d-ink); font-weight: 700; }
.idr-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);
}
.idr-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; }
.idr-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; }
.idr-doc-main .fi-tabs .fi-tabs-item .fi-tabs-item-label { color: inherit; }
.idr-doc-main .fi-tabs .fi-tabs-item .fi-icon { color: var(--lm-d-muted); }
.idr-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); }
.idr-doc-main .fi-tabs .fi-tabs-item.fi-active :is(.fi-tabs-item-label, .fi-icon) { color: var(--lm-d-tab-on-ink); }
.idr-doc-main .fi-sc-tabs-tab { padding: 16px; }
.idr-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) {
    .idr-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .idr-strip-c:nth-child(3n + 1) { border-inline-start: 0; }
    .idr-strip-c:nth-child(n + 4) { border-block-start: 1px solid var(--lm-d-divider); }
    .idr-split, .idr-split.has-open { grid-template-columns: minmax(0, 1fr); }
    .idr-split.has-open .idr-list { border-inline-end: 0; }
    .idr-panel { display: none; }
    .idr-split.has-open .idr-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 */
    .idr-split.has-open.is-auto .idr-panel { display: none; }
    .idr-split.is-auto .idr-table tbody tr.is-open > td { background: transparent; box-shadow: none; }
    .idr-card-h { align-items: stretch; }
    .idr-pills, .idr-doc-main .fi-tabs { flex-wrap: nowrap; overflow-x: auto; padding-block-end: 2px; scrollbar-width: none; }
    .idr-page .fi-header-heading { font-size: 22px; }
}
@media (max-width: 640px) {
    .idr-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .idr-strip-c:nth-child(n) { border-inline-start: 0; border-block-start: 1px solid var(--lm-d-divider); }
    .idr-strip-c:nth-child(-n + 2) { border-block-start: 0; }
    .idr-strip-c:nth-child(2n) { border-inline-start: 1px solid var(--lm-d-divider); }
    .idr-k-v { font-size: 22px; }
    .idr-search { inline-size: 100%; margin-inline-start: 0; block-size: 44px; }
    .idr-money { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* touch: every control at least 44px tall on a phone */
    .idr-pill, .idr-chip, .idr-btn, .idr-seg button, .idr-p-x { min-block-size: 44px; }
    .idr-p-x { inline-size: 44px; }
    .idr-table thead { display: none; }
    .idr-table, .idr-table tbody, .idr-table tr, .idr-table td { display: block; inline-size: 100%; }
    .idr-table tbody tr { padding: 10px 12px; border-block-end: 1px solid var(--lm-d-divider); }
    .idr-table td { padding: 2px 0; border: 0; }
    .idr-table td[data-label]::before { content: attr(data-label) ' · '; color: var(--lm-d-muted); font-size: 12.5px; }
}


/* ── 17. the screen's own bits (approved mockup v1) ── */
.idr-page bdi { white-space: nowrap; }
.idr-phone { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
/* the people on one number, one per line, each with its standing */
.idr-who { display: flex; flex-direction: column; gap: 2px; }
.idr-who > span { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.idr-out { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
/* a contact card in the panel; the main one carries the orange edge */
.idr-c { border: 1px solid var(--lm-d-border); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; background: var(--lm-d-surface); }
.idr-c.is-main { border-color: var(--lm-d-accent); border-inline-start-width: 4px; }
.idr-c-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.idr-c-n { font-weight: 700; color: var(--lm-d-ink); }
.idr-c-m { font-size: 12px; color: var(--lm-d-muted); line-height: 1.6; }
.idr-c-l { font-size: 13px; color: var(--lm-d-ink); line-height: 1.5; }
.idr-c-l.is-empty { color: var(--lm-d-muted); }
.idr-c-l b { color: var(--lm-d-ink); }
.idr-pick { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--lm-d-muted); cursor: pointer; white-space: nowrap; }
.idr-pick input { accent-color: var(--lm-d-accent); }
/* the three-way decision */
.idr-choice { display: flex; flex-direction: column; gap: 6px; }
.idr-opt { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--lm-d-control-edge); border-radius: 10px; padding: 6px 10px; cursor: pointer; }
.idr-opt.is-on { border-color: var(--lm-d-accent); background: var(--lm-d-accent-soft); }
.idr-opt input { margin-block-start: 4px; accent-color: var(--lm-d-accent); }
.idr-opt b { color: var(--lm-d-ink); font-size: 13px; }
.idr-opt small { display: block; color: var(--lm-d-muted); font-size: 12px; }
.idr-reasons { display: flex; flex-wrap: wrap; gap: 6px; margin-block-start: 6px; }
.idr-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--lm-d-muted); }
.idr-field textarea { font: inherit; font-size: 13px; color: var(--lm-d-ink); background: var(--lm-d-surface); border: 1px solid var(--lm-d-control-edge); border-radius: 10px; padding: 6px 10px; min-block-size: 36px; resize: vertical; }
.idr-field textarea:focus { outline: 0; border-color: var(--lm-d-accent); box-shadow: 0 0 0 3px var(--lm-d-accent-soft); }
/* the compare modal: one column per contact, rows that differ are marked */
.idr-modal-bg { position: fixed; inset: 0; background: color-mix(in srgb, var(--lm-d-ink) 45%, transparent); display: none; align-items: center; justify-content: center; z-index: 80; padding: 16px; }
.idr-modal-bg.is-open { display: flex; }
.idr-modal { background: var(--lm-d-surface); border: 1px solid var(--lm-d-border); border-radius: 16px; inline-size: min(1120px, 100%); max-block-size: calc(100dvh - 32px); display: flex; flex-direction: column; overflow: hidden; color: var(--lm-d-ink); }
.idr-modal :focus-visible { outline: 2px solid var(--lm-d-info); outline-offset: 2px; }
.idr-modal-h { padding: 14px 18px; border-block-end: 1px solid var(--lm-d-divider); display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.idr-modal-h h3 { margin: 0; font-size: 18px; color: var(--lm-d-ink); }
.idr-grow { flex: 1 1 auto; }
.idr-modal-b { overflow: auto; padding: 12px 18px; }
.idr-modal-f { padding: 12px 18px; border-block-start: 1px solid var(--lm-d-divider); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.idr-cmp { inline-size: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.idr-cmp th, .idr-cmp td { padding: 7px 10px; border-block-end: 1px solid var(--lm-d-divider); text-align: start; vertical-align: top; }
.idr-cmp thead th { color: var(--lm-d-ink); font-weight: 700; background: var(--lm-d-page); }
.idr-cmp tbody th { color: var(--lm-d-muted); font-weight: 500; white-space: nowrap; }
.idr-cmp td { color: var(--lm-d-ink); }
.idr-cmp tr.is-diff td { background: var(--lm-d-warn-soft); }
.idr-cmp tr.is-same td { color: var(--lm-d-muted); }
.idr-cmp thead th.is-main { box-shadow: inset 0 3px 0 var(--lm-d-accent); }
.idr-cmp td.is-main { font-weight: 600; }
.idr-cmp select { font: inherit; font-size: 13px; color: var(--lm-d-ink); background: var(--lm-d-surface); border: 1px solid var(--lm-d-control-edge); border-radius: 8px; padding: 4px 8px; }
.idr-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--lm-d-muted); margin-block-end: 8px; }
.idr-legend i { display: inline-block; inline-size: 12px; block-size: 12px; border-radius: 3px; vertical-align: -2px; margin-inline-end: 4px; background: var(--lm-d-warn-soft); border: 1px solid var(--lm-d-warn); }
/* ── 18. «صحّح القرار» (IDR-2B, mockup v2): the decision in force, the form, the history ── */
.idr-was { border: 1px dashed var(--lm-d-control-edge); border-radius: 10px; padding: 8px 10px; font-size: 13px; color: var(--lm-d-muted); line-height: 1.6; }
.idr-was b { color: var(--lm-d-ink); }
.idr-req { color: var(--lm-d-danger); }
.idr-mini { display: flex; flex-direction: column; gap: 6px; }
.idr-mini label { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--lm-d-border); border-radius: 10px; padding: 6px 10px; font-size: 13px; color: var(--lm-d-ink); cursor: pointer; }
.idr-mini label.is-main { border-color: var(--lm-d-accent); border-inline-start-width: 4px; }
.idr-mini input { accent-color: var(--lm-d-accent); }
.idr-hist { display: flex; flex-direction: column; gap: 8px; }
.idr-h { border: 1px solid var(--lm-d-border); border-radius: 12px; padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; }
.idr-h.is-now { border-color: var(--lm-d-ok); border-inline-start-width: 4px; }
.idr-h.is-old { background: var(--lm-d-page); }
.idr-h.is-old .idr-h-d { text-decoration: line-through; color: var(--lm-d-muted); }
.idr-h-t { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--lm-d-muted); }
.idr-h-d { font-size: 13px; color: var(--lm-d-ink); font-weight: 600; }
.idr-h-n { font-size: 12px; color: var(--lm-d-muted); }
.idr-p-b > .idr-btn.is-sm { align-self: flex-start; }

@media (max-width: 640px) {
    .idr-modal-bg { padding: 0; align-items: flex-end; }
    .idr-modal { border-radius: 18px 18px 0 0; max-block-size: 92dvh; }
    .idr-opt, .idr-cmp select, .idr-mini label { min-block-size: 44px; }
}
