/* ─────────────────────────────────────────────────────────────────────
   HOMEi «شركات الإنشاءات» on the house design system (CO-DS-1, mockups
   approved by Kamal 30-9-2026):
     the list (.co-list-page) · the company file: create and edit
     (.co-form-page), for a dashboard company and for one that registered
     itself from the contractor app.

   Prefix `co`. Colours: the house tokens (--lm-d-* in tokens.css, with
   their dark mirror) — no colour literal here, the ratchet holds this
   sheet at zero. Text never under 12px. Logical properties only (RTL/LTR).

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

/* ── 1. the page head (Filament) ── */
body .co-page .fi-header-heading { font-size: 28px; font-weight: 700; line-height: 1.25; color: var(--lm-d-ink); display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
body .co-page .fi-header-subheading { margin-block-start: 4px; font-size: 14px; color: var(--lm-d-muted); }
body .co-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;
}
body .co-page .fi-header-actions-ctn .fi-btn .fi-icon { color: currentColor; }
body .co-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); }
body .co-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); }

.co { display: flex; flex-direction: column; gap: 14px; color: var(--lm-d-ink); }
.co :focus-visible { outline: 2px solid var(--lm-d-info); outline-offset: 2px; }
.co-num, .co .co-num { font-variant-numeric: tabular-nums; }
.co bdi { unicode-bidi: isolate; }
.co-ic { inline-size: 18px; block-size: 18px; flex: none; }
.co-dim { color: var(--lm-d-muted); font-size: 12.5px; }

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

/* ── 2. the numbers strip ── */
.co-strip {
    display: grid;
    grid-template-columns: repeat(var(--co-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);
}
.co-strip-c { padding: 12px 18px; border-inline-start: 1px solid var(--lm-d-divider); min-inline-size: 0; }
.co-strip-c:first-child { border-inline-start: 0; }
.co-k-l { font-size: 13px; color: var(--lm-d-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-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; color: var(--lm-d-ink); }
.co-k-v.is-text { font-size: 20px; line-height: 1.6; }
.co-k-s { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--lm-d-muted); }

/* ── 3. the ruled card (the page's main surface) ── */
.co-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;
    min-inline-size: 0;
}
.co-card.is-plain { border-block-start-width: 1px; border-block-start-color: var(--lm-d-border); }
.co-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); }
.co-card-t { font-size: 20px; font-weight: 700; margin: 0; color: var(--lm-d-ink); display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.co-card-t span { font-size: 14px; font-weight: 500; color: var(--lm-d-muted); }
.co-card-b { padding: 14px 18px; display: flex; flex-direction: column; gap: 14px; }

/* ── 4. view pills (navy when on) and tabs inside a card ── */
.co-pills { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.co-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;
    text-decoration: none;
    cursor: pointer;
}
.co-pill .co-ic { inline-size: 16px; block-size: 16px; color: var(--lm-d-muted); }
.co-pill b { font-size: 12.5px; font-weight: 700; color: var(--lm-d-muted); background: var(--lm-d-chip-bg); border-radius: 999px; padding-inline: 7px; line-height: 20px; font-variant-numeric: tabular-nums; }
.co-pill:hover { background: var(--lm-d-hover); }
.co-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); }
.co-pill.is-on .co-ic { color: var(--lm-d-tab-on-ink); }
.co-pill.is-on b { background: transparent; color: var(--lm-d-tab-on-count); }

/* ── 5. status chips with counts ── */
.co-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.co-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;
    text-decoration: none;
}
.co-chip b { color: var(--lm-d-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.co-chip .co-ic { inline-size: 14px; block-size: 14px; }
.co-chip:hover { background: var(--lm-d-chip-bg); }
.co-chip.is-on { background: var(--lm-d-info-soft); border-color: var(--lm-d-info-soft); color: var(--lm-d-info); }
.co-chip.is-on b { color: var(--lm-d-info); }

/* ── 6. segmented switch ── */
.co-seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--lm-d-border); border-radius: 10px; background: var(--lm-d-surface); flex: none; }
.co-seg button { block-size: 32px; 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; white-space: nowrap; }
.co-seg button:hover { color: var(--lm-d-ink); }
.co-seg button.is-on { background: var(--lm-d-chip-bg); color: var(--lm-d-ink); font-weight: 700; }
.co-seg button .co-ic { inline-size: 16px; block-size: 16px; }

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

/* a Filament table flattened into the card */
body .co-list .fi-ta-ctn { border: 0; border-radius: 0; box-shadow: none; background: transparent; }
body .co-list .fi-ta-header-ctn { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding-inline: 18px; border-block-end: 1px solid var(--lm-d-divider); }
body .co-list .fi-ta-header-ctn > * { border: 0; }
body .co-list .fi-ta-header { padding: 10px 0; flex: 1 1 auto; min-inline-size: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
body .co-list .fi-ta-header-toolbar { padding: 8px 0; flex: 0 1 auto; border: 0; margin-inline-start: auto; }
body .co-list .fi-ta-search-field { inline-size: min(320px, 100%); }
body .co-list .fi-ta-search-field .fi-input-wrp { border-radius: 10px; box-shadow: inset 0 0 0 1px var(--lm-d-control-edge); background: var(--lm-d-surface); }
body .co-list .fi-ta-header-cell { background: var(--lm-d-surface); color: var(--lm-d-ink); font-size: 13.5px; font-weight: 700; padding-inline: 12px; white-space: nowrap; }
body .co-list .fi-ta-header-cell .fi-ta-header-cell-label { color: var(--lm-d-ink); }
body .co-list .fi-ta-cell { padding-inline: 12px; color: var(--lm-d-ink); }
body .co-list .fi-ta-cell .fi-ta-text-item { color: var(--lm-d-ink); }
body .co-list .fi-ta-row > td { border-block-end: 1px solid var(--lm-d-divider); }
body .co-list .fi-ta-row:hover > td { background: var(--lm-d-hover); }
body .co-list .fi-ta-row { cursor: pointer; }
body .co-list .fi-ta-row.co-row-open > td { background: var(--lm-d-row-hl); }
body .co-list .fi-ta-row.co-row-open > td:first-child { box-shadow: inset -3px 0 0 var(--lm-d-accent); }
[dir='ltr'] body .co-list .fi-ta-row.co-row-open > td:first-child { box-shadow: inset 3px 0 0 var(--lm-d-accent); }
body .co-list .fi-ta-actions { gap: 6px; }
body .co-list .fi-ta-actions .fi-icon-btn { inline-size: 34px; block-size: 34px; border-radius: 9px; box-shadow: inset 0 0 0 1px var(--lm-d-border); background: var(--lm-d-surface); color: var(--lm-d-muted); }
body .co-list .fi-ta-actions .fi-icon-btn.fi-color-danger { color: var(--lm-d-danger); box-shadow: inset 0 0 0 1px var(--lm-d-gap-edge); }
body .co-list .fi-ta-actions .fi-icon-btn:hover { background: var(--lm-d-hover); color: var(--lm-d-ink); }
body .co-list .fi-pagination { padding-inline: 18px; }
body .co-list .fi-pagination-item.fi-active .fi-pagination-item-btn { color: var(--lm-d-accent-ink); box-shadow: inset 0 0 0 1px var(--lm-d-accent); }

/* ── 8. the panel (the opened item) ── */
.co-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; }
.co-p { display: flex; flex-direction: column; min-block-size: 0; flex: 1 1 auto; }
.co-p-h { padding: 14px 18px 12px; border-block-end: 1px solid var(--lm-d-divider); }
.co-p-t { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; color: var(--lm-d-ink); }
.co-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); cursor: pointer; }
.co-p-x .co-ic { inline-size: 16px; block-size: 16px; }
.co-p-s { margin-block-start: 2px; font-size: 13px; color: var(--lm-d-muted); }
.co-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: 14px; }
.co-p-f { padding: 12px 18px; border-block-start: 1px solid var(--lm-d-divider); display: flex; flex-wrap: wrap; gap: 8px; }
.co-p-f > .co-btn { flex: 1 1 0; justify-content: center; }

/* ── 9. status tag (a dot + a word) ── */
.co-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; line-height: 1.4; }
.co-tag::before { content: ''; inline-size: 6px; block-size: 6px; border-radius: 50%; background: currentColor; flex: none; }
.co-tag.is-info { background: var(--lm-d-info-soft); color: var(--lm-d-info); }
.co-tag.is-ok { background: var(--lm-d-ok-soft); color: var(--lm-d-ok); }
.co-tag.is-warn { background: var(--lm-d-warn-soft); color: var(--lm-d-warn); }
.co-tag.is-danger { background: var(--lm-d-danger-soft); color: var(--lm-d-danger); }
.co-tag.is-accent { background: var(--lm-d-accent-soft); color: var(--lm-d-accent-ink); }
.co-tag.is-quiet { background: var(--lm-d-quiet-bg); color: var(--lm-d-muted); }
body .co-page .fi-header-heading .co-tag { font-size: 13px; min-block-size: 28px; }
.co-mini { display: flex; flex-wrap: wrap; gap: 4px; }
.co-mini .co-tag { min-block-size: 24px; font-size: 12px; padding-inline: 8px; }

/* ── 10. a person in a row / a card ── */
.co-av { display: inline-grid; place-items: center; flex: none; inline-size: 40px; block-size: 40px; border-radius: 10px; font-weight: 700; font-size: 15px; background: var(--lm-d-info-soft); color: var(--lm-d-info); }
.co-av.is-lg { inline-size: 52px; block-size: 52px; border-radius: 14px; font-size: 18px; }
.co-av.is-warn { background: var(--lm-d-warn-soft); color: var(--lm-d-warn); }
.co-av.is-accent { background: var(--lm-d-accent-soft); color: var(--lm-d-accent-ink); }
.co-person { display: flex; align-items: center; gap: 10px; min-inline-size: 0; }
.co-person-t { min-inline-size: 0; display: flex; flex-direction: column; }
.co-person-t b { font-weight: 700; line-height: 1.35; color: var(--lm-d-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-person-t small { font-size: 12.5px; color: var(--lm-d-muted); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }


/* ── 12. figures and lines ── */
.co-sec { font-size: 14px; font-weight: 700; margin-block-end: 6px; color: var(--lm-d-ink); display: flex; align-items: center; gap: 6px; }
.co-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-block-end: 1px solid var(--lm-d-divider); font-size: 13.5px; color: var(--lm-d-ink); }
.co-line:last-child { border-block-end: 0; }
.co-line > span { color: var(--lm-d-muted); }
.co-line b { font-variant-numeric: tabular-nums; text-align: end; }
.co-note { border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.6; border: 1px solid var(--lm-d-divider); display: flex; flex-direction: column; gap: 4px; }
.co-note.is-info { background: var(--lm-d-info-soft); color: var(--lm-d-info); }
.co-note.is-warn { background: var(--lm-d-warn-soft); color: var(--lm-d-warn); }
.co-note.is-danger { background: var(--lm-d-danger-soft); color: var(--lm-d-danger); }
.co-note.is-ok { background: var(--lm-d-ok-soft); color: var(--lm-d-ok); }
.co-note.is-quiet { background: var(--lm-d-hover); color: var(--lm-d-muted); }
.co-note.is-row { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.co-money b { font-size: 15px; font-weight: 700; }
.co-money { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.co-money > div { border: 1px solid var(--lm-d-border); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; min-inline-size: 0; }
.co-money span { font-size: 12px; color: var(--lm-d-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-money b { font-size: 15px; font-weight: 700; color: var(--lm-d-ink); }
.co-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.co-facts > div { border: 1px solid var(--lm-d-border); border-radius: 10px; padding: 8px 10px; min-inline-size: 0; }
.co-facts span { display: block; font-size: 12px; color: var(--lm-d-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-facts b { display: block; font-size: 14px; color: var(--lm-d-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-link { color: var(--lm-d-accent-ink); font-weight: 700; font-size: 13.5px; text-decoration: none; }
.co-link:hover { text-decoration: underline; }

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

/* ── 14. record pages: main card + aside ── */
.co-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.co-aside { display: flex; flex-direction: column; gap: 14px; position: sticky; inset-block-start: 12px; min-inline-size: 0; }
.co-who { display: flex; align-items: center; gap: 12px; }
.co-who b { display: block; font-size: 16px; line-height: 1.3; color: var(--lm-d-ink); }
.co-who small { display: block; font-size: 12.5px; color: var(--lm-d-muted); }

/* ── 15. the company file: the form as one ruled card, sections split by rules, the aside beside it ── */
body .co-form-page .fi-page-content { gap: 16px; }
body .co-form-grid > .fi-sc { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
body .co-form-grid > .fi-sc > .fi-grid-col { grid-column: auto; min-inline-size: 0; }
body .co-form-grid > .fi-sc > .fi-grid-col:last-child { position: sticky; inset-block-start: 12px; }
body .co-form-page .co-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);
    overflow: clip;
}
body .co-form-page .co-main > .fi-sc { gap: 0; }
body .co-form-page .co-main > .fi-sc > .fi-grid-col { padding-inline: 18px; }
body .co-form-page .co-main .fi-section { border: 0; border-radius: 0; box-shadow: none; outline: 0; background: transparent; }
body .co-form-page .co-main > .fi-sc > .fi-grid-col + .fi-grid-col .fi-section { border-block-start: 1px solid var(--lm-d-divider); }
body .co-form-page .co-main .fi-section-header { padding-inline: 0; padding-block: 8px 0; }
body .co-form-page .co-main .fi-section-header-text-ctn { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
body .co-form-page .co-main .fi-section-header-heading { font-size: 16px; font-weight: 700; color: var(--lm-d-ink); }
body .co-form-page .co-main .fi-section-header-description { font-size: 12.5px; color: var(--lm-d-muted); }
body .co-form-page .co-main .fi-section-content-ctn { border: 0; }
body .co-form-page .co-main .fi-section-content { padding-inline: 0; padding-block: 4px 8px; }
body .co-form-page .co-main .fi-section-content > .fi-sc, body .co-form-page .co-main .fi-section-content .fi-sc { gap: 8px 14px; }
body .co-form-page .co-main .fi-fo-field { gap: 4px; }
body .co-form-page .co-main .fi-fo-field-label-content { font-size: 13.5px; font-weight: 700; color: var(--lm-d-ink); }
body .co-form-page .co-main .fi-input-wrp { border-radius: 10px; min-block-size: 40px; box-shadow: inset 0 0 0 1px var(--lm-d-control-edge); background: var(--lm-d-surface); }
body .co-form-page .co-main .fi-input-wrp.fi-disabled { background: var(--lm-d-page); }
body .co-form-page .co-main .fi-fo-field-wrp-helper-text,
body .co-form-page .co-main .fi-sc-text { font-size: 12.5px; color: var(--lm-d-muted); line-height: 1.5; }
body .co-form-page .co-main .fi-toggle.fi-toggle-on { background: var(--lm-d-accent); }
body .co-form-page .co-main .fi-fo-file-upload .filepond--root { border-radius: 10px; }
body .co-form-page .co-main .fi-fo-file-upload .filepond--panel-root { background: var(--lm-d-surface); border: 1.5px dashed var(--lm-d-control-edge); border-radius: 10px; }

/* «النوع»: شركة / فرد — a navy-when-on switch (Filament's inline radio) */
body .co-form-page .co-kind .fi-fo-radio { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; min-block-size: 40px; align-items: center; background: var(--lm-d-surface); box-shadow: inset 0 0 0 1px var(--lm-d-control-edge); inline-size: fit-content; }
body .co-form-page .co-kind .fi-fo-radio-label { position: relative; display: inline-flex; align-items: center; min-block-size: 32px; padding-inline: 20px; border-radius: 8px; color: var(--lm-d-muted); font-weight: 600; cursor: pointer; }
body .co-form-page .co-kind .fi-fo-radio-label .fi-radio-input { position: absolute; opacity: 0; inline-size: 1px; block-size: 1px; }
body .co-form-page .co-kind .fi-fo-radio-label:has(.fi-radio-input:checked) { background: var(--lm-d-tab-on-bg); color: var(--lm-d-tab-on-ink); font-weight: 700; }
body .co-form-page .co-kind .fi-fo-radio-label:has(.fi-radio-input:focus-visible) { outline: 2px solid var(--lm-d-info); outline-offset: 2px; }
body .co-form-page .co-kind .fi-fo-radio-label-text { color: inherit; font-size: 14px; }

/* the repeaters as ruled tables: payment accounts, contact persons */
body .co-form-page .co-main .fi-fo-table-repeater { border: 1px solid var(--lm-d-border); border-radius: 12px; overflow: clip; box-shadow: none; background: var(--lm-d-surface); }
body .co-form-page .co-main .fi-fo-table-repeater > table > thead > tr > th { background: var(--lm-d-surface); color: var(--lm-d-ink); font-size: 13.5px; font-weight: 700; padding: 6px 10px; border-block-end: 1px solid var(--lm-d-border); white-space: nowrap; text-align: start; }
body .co-form-page .co-main .fi-fo-table-repeater > table > tbody > tr > td { padding: 4px 10px; border-block-end: 1px solid var(--lm-d-divider); vertical-align: middle; }
body .co-form-page .co-main .fi-fo-table-repeater > table > tbody > tr:last-child > td { border-block-end: 0; }
body .co-form-page .co-main .fi-fo-table-repeater .fi-input-wrp { min-block-size: 34px; }
body .co-form-page .co-main .fi-fo-table-repeater :is(.fi-input, .fi-select-input) { padding-block: 4px; }
body .co-form-page .co-main .fi-fo-table-repeater-add { padding: 0; }
body .co-form-page .co-main .fi-fo-table-repeater-add .fi-btn { min-block-size: 30px; padding-block: 2px; }
body .co-form-page .co-main .fi-fo-table-repeater .fi-icon-btn { inline-size: 34px; block-size: 34px; border-radius: 9px; box-shadow: inset 0 0 0 1px var(--lm-d-border); background: var(--lm-d-surface); color: var(--lm-d-muted); }
body .co-form-page .co-main .fi-fo-repeater-add .fi-btn,
body .co-form-page .co-main .fi-fo-table-repeater-add .fi-btn,
body .co-form-page .co-main .fi-fo-repeater-add-action-ctn .fi-btn { background: transparent; box-shadow: none; color: var(--lm-d-accent-ink); font-weight: 700; font-size: 13.5px; padding-inline: 4px; }
body .co-form-page .co-main .fi-fo-repeater-add, body .co-form-page .co-main .fi-fo-repeater-add-action-ctn { justify-content: flex-start; }

/* ── 16. the pieces of the company file ── */
.co-docs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.co-doc { display: flex; align-items: center; gap: 10px; border: 1px solid var(--lm-d-border); border-radius: 10px; padding: 5px 10px; min-inline-size: 0; }
.co-doc-ico { inline-size: 30px; block-size: 30px; border-radius: 8px; background: var(--lm-d-info-soft); color: var(--lm-d-info); display: grid; place-items: center; flex: none; }
.co-doc b { display: block; font-size: 14px; color: var(--lm-d-ink); }
.co-doc > .co-btn, .co-doc > .co-dim { margin-inline-start: auto; }
.co-folio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.co-folio > div { border: 1px solid var(--lm-d-border); border-radius: 10px; padding: 5px 12px; min-inline-size: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.co-folio b { display: block; font-size: 14px; color: var(--lm-d-ink); overflow-wrap: anywhere; }
.co-folio small { display: block; font-size: 12.5px; color: var(--lm-d-muted); }
.co-folio p { flex-basis: 100%; margin: 0; font-size: 13px; line-height: 1.6; color: var(--lm-d-muted); }
.co-thumbs { display: flex; flex-wrap: wrap; gap: 4px; margin-inline-start: auto; }
.co-thumbs a, .co-thumbs span { inline-size: 36px; block-size: 28px; border-radius: 8px; background: var(--lm-d-chip-bg); color: var(--lm-d-muted); display: grid; place-items: center; overflow: hidden; font-size: 12.5px; font-weight: 700; text-decoration: none; }
.co-thumbs img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.co-acct { display: flex; align-items: center; gap: 10px; border: 1px solid var(--lm-d-border); border-radius: 10px; padding: 8px 10px; font-size: 13.5px; color: var(--lm-d-ink); min-inline-size: 0; }
.co-acct + .co-acct { margin-block-start: 6px; }
.co-acct-ico { inline-size: 34px; block-size: 34px; border-radius: 9px; background: var(--lm-d-chip-bg); color: var(--lm-d-muted); display: grid; place-items: center; flex: none; }
.co-acct-t { min-inline-size: 0; }
.co-acct-t b { display: block; overflow-wrap: anywhere; }
.co-acct-t small { display: block; font-size: 12.5px; color: var(--lm-d-muted); overflow-wrap: anywhere; }
.co-acct .co-tag { margin-inline-start: auto; }
.co-money.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.co-money.is-3 b { font-size: 17px; }
.co-sec-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--lm-d-ink); }
.co-cell-pay { font-size: 14px; color: var(--lm-d-ink); }
.co-cell-l { display: none; font-size: 12.5px; color: var(--lm-d-muted); }

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

/* ── 18. under 1024px: the page scrolls, the panel becomes a bottom sheet ── */
@media (max-width: 1023.98px) {
    .co-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .co-strip-c:nth-child(3n + 1) { border-inline-start: 0; }
    .co-strip-c:nth-child(n + 4) { border-block-start: 1px solid var(--lm-d-divider); }
    .co-split, .co-split.has-open { grid-template-columns: minmax(0, 1fr); }
    .co-split.has-open .co-list { border-inline-end: 0; }
    .co-panel { display: none; }
    .co-split.has-open .co-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);
    }
    .co-grid { grid-template-columns: minmax(0, 1fr); }
    .co-aside { position: static; }
    body .co-form-page .co-form-grid > .fi-sc { grid-template-columns: minmax(0, 1fr); }
    body .co-form-page .co-form-grid > .fi-sc > .fi-grid-col:last-child { position: static; }
    .co-docs, .co-folio { grid-template-columns: minmax(0, 1fr); }
    .co-card-h { align-items: stretch; }
    .co-pills, .co-chips { flex-wrap: nowrap; overflow-x: auto; padding-block-end: 2px; scrollbar-width: none; }
    body .co-page .fi-header-heading { font-size: 22px; }
}
@media (max-width: 640px) {
    .co-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .co-strip-c:nth-child(n) { border-inline-start: 0; border-block-start: 1px solid var(--lm-d-divider); }
    .co-strip-c:nth-child(-n + 2) { border-block-start: 0; }
    .co-strip-c:nth-child(2n) { border-inline-start: 1px solid var(--lm-d-divider); }
    .co-k-v { font-size: 22px; }
    body .co-list .fi-ta-search-field { inline-size: 100%; }
    .co-pill, .co-chip, .co-btn, .co-seg button, .co-p-x { min-block-size: 44px; }
    .co-p-x { inline-size: 44px; }
    .co-facts { grid-template-columns: minmax(0, 1fr); }
    /* a phone reads each row as a card: one table, one query, the same actions */
    body .co-list .fi-ta-table thead { display: none; }
    body .co-list .fi-ta-table, body .co-list .fi-ta-table tbody, body .co-list .fi-ta-row, body .co-list .fi-ta-row > td { display: block; inline-size: 100%; }
    body .co-list .fi-ta-row { padding: 10px 14px; border-block-end: 1px solid var(--lm-d-divider); }
    body .co-list .fi-ta-row > td { border: 0; padding: 2px 0; }
    body .co-list .fi-ta-row > td:empty { display: none; }
    body .co-list .fi-ta-row > td .fi-ta-col, body .co-list .fi-ta-row > td .fi-ta-text { padding: 0; }
    body .co-list .fi-ta-row > td.fi-ta-actions-cell { padding-block-start: 8px; }
    body .co-list .fi-ta-row > td.fi-ta-actions-cell .fi-ta-actions { justify-content: flex-start; }
    body .co-list .fi-ta-row.co-row-open > td:first-child { box-shadow: none; }
    body .co-list .fi-ta-row.co-row-open { box-shadow: inset -3px 0 0 var(--lm-d-accent); }
    /* the company card: name and status on one line, where it is paid under them */
    body .co-list-page .co-list .fi-ta-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 10px; row-gap: 4px; align-items: center; }
    body .co-list-page .co-list .fi-ta-row > td { inline-size: auto; min-inline-size: 0; }
    body .co-list-page .co-list .fi-ta-row > td.fi-ta-selection-cell { grid-column: 1; grid-row: 1; }
    body .co-list-page .co-list .fi-ta-row > td.fi-ta-cell-name { grid-column: 2; grid-row: 1; }
    body .co-list-page .co-list .fi-ta-row > td.fi-ta-cell-status { grid-column: 3; grid-row: 1; }
    body .co-list-page .co-list .fi-ta-row > td.fi-ta-cell-pay { grid-column: 2 / -1; grid-row: 2; }
    body .co-list-page .co-list .fi-ta-row > td:is(.fi-ta-cell-activity, .fi-ta-cell-contact-phone, .fi-ta-cell-app-account, .fi-ta-cell-updated-at) { display: none; }
    .co-cell-l { display: inline; }
    /* the company file on a phone: every control 44px, the head's buttons share one row */
    body .co-form-page .co-main .fi-input-wrp, body .co-form-page .co-main .fi-fo-table-repeater .fi-input-wrp { min-block-size: 44px; }
    body .co-form-page .co-kind .fi-fo-radio { min-block-size: 44px; }
    body .co-form-page .co-kind .fi-fo-radio-label { min-block-size: 38px; }
    .co-acts > .co-btn, .co-danger > .co-btn { min-block-size: 44px; }
    .co-docs, .co-folio { grid-template-columns: minmax(0, 1fr); }
}

/* ── 19. the company file, tight: acts two a row, delete beside its reason ── */
.co-acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.co-acts > .co-btn { justify-content: center; padding-inline: 8px; min-inline-size: 0; }
.co-acts > .co-btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
.co-danger { display: flex; align-items: center; gap: 10px; padding-block-start: 10px; border-block-start: 1px solid var(--lm-d-divider); }
.co-danger > .co-btn { flex: none; }
body .co-form-page .co-aside { gap: 10px; }
body .co-form-page .co-aside .co-card-b { padding: 12px 14px; gap: 10px; }
body .co-form-page .co-aside .co-line { padding-block: 5px; }
/* the file fits one laptop screen: less air around the head (Kamal 30-9) */
body .co-form-page .fi-page-header-main-ctn { padding-block: 16px; row-gap: 14px; }
body .co-form-page .fi-page-main { row-gap: 14px; }
.co-folio small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── 20. numbers typed left-to-right keep clear of the dictation mic (it sits at the field's end) ── */
:where([dir='rtl']) body .co-form-page .co-main input[dir='ltr'] { padding-inline-start: 24px; }
.co-card-b > .co-btn { justify-content: center; }

/* ── 21. the company file on a tablet / phone ── */
@media (max-width: 1023.98px) {
    /* save stays in reach: pinned above the panel's bottom bar (68px + the safe area) */
    body .co-form-page .co-savebar {
        position: fixed;
        inset-inline: 10px;
        inset-block-end: calc(76px + env(safe-area-inset-bottom, 0px));
        z-index: 40;
        box-shadow: 0 -10px 40px var(--lm-d-sheet-shadow);
        border-radius: 14px;
    }
    body .co-form-page .co-savebar .co-card-b { padding: 8px 10px; }
    body .co-form-page .fi-page-main { padding-block-end: 90px; }
    /* a payment account / a contact person as a two-column card, not a column of full-width rows */
    body .co-form-page .co-main .fi-fo-table-repeater > table > tbody > tr { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; padding-block: 10px; }
    body .co-form-page .co-main .fi-fo-table-repeater > table > tbody > tr > td { padding: 0; border: 0; }
    body .co-form-page .co-main .fi-fo-table-repeater > table > tbody > tr > td > * { inline-size: 100%; }
    body .co-form-page .co-main .fi-fo-table-repeater > table > tbody > tr > td:last-child { align-self: end; }
    /* a phone number, an account number or an e-mail gets the card's full width, never clipped */
    body .co-form-page .co-main .fi-fo-table-repeater > table > tbody > tr > td:has(input[dir='ltr']) { grid-column: 1 / -1; }
    body .co-form-page .co-main .fi-fo-table-repeater > table > tbody > tr + tr { border-block-start: 1px solid var(--lm-d-divider); }
}
