/* Isolated Coach CRM; no overrides of existing page layouts. */
.sidebar .setter-nav { display: none; }
#initial-setter-login { grid-column: 1 / -1; }
body.setter-mode .coach-only { display: block; }
body.setter-mode .athlete-nav,
body.setter-mode .coach-nav,
body.setter-mode .goal-card,
body.setter-mode .access-switch,
body.setter-mode .coach-preview-banner { display: none !important; }
body.setter-mode .sidebar .setter-nav { display: grid; }
body.setter-mode [data-coach-page-view]:not([data-coach-page-view="leads"]) { display: none !important; }
.crm-leads-page { min-width: 0; }
.crm-leads-page [hidden] { display: none !important; }
.crm-leads-page .section-title { margin-bottom: 24px; }
.lead-file-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.lead-file-actions button { min-height: 44px; }
.lead-csv-dialog { width: min(960px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow: auto; padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); }
.lead-csv-dialog::backdrop { background: rgba(15, 34, 33, .6); }
.lead-csv-dialog h3 { margin: 0 0 12px; font-size: 1.2rem; }
.lead-csv-dialog p { color: var(--muted); font-size: .85rem; line-height: 1.5; }
.lead-csv-dialog input[type="file"] { display: block; max-width: 100%; margin: 12px 0; font: inherit; }
.lead-csv-dialog select { display: block; min-height: 40px; margin: 6px 0 14px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); color: var(--ink); font: inherit; }
.lead-csv-summary { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 12px 0; font-weight: 700; }
.lead-csv-table-wrap { max-width: 100%; max-height: 50dvh; overflow: auto; border: 1px solid var(--line); }
.lead-csv-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.lead-csv-table th, .lead-csv-table td { min-width: 100px; padding: 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.lead-csv-table th { position: sticky; top: 0; background: var(--white); z-index: 1; }
.lead-csv-table td:first-child, .lead-csv-table th:first-child { min-width: 72px; }
.lead-csv-table .is-problem { color: #a42d30; }
.lead-csv-table .is-review { color: #76561b; }
.lead-csv-table [data-lead-action="resolve-import-case"] { max-width: 100%; margin-top: 8px; white-space: normal; }
.lead-csv-dialog .lead-form-actions { position: sticky; bottom: -22px; margin: 18px -22px -22px; padding: 12px 22px; background: var(--white); border-top: 1px solid var(--line); }
.crm-leads-page button, .crm-leads-page a { cursor: pointer; }
.crm-leads-page button:disabled { cursor: wait; opacity: .6; }
.crm-leads-page :focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.lead-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.lead-kpi { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--white); padding: 18px; color: inherit; text-align: left; transition: border-color .16s, box-shadow .16s, transform .16s; }
.lead-kpi:hover { border-color: #a9cbbf; box-shadow: 0 7px 18px rgba(26, 107, 90, .08); transform: translateY(-1px); }
.lead-kpi.is-active { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: #f4faf7; }
.lead-kpi span { display: block; color: var(--muted); font-size: .82rem; min-height: 2.4em; }
.lead-kpi strong { display: block; color: var(--ink); font-size: 2rem; line-height: 1.25; margin-top: 5px; }
.lead-today { margin: 0 0 20px; padding: 16px; border: 1px solid #cbded6; border-left: 3px solid var(--brand); border-radius: 8px; background: #f8fbfa; }
.lead-today-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.lead-today-heading h3 { margin: 0; color: var(--ink); font-size: 1rem; }
.lead-today-heading > span { color: var(--muted); font-size: .76rem; }
.lead-today-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.lead-today-group { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); }
.lead-today-group > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.lead-today-group > header strong { font-size: .78rem; }
.lead-today-group > header span { min-width: 22px; padding: 2px 6px; border-radius: 999px; background: #e8f3ee; color: var(--brand); font-size: .7rem; font-weight: 750; text-align: center; }
.lead-today-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px; width: 100%; padding: 9px 2px; border: 0; border-bottom: 1px solid #edf1ef; background: transparent; color: var(--ink); text-align: left; }
.lead-today-row:hover { color: var(--brand); }
.lead-today-row > span { min-width: 0; }
.lead-today-row strong, .lead-today-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-today-row strong { font-size: .79rem; }
.lead-today-row small { margin-top: 2px; color: var(--muted); font-size: .69rem; }
.lead-today-row time { color: var(--muted); font-size: .7rem; white-space: nowrap; }
.lead-today-meta { display: grid; justify-items: end; gap: 4px; }
.lead-open-call { min-height: 34px; padding: 4px 7px; border: 1px solid #b8d2c8; border-radius: 6px; background: #f3f9f6; color: var(--brand); font: inherit; font-size: .69rem; font-weight: 700; white-space: nowrap; }
.lead-open-call:hover { border-color: var(--brand); background: #e9f4ef; }
.lead-today-more { min-height: 34px; margin-top: 5px; padding: 4px 2px; border: 0; background: transparent; color: var(--brand); font: inherit; font-size: .73rem; font-weight: 700; }
.lead-today-empty { margin: 0; color: var(--muted); font-size: .84rem; }
.lead-active-filter { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0 0; padding: 8px 12px; border: 1px solid #cbded6; border-radius: 7px; background: #f4faf7; color: var(--muted); font-size: .78rem; }
.lead-active-filter strong { color: var(--ink); }
.lead-toolbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.lead-toolbar .search-field { grid-column: span 2; }
.lead-summary-status { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; color: var(--muted); font-size: .78rem; }
.lead-workspace { display: grid; min-width: 0; align-items: start; }
.lead-workspace.has-detail { grid-template-columns: minmax(270px, 1fr) minmax(380px, 1.35fr); gap: 24px; }
.lead-workspace > * { min-width: 0; }
.lead-feedback { min-height: 1.4em; font-size: .85rem; color: var(--brand); margin: 12px 0; }
.lead-feedback.is-error { color: #a42d30; }
.lead-result-count { color: var(--muted); font-size: .8rem; margin: 0 0 12px; }
.lead-table { width: 100%; border-collapse: collapse; table-layout: fixed; background: var(--white); }
.lead-table th { text-align: left; padding: 12px; color: var(--muted); font-size: .75rem; font-weight: 650; border-bottom: 1px solid var(--line); }
.lead-table td { padding: 16px 12px; border-bottom: 1px solid var(--line); font-size: .82rem; vertical-align: top; overflow-wrap: anywhere; }
.lead-table th:nth-child(1) { width: 18%; }
.lead-table th:nth-child(2) { width: 13%; }
.lead-table th:nth-child(3) { width: 19%; }
.lead-table th:nth-child(4) { width: 15%; }
.lead-table th:nth-child(5) { width: 13%; }
.lead-table th:nth-child(6) { width: 15%; }
.lead-table th:nth-child(7) { width: 7%; }
.lead-table td > span { display: block; }
.lead-table td > span + span { margin-top: 6px; }
.lead-campaign-detail { display: block; margin-top: 5px; color: var(--muted); font-size: .7rem; overflow-wrap: anywhere; }
.lead-funnel-status { display: block; margin-top: 6px; color: var(--brand); font-size: .73rem; font-weight: 700; }
.lead-table tbody tr { cursor: pointer; transition: background-color .15s; }
.lead-table tbody tr:hover, .lead-table tr.is-selected { background: #f0f8f5; }
.lead-name { display: inline; padding: 0; border: 0; background: none; text-align: left; color: var(--brand); font: inherit; font-weight: 750; overflow-wrap: anywhere; }
.lead-name:hover, .lead-link:hover { text-decoration: underline; }
.lead-phone { color: var(--brand); font-weight: 650; text-decoration: none; overflow-wrap: anywhere; }
.lead-phone:hover { text-decoration: underline; }
.lead-muted { display: block; color: var(--muted); margin-top: 5px; font-size: .78rem; }
.lead-stage { display: inline-block !important; width: fit-content; padding: 4px 7px; border: 1px solid #d2dce0; border-radius: 4px; background: #f3f6f8; color: #36464f; font-size: .72rem; line-height: 1.4; }
.lead-stage[data-stage="won"] { background: #e5f4ed; border-color: #bddacc; color: #185c47; }
.lead-stage[data-stage="negotiation"], .lead-stage[data-stage="follow_up"] { background: #fff6de; border-color: #e9d598; color: #715414; }
.lead-stage[data-stage="lost"] { background: #f7eeee; border-color: #e6caca; color: #874040; }
.lead-marketing-badge { display: block; width: fit-content; margin-top: 7px; padding: 3px 6px; border: 1px solid #d2dce0; border-radius: 4px; background: #f3f6f8; color: #536169; font-size: .68rem; line-height: 1.35; }
.lead-marketing-badge[data-status="consented"] { border-color: #bddacc; background: #e5f4ed; color: #185c47; }
.lead-marketing-badge[data-status="revoked"] { border-color: #e6caca; background: #f7eeee; color: #874040; }
.lead-empty { padding: 48px 20px; min-height: 240px; text-align: center; border-top: 1px solid var(--line); color: var(--muted); }
.lead-empty h3 { font-size: 1rem; margin-bottom: 18px; color: var(--ink); }
#lead-detail { border-left: 1px solid var(--line); padding-left: 24px; }
.lead-detail-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.lead-detail-heading h3 { font-size: 1.25rem; line-height: 1.4; overflow-wrap: anywhere; margin: 4px 0; }
.lead-icon-button { flex-shrink: 0; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 8px; background: white; font-size: 1.5rem; color: var(--ink); }
.lead-contact-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.lead-contact-actions a { color: var(--brand); font-size: .85rem; font-weight: 650; text-underline-offset: 3px; }
.lead-operational-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 22px; }
.lead-operational-actions .primary-action { min-height: 44px; }
.lead-marketing { margin: 0 0 22px; padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 8px; background: #f8fbfa; }
.lead-marketing > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lead-marketing h4 { margin: 0; font-size: .9rem; text-transform: uppercase; }
.lead-marketing .lead-marketing-badge { margin: 0; }
.lead-marketing p { margin: 9px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.55; overflow-wrap: anywhere; }
.lead-marketing > button { margin-top: 10px; }
.lead-delete-explanation { flex-basis: 100%; margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.lead-sale-date { color: var(--brand); font-size: .82rem; margin-bottom: 14px; }
.lead-conversion-pending { width: fit-content; margin: 0 0 14px; padding: 6px 9px; border: 1px solid #dfca8d; border-radius: 6px; background: #fff8e5; color: #715414; font-size: .78rem; font-weight: 750; }
.lead-conversion-status { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; margin: 0 0 20px; padding: 14px 16px; border: 1px solid #bddacc; border-left: 3px solid var(--brand); border-radius: 8px; background: #f0f8f5; }
.lead-conversion-status span { color: var(--muted); font-size: .76rem; }
.lead-conversion-status strong { grid-column: 1; overflow-wrap: anywhere; }
.lead-conversion-status .lead-link { grid-column: 2; grid-row: 1 / span 2; }
.lead-conversion-summary { grid-template-columns: minmax(0, 1fr); }
.lead-conversion-summary dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin: 12px 0 0; }
.lead-conversion-summary dl div { min-width: 0; padding-top: 10px; border-top: 1px solid #d3e5dd; }
.lead-conversion-summary dt { color: var(--muted); font-size: .72rem; }
.lead-conversion-summary dd { margin: 3px 0 0; color: var(--ink); font-size: .84rem; font-weight: 650; overflow-wrap: anywhere; }
.crm-leads-page fieldset { padding: 0; margin: 0 0 24px; min-width: 0; border: 0; }
.crm-leads-page legend { font-size: .92rem; font-weight: 750; margin-bottom: 14px; padding: 0; }
.lead-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.lead-fields label, #lead-note-form label { display: grid; gap: 6px; color: var(--muted); font-size: .8rem; font-weight: 600; }
.lead-fields input, .lead-fields select, .lead-fields textarea, #lead-note-text { width: 100%; max-width: 100%; min-width: 0; min-height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); font: inherit; font-size: .9rem; box-sizing: border-box; }
.lead-fields textarea, #lead-note-text { resize: vertical; line-height: 1.6; }
.lead-fields label.is-required { color: var(--brand); }
.lead-fields label.is-required input, .lead-fields label.is-required textarea { border-color: #81ae9f; }
.lead-readonly-field { display: grid; align-content: center; gap: 6px; min-height: 44px; padding: 10px; border: 1px solid #dce4e1; border-radius: 8px; background: #f6f8f7; }
.lead-readonly-field span { color: var(--muted); font-size: .8rem; font-weight: 600; }
.lead-readonly-field strong { color: var(--ink); font-size: .88rem; overflow-wrap: anywhere; }
.lead-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 12px; }
.lead-link, .lead-delete { min-height: 40px; border: 0; padding: 6px 0; background: none; color: var(--brand); font: inherit; font-size: .85rem; }
.lead-delete { color: #974444; }
.lead-history { min-width: 0; padding-top: 24px; border-top: 1px solid var(--line); margin-top: 26px; }
.lead-attribution { min-width: 0; padding-top: 24px; border-top: 1px solid var(--line); margin-top: 26px; }
.lead-attribution h3 { font-size: 1.05rem; }
.lead-attribution h4 { font-size: .85rem; margin: 20px 0 8px; }
.lead-attribution dl { margin: 12px 0; }
.lead-attribution dl > div { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 12px; margin-block: 8px; font-size: .85rem; }
.lead-attribution dt { color: var(--muted); overflow-wrap: anywhere; }
.lead-attribution dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.lead-attribution-basis { margin: 8px 0; color: var(--muted); font-size: .8rem; }
.lead-prequalification { min-width: 0; padding-top: 24px; border-top: 1px solid var(--line); margin-top: 26px; }
.lead-prequalification h3 { font-size: 1.05rem; }
.lead-prequalification h4 { font-size: .85rem; margin-bottom: 8px; }
.lead-prequalification dl { margin: 12px 0 20px; }
.lead-prequalification dl > div { display: grid; grid-template-columns: minmax(90px, .7fr) minmax(0, 1.3fr); gap: 12px; margin-block: 8px; font-size: .85rem; }
.lead-prequalification dt { color: var(--muted); }
.lead-prequalification dd { margin: 0; overflow-wrap: anywhere; }
.lead-prequalification-situation { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; }
.lead-history-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.lead-history-heading h3 { margin: 0; font-size: 1.05rem; }
#lead-note-text { margin-top: 8px; }
.lead-note-actions { display: flex; gap: 20px; }
.lead-timeline { position: relative; display: grid; margin-top: 6px; }
.lead-timeline::before { content: ""; position: absolute; top: 10px; bottom: 14px; left: 6px; width: 1px; background: var(--line); }
.lead-timeline-item { position: relative; display: grid; grid-template-columns: 13px minmax(0, 1fr); gap: 12px; padding: 13px 0; }
.lead-timeline-marker { position: relative; z-index: 1; width: 9px; height: 9px; margin-top: 5px; border: 2px solid white; border-radius: 50%; background: #8ca39a; box-shadow: 0 0 0 1px #8ca39a; }
.lead-timeline-item[data-category="pipeline"] .lead-timeline-marker,
.lead-timeline-item[data-category="call"] .lead-timeline-marker { background: #4d7891; box-shadow: 0 0 0 1px #4d7891; }
.lead-timeline-item[data-category="followup"] .lead-timeline-marker,
.lead-timeline-item[data-category="proposal"] .lead-timeline-marker { background: #ad8737; box-shadow: 0 0 0 1px #ad8737; }
.lead-timeline-item[data-category="sale"] .lead-timeline-marker,
.lead-timeline-item[data-category="conversion"] .lead-timeline-marker { background: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.lead-timeline-item[data-category="lost"] .lead-timeline-marker { background: #a76161; box-shadow: 0 0 0 1px #a76161; }
.lead-timeline-item[data-kind="note"] .lead-timeline-marker { background: white; box-shadow: 0 0 0 1px #74828a; }
.lead-timeline-content { min-width: 0; padding: 0 0 13px; border-bottom: 1px solid #edf0f1; }
.lead-timeline-content time { display: block; color: var(--muted); font-size: .72rem; line-height: 1.4; }
.lead-timeline-content h4 { margin: 4px 0 0; color: var(--ink); font-size: .86rem; line-height: 1.45; overflow-wrap: anywhere; }
.lead-timeline-content p { margin: 5px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: #46545c; font-size: .83rem; line-height: 1.55; }
.lead-timeline-content .lead-note-actions { margin-top: 4px; }
.lead-timeline-content .lead-note-actions button { min-height: 34px; font-size: .76rem; }
.lead-history-loading, .lead-history-empty, .lead-history-notice, #lead-history-list > p { margin: 10px 0; color: var(--muted); font-size: .8rem; line-height: 1.55; }
.lead-history-notice { padding: 10px 12px; border-left: 2px solid #a9bdb5; background: #f6f9f8; }
.lead-history-toggle { width: 100%; min-height: 40px; margin-top: 8px; border: 0; background: transparent; color: var(--brand); font: inherit; font-size: .82rem; font-weight: 700; }
.lead-history-toggle:hover { text-decoration: underline; }
.lead-confirm-dialog { width: min(440px, calc(100% - 32px)); max-height: calc(100dvh - 48px); overflow: auto; padding: 24px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--white); box-shadow: var(--shadow); }
.lead-confirm-dialog::backdrop { background: rgba(26, 31, 37, .42); }
.lead-confirm-dialog h3 { font-size: 1.1rem; margin: 0 0 12px; }
.lead-confirm-dialog p { line-height: 1.6; font-size: .9rem; }
.lead-sale-dialog .lead-fields { grid-template-columns: minmax(0, 1fr); }
.lead-marketing-dialog label { display: grid; gap: 7px; color: var(--muted); font-size: .82rem; font-weight: 650; }
.lead-marketing-dialog select { width: 100%; min-height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); font: inherit; }
.lead-conversion-dialog { width: min(620px, calc(100% - 32px)); }
.lead-conversion-dialog .lead-detail-heading { margin-bottom: 8px; }
.lead-conversion-dialog .lead-conversion-intro { margin: 0 0 20px; color: var(--muted); }
.lead-conversion-dialog fieldset { margin-bottom: 8px; }
.lead-interaction-dialog { width: min(680px, calc(100% - 32px)); }
.lead-interaction-dialog form { min-width: 0; }
.lead-interaction-dialog fieldset { margin-bottom: 18px; }
.lead-tidycal-dialog { width: min(680px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; }
.lead-tidycal-meta { display: flex; justify-content: space-between; gap: 12px; margin: 14px 0 18px; padding: 13px 14px; border-left: 3px solid var(--brand); border-radius: 7px; background: #f3f8f6; }
.lead-tidycal-meta strong { color: var(--ink); }
.lead-tidycal-meta span, .lead-tidycal-loading, .lead-tidycal-empty { margin: 0; color: var(--muted); font-size: .82rem; }
#lead-tidycal-slots { display: grid; gap: 16px; }
.lead-tidycal-day { display: grid; gap: 9px; }
.lead-tidycal-day h4 { margin: 0; color: var(--ink); font-size: .88rem; text-transform: capitalize; }
.lead-tidycal-times { display: flex; flex-wrap: wrap; gap: 8px; }
.lead-tidycal-times button { min-width: 74px; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); color: var(--brand); font: inherit; font-weight: 700; }
.lead-tidycal-times button:hover, .lead-tidycal-times button.is-selected { border-color: var(--brand); background: #e9f4ef; box-shadow: inset 0 0 0 1px var(--brand); }
.lead-tidycal-times button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.lead-tidycal-confirmation { margin-top: 18px; padding: 14px; border: 1px solid #cbded6; border-radius: 8px; background: #f8fbfa; }
.lead-tidycal-confirmation p { margin: 0 0 12px; color: var(--ink); line-height: 1.55; }
.lead-tidycal-refresh { display: inline-flex; margin-top: 16px; }
.lead-interaction-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.lead-interaction-outcomes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lead-interaction-choice { min-width: 0; }
.lead-interaction-choice input { position: absolute; opacity: 0; pointer-events: none; }
.lead-interaction-choice span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); font-size: .78rem; font-weight: 650; text-align: center; transition: border-color .15s, background-color .15s, box-shadow .15s, transform .15s; }
.lead-interaction-choice input:checked + span { border-color: var(--brand); background: #edf7f2; color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.lead-interaction-choice:hover span { border-color: #9dbfb3; transform: translateY(-1px); }
.lead-interaction-choice input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.lead-interaction-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.lead-interaction-fields label { display: grid; gap: 6px; min-width: 0; color: var(--muted); font-size: .8rem; font-weight: 600; }
.lead-interaction-fields input, .lead-interaction-fields textarea { width: 100%; min-width: 0; min-height: 44px; box-sizing: border-box; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); font: inherit; font-size: .9rem; }
.lead-interaction-fields textarea { resize: vertical; line-height: 1.55; }
.lead-interaction-fields label.is-required { color: var(--brand); }
.lead-interaction-fields label.is-required input, .lead-interaction-fields label.is-required textarea { border-color: #81ae9f; }
.lead-follow-up-toggle { margin: 8px 0; }
.lead-existing-follow-up { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 18px; align-items: center; margin-top: 14px; padding: 13px 14px; border-left: 3px solid var(--brand); border-radius: 7px; background: #f3f8f6; }
.lead-existing-follow-up strong, .lead-existing-follow-up time, .lead-existing-follow-up p { display: block; }
.lead-existing-follow-up strong { color: var(--ink); font-size: .84rem; }
.lead-existing-follow-up time, .lead-existing-follow-up p, .lead-follow-up-policy-note { margin: 3px 0 0; color: var(--muted); font-size: .78rem; }
.lead-follow-up-policy { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.lead-follow-up-policy button { min-height: 40px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); color: var(--ink); font: inherit; font-size: .76rem; font-weight: 700; }
.lead-follow-up-policy button.is-selected { border-color: var(--brand); background: #e9f4ef; color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.lead-follow-up-policy button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.lead-follow-up-policy-note { grid-column: 1 / -1; }
.lead-interaction-follow-up { margin-top: 8px; padding: 14px; border: 1px solid #cbded6; border-radius: 8px; background: #f8fbfa; }
.lead-follow-up-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.lead-follow-up-presets button { min-height: 38px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); color: var(--brand); font: inherit; font-size: .76rem; font-weight: 700; }
.lead-follow-up-presets button:hover { border-color: var(--brand); }
.lead-interaction-submit-row { justify-content: flex-end; }
.lead-timeline-item[data-kind="interaction"] .lead-timeline-marker { background: #367c68; box-shadow: 0 0 0 1px #367c68; }
.has-detail .lead-table, .has-detail .lead-table tbody, .has-detail .lead-table tr, .has-detail .lead-table td { display: block; width: auto; }
.has-detail .lead-table thead { display: none; }
.has-detail .lead-table { background: transparent; }
.has-detail .lead-table tr { padding: 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.has-detail .lead-table tr.is-selected { border-color: var(--brand); background: #f0f8f5; }
.has-detail .lead-table td { border: 0; padding: 4px 0; }
.has-detail .lead-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: .75rem; }
.has-detail .lead-table td > span { display: inline; }
.has-detail .lead-table td > span + span { display: block; }
.has-detail .lead-table td > .lead-muted { display: block; }
@media (max-width: 1100px) {
  .lead-today-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead-workspace.has-detail { grid-template-columns: minmax(0, 1fr); }
  .has-detail #lead-list { display: none; }
  #lead-detail { border-left: 0; padding-left: 0; }
}
@media (max-width: 768px) {
  .crm-leads-page .section-title { align-items: stretch; }
  .lead-file-actions { justify-content: flex-start; }
  .lead-csv-dialog { padding: 16px; }
  .lead-csv-dialog .lead-form-actions { bottom: -16px; margin: 16px -16px -16px; padding: 12px 16px; }
  body.setter-mode .app-shell { display: block; width: 100%; }
  body.setter-mode .sidebar { position: sticky; top: 0; z-index: 40; display: grid; grid-template-columns: minmax(0, 1fr) auto; width: 100%; max-width: 100%; min-width: 0; height: auto; padding: 12px; }
  body.setter-mode .brand-lockup { margin: 0; padding: 0; }
  body.setter-mode .mobile-menu-toggle { display: inline-flex; align-items: center; justify-content: center; min-width: 112px; min-height: 44px; padding: 0 14px; }
  body.setter-mode .sidebar .setter-nav { grid-column: 1 / -1; display: none; width: 100%; max-width: 100%; min-width: 0; margin-top: 10px; overflow-x: hidden; }
  body.setter-mode.mobile-menu-open .sidebar .setter-nav { display: grid; }
  body.setter-mode .sidebar .setter-nav .nav-item { width: 100%; min-height: 44px; }
  body.setter-mode .content { width: 100%; padding: 14px; }
  .lead-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .lead-kpi { padding: 14px; }
  .lead-today { padding: 12px; }
  .lead-today-groups { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .lead-today-group { padding: 9px; }
  .lead-today-row { align-items: center; }
  .lead-open-call { min-height: 40px; padding-inline: 10px; }
  .lead-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead-toolbar .search-field { grid-column: 1 / -1; }
  .lead-table, .lead-table tbody, .lead-table tr, .lead-table td { display: block; width: auto; }
  .lead-table thead { display: none; }
  .lead-table { background: transparent; }
  .lead-table tr { padding: 14px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 8px; background: white; }
  .lead-table td { border: 0; padding: 4px 0; }
  .lead-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: .75rem; }
  .lead-table td > span { display: inline; }
  .lead-table td > span + span { display: block; }
  .lead-table td > .lead-muted { display: block; }
  body.setter-mode .lead-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
  body.setter-mode .lead-table td { min-width: 0; overflow-wrap: anywhere; }
  body.setter-mode .lead-table td:nth-child(1) { order: 1; grid-column: 1 / -1; }
  body.setter-mode .lead-table td:nth-child(5) { order: 2; grid-column: 1 / -1; }
  body.setter-mode .lead-table td:nth-child(4) { order: 3; grid-column: 1 / -1; }
  body.setter-mode .lead-table td:nth-child(3) { order: 4; grid-column: 1 / -1; }
  .lead-table td:nth-child(3) > strong,
  .lead-table td:nth-child(3) > span { display: block; }
  body.setter-mode .lead-table td:nth-child(6) { order: 5; }
  body.setter-mode .lead-table td:nth-child(2) { order: 6; }
  body.setter-mode .lead-table td:nth-child(7) { order: 7; grid-column: 1 / -1; }
  .lead-fields input, .lead-fields textarea, .lead-fields select, #lead-note-text { font-size: 16px; }
  .lead-interaction-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); padding: 18px; }
  .lead-tidycal-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); padding: 18px; }
  .lead-tidycal-meta { display: grid; }
  .lead-tidycal-times { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lead-tidycal-times button { width: 100%; min-width: 0; }
  .lead-interaction-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead-interaction-outcomes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead-interaction-fields { grid-template-columns: minmax(0, 1fr); }
  .lead-existing-follow-up { grid-template-columns: minmax(0, 1fr); }
  .lead-follow-up-policy { justify-content: stretch; }
  .lead-follow-up-policy button { flex: 1 1 140px; }
  .lead-interaction-fields input, .lead-interaction-fields textarea { font-size: 16px; }
  .lead-interaction-submit-row { position: sticky; bottom: -18px; margin: 16px -18px -18px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--white); }
  .lead-timeline-item { gap: 10px; }
  .lead-timeline-content h4 { font-size: .84rem; }
  .lead-timeline-content p { font-size: .82rem; }
}
@media (max-width: 480px) {
  .lead-fields { grid-template-columns: minmax(0, 1fr); }
  .lead-form-actions .primary-action { width: 100%; }
  .lead-conversion-status { grid-template-columns: minmax(0, 1fr); }
  .lead-conversion-status .lead-link { grid-column: 1; grid-row: auto; justify-self: start; }
  .lead-conversion-summary dl { grid-template-columns: minmax(0, 1fr); }
  .lead-interaction-submit-row .primary-action { width: 100%; }
  .lead-marketing > div { align-items: flex-start; }
  .lead-marketing-dialog .lead-form-actions .primary-action { width: 100%; }
}
/* Setter controls use the existing Lead Detail, without a separate workspace. */
.lead-setter-section { border-top: 1px solid #d8dfe2; padding: 18px 0; margin-top: 12px; }
.lead-setter-section h3 { font-size: 14px; margin: 0 0 12px; }
.lead-setter-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; margin: 0; }
.lead-setter-summary dt { font-size: 12px; color: #626a70; }
.lead-setter-summary dd { margin: 4px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.lead-setter-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.lead-setter-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.lead-setter-actions button { min-height: 48px; padding: 10px; font-size: 12px; white-space: normal; overflow-wrap: anywhere; }
.lead-setter-actions .lead-setter-book { grid-column: 1 / -1; background: #19624b; border-color: #19624b; color: #fff; }
.lead-setter-link { font-size: 13px; overflow-wrap: anywhere; }
.lead-setter-complete { color: #19624b; font-weight: 600; }
.lead-setter-dialog label, .lead-setter-schedule-dialog label { display: grid; gap: 6px; }
.lead-setter-dialog fieldset, .lead-setter-schedule-dialog fieldset { border: 0; padding: 0; min-width: 0; }
.lead-setter-dialog textarea, .lead-setter-dialog select, .lead-setter-dialog input,
.lead-setter-schedule-dialog input { box-sizing: border-box; width: 100%; min-width: 0; min-height: 44px; font: inherit; padding: 8px; }
.lead-setter-dialog { width: min(500px, calc(100vw - 40px)); }
.lead-setter-schedule-dialog { width: min(650px, calc(100vw - 40px)); }
.lead-setter-dialog, .lead-setter-schedule-dialog { box-sizing: border-box; max-height: calc(100dvh - 40px); overflow-y: auto; }
.lead-setter-follow-up { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.lead-setter-day { padding: 12px 0; border-bottom: 1px solid #d8dfe2; }
.lead-setter-day header { display: flex; align-items: center; justify-content: space-between; }
.lead-setter-slot { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) 44px; gap: 10px; align-items: end; margin: 10px 0; }
.lead-setter-slot .lead-icon-button, .lead-setter-day header .lead-icon-button { min-width: 44px; min-height: 44px; }
.lead-setter-day-off { color: #626a70; }
.lead-setter-schedule-open { min-height: 44px; margin-bottom: 12px; }
@media (max-width: 480px) {
  .lead-setter-summary { grid-template-columns: minmax(0,1fr); }
  .lead-setter-actions button { font-size: 11px; }
  .lead-setter-follow-up { grid-template-columns: minmax(0,1fr); }
}
