/* css/client-intake-link.css — Client Intake Link: the step-6 row, the
   composer / submissions / review modals, status chips, and the provenance
   tint for fields filled from a client's form.

   Modals reuse the Call Hub chrome (.ch-modal-overlay / .ch-modal from
   css/call-hub.css, eagerly linked and globally scoped) — the
   reminders-call-modal precedent. Only the .cil-* additions live here.
   No @keyframes (animations.css owns those). */

/* ── Step-6 row ────────────────────────────────────────────────── */
.client-intake-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 10px 0 14px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-input);
    color: var(--text);
    font-size: 13px;
}
.client-intake-row[hidden] { display: none; }
.cil-row-icon { font-size: 18px; line-height: 1; }
.cil-row-text { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cil-row-text strong { font-size: 13px; }
.cil-status { color: var(--text-secondary); font-size: 12px; }
.cil-status.is-ready { color: var(--text); font-weight: 600; }
.cil-row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }

/* ── Status chips ──────────────────────────────────────────────── */
.cil-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
    white-space: nowrap;
}
.cil-chip-live { border-color: rgba(10, 132, 255, 0.45); color: var(--apple-blue); }
.cil-chip-submitted { border-color: rgba(255, 149, 0, 0.55); color: #B25E00; background: rgba(255, 149, 0, 0.10); }
.cil-chip-applied { border-color: rgba(52, 199, 89, 0.5); color: #1E7B3A; background: rgba(52, 199, 89, 0.10); }
.cil-chip-dead { color: var(--text-secondary); opacity: 0.85; }
.cil-chip-warn { border-color: rgba(255, 59, 48, 0.5); color: #C62828; background: rgba(255, 59, 48, 0.08); }
body.dark-mode .cil-chip-submitted { color: #FFB84D; background: rgba(255, 159, 10, 0.14); }
body.dark-mode .cil-chip-applied { color: #5AD67A; background: rgba(50, 215, 75, 0.14); }
body.dark-mode .cil-chip-warn { color: #FF7B72; background: rgba(255, 69, 58, 0.14); }

/* ── Modals (composer / submissions / review) ──────────────────── */
.cil-modal { gap: 12px; }
.cil-modal p { margin: 0; }
.cil-modal .ch-modal-hint { line-height: 1.45; }
.cil-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.cil-fields .cil-field-wide { grid-column: 1 / -1; }
.cil-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-secondary); }
.cil-field input, .cil-field select {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
}
.cil-summary { font-size: 13px; color: var(--text); font-weight: 600; }
.cil-summary-sub { font-size: 12px; color: var(--text-secondary); }
.cil-groups {
    list-style: none;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-input);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    max-height: 240px;
    overflow-y: auto;
}
.cil-groups li label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; }
.cil-muted { color: var(--text-secondary); font-size: 12px; }
.cil-error {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 59, 48, 0.45);
    background: rgba(255, 59, 48, 0.08);
    color: #C62828;
    font-size: 13px;
}
.cil-error[hidden] { display: none; }
body.dark-mode .cil-error { color: #FF7B72; background: rgba(255, 69, 58, 0.14); }
.cil-note { font-size: 12px; color: var(--text-secondary); line-height: 1.45; }

/* Submissions table */
.cil-table-wrap { overflow-x: auto; }
.cil-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cil-table th, .cil-table td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.cil-table th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-secondary); font-weight: 700; }
.cil-table td.cil-actions { white-space: nowrap; }
.cil-table td.cil-actions .ch-btn { margin-right: 4px; }
.cil-table .cil-client { font-weight: 600; color: var(--text); }
.cil-table .cil-sub { display: block; font-size: 11px; color: var(--text-secondary); }
.cil-empty { padding: 18px 8px; text-align: center; color: var(--text-secondary); font-size: 13px; }

/* Review (apply) table */
.cil-review { max-height: 46vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.cil-review .cil-table th { position: sticky; top: 0; background: #ffffff; z-index: 1; }
body.dark-mode .cil-review .cil-table th { background: #1c1c1e; }
.cil-review tr.is-conflict td { background: rgba(255, 149, 0, 0.08); }
body.dark-mode .cil-review tr.is-conflict td { background: rgba(255, 159, 10, 0.12); }
.cil-review .cil-current { color: var(--text-secondary); }
.cil-review .cil-incoming { color: var(--text); font-weight: 600; }
.cil-review .cil-accept { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text); white-space: nowrap; }
.cil-review tr.is-rejected td { color: var(--text-secondary); text-decoration: line-through; }

/* ── Provenance tint: filled from the client's own form ───────────
   A THIRD claim beside the green scan glow and the indigo HawkSoft tint in
   css/components-inputs.css: teal means "the client said this". Same two
   constraints as the HawkSoft rule — class AND attribute so it out-specifies
   the green rule, and a colour that is not the blue focus ring. */
input.auto-filled[data-auto-filled-source="client-form"],
select.auto-filled[data-auto-filled-source="client-form"],
textarea.auto-filled[data-auto-filled-source="client-form"] {
    border-color: rgba(48, 176, 199, 0.6);
    border-left-color: #30B0C7;
    box-shadow: 0 0 0 2px rgba(48, 176, 199, 0.2), 0 0 16px rgba(48, 176, 199, 0.28);
}
input.auto-filled[data-auto-filled-source="client-form"]:focus,
select.auto-filled[data-auto-filled-source="client-form"]:focus,
textarea.auto-filled[data-auto-filled-source="client-form"]:focus {
    border-color: rgba(48, 176, 199, 0.85);
    border-left-color: #30B0C7;
    box-shadow: 0 0 0 2px rgba(48, 176, 199, 0.24), 0 0 18px rgba(48, 176, 199, 0.4), 0 2px 8px rgba(0, 0, 0, 0.08);
}
body.dark-mode input.auto-filled[data-auto-filled-source="client-form"],
body.dark-mode select.auto-filled[data-auto-filled-source="client-form"],
body.dark-mode textarea.auto-filled[data-auto-filled-source="client-form"] {
    border-color: rgba(100, 210, 255, 0.55);
    border-left-color: #64D2FF;
    box-shadow: 0 0 0 2px rgba(100, 210, 255, 0.18), 0 0 16px rgba(100, 210, 255, 0.24);
}

@media (max-width: 640px) {
    .cil-fields, .cil-groups { grid-template-columns: 1fr; }
    .cil-row-actions { margin-left: 0; width: 100%; }
}
