:root {
  --bg: #fafafa; --surface: #fff; --surface-2: #f5f5f4; --text: #292929; --muted: #808080;
  --line: #e9e9e7; --accent: #343434; --accent-2: #5a7b9a; --accent-soft: #f0f0ee;
  --warn: #a87928; --warn-soft: #fbf5e9; --danger: #bc5555; --danger-soft: #fbefed;
  --shadow: -8px 0 40px #0000000b;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
}
:root[data-theme="dark"] {
  --bg: #191919; --surface: #202020; --surface-2: #272727; --text: #e4e4e3; --muted: #999997;
  --line: #343433; --accent: #dededb; --accent-soft: #30302f; --warn: #d8ad62; --warn-soft: #332e23;
  --danger: #e08c84; --danger-soft: #382826; --shadow: -8px 0 40px #0003;
}
* { letter-spacing: 0 !important; }
body { font-size: 13px; line-height: 1.45; }
button, input, select, textarea { font-size: 13px; }
button { font-weight: 500; border-radius: 5px; padding: 7px 11px; min-height: 32px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
button:hover { filter: none; opacity: .85; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid #749bc0; outline-offset: 3px; }
button.secondary { background: var(--surface); border-color: var(--line); }
button.small { font-size: 12px; font-weight: 500; padding: 5px 9px; min-height: 28px; }
button.danger { background: var(--danger-soft); color: var(--danger); }
:root[data-theme="dark"] #newLeadBtn,
:root[data-theme="dark"] #saveLeadBtn,
:root[data-theme="dark"] #leadTaskSaveBtn { color: #222; }
svg.lucide { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; }
input, select, textarea { border-radius: 5px; padding: 8px 10px; min-width: 0; font-weight: 400; }
input, select { height: 34px; }
input:focus, select:focus, textarea:focus { border-color: #9ba9b5; box-shadow: 0 0 0 2px #809bb315; }
input::placeholder, textarea::placeholder { color: #a0a09c; }
label { font-size: 12px; font-weight: 400; color: var(--muted); gap: 5px; }
.shell { grid-template-columns: 208px minmax(0, 1fr); height: 100dvh; min-height: 0; }
.sidebar { display: flex; flex-direction: column; gap: 0; padding: 22px 12px 12px; background: var(--surface-2); border-right: 1px solid var(--line); min-height: 0; }
.brand { gap: 9px; padding: 0 7px; }
.brand-mark { width: 29px; height: 29px; border-radius: 7px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; flex-shrink: 0; }
.brand-mark img { width: 23px; height: 23px; object-fit: contain; }
.brand strong { font-size: 13px; font-weight: 600; }
.brand span { font-size: 10px; margin-top: 2px; }
.sidebar-search { display: flex; align-items: center; gap: 6px; margin: 25px 7px 24px; color: var(--muted); }
.sidebar-search input { padding: 0; border: 0; background: transparent; font-size: 12px; height: 25px; }
.nav-caption { color: var(--muted); font-size: 10px; margin: 0 10px 8px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item { height: 34px; padding: 7px 10px; border: 0; font-weight: 400; font-size: 12px; color: var(--muted); border-radius: 5px; min-width: 0; }
.nav-item.active { background: #e9e9e6; color: #31312f; font-weight: 500; }
:root[data-theme="dark"] .nav-item.active { background: #373735; color: var(--text); }
.nav-item:hover { background: var(--line); border: 0; }
.nav-item svg { width: 16px; height: 16px; flex-basis: 16px; fill: none; }
.nav-item[data-view="integrations"] { margin-top: 24px; }
.avito-note { display: none; }
.sidebar-foot { margin-top: auto; padding: 18px 6px 0; }
.preview-label { display: flex; align-items: center; gap: 7px; font-size: 10px; color: var(--muted); padding: 12px 3px; border-bottom: 1px solid var(--line); margin-bottom: 15px; }
.preview-label > span { width: 6px; height: 6px; border-radius: 50%; background: #b9ac77; }
.profile-row { display: flex; align-items: center; gap: 8px; }
.profile-row strong { font-size: 11px; font-weight: 500; display: block; }
.profile-row div > span { font-size: 9px; color: var(--muted); }
.profile-row > div { min-width: 0; flex: 1; }
.profile-row div > span, .profile-row strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-avatar { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; background: #e1e8e5; color: #507064; font-size: 10px; flex-shrink: 0; }
.profile-row button { margin-left: auto; }
.ghost-icon, .column-add { padding: 0; width: 28px; height: 28px; min-height: 28px; background: transparent; color: var(--muted); border: 0; flex-shrink: 0; }
.ghost-icon:hover, .column-add:hover { background: var(--surface-2); color: var(--text); }
.workspace { padding: 0; gap: 0; background: var(--surface); height: 100dvh; display: flex; flex-direction: column; }
.workspace > .view:not(#leadsView) { flex: 1; min-height: 0; overflow: auto; padding: 24px; }
.workspace > .view:not(#leadsView) .panel { box-shadow: none; border-radius: 6px; }
.workspace > .view:not(#leadsView) h2 { font-size: 16px; font-weight: 550; }
.workspace > .view:not(#leadsView) .task-actions button { width: auto; min-width: 28px; }
.workspace > .view:not(#leadsView) .task-check { width: 22px; height: 22px; }
#logoutBtn { padding: 5px; width: 30px; height: 30px; min-height: 30px; background: transparent; border: 0; color: var(--muted); }
.login { background: var(--bg); }
.login-panel { border-radius: 8px; box-shadow: 0 8px 30px #00000008; }
.login-panel h1 { font-size: 24px; }
.login-panel .brand-mark { color: var(--text); }
.topbar { height: 64px; min-height: 64px; padding: 0 25px; align-items: center; border-bottom: 1px solid var(--line); gap: 12px; flex-wrap: nowrap; }
.page-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.page-heading > svg { color: var(--muted); }
.topbar h1 { font-size: 15px; font-weight: 550; line-height: 1.3; }
#pageSubtitle { display: none; }
.lead-count { display: inline-flex; align-items: center; justify-content: center; height: 20px; min-width: 25px; padding: 1px 5px; border-radius: 4px; background: var(--surface-2); color: var(--muted); font-size: 11px; }
.top-actions { gap: 10px; flex-wrap: nowrap; }
.top-actions select { width: 87px; padding: 4px 6px; height: 29px; background: transparent; border-color: transparent; color: var(--muted); font-size: 11px; }
#newLeadBtn { font-size: 12px; white-space: nowrap; }
.demo-badge { font-size: 10px; color: var(--muted); padding: 2px 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; }
#leadsView { gap: 0; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.view-toolbar { min-height: 49px; padding: 0 25px; display: flex; gap: 16px; align-items: center; border-bottom: 1px solid var(--line); }
.view-switch { height: 49px; display: flex; gap: 20px; }
.view-switch button { height: 49px; border-radius: 0; border: 0; border-bottom: 2px solid transparent; padding: 0; background: transparent; color: var(--muted); font-size: 12px; }
.view-switch button[aria-pressed="true"] { border-bottom-color: var(--text); color: var(--text); }
.pipeline-summary { margin-left: auto; color: var(--muted); font-size: 11px; white-space: nowrap; }
.pipeline-summary strong { color: var(--text); font-weight: 500; margin-left: 7px; }
.toolbar-button { background: transparent; color: var(--muted); font-size: 12px; border: 1px solid transparent; }
.toolbar-button[aria-expanded="true"] { background: var(--surface-2); border-color: var(--line); }
.filters.panel { padding: 12px 25px; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 0; box-shadow: none; min-height: 56px; flex-wrap: wrap; }
.search-control { display: flex; align-items: center; gap: 8px; flex: 1 1 170px; max-width: 340px; }
.search-control input { border: 0; background: transparent; height: 30px; padding: 4px 0; font-size: 12px; }
.filters select { border: 0; width: auto; max-width: 200px; background: transparent; color: var(--muted); font-size: 11px; height: 30px; padding: 3px 20px 3px 5px; }
.filter-check { padding: 0; min-height: 30px; border: 0; background: transparent; font-size: 11px; font-weight: 400; white-space: nowrap; gap: 6px; }
.filter-check input { width: 13px; height: 13px; accent-color: #555; }
#sortSelect { margin-left: auto; }
.extra-filters { padding: 0 25px 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.extra-filters select { width: auto; max-width: 100%; font-size: 12px; }
.bulk-toolbar.panel { margin: 0 25px 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px; box-shadow: none; }
.bulk-toolbar strong { font-weight: 500; font-size: 12px; }
.bulk-actions { gap: 6px; }
.bulk-actions button, .bulk-actions select { font-size: 11px; min-height: 28px; padding: 3px 7px; }
.board { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(6, minmax(215px, 1fr)); gap: 14px; padding: 13px 24px 28px; background: var(--bg); overflow: auto; align-items: start; border-block: 1px solid var(--line); }
.board.lost-collapsed { grid-template-columns: repeat(5, minmax(208px, 1fr)) 30px; }
.column { border: 0; border-radius: 0; padding: 0; background: transparent; min-height: 100%; gap: 10px; }
.column > header { height: 34px; margin-bottom: 5px; padding: 0 3px; }
.column h2 { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.count { font-size: 11px; font-weight: 400; }
.column-head-actions { gap: 6px; }
.stage-dot { width: 7px; height: 7px; border-radius: 50%; background: #a4a4a0; flex-shrink: 0; }
[data-status="in_progress"] .stage-dot { background: #759bbb; }
[data-status="contacted"] .stage-dot { background: #b79b65; }
[data-status="deal"] .stage-dot { background: #a992b5; }
[data-status="closed"] .stage-dot { background: #7ca38c; }
.card { border: 1px solid var(--line); border-radius: 6px; padding: 12px; gap: 10px; background: var(--surface); box-shadow: 0 1px 2px #00000003; transition: border-color .12s, box-shadow .12s; }
.card:hover { border-color: #c8cbc9; box-shadow: 0 3px 8px #00000005; }
.card:focus-visible { outline: 2px solid #749bc0; outline-offset: 2px; }
.card.selected { border-color: #7e9c8f; box-shadow: 0 0 0 1px #7e9c8f; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 5px; }
.source-label { display: inline-flex; gap: 5px; align-items: center; color: var(--muted); font-size: 10px; }
.source-label svg { width: 12px; height: 12px; }
.card-check { width: 16px; height: 16px; background: transparent; border: 0; }
.card-check input { width: 13px; height: 13px; margin: 0; accent-color: #627d70; }
.card-identity { display: flex; align-items: center; gap: 8px; min-width: 0; }
.card h3 { font-size: 13px; font-weight: 550; line-height: 1.4; }
.avatar.small { width: 26px; height: 26px; min-width: 26px; font-size: 9px; border-radius: 7px; }
.avatar b { font-weight: 500; }
.avatar-teal { background: #e2eeea; color: #5e8277; }.avatar-blue { background: #e5edf5; color: #6082a0; }.avatar-amber { background: #f1eadc; color: #947a4b; }.avatar-rose { background: #f2e5e7; color: #ac7680; }.avatar-violet { background: #eee8f3; color: #9680a2; }
.card-service { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.card-value { display: flex; align-items: center; gap: 6px; justify-content: space-between; font-weight: 500; font-size: 13px; min-height: 20px; }
.pill { padding: 1px 5px; border: 0; font-size: 9px; font-weight: 400; border-radius: 3px; }
.card-task { display: flex; align-items: center; gap: 6px; font-size: 10px; min-width: 0; padding-top: 9px; border-top: 1px solid var(--line); color: var(--muted); min-height: 25px; }
.card-task > span:not(.task-marker) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-task time { margin-left: auto; white-space: nowrap; font-size: 9px; }
.card-task.late { color: var(--danger); }
.card-task.no-task { color: #a2a29f; }
.task-marker { width: 6px; height: 6px; flex-basis: 6px; margin: 0; border: 0; box-shadow: none; }
.task-marker-green { background: #76a18a; }.task-marker-yellow { background: #cea657; }.task-marker-red { background: #cb7770; }
.card-footer { display: flex; justify-content: space-between; align-items: center; gap: 2px; margin: 0 -3px -3px; }
.card-footer select { min-width: 0; max-width: 108px; width: 100%; font-size: 10px; border: 0; padding: 3px; color: var(--muted); height: 26px; background: transparent; }
.card-footer .quick-links { flex-wrap: nowrap; gap: 0; }
.quick-links .contact-icon-action { width: 28px; min-width: 28px; height: 28px; min-height: 28px; flex-basis: 28px; border: 0; border-radius: 4px; background: transparent; }
.quick-links .contact-icon-action svg { width: 15px; height: 15px; }
.card-footer .contact-icon-action { color: var(--muted); }
.quick-links .contact-icon-action:hover { background: var(--surface-2); color: var(--text); }
.lost-column.collapsed { min-width: 30px; padding: 0; background: transparent; border-left: 1px solid var(--line); }
.lost-column-toggle { border: 0; background: transparent; color: var(--muted); width: 26px; height: 26px; min-height: 26px; }
.lost-column.collapsed::after { content: 'Не закрылся'; writing-mode: vertical-rl; font-size: 11px; color: var(--muted); justify-self: center; }
.empty { background: transparent; border: 1px dashed var(--line); padding: 18px 12px; color: var(--muted); font-size: 12px; font-weight: 400; border-radius: 5px; }
.board-bottom { min-height: 34px; padding: 7px 25px; display: flex; align-items: center; gap: 6px; color: #9b9b97; font-size: 10px; }
.board-bottom > svg { width: 11px; height: 11px; }
.board-bottom-right { margin-left: auto; }
.board.list-layout { display: flex; flex-direction: column; gap: 20px; }
.list-layout .column { width: 100%; min-height: auto; gap: 0; }
.list-layout .column > header { justify-content: flex-start; gap: 15px; }
.list-layout .card { grid-template-columns: 145px minmax(170px, 1fr) minmax(140px, 1fr) 100px minmax(160px, 1fr) 165px; align-items: center; border-radius: 0; box-shadow: none; border-width: 0 0 1px; padding: 11px 8px; gap: 10px; }
.list-layout .card-task { border: 0; padding: 0; }
.list-layout .card-value { flex-direction: column; align-items: flex-start; }
.list-layout .card-footer { margin: 0; }
.list-layout .lost-column.collapsed { width: auto; border: 0; display: flex; align-items: center; gap: 8px; }
.list-layout .lost-column.collapsed::after { writing-mode: horizontal-tb; }
.toast { position: fixed; z-index: 100; top: auto; bottom: 20px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 30px); background: var(--text); color: var(--surface); border: 0; border-radius: 6px; padding: 10px 15px; font-size: 12px; box-shadow: 0 5px 25px #0002; }

.lead-drawer { grid-template-columns: minmax(0, 1fr) min(1200px, calc(100vw - 80px)); }
.lead-overlay { background: #15151526; backdrop-filter: blur(1px); }
.drawer-panel { gap: 0; grid-template-rows: auto auto auto auto minmax(0,1fr) auto; box-shadow: var(--shadow); }
.drawer-head { padding: 25px 28px 17px; align-items: center; }
.drawer-title { gap: 12px; }
.drawer-title h2 { font-size: 21px; font-weight: 550; line-height: 1.35; }
.avatar.large { width: 42px; height: 42px; min-width: 42px; font-size: 14px; border-radius: 10px; }
#leadSubtitle { font-size: 11px; margin: 4px 0 0; }
.warning-text:empty { display: none; }
.warning-text { font-size: 11px; font-weight: 500; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; min-height: 30px; border: 0; background: transparent; color: var(--muted); }
.lead-compact-meta { padding: 0 28px 15px; gap: 14px; }
.lead-compact-meta span { padding: 0; border: 0; background: transparent; border-radius: 0; font-size: 11px; }
.lead-compact-meta strong { font-weight: 400; margin-left: 4px; }
.stage-bar { padding: 0 28px 20px; gap: 4px; }
.stage-step { flex: 1; min-width: 106px; border: 0; border-radius: 3px; min-height: 30px; font-size: 11px; padding: 6px 9px; gap: 5px; background: var(--surface-2); color: var(--muted); }
.stage-step span { width: 14px; height: 14px; font-size: 9px; border: 0; background: transparent; }
.stage-step.current { background: #e7eef4; color: #527c9e; border: 0; }
.stage-step.current span { color: inherit; }
.stage-step.done { color: #719282; }
:root[data-theme="dark"] .stage-step.current { background: #293640; color: #a3c1d7; }
.drawer-tabs { padding: 0 28px; gap: 24px; min-height: 40px; }
.tab { border: 0; border-bottom: 2px solid transparent; padding: 9px 1px; font-size: 12px; background: transparent; border-radius: 0; font-weight: 400; white-space: nowrap; }
.tab.active { background: transparent; border: 0; border-bottom: 2px solid var(--text); color: var(--text); }
.drawer-scroll { padding: 0; }
.drawer-main-grid { grid-template-columns: minmax(250px, .9fr) minmax(370px, 1.4fr) minmax(200px, .7fr); gap: 0; min-height: 100%; }
.lead-fields { gap: 0; padding: 8px 22px 24px 28px; border-right: 1px solid var(--line); }
.form-section, .lead-focus-panel > section, .activity-panel > section, .activity-panel > details { border: 0; border-radius: 0; padding: 18px 0; background: transparent; }
.form-section { border-bottom: 1px solid var(--line); }
.form-section summary { font-weight: 500; font-size: 12px; margin: 0 0 15px; }
.form-section:not([open]) summary { margin-bottom: 0; }
.form-grid { grid-template-columns: 1fr; gap: 11px; }
.lead-fields .form-grid label { display: grid; grid-template-columns: 90px minmax(0,1fr); align-items: center; gap: 8px; font-size: 11px; }
.lead-fields input, .lead-fields select { padding: 5px 6px; border-color: transparent; background: transparent; font-size: 12px; height: 30px; }
.lead-fields input:hover, .lead-fields select:hover { background: var(--surface-2); }
.lead-fields input:focus, .lead-fields select:focus { border-color: var(--line); background: var(--surface); }
.lead-fields .contact-field > label { display: grid; grid-template-columns: 90px minmax(0,1fr); align-items: center; }
.contact-edit-button { top: 12px; right: 0; padding: 0; width: 25px; height: 25px; min-height: 25px !important; border: 0 !important; background: transparent !important; color: var(--muted) !important; }
.contact-edit-button svg { width: 13px; height: 13px; }
.preferred-channel-row { flex-wrap: wrap; gap: 10px; }
.preferred-channel-field { flex: 1 1 100%; display: grid; grid-template-columns: 90px minmax(0,1fr); gap: 8px; align-items: center; }
.messenger-contact-actions { margin-left: 98px; gap: 8px; min-height: 28px; }
.messenger-contact-actions .contact-actions { min-height: 28px; }
.messenger-contact-actions .contact-icon-action { min-width: 28px; background: var(--surface-2); }
.messenger-contact-editor { padding: 10px 0; background: transparent; border: 0; }
.lead-focus-panel { gap: 0; padding: 8px 25px 24px; }
.lead-focus-panel h3, .activity-panel h3, .client-request-card h3 { font-size: 13px; font-weight: 550; }
.focus-tasks-card { border: 0 !important; border-bottom: 1px solid var(--line) !important; margin-bottom: 0; padding-bottom: 24px !important; }
.lead-task-head { margin-bottom: 6px; }
#leadTaskSummary { font-size: 10px; }
.lead-task-list { gap: 10px; }
.lead-task-item { border-top: 0; border-left: 0 !important; padding: 5px 0 !important; grid-template-columns: 18px minmax(0,1fr) auto; gap: 10px; }
.task-check { width: 16px; height: 16px; min-height: 16px; border-radius: 4px; background: var(--surface); border: 1px solid #cbd0cc; margin-top: 2px; padding: 0; font-size: 11px; }
.task-main strong { font-size: 12px; font-weight: 500; line-height: 1.5; }
.task-main > .meta { margin-top: 4px; font-size: 10px; }
.task-main p { font-size: 11px; line-height: 1.5; margin: 6px 0 0; color: var(--muted); }
.task-actions { gap: 0; flex-wrap: nowrap; }
.task-actions button { width: 23px; min-width: 23px; height: 25px; min-height: 25px; border: 0; background: transparent; padding: 3px; color: var(--muted); }
.task-actions svg { width: 12px; height: 12px; }
.completed-task-group { border: 0; margin: 3px 0; padding: 0; }
.completed-task-group summary { color: var(--muted); font-size: 11px; font-weight: 400; padding: 6px 0; cursor: pointer; }
.completed-task-group > summary { text-transform: none; justify-content: flex-start; }
.completed-task-group summary span { margin-left: 5px; }
.task-composer { margin-top: 8px; }
.task-composer > summary { display: flex; align-items: center; gap: 6px; list-style: none; cursor: pointer; font-size: 11px; color: var(--muted); padding: 8px 0; }
.task-composer > summary::-webkit-details-marker { display: none; }
.task-composer > summary svg:last-child { margin-left: auto; width: 13px; transition: transform .15s; }
.task-composer[open] > summary svg:last-child { transform: rotate(180deg); }
.focus-tasks-card .lead-task-form { padding-top: 10px; border: 0; margin-top: 0; gap: 9px; }
.lead-task-form-row { grid-template-columns: minmax(0,1fr) 115px; align-items: start; }
.task-quick-date { min-height: 25px; padding: 3px 9px; font-size: 10px; }
.client-request-card { border: 0 !important; background: transparent !important; padding: 20px 0; gap: 12px; }
.focus-section-head span { display: none; }
.client-request-card textarea { min-height: 100px; font-size: 12px; line-height: 1.65; border: 0; padding: 0; resize: vertical; }
.comment-box { gap: 12px; }
.comment-box > h3 { margin-bottom: 2px; }
.internal-comments-list { background: transparent; border: 0; border-radius: 0; max-height: 320px; }
.internal-comment-item { min-height: 100px; padding: 13px 0; display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 9px; border-bottom: 1px solid var(--line); }
.internal-comment-item:first-child { padding-top: 0; }
.internal-comment-item p { font-size: 12px; line-height: 1.65; }
.internal-comment-meta { font-size: 10px; }
.internal-comment-meta > span { color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.internal-comment-meta > span::before { content: 'А'; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: #e4ebe6; color: #648270; font-size: 9px; }
.internal-comment-meta time { font-size: 9px; }
#internalCommentInput { background: var(--bg); font-size: 12px; line-height: 1.6; }
#addCommentBtn { justify-self: end; font-size: 11px; padding: 4px 9px; }
.activity-panel { position: static; grid-column: auto; grid-template-columns: 1fr; padding: 8px 22px; border-left: 1px solid var(--line); background: var(--bg); gap: 0; }
.focus-action-card { border: 0 !important; border-bottom: 1px solid var(--line) !important; background: transparent !important; gap: 12px; }
.focus-action-card #nextActionPreview { gap: 8px; }
.focus-action-card #nextActionPreview strong { font-weight: 500; font-size: 12px; color: #8c7952; }
.focus-action-card #nextActionPreview span { font-size: 11px; line-height: 1.6; }
.activity-panel .panel-head { flex-direction: column; align-items: flex-start; gap: 15px; }
.activity-panel .panel-head button { font-size: 10px; }
#leadPaymentSummary { font-size: 11px; line-height: 1.8; margin-bottom: 10px; }
.drawer-footer { padding: 12px 25px; gap: 10px; grid-template-columns: auto minmax(0,1fr) auto auto; }
.drawer-footer button { font-size: 12px; }
#deleteLeadBtn { background: transparent; width: 29px; padding: 0; }
#saveState { font-size: 10px; }
.history-tab-content, #leadTabAvito { padding: 24px 28px; }
.history, .history-item.comment { background: transparent; border-radius: 0; }
.history-item { padding: 14px; }
.history-item strong { font-weight: 500; }
.meta { font-size: 12px; }
@media (max-width: 1200px) {
  .shell { grid-template-columns: 180px minmax(0,1fr); }
  .sidebar { padding-inline: 8px; }
  .brand strong { font-size: 12px; }
  .drawer-main-grid { grid-template-columns: 280px minmax(0,1fr); }
  .activity-panel { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; border-left: 0; border-top: 1px solid var(--line); gap: 30px; padding-inline: 28px; }
  .focus-action-card { border: 0 !important; }
  .list-layout .card { min-width: 960px; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 52px minmax(0,1fr); }
  .sidebar { padding: 17px 7px 12px; }
  .brand { padding: 0; justify-content: center; }
  .brand > div:last-child, .sidebar-search, .nav-caption, .sidebar-foot, .nav-item > span { display: none; }
  .nav { margin-top: 28px; gap: 10px; }
  .nav-item { justify-content: center; height: 34px; padding: 0; }
  .nav-item svg { width: 18px; height: 18px; flex-basis: 18px; }
  .topbar { padding: 0 14px; min-height: 56px; height: 56px; }
  .topbar h1 { font-size: 14px; }
  .workspace > .view:not(#leadsView) { padding: 12px; }
  .page-heading { gap: 7px; }
  .page-heading > svg { display: none; }
  .top-actions { width: auto; gap: 6px; }
  .top-actions button { width: auto; }
  .top-actions select { width: 30px; font-size: 0; background: var(--surface-2); padding: 2px; }
  .top-actions select option { font-size: 12px; }
  .demo-badge { display: none; }
  #newLeadBtn { font-size: 11px; padding: 6px 8px; }
  .view-toolbar { padding: 0 14px; gap: 8px; }
  .view-switch { gap: 13px; }
  .pipeline-summary { display: none; }
  #filterToggle { margin-left: auto; font-size: 11px; padding: 4px; }
  .filters.panel { padding: 8px 14px; gap: 6px 10px; }
  .search-control { max-width: none; flex-basis: 100%; }
  #sortSelect { display: none; }
  .filters .ghost-icon { margin-left: auto; }
  .extra-filters { padding: 0 14px 10px; }
  .extra-filters select { width: 100%; }
  .board { padding: 10px 14px 24px; }
  .board.lost-collapsed { grid-template-columns: repeat(5, 242px) 30px; }
  .board:not(.lost-collapsed) { grid-template-columns: repeat(6, 242px); }
  .board-bottom { padding: 6px 14px; }
  .board-bottom-right { display: none; }
  .lead-drawer { grid-template-columns: minmax(0,1fr); }
  .lead-overlay { display: none; }
  .drawer-panel { width: 100%; }
  .drawer-head { padding: 18px 18px 12px; display: flex; }
  .drawer-title h2 { font-size: 18px; }
  .drawer-title .avatar { width: 32px; min-width: 32px; height: 32px; font-size: 11px; }
  .drawer-head-actions { display: flex; }
  #actionLinks { display: none; }
  .lead-compact-meta { padding: 0 18px 12px; gap: 5px 12px; }
  .lead-compact-meta span { font-size: 10px; }
  .stage-bar { padding: 0 18px 13px; }
  .stage-step { min-width: 105px; }
  .drawer-tabs { padding-inline: 18px; }
  .drawer-main-grid { grid-template-columns: minmax(0,1fr); }
  .lead-fields { border-right: 0; padding: 0 18px 12px; }
  .lead-focus-panel { grid-row: 1; padding: 0 18px 12px; border-bottom: 1px solid var(--line); }
  .activity-panel { grid-column: auto; grid-template-columns: 1fr; padding: 0 18px; }
  .lead-task-form-row { grid-template-columns: minmax(0,1fr) 105px; }
  .lead-task-item { grid-template-columns: 18px minmax(0,1fr) auto; }
  .drawer-footer { padding: 10px 16px; grid-template-columns: auto minmax(0,1fr) auto auto; }
  .drawer-footer button { padding: 6px 9px; font-size: 11px; }
  #saveState { font-size: 9px; }
  .bulk-toolbar.panel { margin: 0 14px 10px; width: auto; }
  .bulk-actions { width: auto; }
  .bulk-actions button, .bulk-actions select { width: auto; }
  .list-layout .card { min-width: 0; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
  .list-layout .card-top { grid-column: 1 / -1; }
  .list-layout .card-service { grid-column: 1; }
  .list-layout .card-value { grid-column: 2; grid-row: 2; }
  .list-layout .card-task { grid-column: 1 / -1; }
  .list-layout .card-footer { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
