/* CRM keeps OSTRO typography and layout with an independent graphite/teal palette. */
.nav[hidden], .crm-root [hidden], .crm-nav-count[hidden] { display: none !important; }
.crm-nav-count { margin-left: auto; font: 11px var(--f-body); background: #b7374b; color: #fff; padding: 2px 6px; }
.crm-root { --crm-blue: var(--accent); --crm-overdue: #fb8995; --crm-good: #55d4c0; --crm-muted: var(--muted); min-width: 0; }
.crm-root .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.crm-detail { scroll-margin-top: 160px; }
.crm-demo { padding: 10px 14px; border: 1px dashed var(--line-strong); color: var(--muted); font-size: 12px; margin-bottom: 20px; }
.crm-top, .crm-leads-head, .crm-actions, .crm-card-heading, .crm-dialog-head, .crm-list-foot, .crm-event-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.crm-top { margin-bottom: 18px; }
.crm-tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--line-strong); }
.crm-tabs button { border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 12px 18px; color: var(--muted); cursor: pointer; font: 14px var(--f-body); }
.crm-tabs button.active { color: var(--ink); border-bottom-color: var(--crm-blue); }
.crm-availability, .crm-check, .crm-week label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.crm-root input[type="checkbox"], .crm-dialog input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--crm-blue); flex-shrink: 0; }
.crm-root h2 { font: 600 20px var(--f-display); letter-spacing: -.04em; margin: 0; }
.crm-root h3 { font: 600 15px var(--f-body); margin: 0 0 14px; }
.crm-leads-head { margin: 26px 0 20px; }
.crm-leads-head p { margin: 8px 0 0; font-size: 13px; }
.crm-leads-head h2 .muted { font: 400 15px var(--f-body); margin-left: 8px; }
.crm-actions { justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
.crm-root .primary, .crm-root .table-action, .crm-dialog .primary, .crm-dialog .table-action { min-height: 38px; cursor: pointer; }
.crm-root button:disabled, .crm-dialog button:disabled { opacity: .45; cursor: default; }
.crm-text-button, .crm-back { border: none; background: transparent; color: var(--accent-hover); cursor: pointer; padding: 6px 0; font: 13px var(--f-body); }
.crm-root input:not([type="checkbox"]), .crm-root select, .crm-root textarea, .crm-dialog input, .crm-dialog textarea, .crm-dialog select { background: var(--sunken); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 2px; min-width: 0; padding: 10px 12px; font: 14px/1.45 var(--f-body); width: 100%; box-sizing: border-box; }
.crm-root textarea, .crm-dialog textarea { resize: vertical; }
.crm-root textarea::placeholder, .crm-root input::placeholder, .crm-dialog input::placeholder { color: var(--faint); }
.crm-root :focus-visible, .crm-dialog :focus-visible { outline: 2px solid var(--crm-blue); outline-offset: 3px; }
.crm-filters { display: grid; grid-template-columns: minmax(180px, 1fr) 160px 180px auto auto; align-items: center; gap: 10px; margin-bottom: 16px; }
.crm-more-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 18px; border: 1px solid var(--line); margin-bottom: 16px; }
.crm-root label:not(.crm-check):not(.crm-availability), .crm-dialog label { display: grid; gap: 7px; font-size: 13px; color: var(--muted); }
.crm-more-filters .crm-check { grid-column: 1 / -1; }
.crm-reminder { margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: rgba(183, 55, 75, .12); border-left: 3px solid #c24960; padding: 13px 16px; font-size: 14px; }
.crm-reminder button { background: transparent; border: 0; color: var(--ink); text-decoration: underline; cursor: pointer; }
.crm-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(350px, 1fr); align-items: start; gap: 18px; }
.crm-list, .crm-detail { padding: 0 !important; min-width: 0; overflow: hidden; }
.crm-detail { max-height: calc(100vh - 145px); overflow-y: auto; position: sticky; top: 20px; scrollbar-gutter: stable; }
.crm-table-wrap { overflow-x: auto; }
.crm-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.crm-table th { font: 500 11px var(--f-body); color: var(--muted); background: var(--surface-2); padding: 14px 12px; white-space: nowrap; text-transform: none; letter-spacing: 0; }
.crm-table td { border-bottom: 1px solid var(--line); padding: 16px 12px; vertical-align: top; }
.crm-table td b { display: block; font-weight: 500; }
.crm-table tbody tr[data-crm-lead] { cursor: pointer; }
.crm-table tbody tr[data-crm-lead]:hover { background: var(--accent-soft); }
.crm-table tr.selected { background: var(--accent-soft); box-shadow: inset 3px 0 var(--crm-blue); }
.crm-table tr.overdue:not(.selected) { box-shadow: inset 3px 0 #c24960; }
.crm-row-secondary { display: block; color: var(--muted); margin-top: 6px; font-size: 11px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.crm-status { display: inline-flex; align-items: center; gap: 6px; color: #afbbd7; font: 12px var(--f-body); white-space: nowrap; }
.crm-status::before { content: ''; width: 5px; height: 5px; background: currentColor; }
.crm-status-new { color: #91b1ff; }.crm-status-won { color: var(--crm-good); }.crm-status-lost { color: var(--crm-overdue); }.crm-status-call { color: #c6a5f7; }.crm-status-not_found { color: var(--muted); }
.crm-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.crm-tag { font-size: 10px; padding: 3px 6px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line-strong); }
.crm-tag.is-repeat { color: #d3b5f9; }
.crm-date { white-space: nowrap; font-size: 11px; color: var(--muted); }
.crm-wait { display: block; color: var(--crm-overdue); font-size: 11px; margin-top: 8px; white-space: nowrap; }
.crm-list-foot { padding: 12px 16px; color: var(--muted); font-size: 12px; }
.crm-list-foot > div { display: flex; gap: 8px; }
.crm-empty { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 42px 28px; min-height: 220px; }
.crm-empty h3 { font-size: 16px; margin: 12px 0; }
.crm-empty p { color: var(--muted); font-size: 14px; line-height: 1.6; max-width: 310px; margin: 0 0 16px; }
.crm-empty-symbol { font-size: 32px; color: var(--line-strong); }
.crm-card-head { padding: 22px 22px 17px; border-bottom: 1px solid var(--line); }
.crm-back { display: none; margin-bottom: 16px; }
.crm-card-heading { align-items: flex-start; }.crm-card-heading h2 { font-size: 20px; margin-top: 8px; overflow-wrap: anywhere; }
.crm-id { font-size: 11px; color: var(--muted); }
.crm-card-head p { font-size: 12px; margin: 12px 0 0; }
.crm-repeat, .crm-card-overdue, .crm-claim { font-size: 12px; line-height: 1.6; padding: 12px 22px; background: rgba(168, 85, 247, .07); border-bottom: 1px solid var(--line); }
.crm-card-overdue { background: rgba(183, 55, 75, .10); color: var(--crm-overdue); }
.crm-claim { background: var(--accent-soft); }
.crm-card-section { padding: 22px; border-bottom: 1px solid var(--line); }
.crm-message-state { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; line-height: 1.4; gap: 16px; margin: 9px 0 14px; }
.crm-message-state span { white-space: nowrap; }
.crm-contact-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.crm-contact-buttons button { font-family: var(--f-body); font-size: 12px; padding-inline: 8px; }
.crm-help { color: var(--muted); font-size: 12px; line-height: 1.65; margin: 10px 0 14px; }
.crm-contacted { font-size: 11px; line-height: 1.6; color: var(--muted); margin-bottom: 0; }
.crm-controls { display: grid; gap: 16px; }
.crm-root fieldset { border: 0; padding: 0; margin: 12px 0; min-width: 0; }
.crm-root legend { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.crm-tag-picker label { display: inline-flex !important; align-items: center; margin-right: 12px; margin-top: 8px; font-size: 12px; }
.crm-facts { margin: 0; }.crm-facts > div { display: grid; grid-template-columns: minmax(90px, .7fr) minmax(0, 1fr); gap: 12px; padding: 8px 0; font-size: 13px; border-bottom: 1px solid var(--line); }
.crm-facts dt { color: var(--muted); overflow-wrap: anywhere; }.crm-facts dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.crm-root summary { color: var(--muted); cursor: pointer; font-size: 12px; padding: 14px 0; }
.crm-root details[open] > summary { color: var(--ink); }
.crm-root #crmNoteForm .table-action { margin-top: 8px; }
.crm-timeline { list-style: none; padding: 0; margin: 24px 0 0; }.crm-timeline li { display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 12px; padding-bottom: 22px; position: relative; }
.crm-timeline li:not(:last-child)::after { content: ''; position: absolute; top: 10px; left: 2px; bottom: 0; width: 1px; background: var(--line-strong); }
.crm-timeline-dot { width: 5px; height: 5px; background: var(--accent-hover); margin-top: 5px; }
.crm-event-top { align-items: flex-start; font-size: 12px; gap: 8px; }.crm-event-top b { font-weight: 500; }.crm-event-top time { color: var(--muted); font-size: 10px; white-space: nowrap; }
.crm-timeline p { white-space: pre-wrap; font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; margin: 7px 0; }.crm-timeline small { font-size: 10px; }.crm-refusal { color: var(--crm-overdue); font-size: 12px; }
.crm-dialog { color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); padding: 26px; max-width: 620px; width: calc(100vw - 32px); box-sizing: border-box; border-radius: 2px; max-height: 90vh; overflow-y: auto; }
.crm-dialog::backdrop { background: rgba(0, 5, 30, .78); backdrop-filter: blur(3px); }.crm-dialog-head { margin-bottom: 22px; }.crm-dialog h2 { font: 600 20px var(--f-display); margin: 0; }.crm-dialog form { display: grid; gap: 18px; }
.crm-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }.crm-form-error { color: #fb8995; font-size: 13px; margin: 8px 0; }
.crm-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }.crm-metrics article { padding: 22px; }.crm-metrics span { display: block; color: var(--muted); font-size: 12px; }.crm-metrics strong { display: block; font: 500 30px var(--f-display); letter-spacing: -.06em; margin-top: 16px; }
.crm-analytics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }.crm-analytics-panel { padding: 22px; margin-bottom: 18px; min-width: 0; }.crm-analytics-panel .crm-table td { white-space: nowrap; }
.crm-funnel > div { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; font-size: 12px; padding: 9px 0; }.crm-funnel small { color: var(--muted); min-width: 80px; text-align: right; }.crm-funnel i { display: block; grid-column: 1/-1; height: 5px; background: linear-gradient(to right, var(--accent) var(--funnel-width), var(--line) var(--funnel-width)); }
.crm-speed > div { display: flex; justify-content: space-between; padding: 10px 0; font-size: 13px; border-bottom: 1px solid var(--line); }.crm-speed b { font-weight: 400; }
.crm-settings-form { display: grid; gap: 18px; max-width: 900px; }.crm-settings-section { padding: 24px !important; max-width: 900px; margin: 0 0 18px; }.crm-settings-form .crm-settings-section { margin: 0; }.crm-settings-section > label, .crm-settings-section .crm-form-grid { margin-top: 18px; }.crm-settings-section p { font-size: 13px; line-height: 1.6; }.crm-settings-section textarea { margin-top: 0; }.crm-settings-save { display: flex; justify-content: flex-end; margin-bottom: 24px; gap: 16px; }
:root[data-theme="light"] .crm-root { --crm-overdue: #a72e45; --crm-good: #167565; }
:root[data-theme="light"] .crm-status { color: #526582; }
:root[data-theme="light"] .crm-status-new { color: #215ad6; }
:root[data-theme="light"] .crm-status-call { color: #7948ab; }
:root[data-theme="light"] .crm-status-won { color: #167565; }
:root[data-theme="light"] .crm-status-lost, :root[data-theme="light"] .crm-form-error { color: #a72e45; }
:root[data-theme="light"] .crm-tag.is-repeat { color: #7948ab; }
.crm-status-editor { display: flex; gap: 14px; margin-bottom: 8px; align-items: center; }.crm-status-editor input { flex: 1; }.crm-status-editor button { width: 24px; flex-shrink: 0; }.crm-assignees { display: grid; gap: 12px; }.crm-week { display: flex; flex-wrap: wrap; gap: 16px; }.crm-preview { white-space: pre-wrap; padding: 12px 0; }.crm-settings-section #crmTokenValue { margin-bottom: 10px; font-family: var(--f-mono); }
.series-4 { --series-color: #55d4c0; background: #55d4c0; fill: #55d4c0; }
body[data-crm-only] .nav-group-title { display: none; }body[data-crm-only] .page-head .crumb { display: none; }
@media (max-width: 1350px) and (min-width: 981px) { .crm-layout { grid-template-columns: minmax(0, 1fr) 370px; }.crm-table th:nth-child(3), .crm-table td:nth-child(3) { display: none; } }
@media (max-width: 980px) { .crm-layout { grid-template-columns: minmax(0, 1fr); }.crm-detail { display: none; position: static; max-height: none; }.crm-layout.has-selection .crm-list { display: none; }.crm-layout.has-selection .crm-detail { display: block; }.crm-back { display: inline-block; }.crm-filters { grid-template-columns: 1fr 1fr auto; }.crm-filters input { grid-column: 1/-1; }.crm-filters .crm-text-button { grid-column: 3; }.crm-more-filters { grid-template-columns: 1fr 1fr; }.crm-analytics-grid { grid-template-columns: 1fr; }.crm-metrics { grid-template-columns: 1fr 1fr; } }
@media (max-width: 580px) { .crm-top { align-items: flex-start; flex-direction: column; gap: 16px; }.crm-tabs { width: 100%; }.crm-tabs button { flex: 1; padding: 10px; font-size: 13px; }.crm-leads-head { align-items: flex-start; flex-direction: column; gap: 16px; }.crm-leads-head .crm-actions { width: 100%; }.crm-leads-head .primary { margin-left: auto; }.crm-filters { grid-template-columns: 1fr 1fr; gap: 8px; }.crm-filters .crm-text-button { grid-column: auto; }.crm-more-filters { grid-template-columns: 1fr 1fr; padding: 12px; }.crm-table thead { display: none; }.crm-list .crm-table, .crm-list .crm-table tbody { display: block; }.crm-list .crm-table tr { display: grid; grid-template-columns: 1fr auto; padding: 16px; gap: 6px 16px; border-bottom: 1px solid var(--line-strong); }.crm-list .crm-table td { border: 0; padding: 0; }.crm-list .crm-table td:nth-child(3) { grid-column: 1; }.crm-list .crm-table td:nth-child(4) { grid-column: 2; grid-row: 2; text-align: right; }.crm-list .crm-table td:nth-child(2) { text-align: right; }.crm-card-head, .crm-card-section { padding: 18px; }.crm-contact-buttons { grid-template-columns: 1fr; }.crm-dialog { padding: 20px; }.crm-dialog h2 { font-size: 17px; }.crm-form-grid { grid-template-columns: 1fr; }.crm-facts > div { grid-template-columns: 95px minmax(0, 1fr); }.crm-event-top { display: block; }.crm-event-top time { display: block; margin: 5px 0; }.crm-settings-section { padding: 18px !important; }.crm-settings-save { position: sticky; bottom: 12px; }.crm-metrics article { padding: 16px; }.crm-metrics strong { font-size: 24px; }.crm-root h2 { font-size: 18px; } }
@media (prefers-reduced-motion: reduce) { .crm-root *, .crm-dialog * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Funnel and focused work queues share the existing lead model and permissions. */
.crm-top { flex-wrap: wrap; }
.crm-tabs { min-width: 0; max-width: 100%; overflow-x: auto; }
.crm-tabs button { flex: 0 0 auto; white-space: nowrap; padding-inline: 14px; }
#crmOverdueTabCount:not(:empty) { font: 11px var(--f-body); margin-left: 7px; color: var(--crm-overdue); }
.crm-owner-shortcuts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.crm-owner-shortcuts button { border: 1px solid var(--line-strong); background: transparent; padding: 7px 12px; color: var(--muted); font: 12px var(--f-body); cursor: pointer; }
.crm-owner-shortcuts button.active { background: var(--accent-soft); color: var(--ink); border-color: var(--accent-text); }
.crm-board { display: flex; align-items: flex-start; gap: 14px; width: 100%; min-width: 0; overflow-x: auto; padding: 2px 2px 18px; scrollbar-width: thin; }
.crm-board-column { flex: 0 0 278px; min-width: 0; border: 1px solid var(--line); border-top: 2px solid var(--accent-text); background: var(--sunken); }
.crm-board-column-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 14px; border-bottom: 1px solid var(--line); }
.crm-board-column-head h3 { margin: 0; font: 500 14px var(--f-body); overflow-wrap: anywhere; }
.crm-board-column-head > span { font: 12px var(--f-mono); color: var(--muted); }
.crm-board-cards { display: grid; gap: 10px; align-content: start; min-height: 150px; max-height: 65vh; overflow-y: auto; padding: 10px; scrollbar-width: thin; }
.crm-board-card { position: relative; padding: 13px; border: 1px solid var(--line-strong); background: var(--surface); min-width: 0; }
.crm-board-card[data-movable="true"] { cursor: default; }
.crm-board-card.overdue { border-left: 2px solid var(--crm-overdue); }
.crm-board-card.is-dragging { opacity: .5; }
.crm-board-column.is-drop-target { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.crm-board-open { display: grid; gap: 6px; width: 100%; border: 0; padding: 0; background: transparent; color: var(--ink); cursor: pointer; text-align: left; font: 13px/1.45 var(--f-body); overflow-wrap: anywhere; }
.crm-board-open b { font-weight: 500; }
.crm-board-open > span { color: var(--muted); font-size: 12px; }
.crm-board-meta { display: grid; gap: 4px; color: var(--muted); font-size: 11px; margin-top: 14px; overflow-wrap: anywhere; }
.crm-board-date { font-size: 10px; color: var(--muted); margin-top: 10px; }
.crm-board-status { margin-top: 12px; }
.crm-root .crm-board-status select { padding: 6px 8px; font-size: 12px; min-height: 32px; }
.crm-board-claim-help { display: block; color: var(--muted); font-size: 10px; margin-top: 8px; line-height: 1.5; }
.crm-board-empty { padding: 10px 4px; color: var(--muted); font-size: 12px; }
.crm-board-more { width: calc(100% - 20px); margin: 0 10px 10px; font-size: 12px; }
.crm-board-add-stage { flex: 0 0 170px; padding: 18px; border: 1px dashed var(--line-strong); background: transparent; color: var(--muted); font: 13px var(--f-body); cursor: pointer; }
.crm-board-add-stage:hover { color: var(--ink); border-color: var(--accent-text); }
.crm-lead-drawer { position: fixed; inset: 0 0 0 auto; width: min(100vw, 620px); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; overflow-y: auto; background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 0; }
.crm-lead-drawer .crm-detail { display: block; position: static; max-height: none; border: 0; overflow: visible; }
.crm-lead-drawer .crm-back { display: inline-block; }
.crm-lead-drawer::backdrop { background: rgb(0 5 30 / .65); }
body:has(#crmLeadDrawer:modal) { overflow: hidden; }
@media (max-width: 600px) {
  .crm-tabs button { flex: 0 0 auto; padding-inline: 12px; }
  .crm-board-column { flex-basis: min(278px, calc(100vw - 52px)); }
  .crm-lead-drawer { width: 100%; border: 0; }
}


.crm-board-drag-handle { position: absolute; top: 8px; right: 8px; color: var(--faint); cursor: grab; padding: 4px; font-size: 17px; line-height: 1; }
.crm-board-card[data-movable="true"] .crm-board-open { padding-right: 20px; }

.crm-board-drag-handle { user-select: none; touch-action: none; -webkit-user-drag: none; }

.crm-board-drag-preview { position: fixed; z-index: 1000; pointer-events: none; max-width: 220px; padding: 12px 16px; border: 1px solid var(--accent-text); background: var(--surface); color: var(--ink); font: 13px var(--f-body); box-shadow: var(--shadow); }

/* Scoped CRM theme: workspace and detached overlays share tokens; the sidebar keeps OSTRO colors. */
:root body[data-crm-active]{background-color:#11121f;background-image:none}
body[data-crm-active] :is(.crm-frame,.workspace,.crm-dialog,.crm-lead-drawer,.crm-board-drag-preview,.crm-app-login,#crmToast){
  --bg:#11121f;--surface:#1a1c2e;--surface-2:#23263c;--sunken:#0e0f1a;
  --line:#2c3050;--line-strong:#3c416a;--ink:#eef0ff;--muted:#a9aed0;--faint:#7f85a8;
  --accent:#818cf8;--accent-hover:#a5b4fc;--accent-text:#a5b4fc;--accent-soft:rgba(129,140,248,.13);--on-accent:#11133a;
  --crm-blue:var(--accent);--shadow:0 30px 80px -30px rgba(0,0,0,.7);
}
body[data-crm-active] .workspace{background:var(--bg)}
body[data-crm-active] :is(.crm-dialog,.crm-lead-drawer)::backdrop{background:rgba(8,9,20,.74)}
.nav[data-tab="crm"] .nav-icon{color:#818cf8}
.nav[data-tab="crm"].active{--accent-hover:#818cf8;background:rgba(129,140,248,.13);color:#e0e7ff}
:root[data-theme="light"] body[data-crm-active]{background-color:#f4f5fb}
:root[data-theme="light"] body[data-crm-active] :is(.crm-frame,.workspace,.crm-dialog,.crm-lead-drawer,.crm-board-drag-preview,.crm-app-login,#crmToast){
  --bg:#f4f5fb;--surface:#ffffff;--surface-2:#eceefa;--sunken:#f9f9fe;
  --line:#dcdff2;--line-strong:#c3c8e8;--ink:#1a1c33;--muted:#50547a;--faint:#6f7396;
  --accent:#4f46e5;--accent-hover:#4338ca;--accent-text:#4f46e5;--accent-soft:rgba(79,70,229,.08);--on-accent:#ffffff;
  --shadow:0 30px 70px -36px rgba(30,30,90,.25);
}
:root[data-theme="light"] .nav[data-tab="crm"] .nav-icon{color:#4f46e5}
:root[data-theme="light"] .nav[data-tab="crm"].active{--accent-hover:#4f46e5;background:rgba(79,70,229,.08);color:#4338ca}

/* 18.10.2026: sections in the left menu, sub-tabs of a section on top; settings by sub-tabs with one save bar */
.crm-root .crm-leads-head { margin: 4px 0 18px; align-items: flex-start; }
.crm-subtabs { display: flex; gap: 2px; margin: 0 0 18px; border-bottom: 1px solid var(--line-strong); overflow-x: auto; scrollbar-width: none; }
.crm-subtabs::-webkit-scrollbar { display: none; }
.crm-subtabs button { flex: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: transparent; padding: 11px 16px; color: var(--muted); font: 14px var(--f-body); cursor: pointer; white-space: nowrap; }
.crm-subtabs button:hover { color: var(--ink); }
.crm-subtabs button.active { color: var(--ink); border-bottom-color: var(--accent); }
.crm-filters.no-owner { grid-template-columns: minmax(180px, 1fr) 180px auto auto; }
.crm-menu { position: relative; }
.crm-menu > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 13px; }
.crm-menu > summary::-webkit-details-marker { display: none; }
.crm-menu > summary::after { content: "▾"; font-size: 11px; color: var(--muted); }
.crm-root .crm-menu > summary { padding: 0 14px; }
.crm-menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; display: grid; min-width: 220px; padding: 6px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow); }
.crm-menu-list button { border: 0; background: transparent; color: var(--ink); text-align: left; padding: 10px 12px; font: 13px var(--f-body); cursor: pointer; }
.crm-menu-list button:hover { background: var(--accent-soft); }
.crm-menu-list small { padding: 6px 12px 4px; color: var(--muted); font-size: 11px; }

.crm-settings-form { max-width: 1040px; gap: 0; }
.crm-settings-section { max-width: 1040px; }
.crm-settings-section h3 { margin-bottom: 6px; }
.crm-settings-section .crm-help { margin: 0 0 14px; }
.crm-settings-cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .9fr); gap: 28px; align-items: start; }
.crm-settings-main { display: grid; gap: 14px; }
.crm-settings-main .crm-help { margin: 0; }
.crm-preview-box { display: grid; gap: 14px; padding: 20px; background: var(--sunken); border: 1px solid var(--line); }
.crm-preview-box .crm-help { margin: 0; }
.crm-preview-box .crm-form-grid { gap: 12px; }
.crm-preview { min-height: 64px; padding: 14px 16px; border: 1px dashed var(--line-strong); color: var(--muted); font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
.crm-preview.is-ready { border-style: solid; border-color: var(--accent-text); color: var(--ink); background: var(--accent-soft); }
.crm-insert { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-top: -4px; }
.crm-insert button, .crm-presets button { border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); padding: 5px 10px; font: 12px var(--f-mono); cursor: pointer; }
.crm-insert button:hover, .crm-presets button:hover { border-color: var(--accent-text); }
.crm-settings-block { padding: 0 0 22px; margin: 0 0 22px; border-bottom: 1px solid var(--line); }
.crm-settings-block:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.crm-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.crm-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border: 1px solid var(--line-strong); background: var(--surface-2); font-size: 13px; color: var(--ink); }
.crm-chip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0 4px; font-size: 12px; line-height: 1; }
.crm-chip button:hover { color: var(--crm-overdue); }
.crm-chip-add { display: inline-flex; gap: 6px; }
.crm-root .crm-chip-add input { width: 180px; padding: 6px 10px; min-height: 34px; }
.crm-root .crm-chip-add .table-action { min-height: 34px; }
.crm-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0 18px; }
.crm-root label.crm-choice.crm-choice { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: 1px solid var(--line-strong); cursor: pointer; color: var(--ink); }
.crm-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.crm-root .crm-choice input[type="radio"] { margin: 2px 0 0; padding: 0; border: 0; background: none; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.crm-choice > span { min-width: 0; }
.crm-choice b { display: block; font-weight: 500; font-size: 14px; }
.crm-choice small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.crm-root .crm-assignees-box { padding: 16px; border: 1px solid var(--line); }
.crm-root label.crm-inline-field.crm-inline-field { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--ink); font-size: 14px; margin: 6px 0 10px; }
.crm-inline-field span { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.crm-root .crm-inline-field input { width: 96px; }
.crm-presets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.crm-work-hours { margin-top: 16px; padding: 16px; border: 1px solid var(--line); display: grid; gap: 4px; }
.crm-root .crm-week { gap: 8px; }
.crm-root .crm-week label { position: relative; }
.crm-root .crm-week input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.crm-week span { display: inline-grid; place-items: center; min-width: 44px; height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); color: var(--muted); font-size: 13px; cursor: pointer; }
.crm-week input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.crm-week input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.crm-savebar { position: sticky; bottom: 0; z-index: 10; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; margin-top: 16px; background: var(--surface); border: 1px solid var(--line-strong); }
.crm-savebar.is-dirty { border-color: var(--accent); box-shadow: 0 -12px 30px -18px rgba(0, 0, 0, .5); }
.crm-savebar.is-dirty #crmSettingsState { color: var(--ink); }
.crm-savebar #crmSettingsState { font-size: 13px; margin-right: auto; }
.crm-savebar .crm-form-error { flex-basis: 100%; order: 3; margin: 0; }
.crm-savebar .crm-form-error:empty { display: none; }
.crm-intake-state { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; margin: 4px 0 18px; border: 1px solid var(--line-strong); color: var(--muted); font-size: 12px; }
.crm-intake-state::before { content: ""; width: 6px; height: 6px; background: var(--faint); }
.crm-intake-state.is-on { color: var(--crm-good); border-color: currentColor; }
.crm-intake-state.is-on::before { background: currentColor; }
.crm-steps { list-style: none; counter-reset: step; display: grid; padding: 0; margin: 0 0 8px; }
.crm-steps > li { counter-increment: step; position: relative; display: grid; gap: 8px; justify-items: start; padding: 0 0 22px 44px; }
.crm-steps > li::before { content: counter(step); position: absolute; left: 0; top: -2px; display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--accent-text); color: var(--accent-text); font: 13px var(--f-mono); }
.crm-steps > li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 30px; bottom: 4px; width: 1px; background: var(--line-strong); }
.crm-steps b { font-weight: 500; font-size: 14px; }
.crm-steps span { color: var(--muted); font-size: 13px; line-height: 1.55; }
.crm-steps .crm-facts { width: 100%; max-width: 640px; }
.crm-steps code { font: 12px var(--f-mono); color: var(--ink); overflow-wrap: anywhere; }
.crm-steps #crmIntakeToken:not(:empty) { display: grid; gap: 8px; width: 100%; max-width: 640px; }
.crm-columns { border-top: 1px solid var(--line); margin-top: 6px; }
@media (max-width: 980px) { .crm-settings-cols { grid-template-columns: 1fr; } }
@media (max-width: 580px) {
  .crm-subtabs { margin-left: -12px; margin-right: -12px; padding: 0 6px; }
  .crm-subtabs button { padding: 10px 12px; font-size: 13px; }
  .crm-filters.no-owner { grid-template-columns: 1fr 1fr; }
  .crm-choices { grid-template-columns: 1fr; }
  .crm-root .crm-chip-add { width: 100%; }
  .crm-root .crm-chip-add input { flex: 1; width: auto; }
  .crm-savebar { padding: 12px; }
  .crm-savebar #crmSettingsState { flex-basis: 100%; }
  .crm-savebar .primary { flex: 1; }
  .crm-steps > li { padding-left: 38px; }
  .crm-menu-list { right: auto; left: 0; }
}
.crm-chart { padding-top: 10px; }
.crm-bars, .crm-bars-axis { display: flex; gap: 3px; }
.crm-bars { align-items: flex-end; height: 180px; border-bottom: 1px solid var(--line-strong); }
.crm-bar { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.crm-bar b { font: 10px var(--f-mono); color: var(--muted); }
.crm-bars.is-dense .crm-bar b { display: none; }
.crm-bar i { display: block; width: 100%; max-width: 32px; background: var(--accent); }
.crm-bar:hover i { background: var(--accent-hover); }
.crm-bars-axis span { flex: 1 1 0; min-width: 0; overflow: visible; white-space: nowrap; font-size: 9.5px; color: var(--faint); padding-top: 6px; text-align: center; }
.crm-root .crm-metrics .panel, .crm-root .crm-analytics-grid .panel { margin-top: 0; }
.crm-root .crm-analytics-grid { align-items: stretch; }

/* 18.10.2026: funnels as board sub-tabs, tasks, personal notifications */
.crm-side-nav .crm-side-count.is-calm { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-strong); }
.crm-subtabs-row { display: flex; align-items: flex-end; gap: 12px; border-bottom: 1px solid var(--line-strong); margin-bottom: 14px; }
.crm-subtabs-row .crm-subtabs { border-bottom: 0; margin-bottom: 0; flex: 0 1 auto; min-width: 0; }
.crm-funnel-new { flex: none; padding: 11px 4px; }
.crm-segment { display: inline-flex; margin: 0 0 14px; border: 1px solid var(--line-strong); }
.crm-segment button { border: 0; background: transparent; color: var(--muted); padding: 7px 12px; font: 12px var(--f-body); cursor: pointer; }
.crm-segment button + button { border-left: 1px solid var(--line-strong); }
.crm-segment button.active { background: var(--accent-soft); color: var(--ink); }
.crm-filters.with-pipeline { grid-template-columns: minmax(180px, 1fr) 170px 170px 180px auto auto; }
.crm-filters.with-pipeline.no-owner { grid-template-columns: minmax(180px, 1fr) 170px 180px auto auto; }
.crm-tab-count { margin-left: 6px; color: var(--crm-overdue); font: 11px var(--f-mono); }
.crm-pad { padding: 18px; }
.crm-task-badge { display: inline-block; margin-top: 8px; padding: 2px 6px; font-size: 11px; color: var(--muted); border: 1px solid var(--line-strong); white-space: nowrap; }
.crm-task-badge.is-late { color: var(--crm-overdue); border-color: currentColor; }
.crm-table .crm-task-badge { display: table; }
.crm-tasks { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.crm-task { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-strong); background: var(--sunken); }
.crm-task.is-late { border-left: 3px solid var(--crm-overdue); }
.crm-task.is-done { opacity: .7; }
.crm-task.is-done b { text-decoration: line-through; }
.crm-task b { display: block; font-weight: 500; font-size: 13px; overflow-wrap: anywhere; }
.crm-task small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.crm-task.is-late small { color: var(--crm-overdue); }
.crm-task-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.crm-root .crm-task-actions .table-action { min-height: 32px; padding: 0 12px; font-size: 12px; }
.crm-task-actions .crm-menu > summary { padding: 0; }
.crm-task-actions .crm-menu > summary::after { content: none; }
.crm-task-form { display: grid; gap: 10px; margin-top: 4px; }
.crm-task-form .crm-presets { margin: 0; }
.crm-task-custom { display: flex; align-items: flex-end; gap: 8px; }
.crm-task-custom label { flex: 1; }
.crm-task-page { margin: 0; padding: 12px; }
.crm-task-page .crm-task { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; }
.crm-task-when { font: 12px var(--f-mono); color: var(--muted); }
.crm-task.is-late .crm-task-when { color: var(--crm-overdue); }
.crm-task-lead { display: block; margin-top: 4px; padding: 0; border: 0; background: none; color: var(--accent-text); font: 13px var(--f-body); text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.crm-task-lead:hover { text-decoration: underline; }
.crm-funnel-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 16px; }
.crm-funnel-tabs button[data-crm-funnel-tab] { border: 1px solid var(--line-strong); background: transparent; color: var(--muted); padding: 7px 12px; font: 13px var(--f-body); cursor: pointer; }
.crm-funnel-tabs button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.crm-funnel-edit { padding: 16px; border: 1px solid var(--line); }
.crm-funnel-name { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.crm-funnel-name label { flex: 1 1 260px; }
.crm-funnel-name small { padding-bottom: 12px; font-size: 12px; }
.crm-text-button.is-danger { color: var(--crm-overdue); padding-bottom: 12px; }
.crm-status-fixed { width: 24px; flex-shrink: 0; text-align: center; color: var(--faint); }
.crm-steps-compact > li { padding-bottom: 16px; }
.crm-notify-form { display: grid; gap: 14px; max-width: 420px; margin-top: 8px; }
.crm-notify-form .crm-actions { margin-top: 4px; }
.crm-notify-form #crmNotifyState:empty { display: none; }
@media (max-width: 980px) { .crm-filters.with-pipeline, .crm-filters.with-pipeline.no-owner { grid-template-columns: 1fr 1fr auto; } }
@media (max-width: 580px) {
  .crm-subtabs-row { margin-left: -12px; margin-right: -12px; padding: 0 6px; }
  .crm-subtabs-row .crm-subtabs { margin: 0; padding: 0; }
  .crm-filters.with-pipeline, .crm-filters.with-pipeline.no-owner { grid-template-columns: 1fr 1fr; }
  .crm-task { flex-wrap: wrap; }
  .crm-task-page .crm-task { grid-template-columns: minmax(0, 1fr); }
  .crm-task-custom { flex-wrap: wrap; }
}
.crm-root a.table-action { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 14px; text-decoration: none; white-space: nowrap; }
.crm-card-deleted { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 22px; font-size: 12px; line-height: 1.6; color: var(--crm-overdue); background: rgba(183, 55, 75, .10); border-bottom: 1px solid var(--line); }
.crm-card-danger { display: grid; gap: 6px; justify-items: start; }
.crm-card-danger small { font-size: 11px; line-height: 1.5; }
.crm-root .primary.is-danger, .crm-dialog .primary.is-danger { background: #b7374b; border-color: #b7374b; color: #fff; }
.crm-tag-new { display: inline-flex; gap: 6px; margin-top: 10px; width: 100%; max-width: 320px; }
.crm-root .crm-tag-new input { flex: 1; padding: 6px 10px; min-height: 32px; font-size: 13px; }
.crm-root .crm-tag-new .table-action { min-height: 32px; }

/* 19.10.2026: settings use the whole width; on a wide screen the panes are two columns */
.crm-settings-form, .crm-settings-section, .crm-root .crm-settings-section { max-width: none; }
@media (min-width: 1200px) {
  .crm-settings-section[data-crm-pane="pipeline"]:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(340px, 1fr); grid-template-rows: auto auto auto 1fr; column-gap: 40px; align-items: start; }
  [data-crm-pane="pipeline"] > .crm-settings-block:first-child { grid-column: 1; grid-row: 1 / span 4; margin: 0; padding: 0; border: 0; }
  [data-crm-pane="pipeline"] > .crm-settings-block:not(:first-child) { grid-column: 2; }
  .crm-settings-section[data-crm-pane="intake"]:not([hidden]), .crm-settings-section[data-crm-pane="notify"]:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, 1fr); column-gap: 48px; align-items: start; }
  [data-crm-pane="intake"] > :is(h3, .crm-help, .crm-intake-state), [data-crm-pane="notify"] > :is(h3, .crm-help) { grid-column: 1 / -1; justify-self: start; }
  [data-crm-pane="intake"] > .crm-steps, [data-crm-pane="notify"] > .crm-steps { grid-column: 1; }
  [data-crm-pane="intake"] > .crm-columns { grid-column: 2; margin-top: 0; border-top: 0; padding: 0 0 0 24px; border-left: 1px solid var(--line); }
  [data-crm-pane="notify"] > .crm-notify-form { grid-column: 2; margin-top: 0; padding-left: 24px; border-left: 1px solid var(--line); max-width: none; }
  [data-crm-pane="reminders"] .crm-work-hours { max-width: 720px; }
  [data-crm-pane="distribution"] .crm-choices { max-width: 1100px; }
}
.crm-intake-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 18px; margin: 6px 0 20px; border: 1px solid var(--line-strong); border-left: 3px solid var(--faint); background: var(--sunken); }
.crm-intake-card > div { display: grid; gap: 4px; min-width: 0; }
.crm-intake-card b { font-weight: 500; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.crm-intake-card b::before { content: ""; width: 8px; height: 8px; background: var(--faint); flex: none; }
.crm-intake-card span { font-size: 13px; color: var(--ink); }
.crm-intake-card small { font-size: 12px; color: var(--muted); }
.crm-intake-card.is-on { border-left-color: var(--crm-good); }
.crm-intake-card.is-on b::before { background: var(--crm-good); }
.crm-intake-card.is-wait { border-left-color: #d9a441; }
.crm-intake-card.is-wait b::before { background: #d9a441; }
.crm-intake-howto > summary { padding: 6px 0 14px; }
@media (min-width: 1200px) {
  [data-crm-pane="intake"] > .crm-intake-card { grid-column: 1 / -1; justify-self: stretch; }
  [data-crm-pane="intake"] > .crm-intake-howto { grid-column: 1; }
}
/* where to write the lead (21.10.2026) */
.crm-channel-icon { display: inline-flex; flex: none; color: var(--muted); }
.crm-channel-icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.crm-table .crm-channel-icon { margin-left: 6px; vertical-align: -2px; }

/* Антон 21.10.2026: slightly rounded corners in the CRM (the rest of the admin keeps its sharp brand) */
body.crm-shell .panel, body.crm-shell .crm-board-card, body.crm-shell .crm-board-column, body.crm-shell .crm-dialog,
body.crm-shell .crm-table-wrap, body.crm-shell .stat-line, body.crm-shell .admin-toast,
body.crm-shell .crm-analytics-panel { border-radius: 12px !important; }
body.crm-shell select, body.crm-shell input:not([type="checkbox"]):not([type="radio"]), body.crm-shell textarea,
body.crm-shell .crm-root input:not([type="checkbox"]), body.crm-shell .crm-root select, body.crm-shell .crm-root textarea,
body.crm-shell .crm-dialog input, body.crm-shell .crm-dialog select, body.crm-shell .crm-dialog textarea,
body.crm-shell .table-action, body.crm-shell button.primary, body.crm-shell .icon-button, body.crm-shell .logout-button,
body.crm-shell .nav, body.crm-shell .side-brand, body.crm-shell .pill, body.crm-shell .tag { border-radius: 8px !important; }
body.crm-shell .chip { border-radius: 6px !important; }
body.crm-shell button.primary, body.crm-shell .icon-button, body.crm-shell .logout-button, body.crm-shell .table-action { clip-path: none; }
.crm-switches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 14px; }
.crm-switches .crm-segment { margin: 0; }
body.crm-shell .crm-segment { border-radius: 8px; overflow: hidden; }
.table-action.crm-filters-on { border-color: var(--accent); color: var(--accent-text); }

/* «Созвоны» (30.10.2026) */
.crm-call-list, .crm-call-day, .crm-call-form { padding: 16px; margin-bottom: 14px; }
.crm-call-list h3, .crm-call-day h3, .crm-call-form h3 { margin: 0 0 10px; font-size: 15px; }
.crm-call-list .crm-table th:nth-child(3), .crm-call-list .crm-table td:nth-child(3) { display: table-cell; }  /* the contact: not the leads' table column that hides at this width */
.crm-call-list .crm-table thead { display: table-header-group; }  /* the phone hides the leads' table head; here the columns scroll and need names */
.crm-call-form h3:not(:first-child) { margin-top: 18px; }
.crm-call-host { margin-bottom: 12px; }
.crm-call-host:last-child { margin-bottom: 0; }
.crm-call-host > b { display: block; margin-bottom: 6px; font-size: 13px; }
.crm-call-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 6px; }
.crm-call-slot { display: grid; gap: 2px; min-width: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: inherit; font: inherit; font-size: 12px; text-align: left; }
.crm-call-slot b { font-size: 13px; font-variant-numeric: tabular-nums; }
.crm-call-slot span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-call-slot.is-busy { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); cursor: pointer; }
.crm-call-who { display: block; max-width: 320px; margin-bottom: 14px; }
.crm-call-link { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0; font-size: 13px; }
.crm-call-link b { overflow-wrap: anywhere; }
.crm-call-week { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.crm-call-week input[type="date"] { width: 100%; }
.crm-call-ranges { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.crm-call-range { display: inline-flex; align-items: center; gap: 4px; }
.crm-call-range input { width: 96px; }
.crm-call-special-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.crm-call-person { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.crm-call-person .crm-actions { grid-column: 1 / -1; }
.crm-call-check { display: flex; align-items: center; gap: 6px; min-height: 40px; }
.crm-call-add { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
#crmCallsGraph > .primary, #crmCallsSettings > .primary { margin-top: 14px; }
@media (max-width: 640px) {
  .crm-call-week { grid-template-columns: minmax(0, 1fr); }
  .crm-call-person { grid-template-columns: minmax(0, 1fr); }
}

/* «Созвоны» → «Сообщения» (05.11.2026) */
.crm-call-subhead{margin-top:18px}
.crm-call-reminder{display:grid;grid-template-columns:150px minmax(0,1fr);gap:10px 14px;padding:14px 0;border-top:1px solid var(--line)}
.crm-call-reminder-text,.crm-call-reminder .crm-call-sample{grid-column:2}
.crm-call-reminder>.crm-text-button{grid-column:2;justify-self:start}
.crm-call-sample{white-space:pre-wrap;padding:10px 12px;border:1px dashed var(--line-strong);background:var(--surface-2,transparent);color:var(--muted);font-size:13px;line-height:1.45}
#crmCallsMessages textarea{width:100%;resize:vertical}
@media (max-width:760px){.crm-call-reminder{grid-template-columns:1fr}.crm-call-reminder-text,.crm-call-reminder .crm-call-sample,.crm-call-reminder>.crm-text-button{grid-column:1}}
/* «Горячие» и «Игнор» и выжимка диалога (21.11.2026, app/crm_ai.py): ИИ двигает лидов по переписке AI-сейлза */
.crm-status-hot { color: #f2b35c; }.crm-status-ignore { color: var(--muted); }
:root[data-theme="light"] .crm-status-hot { color: #9a5b00; }
.crm-hot { display: block; color: #f2b35c; font-size: 11px; margin-top: 8px; white-space: nowrap; }
:root[data-theme="light"] .crm-hot { color: #9a5b00; }
.crm-hot.is-late { color: var(--crm-overdue); }
.crm-brief .crm-hot { margin: 0 0 10px; font-size: 13px; }
.crm-brief-title { margin: 14px 0 6px; font: 500 12px var(--f-body); color: var(--muted); }
.crm-brief-quote { margin: 0; padding: 10px 12px; border-left: 2px solid var(--line-strong); background: var(--surface-2, transparent); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.45; }
.crm-brief-quote small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }
.crm-settings-gap { margin-top: 28px; }
/* «Обзвон» партнёра и переписка в карточке (22.11.2026) */
.crm-status-no_answer, .crm-status-to_write { color: #f2b35c; }
:root[data-theme="light"] .crm-status-no_answer, :root[data-theme="light"] .crm-status-to_write { color: #9a5b00; }
.crm-tries { display: block; color: var(--muted); font-size: 11px; margin-top: 8px; white-space: nowrap; }
/* «Кратко» (22.11.2026): who the lead is and its stages by dates; the other flow of the lead */
.crm-story p { margin: 0; line-height: 1.5; }
.crm-story p + p { margin-top: 6px; }
.crm-story .crm-text-button { margin-left: 6px; }
.crm-chat summary { cursor: pointer; font: 500 14px var(--f-body); } /* the conversation; .crm-dialog is the modal */
.crm-dialog-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; max-height: 480px; overflow-y: auto; }
.crm-dialog-list li { padding: 8px 10px; border: 1px solid var(--line); background: var(--surface-2, transparent); }
.crm-dialog-list li.is-lead { border-left: 2px solid var(--accent-text); }
.crm-dialog-top { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--muted); }
.crm-dialog-top b { color: var(--ink); font-weight: 500; }
.crm-dialog-list p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.45; }
/* 23.11.2026 (the screens' check): the phone hides the leads' table head - the analytics' tables («Работа менеджеров»,
   «Сотрудники», «Кампании», «Отказы») keep theirs: only numbers in a row said nothing; they scroll sideways in the panel */
@media (max-width: 580px) {
  .crm-analytics-panel .crm-table thead { display: table-header-group; }
  .crm-analytics-panel .crm-table th, .crm-analytics-panel .crm-table td { padding: 12px 10px; }
  .crm-analytics-panel .crm-table-wrap { margin: 0 -22px; padding: 0 22px; }
}

/* ---------- 24.11.2026: the CRM's new look, step 1 - the board («сейчас колхоз, а всё остальное у нас современное») ---------- */
/* the late leads: one quiet line */
.crm-reminder { margin-bottom: 16px; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--crm-overdue) 45%, transparent); border-left-width: 1px; border-radius: 10px; background: color-mix(in srgb, var(--crm-overdue) 8%, transparent); font-size: 13px; }
.crm-reminder button { color: var(--accent-text); text-decoration: none; font-size: 13px; }
.crm-reminder button:hover { text-decoration: underline; }
.crm-root .crm-leads-head { margin: 0 0 16px; align-items: center; }
.crm-leads-head p:empty { display: none; }
/* the filters in one row */
.crm-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.crm-toolbar .crm-search { flex: 1 1 240px; min-width: 0; max-width: 420px; }
.crm-toolbar .crm-segment { margin: 0; }
.crm-segment button { padding: 7px 12px; }
.crm-segment button.active { background: var(--surface-2); color: var(--ink); }
.crm-more-filters { border-radius: 12px; }
/* the board: quiet columns, the count in a pill */
.crm-board { gap: 12px; }
.crm-board-column { flex: 0 0 292px; border: 1px solid var(--line); border-top: 1px solid var(--line); background: var(--sunken); }
.crm-board-column-head { padding: 12px 14px 8px; border-bottom: 0; }
.crm-board-column-head h3 { font: 600 13px var(--f-body); }
.crm-board-column-head > span { min-width: 22px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font: 500 11px/1.6 var(--f-body); text-align: center; }
.crm-board-cards { gap: 8px; padding: 4px 8px 10px; }
/* the card: who - what's urgent - whose and when - the stage */
.crm-board-card { padding: 12px 12px 10px; border: 1px solid var(--line); background: var(--surface); transition: border-color .15s; }
.crm-board-card:hover { border-color: var(--line-strong); }
.crm-board-card.overdue { border-left: 1px solid var(--line); box-shadow: inset 3px 0 0 var(--crm-overdue); }
.crm-board-open { gap: 3px; font-size: 13px; line-height: 1.4; }
.crm-board-open b { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.crm-board-open > span { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-card-signals { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; }
.crm-card-signals > span { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: 11.5px; white-space: nowrap; }
.crm-card-signals .crm-task-badge { padding: 0; border: 0; }
.crm-task-badge svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.crm-card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 8px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); min-width: 0; }
.crm-card-meta { display: inline-flex; flex: 1 1 128px; align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-size: 11.5px; }
.crm-card-meta > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the stage: a small «Новый ▾» that is still a select (a phone can't drag cards well) */
.crm-board-status { position: relative; display: inline-flex; flex: 0 0 auto; max-width: 100%; margin: 0 0 0 auto; }
.crm-stage-pill { display: block; max-width: 100%; padding: 3px 22px 3px 8px; border: 1px solid transparent; border-radius: 6px; background: var(--surface-2); color: var(--ink); font: 500 11.5px/1.5 var(--f-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; position: relative; }
.crm-stage-pill::after { content: ''; position: absolute; right: 8px; top: 50%; width: 5px; height: 5px; margin-top: -4px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.crm-board-status:hover .crm-stage-pill { border-color: var(--line-strong); }
.crm-board-status:focus-within .crm-stage-pill { border-color: var(--accent); }
.crm-board-status.is-locked .crm-stage-pill { padding-right: 8px; background: transparent; color: var(--muted); }
.crm-board-status.is-locked .crm-stage-pill::after { display: none; }
.crm-root .crm-board-status select, body.crm-shell .crm-root .crm-board-status select { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; margin: 0; opacity: 0; cursor: pointer; font-size: 16px; }
.crm-root .crm-board-status select:disabled { cursor: default; }
.crm-board-claim-help { font-size: 11px; margin-top: 6px; }
.crm-board-drag-handle { top: 10px; right: 6px; }
.crm-narrow-only { display: none; }
@media (max-width: 580px) {
  .crm-wide-only { display: none; }
  .crm-narrow-only { display: inline; }
  .crm-root .crm-leads-head { align-items: stretch; gap: 12px; }
  .crm-leads-head .crm-actions { flex-wrap: wrap; justify-content: flex-start; gap: 8px; }
  .crm-leads-head .crm-actions .primary { order: -1; margin-left: 0; }
  .crm-leads-head .crm-actions .table-action, .crm-leads-head .crm-actions .primary, .crm-leads-head .crm-actions summary { padding: 8px 12px; font-size: 13px; min-height: 0; }
  .crm-toolbar { gap: 6px; }
  .crm-toolbar .crm-search { flex-basis: 100%; max-width: none; }
  .crm-toolbar .crm-segment { flex: none; }
  .crm-board-column { flex-basis: min(280px, calc(100vw - 48px)); }
}

