:root {
  --bg: #f3f6fa;
  --surface: #ffffff;
  --text: #202a35;
  --muted: #5f6c7b;
  --border: rgba(17, 24, 39, 0.12);
  --popover-bg: rgba(255, 255, 255, 0.98);
  --popover-shadow: 0 14px 28px rgba(26, 36, 53, 0.14);
  --accent: #475569;
  --accent-rgb: 71, 85, 105;
  --danger: #c55862;
  --danger-rgb: 197, 88, 98;
  --warning: #c58a3f;
  --warning-rgb: 197, 138, 63;
  --success: #238a4a;
  --success-hover: #1d7440;
  --kanban-icon-success: #238a4a;
  --kanban-icon-success-rgb: 35, 138, 74;
  --kanban-icon-danger: #b42318;
  --kanban-icon-danger-rgb: 180, 35, 24;
  --kanban-icon-warning: #b7791f;
  --kanban-icon-warning-rgb: 183, 121, 31;
  --kanban-icon-info: #2563eb;
  --kanban-icon-info-rgb: 37, 99, 235;
  --kanban-icon-muted: #64748b;
  --kanban-icon-muted-rgb: 100, 116, 139;
  --kanban-icon-stage: var(--stage-color, #97a2b0);
  --kanban-icon-danger-filter: brightness(0) saturate(100%) invert(19%) sepia(88%) saturate(2490%) hue-rotate(350deg) brightness(93%) contrast(89%);
  --code: #2f4f94;
  --color-scheme: light;
  --sidebar-bg: rgba(255, 255, 255, 0.96);
  --customize-bar-bg: rgba(255, 255, 255, 0.96);
  --control-bg: rgba(16, 24, 40, 0.06);
  --control-bg-hover: rgba(16, 24, 40, 0.1);
  --ui-radius-xs: 4px;
  --ui-radius-sm: 6px;
  --ui-radius-md: 8px;
  --ui-radius-lg: 10px;
  --ui-control-height: 32px;
  --ui-control-padding-x: 10px;
  --ui-card-padding: 8px;
  --ui-panel-gap: 6px;
  --field-radius: var(--ui-radius-sm);
  --field-border: rgba(71, 85, 105, 0.14);
  --field-bg: rgba(255, 255, 255, 0.74);
  --field-bg-hover: rgba(248, 250, 252, 0.96);
  --field-hover-border: var(--field-border);
  --field-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 1px 2px rgba(15, 23, 42, 0.035);
  --field-shadow-hover:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 4px 12px rgba(71, 85, 105, 0.055);
  --field-focus-border: rgba(var(--accent-rgb), 0.34);
  --field-focus-bg: rgba(255, 255, 255, 0.98);
  --field-focus-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 0 3px rgba(var(--accent-rgb), 0.08),
    0 6px 16px rgba(26, 36, 53, 0.07);
  --scrollbar-track: transparent;
  --scrollbar-thumb: rgba(95, 108, 123, 0.52);
  --scrollbar-thumb-hover: rgba(95, 108, 123, 0.72);
  --scrollbar-thumb-border: rgba(255, 255, 255, 0.5);
  --uniform-scrollbar-size: 10px;
  --uniform-scrollbar-gap: 4px;
  --uniform-scrollbar-track-bg: rgba(255, 255, 255, 0.78);
  --uniform-scrollbar-track-border: rgba(148, 163, 184, 0.2);
  --uniform-scrollbar-thumb-bg: rgba(95, 108, 123, 0.62);
  --uniform-scrollbar-thumb-bg-hover: rgba(95, 108, 123, 0.82);
  --sidebar-width: 232px;
  --sidebar-rail: 54px;
}

:root[data-theme='light'] {
  --bg: #f3f6fa;
  --surface: #ffffff;
  --text: #202a35;
  --muted: #5f6c7b;
  --border: rgba(17, 24, 39, 0.12);
  --popover-bg: rgba(255, 255, 255, 0.98);
  --popover-shadow: 0 14px 28px rgba(26, 36, 53, 0.14);
  --accent: #475569;
  --accent-rgb: 71, 85, 105;
  --danger: #c55862;
  --danger-rgb: 197, 88, 98;
  --warning: #c58a3f;
  --warning-rgb: 197, 138, 63;
  --success: #238a4a;
  --success-hover: #1d7440;
  --code: #2f4f94;
  --color-scheme: light;
  --sidebar-bg: rgba(255, 255, 255, 0.96);
  --customize-bar-bg: rgba(255, 255, 255, 0.96);
  --control-bg: rgba(16, 24, 40, 0.06);
  --control-bg-hover: rgba(16, 24, 40, 0.1);
  --ui-radius-xs: 4px;
  --ui-radius-sm: 6px;
  --ui-radius-md: 8px;
  --ui-radius-lg: 10px;
  --ui-control-height: 32px;
  --ui-control-padding-x: 10px;
  --ui-card-padding: 8px;
  --ui-panel-gap: 6px;
  --field-radius: var(--ui-radius-sm);
  --scrollbar-track: transparent;
  --scrollbar-thumb: rgba(95, 108, 123, 0.52);
  --scrollbar-thumb-hover: rgba(95, 108, 123, 0.72);
  --scrollbar-thumb-border: rgba(255, 255, 255, 0.5);
  --uniform-scrollbar-size: 10px;
  --uniform-scrollbar-gap: 4px;
  --uniform-scrollbar-track-bg: rgba(255, 255, 255, 0.78);
  --uniform-scrollbar-track-border: rgba(148, 163, 184, 0.2);
  --uniform-scrollbar-thumb-bg: rgba(95, 108, 123, 0.62);
  --uniform-scrollbar-thumb-bg-hover: rgba(95, 108, 123, 0.82);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  scrollbar-width: none;
}

html::-webkit-scrollbar {
  width: 0;
  height: 0;
}

* {
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
  background: transparent;
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

.uniform-scrollbar-host {
  position: relative;
}

.uniform-scrollbar-target {
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
  scrollbar-color: transparent transparent !important;
  margin-top: var(--uniform-scrollbar-reserve-top, 0px) !important;
  margin-right: var(--uniform-scrollbar-reserve-right, 0px) !important;
  margin-bottom: var(--uniform-scrollbar-reserve-bottom, 0px) !important;
}

.uniform-scrollbar-target::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

.uniform-scrollbar-overlay {
  position: absolute;
  z-index: 14;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.uniform-scrollbar-overlay[hidden] {
  display: none !important;
}

.uniform-scrollbar-track {
  position: absolute;
  pointer-events: none;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.78)),
    var(--uniform-scrollbar-track-bg);
  border: 1px solid var(--uniform-scrollbar-track-border);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 1px 2px rgba(15, 23, 42, 0.08);
  opacity: 0.74;
  transition: opacity 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.uniform-scrollbar-track[hidden] {
  display: none !important;
}

.uniform-scrollbar-track--y {
  width: var(--uniform-scrollbar-size);
}

.uniform-scrollbar-track--x {
  height: var(--uniform-scrollbar-size);
}

.uniform-scrollbar-thumb {
  position: absolute;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0)),
    var(--uniform-scrollbar-thumb-bg);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.24),
    0 1px 3px rgba(15, 23, 42, 0.18);
  pointer-events: auto;
  cursor: pointer;
  touch-action: none;
}

.uniform-scrollbar-thumb--y {
  top: 0;
  left: 0;
  width: 100%;
}

.uniform-scrollbar-thumb--x {
  top: 0;
  left: 0;
  height: 100%;
}

.uniform-scrollbar-host:hover .uniform-scrollbar-track,
.uniform-scrollbar-overlay.is-active .uniform-scrollbar-track,
.uniform-scrollbar-overlay.is-dragging .uniform-scrollbar-track {
  opacity: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 2px 5px rgba(15, 23, 42, 0.1);
}

.uniform-scrollbar-host:hover .uniform-scrollbar-thumb,
.uniform-scrollbar-overlay.is-active .uniform-scrollbar-thumb,
.uniform-scrollbar-overlay.is-dragging .uniform-scrollbar-thumb {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0)),
    var(--uniform-scrollbar-thumb-bg-hover);
}

.uniform-scrollbar-overlay--kanban .uniform-scrollbar-track--x {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.uniform-scrollbar-overlay--kanban .uniform-scrollbar-thumb--x {
  background: rgba(95, 108, 123, 0.72);
  box-shadow: none;
}

.uniform-scrollbar-host:hover .uniform-scrollbar-overlay--kanban .uniform-scrollbar-thumb--x,
.uniform-scrollbar-overlay--kanban.is-active .uniform-scrollbar-thumb--x,
.uniform-scrollbar-overlay--kanban.is-dragging .uniform-scrollbar-thumb--x {
  background: rgba(95, 108, 123, 0.86);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  color-scheme: var(--color-scheme);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(var(--accent-rgb), 0.22);
}

a {
  color: var(--accent);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

a:hover {
  text-decoration: underline;
}

button,
[role='button'],
summary {
  -webkit-tap-highlight-color: transparent;
}

.link-danger {
  color: rgba(176, 186, 198, 0.92);
  text-decoration: none;
}

.link-danger:hover {
  color: var(--accent);
  text-decoration: none;
}

code {
  color: var(--code);
}

.container {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
}

.shell .container {
  width: calc(100% - 12px);
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
}

.sidebar {
  border-right: 1px solid var(--border);
  background: var(--sidebar-bg);
  backdrop-filter: blur(8px);
  padding: 8px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: auto;
}

.sidebar__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
}

.gear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--control-bg);
  color: var(--text);
  white-space: nowrap;
}

.gear-btn:hover {
  background: var(--control-bg-hover);
}

.gear-btn__icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex: 0 0 auto;
}

.gear-btn__icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.gear-btn:hover .gear-btn__icon {
  color: var(--text);
}

.gear-btn__label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1;
}

.gear-btn.is-active {
  color: rgb(45, 96, 164);
  border-color: rgba(61, 112, 179, 0.42);
  background: linear-gradient(180deg, rgba(222, 238, 255, 1) 0%, rgba(203, 227, 255, 0.98) 100%);
}

.gear-btn.is-active:hover {
  background: linear-gradient(180deg, rgba(216, 235, 255, 1) 0%, rgba(197, 223, 255, 1) 100%);
}

.gear-btn.is-active .gear-btn__icon,
.gear-btn.is-active .gear-btn__label {
  color: currentColor;
}

body.menu-customize-mode .menu__item.is-active {
  background: transparent;
  border-color: transparent;
}

body.menu-customize-mode .menu__item.is-active[data-customizable='1'] {
  color: var(--danger);
  background: rgba(var(--danger-rgb), 0.12);
  border-color: transparent;
}

body.menu-customize-mode .menu__item.is-active[data-customizable='1']:hover {
  background: rgba(var(--danger-rgb), 0.12);
  border-color: transparent;
}

body.menu-customize-mode .menu__item.is-active::before {
  opacity: 0;
}

.sidebar__bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1px;
}

.sidebar__bottom .gear-btn,
.sidebar__bottom .sidebar-action {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: var(--menu-item-height, 34px);
  height: var(--menu-item-height, 34px);
  padding: 3px 8px;
  border-radius: 10px;
  justify-content: flex-start;
  gap: 8px;
  box-shadow: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 220ms ease;
}

.sidebar__bottom .gear-btn,
.sidebar__bottom .sidebar-action {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
}

.sidebar__bottom .gear-btn:hover,
.sidebar__bottom .sidebar-action:hover {
  border-color: transparent;
  background: rgba(248, 250, 252, 0.9);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.sidebar__bottom .gear-btn__label,
.sidebar__bottom .sidebar-action__label {
  display: inline-flex;
  align-items: center;
  max-width: 170px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1;
  color: currentColor;
  transition:
    opacity 180ms ease,
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    max-width 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar__bottom .gear-btn__icon,
.sidebar__bottom .sidebar-action__icon {
  width: 18px;
  height: 18px;
  color: currentColor;
  flex: 0 0 auto;
}

.sidebar__bottom .gear-btn__icon svg,
.sidebar__bottom .sidebar-action__icon svg {
  width: 18px;
  height: 18px;
}

.shell__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

.customize-bar {
  position: fixed;
  left: var(--sidebar-width);
  right: 0;
  bottom: 0;
  z-index: 50;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  background: var(--customize-bar-bg);
  backdrop-filter: blur(8px);
}


/* Desktop: collapsible sidebar (icon rail + expand on hover). */
@media (min-width: 901px) and (hover: hover) and (pointer: fine) {
  body[data-auth='1'] .shell {
    grid-template-columns: var(--sidebar-rail) 1fr;
  }

  body[data-auth='1'] .sidebar {
    width: var(--sidebar-rail);
    transition:
      width 280ms cubic-bezier(0.22, 1, 0.36, 1),
      box-shadow 240ms ease,
      background-color 240ms ease;
    overflow: hidden;
    z-index: 60;
    will-change: width;
  }

  body[data-auth='1'] .sidebar:hover,
  body[data-auth='1'] .sidebar:focus-within {
    width: var(--sidebar-width);
    overflow: auto;
    box-shadow: 10px 0 28px rgba(15, 23, 42, 0.13);
  }

  body[data-auth='1'] .customize-bar {
    left: var(--sidebar-rail);
  }

  body[data-auth='1'] .sidebar:not(:hover):not(:focus-within) .menu__label,
  body[data-auth='1'] .sidebar:not(:hover):not(:focus-within) .gear-btn__label,
  body[data-auth='1'] .sidebar:not(:hover):not(:focus-within) .sidebar-action__label {
    max-width: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-6px);
  }

  body[data-auth='1'] .sidebar:not(:hover):not(:focus-within) .menu__chevron {
    width: 0;
    margin-left: 0;
    opacity: 0;
    pointer-events: none;
  }

  body[data-auth='1'] .sidebar:not(:hover):not(:focus-within) .brand__text {
    max-width: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-6px);
  }

  body[data-auth='1'] .sidebar:not(:hover):not(:focus-within) .menu__item {
    justify-content: center;
    padding: 6px 6px;
  }

  body[data-auth='1'] .sidebar:not(:hover):not(:focus-within) .menu__item:hover,
  body[data-auth='1'] .sidebar:not(:hover):not(:focus-within) .sidebar-action:hover,
  body[data-auth='1'] .sidebar:not(:hover):not(:focus-within) .gear-btn:hover {
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
  }

  body[data-auth='1'] .sidebar:not(:hover):not(:focus-within) .menu__item--sub {
    display: none;
  }

  body[data-auth='1'] .sidebar:not(:hover):not(:focus-within) .menu__icon {
    margin-right: 0;
  }

  body[data-auth='1'] .sidebar:not(:hover):not(:focus-within) .sidebar-action,
  body[data-auth='1'] .sidebar:not(:hover):not(:focus-within) .gear-btn {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }
}


.customize-bar__inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.customize-bar__label {
  margin-right: auto;
  color: var(--muted);
  font-size: 14px;
}

body.menu-customize-mode .shell__main > main.container {
  padding-bottom: 70px;
}

@media (max-width: 900px) {
  .customize-bar {
    left: 0;
  }
}

.shell__main > main.container {
  flex: 1;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0.2px;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand__text {
  min-width: 0;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition:
    opacity 180ms ease,
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    max-width 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.shell .page-head {
  margin-bottom: 8px;
}

.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;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  flex-wrap: wrap;
}

.toolbar__group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.toolbar__group--right {
  justify-content: flex-end;
  margin-left: auto;
}

.toolbar__meta {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 6px;
  font-size: 13px;
  white-space: nowrap;
  color: var(--muted);
}

.field-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
}

.field-inline > span {
  color: var(--muted);
  font-size: 14px;
}

.field-inline--search {
  flex: 1 1 260px;
}

.field-inline--search > input {
  width: 100%;
}

body[data-page='leads'] .toolbar {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

body[data-page='deals'] .toolbar {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

body[data-page='goods-services'] .toolbar {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

body[data-page='leads'] .toolbar::-webkit-scrollbar {
  width: 0;
  height: 0;
}

body[data-page='deals'] .toolbar::-webkit-scrollbar {
  width: 0;
  height: 0;
}

body[data-page='goods-services'] .toolbar::-webkit-scrollbar {
  width: 0;
  height: 0;
}

body[data-page='leads'] .toolbar input:focus-visible,
body[data-page='leads'] .toolbar select:focus-visible,
body[data-page='leads'] .toolbar button:focus-visible,
body[data-page='leads'] .toolbar a:focus-visible {
  outline-offset: -2px;
}

body[data-page='deals'] .toolbar input:focus-visible,
body[data-page='deals'] .toolbar select:focus-visible,
body[data-page='deals'] .toolbar button:focus-visible,
body[data-page='deals'] .toolbar a:focus-visible {
  outline-offset: -2px;
}

body[data-page='goods-services'] .toolbar input:focus-visible,
body[data-page='goods-services'] .toolbar select:focus-visible,
body[data-page='goods-services'] .toolbar button:focus-visible,
body[data-page='goods-services'] .toolbar a:focus-visible {
  outline-offset: -2px;
}

body[data-page='leads'] .toolbar__group {
  flex-wrap: nowrap;
  min-width: 0;
}

body[data-page='deals'] .toolbar__group {
  flex-wrap: nowrap;
  min-width: 0;
}

body[data-page='goods-services'] .toolbar__group {
  flex-wrap: nowrap;
  min-width: 0;
}

body[data-page='leads'] .toolbar__group--right {
  flex: 0 0 auto;
}

body[data-page='deals'] .toolbar__group--right {
  flex: 0 0 auto;
}

body[data-page='goods-services'] .toolbar__group--right {
  flex: 0 0 auto;
}

body[data-page='tasks'] .toolbar__group {
  flex-wrap: nowrap;
  min-width: 0;
}

body[data-page='tasks'] .toolbar__group--right {
  flex: 0 0 auto;
}

body[data-page='leads'] .field-inline--search {
  min-width: 240px;
}

body[data-page='deals'] .field-inline--search {
  min-width: 240px;
}

body[data-page='goods-services'] .field-inline--search {
  min-width: 240px;
}

body[data-page='leads'] .toolbar button,
body[data-page='leads'] .toolbar input,
body[data-page='leads'] .toolbar select {
  padding: 6px 8px;
  height: 36px;
  line-height: 1.3;
}

body[data-page='deals'] .toolbar button,
body[data-page='deals'] .toolbar input,
body[data-page='deals'] .toolbar select {
  padding: 6px 8px;
  height: 36px;
  line-height: 1.3;
}

body[data-page='goods-services'] .toolbar button,
body[data-page='goods-services'] .toolbar input,
body[data-page='goods-services'] .toolbar select {
  padding: 6px 8px;
  height: 36px;
  line-height: 1.3;
}

body[data-page='leads'] .toolbar select {
  padding-right: 30px;
}

body[data-page='deals'] .toolbar select {
  padding-right: 30px;
}

body[data-page='goods-services'] .toolbar select {
  padding-right: 30px;
}

body[data-page='leads'] #leads-pipeline {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  flex: 0 0 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-page='leads'] .field-inline--pipeline {
  position: relative;
  align-items: center;
  width: clamp(178px, 18vw, 256px);
  min-width: 178px;
  max-width: 256px;
  flex: 0 0 clamp(178px, 18vw, 256px);
}

body[data-page='leads'] .field-inline--pipeline.is-loading {
  visibility: hidden;
  pointer-events: none;
}

body[data-page='leads'] .field-inline--pipeline::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 12px;
  width: 7px;
  height: 7px;
  border-right: 2px solid rgba(15, 23, 42, 0.5);
  border-bottom: 2px solid rgba(15, 23, 42, 0.5);
  transform: translateY(-62%) rotate(45deg);
  pointer-events: none;
}

body[data-page='leads'] .toolbar .field-inline:not(.field-inline--search) {
  flex: 0 0 auto;
  width: max-content;
  max-width: none;
}

body[data-page='leads'] .toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body[data-page='leads'] #leads-refresh {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  opacity: 0.75;
  font-size: 20px;
  line-height: 1;
}

body[data-page='deals'] #deals-refresh,
body[data-page='deals'] #deals-structure-toggle {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  opacity: 0.75;
  font-size: 20px;
  line-height: 1;
}

body[data-page='goods-services'] #goods-services-refresh,
body[data-page='goods-services'] #goods-services-structure-toggle {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  opacity: 0.75;
  font-size: 20px;
  line-height: 1;
}

body[data-page='deals'] #deals-structure-toggle svg {
  width: 22px;
  height: 22px;
  display: block;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

body[data-page='goods-services'] #goods-services-structure-toggle svg {
  width: 22px;
  height: 22px;
  display: block;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

body[data-page='leads'] #leads-refresh svg {
  width: 22px;
  height: 22px;
  display: block;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

body[data-page='leads'] #leads-refresh:hover {
  background: rgba(255, 255, 255, 0.04);
  opacity: 1;
}

body[data-page='deals'] #deals-refresh:hover,
body[data-page='deals'] #deals-structure-toggle:hover {
  background: rgba(255, 255, 255, 0.04);
  opacity: 1;
}

body[data-page='deals'] .deals-view-switch {
  gap: 6px;
  flex-wrap: wrap;
}

body[data-page='deals'] .deals-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  color: rgba(176, 186, 198, 0.94);
}

body[data-page='deals'] .deals-view-toggle__input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

body[data-page='deals'] .deals-view-toggle__track {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 38px;
  height: 22px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  transition: background 0.18s ease;
}

body[data-page='deals'] .deals-view-toggle__thumb {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28);
  transition: transform 0.18s ease, background 0.18s ease;
}

body[data-page='deals'] .deals-view-toggle__label {
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}

body[data-page='deals'] .deals-view-toggle:hover .deals-view-toggle__track {
  background: rgba(148, 163, 184, 0.28);
}

body[data-page='deals'] .deals-view-toggle__input:checked + .deals-view-toggle__track {
  background: rgba(var(--accent-rgb), 0.28);
}

body[data-page='deals'] .deals-view-toggle__input:checked + .deals-view-toggle__track .deals-view-toggle__thumb {
  transform: translateX(16px);
  background: rgba(255, 255, 255, 0.96);
}

body[data-page='deals'] .deals-view-toggle__input:focus-visible + .deals-view-toggle__track {
  outline: 2px solid rgba(var(--accent-rgb), 0.42);
  outline-offset: 2px;
}

body[data-page='goods-services'] #goods-services-refresh:hover,
body[data-page='goods-services'] #goods-services-structure-toggle:hover {
  background: rgba(255, 255, 255, 0.04);
  opacity: 1;
}

body[data-page='goods-services'] #goods-services-structure-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(76vh, 820px);
}

body[data-page='goods-services'] #goods-services-structure-content {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 4px;
  padding-bottom: 4px;
}

.panel {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.shell .panel {
  margin-top: 6px;
  padding: 6px;
  border-radius: 10px;
}

.kanban {
  display: grid;
  grid-template-rows: 1fr;
  grid-auto-flow: column;
  grid-auto-columns: minmax(232px, 1fr);
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  min-width: 0;
}

.shell .kanban {
  gap: 6px;
  padding-bottom: 2px;
}

body[data-page='leads'] .kanban {
  transform: rotateX(180deg);
  margin-top: 0;
  margin-bottom: 0;
  scrollbar-gutter: stable;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-width: auto;
}

body[data-page='leads'] .kanban > * {
  transform: rotateX(180deg);
}

body[data-page='leads'] .kanban::-webkit-scrollbar {
  height: 12px;
}

body[data-page='leads'] .kanban::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 999px;
  box-shadow: none;
}

body[data-page='leads'] .kanban::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 2px solid var(--scrollbar-thumb-border);
}

body[data-page='leads'] .kanban::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

body[data-page='leads'] .leads-board {
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

body[data-page='leads'] .leads-board__meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.leads-task-metric,
.tasks-summary__badge {
  --metric-color: rgba(30, 41, 59, 0.88);
  --metric-rgb: 148, 163, 184;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  white-space: nowrap;
  box-shadow: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
  touch-action: manipulation;
}

.leads-task-metric--passive,
.tasks-summary__badge--passive {
  cursor: default;
  touch-action: auto;
}

.leads-task-metric--loading,
.tasks-summary__badge--loading {
  cursor: default;
  pointer-events: none;
  user-select: none;
}

.leads-task-metric--loading::before,
.tasks-summary__badge--loading::before {
  content: '';
  display: block;
  width: clamp(104px, 10vw, 128px);
  height: 36px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 13px;
  background:
    linear-gradient(90deg, rgba(var(--metric-rgb), 0.05), rgba(var(--metric-rgb), 0.16), rgba(var(--metric-rgb), 0.05)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 251, 253, 0.95));
  background-size: 220% 100%, 100% 100%;
  background-position: 200% 0, 0 0;
  box-shadow:
    0 6px 14px rgba(15, 23, 42, 0.035),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  animation: tasks-summary-loading-shimmer 1.2s linear infinite;
}

.leads-task-metric--passive .leads-task-metric__main,
.tasks-summary__badge--passive .tasks-summary__badge-main {
  min-height: 0;
  padding: 3px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

@keyframes tasks-summary-loading-shimmer {
  from {
    background-position: 200% 0, 0 0;
  }
  to {
    background-position: -20% 0, 0 0;
  }
}

.leads-task-metric--overdue,
.tasks-summary__badge--overdue {
  --metric-color: var(--kanban-icon-danger);
  --metric-rgb: var(--kanban-icon-danger-rgb);
}

.leads-task-metric--active,
.tasks-summary__badge--active {
  --metric-color: var(--kanban-icon-success);
  --metric-rgb: var(--kanban-icon-success-rgb);
}

.leads-task-metric--active .leads-task-metric__main,
.tasks-summary__badge--active .tasks-summary__badge-main {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.985), rgba(244, 253, 248, 0.95)),
    linear-gradient(180deg, rgba(var(--metric-rgb), 0.24), rgba(var(--metric-rgb), 0.1));
}

.leads-task-metric--active:hover .leads-task-metric__main,
.leads-task-metric--active:focus-within .leads-task-metric__main,
.tasks-summary__badge--active:hover .tasks-summary__badge-main,
.tasks-summary__badge--active:focus-within .tasks-summary__badge-main {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(243, 252, 247, 0.96)),
    linear-gradient(180deg, rgba(var(--metric-rgb), 0.3), rgba(var(--metric-rgb), 0.13));
}

.leads-task-metric--active.is-filter-selected .leads-task-metric__main,
.tasks-summary__badge--active.is-filter-selected .tasks-summary__badge-main {
  border-color: rgba(148, 163, 184, 0.26);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(240, 252, 245, 0.66)),
    linear-gradient(180deg, rgba(var(--metric-rgb), 0.92), rgba(var(--metric-rgb), 0.76));
  box-shadow:
    0 18px 34px rgba(var(--kanban-icon-success-rgb), 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.leads-task-metric--today,
.tasks-summary__badge--today {
  --metric-color: var(--kanban-icon-warning);
  --metric-rgb: var(--kanban-icon-warning-rgb);
}

.leads-task-metric--completed,
.tasks-summary__badge--completed {
  --metric-color: var(--kanban-icon-info);
  --metric-rgb: var(--kanban-icon-info-rgb);
}

.leads-task-metric--done,
.tasks-summary__badge--done {
  --metric-color: var(--kanban-icon-info);
  --metric-rgb: var(--kanban-icon-info-rgb);
}

.leads-task-metric--canceled,
.tasks-summary__badge--canceled {
  --metric-color: var(--kanban-icon-muted);
  --metric-rgb: var(--kanban-icon-muted-rgb);
}

.leads-task-metric--tomorrow,
.tasks-summary__badge--tomorrow {
  --metric-color: var(--kanban-icon-info);
  --metric-rgb: var(--kanban-icon-info-rgb);
}

.leads-task-metric__main,
.tasks-summary__badge-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 36px;
  padding: 5px 10px 5px 7px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 251, 253, 0.95)),
    linear-gradient(180deg, rgba(var(--metric-rgb), 0.07), rgba(var(--metric-rgb), 0.025));
  box-shadow:
    0 6px 14px rgba(15, 23, 42, 0.035),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.leads-task-metric__icon,
.tasks-summary__badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  min-width: 16px;
  height: 16px;
  border-radius: 0;
  background: transparent;
  color: rgba(var(--metric-rgb), 0.96);
  box-shadow: none;
}

.leads-task-metric__content,
.tasks-summary__badge-content {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: nowrap;
}

.leads-task-metric__value,
.tasks-summary__badge-value {
  color: rgba(30, 41, 59, 0.96);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
}

.leads-task-metric__label,
.tasks-summary__badge-label {
  color: rgba(71, 85, 105, 0.82);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0;
}

.leads-task-metric:hover .leads-task-metric__main,
.leads-task-metric:focus-within .leads-task-metric__main,
.tasks-summary__badge:hover .tasks-summary__badge-main,
.tasks-summary__badge:focus-within .tasks-summary__badge-main {
  transform: none;
  border-color: rgba(148, 163, 184, 0.26);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(249, 251, 253, 0.96)),
    linear-gradient(180deg, rgba(var(--metric-rgb), 0.09), rgba(var(--metric-rgb), 0.035));
  box-shadow:
    0 10px 20px rgba(15, 23, 42, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.leads-task-metric--passive:hover .leads-task-metric__main,
.leads-task-metric--passive:focus-within .leads-task-metric__main,
.tasks-summary__badge--passive:hover .tasks-summary__badge-main,
.tasks-summary__badge--passive:focus-within .tasks-summary__badge-main {
  transform: none;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.leads-task-metric.is-filter-selected .leads-task-metric__main,
.tasks-summary__badge.is-filter-selected .tasks-summary__badge-main {
  border-color: rgba(148, 163, 184, 0.26);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(247, 250, 252, 0.68)),
    linear-gradient(180deg, rgba(var(--metric-rgb), 0.52), rgba(var(--metric-rgb), 0.38));
  box-shadow:
    0 14px 28px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.leads-task-metric__icon svg,
.tasks-summary__badge-icon svg {
  display: block;
  width: 14px;
  height: 14px;
}

body[data-page='deals'] .deals-board {
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

body[data-page='goods-services'] .goods-services-board {
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

body[data-page='deals'] .deals-board > #deals-table {
  flex: 1 1 auto;
  min-height: 0;
}

body[data-page='deals'] #deals-table.table-wrap {
  padding: 8px;
  background: #fff;
}

body[data-page='goods-services'] .goods-services-board > #goods-services-table {
  flex: 1 1 auto;
  min-height: 0;
}

body[data-page='leads'] .leads-board > #leads-kanban,
body[data-page='leads'] .leads-board > #leads-table {
  flex: 1 1 auto;
  min-height: 0;
}

.kanban__col {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 6px 1px;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 4px;
  min-height: 0;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.shell .kanban__col {
  border-radius: 10px;
  padding: 6px 1px;
  gap: 4px;
}

.kanban__col::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--stage-color, rgba(255, 255, 255, 0.08));
  border-radius: inherit;
  opacity: 0.9;
  pointer-events: none;
}

.kanban__col-head,
.settings-preview-stage-header {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 4px 12px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.kanban__col-strip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  width: calc(100% - 10px);
  min-height: 28px;
  margin: 0 5px;
  padding: 3px 6px;
  border-radius: 8px;
  background:
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--stage-color, #97a2b0) 44%, rgba(255, 255, 255, 0.48)) 0%,
      color-mix(in srgb, var(--stage-color, #97a2b0) 26%, rgba(255, 255, 255, 0.66)) 100%
    );
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--stage-color, #97a2b0) 24%, rgba(255, 255, 255, 0.48)),
    inset 0 1px 0 rgba(255, 255, 255, 0.54);
}

.kanban__col-head .kanban__col-title {
  flex: 1 1 auto;
  width: auto;
}

.settings-preview-stage-header {
  width: min(100%, 360px);
}

.kanban__col-title {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  font-weight: 650;
  font-size: 17px;
  line-height: 1.2;
  color: rgba(79, 91, 106, 0.96);
}

.kanban__col-title > span {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
}

.kanban__col-strip-metrics {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  flex: 0 0 auto;
  min-width: 0;
  max-width: 52%;
}

.kanban__count-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-start;
  min-width: 0;
  min-height: 26px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 11px;
  background: transparent;
  box-sizing: border-box;
  color: rgba(58, 68, 84, 0.96);
  font-weight: 900;
  letter-spacing: -0.02em;
  box-shadow: none;
  backdrop-filter: none;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
  flex: 0 0 auto;
  white-space: nowrap;
}

.kanban__col-strip .kanban__count-badge,
.kanban__col-strip .kanban__tags-badge,
.kanban__col-strip .kanban__col-timer {
  min-height: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 7px;
  border-color: rgba(255, 255, 255, 0.54);
  background: #fff;
  color: rgba(38, 48, 62, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 1px 2px rgba(15, 23, 42, 0.035);
}

.kanban__col-strip .kanban__tags-badge {
  gap: 2px;
}

.kanban__col-strip .kanban__count-badge-dot {
  width: 15px;
  min-width: 15px;
  height: 15px;
}

.kanban__col-strip .kanban__count-badge-value,
.kanban__col-strip .kanban__tags-badge-value,
.kanban__col-strip .kanban__col-timer-value {
  font-size: 12px;
}

.kanban__col-strip .kanban__col-timer-icon,
.kanban__col-strip .kanban__col-timer-icon svg,
.kanban__col-strip .kanban__col-timer-image {
  width: 12px;
  min-width: 12px;
  height: 12px;
}

.kanban__col-strip .kanban__col-timer-icon {
  color: var(--kanban-icon-stage);
}

.kanban__col-strip .kanban__col-timer-image {
  filter: none;
  animation: kanban-stage-timer-icon-breathe 3.2s ease-in-out infinite;
}

@keyframes kanban-stage-timer-icon-breathe {
  0%,
  100% {
    opacity: 0.78;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.045);
  }
}

@media (prefers-reduced-motion: reduce) {
  .kanban__col-strip .kanban__col-timer-image {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.kanban__count-badge-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  min-width: 14px;
  height: 14px;
  background-color: var(--kanban-icon-stage);
  -webkit-mask-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAYAAAA4qEECAAAACXBIWXMAAAsTAAALEwEAmpwYAAAC0UlEQVR4nO2cS4hOcRiHHyMzZDPGhsXEQsplzSQ7l500ZCeslBkryWUrt6XLTr7Izm2l3FZiGKEk2dCwEhlKw7BAr776b9SYonPe9z3zvk/99s95mvN9Nd85f0iSJEmSJEmSJJkidAKDwDDwFRDH+wjcA7YDM2gQ84EnDgLKf6wdfC4N+UtuamQpuwt04JxBB6Gkgp0vHyV9QA8OeeggktSwUWAIaAEHgE3AMqDLKvQXB1FEcT+BEeAGcBIYANYCvXWH/puQZ6SmvQWOAd2a0p6RmvcaWKQl7RlR2Etgloa0Z0RpezSkPSNKe6Qh7RlR2piGtGdEaZ81pD0jSnuuIe0ZUdpVDWnPiNKOakh7RpS2Q0PaM6K0VRrSnhGlVfqDQoZmwn3Sko4e+oGWdPTQ57Sko4c+qCUdPfRmLenooZdrSXtGat6vqv/pP5l05NBvNKUjh76pKR059ClN6cihd2tKRw69TlM6cugFmtKekRr3ra4nUzM0f+yZtnTU0Je1paOGPqwtHTX0Nm3pqKH7tKWjhu7RlvaM1LQPFtIRQw9ZSEcM3bKQjhh6v4V0xND9FtIRQy+1kPaM1PQ74UwL6WihR6yko4W+biUdLfQJK+looQespKOFXmMlHS10r5W0Z6TijWucYJOh4amldKTQFy2lI4U+ZCkdKfRWS+lIoVdYSkcK3W0p7RmpcO+1pKMdxyYTnAKpwrCDixXDndUKPeDgYsVw+zQPgX3s4ILFaBtRZF45EUsCbgnKtA+83gXcD/QF+aPc0Y1hOrAY2ADsBc4Ad4B3DmJOtldMIbrKccJbygMqF8rB4GMOQrddQjAHWA3sBI4Dl4AX5ehhjdDt44xD01keZukvd0GrPIA4WmHkK9YX2YS7YGU5Zv5Ieeek/YLP93+IfA2YbX0hTaUDWAisL2++ngZulRfox8sZSbfLd8U0a9kkSZIkSZIkSRI0+A0Q+oHTCuyZLQAAAABJRU5ErkJggg==");
  mask-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAYAAAA4qEECAAAACXBIWXMAAAsTAAALEwEAmpwYAAAC0UlEQVR4nO2cS4hOcRiHHyMzZDPGhsXEQsplzSQ7l500ZCeslBkryWUrt6XLTr7Izm2l3FZiGKEk2dCwEhlKw7BAr776b9SYonPe9z3zvk/99s95mvN9Nd85f0iSJEmSJEmSJJkidAKDwDDwFRDH+wjcA7YDM2gQ84EnDgLKf6wdfC4N+UtuamQpuwt04JxBB6Gkgp0vHyV9QA8OeeggktSwUWAIaAEHgE3AMqDLKvQXB1FEcT+BEeAGcBIYANYCvXWH/puQZ6SmvQWOAd2a0p6RmvcaWKQl7RlR2Etgloa0Z0RpezSkPSNKe6Qh7RlR2piGtGdEaZ81pD0jSnuuIe0ZUdpVDWnPiNKOakh7RpS2Q0PaM6K0VRrSnhGlVfqDQoZmwn3Sko4e+oGWdPTQ57Sko4c+qCUdPfRmLenooZdrSXtGat6vqv/pP5l05NBvNKUjh76pKR059ClN6cihd2tKRw69TlM6cugFmtKekRr3ra4nUzM0f+yZtnTU0Je1paOGPqwtHTX0Nm3pqKH7tKWjhu7RlvaM1LQPFtIRQw9ZSEcM3bKQjhh6v4V0xND9FtIRQy+1kPaM1PQ74UwL6WihR6yko4W+biUdLfQJK+looQespKOFXmMlHS10r5W0Z6TijWucYJOh4amldKTQFy2lI4U+ZCkdKfRWS+lIoVdYSkcK3W0p7RmpcO+1pKMdxyYTnAKpwrCDixXDndUKPeDgYsVw+zQPgX3s4ILFaBtRZF45EUsCbgnKtA+83gXcD/QF+aPc0Y1hOrAY2ADsBc4Ad4B3DmJOtldMIbrKccJbygMqF8rB4GMOQrddQjAHWA3sBI4Dl4AX5ehhjdDt44xD01keZukvd0GrPIA4WmHkK9YX2YS7YGU5Zv5Ieeek/YLP93+IfA2YbX0hTaUDWAisL2++ngZulRfox8sZSbfLd8U0a9kkSZIkSZIkSRI0+A0Q+oHTCuyZLQAAAABJRU5ErkJggg==");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  flex: 0 0 auto;
  align-self: center;
  vertical-align: middle;
  line-height: 0;
  cursor: help;
}

.kanban__count-badge-value {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
}

.kanban__col-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: start;
  gap: 2px;
  width: calc(100% - 10px);
  min-width: 0;
  min-height: 28px;
  box-sizing: border-box;
  margin: 0 5px 2px;
  padding: 3px 5px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.12);
  box-shadow: none;
}

.kanban__col-meta:empty {
  display: none;
}

.settings-preview-stage-header__metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: start;
  gap: 4px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0 12px 2px;
}

.kanban__col-meta .badge,
.settings-preview-stage-header__metrics .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 26px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--badge-border);
  border-radius: 11px;
  background: transparent;
  box-sizing: border-box;
  box-shadow: none;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
  flex: 0 0 auto;
  max-width: 100%;
}

.kanban__col-meta .badge {
  min-height: 22px;
  height: 22px;
  padding: 0 5px;
  border-color: transparent;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
}

.kanban__col-meta .badge__icon,
.kanban__col-meta .badge__icon svg,
.settings-preview-stage-header__metrics .badge__icon,
.settings-preview-stage-header__metrics .badge__icon svg {
  width: 14px;
  min-width: 14px;
  height: 14px;
}

.kanban__col-meta .badge__icon,
.settings-preview-stage-header__metrics .badge__icon {
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--badge-color);
}

.kanban__col-meta .badge--success,
.settings-preview-stage-header__metrics .badge--success {
  --badge-rgb: var(--kanban-icon-success-rgb);
  --badge-color: var(--kanban-icon-success);
  --badge-border: rgba(var(--kanban-icon-success-rgb), 0.32);
}

.kanban__col-meta .badge--warn,
.kanban__col-meta .badge--danger,
.settings-preview-stage-header__metrics .badge--warn,
.settings-preview-stage-header__metrics .badge--danger {
  --badge-rgb: var(--kanban-icon-danger-rgb);
  --badge-color: var(--kanban-icon-danger);
  --badge-border: rgba(var(--kanban-icon-danger-rgb), 0.26);
}

.kanban__col-meta .badge[data-icon-type='unassigned'],
.settings-preview-stage-header__metrics .badge[data-icon-type='unassigned'] {
  gap: 6px;
}

.kanban__col-meta .badge[data-icon-type='timerOverdue'] {
  gap: 5px;
}

.kanban__col-meta .badge[data-icon-type='timerOverdue'] .kanban__col-timer-image {
  filter: none;
  animation: kanban-stage-timer-icon-breathe 3.6s ease-in-out infinite;
}

.kanban__col-meta .badge > span:last-child,
.settings-preview-stage-header__metrics .badge > span:last-child {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
}

.kanban__col-meta .badge--interactive {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.kanban__col-meta .badge--interactive:hover,
.kanban__col-meta .badge--interactive:focus-visible,
.kanban__col-meta .badge--interactive[aria-expanded='true'] {
  background: rgba(255, 255, 255, 0.38);
  border-color: transparent;
  color: var(--badge-color);
  outline: none;
}

.kanban__col-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 11px;
  border: 1px solid rgba(var(--kanban-icon-success-rgb), 0.32);
  background: transparent;
  box-sizing: border-box;
  color: var(--kanban-icon-success);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  box-shadow: none;
  opacity: 1;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
  flex: 0 0 auto;
  max-width: 100%;
}

.kanban__col-timer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  min-width: 14px;
  height: 14px;
  flex: 0 0 auto;
  align-self: center;
  vertical-align: middle;
  line-height: 0;
}

.kanban__col-timer-image {
  display: block;
  width: 100%;
  height: 100%;
}

.kanban__col-timer-image {
  --kanban-timer-icon: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAACXBIWXMAAAsTAAALEwEAmpwYAAAExUlEQVR4nO2dy2teRRiHn4AYakMbcdlioyAoXvJVS5uKVZfuFHXjH2ApaHGrYKWICyvSUBuUbt2JdmNvKxWL0HrDG6gVqwvbWry1qNTWNHll4D0gwZh855yZ950554EfhOTLOTO/mTPX98wH/pCW9CdwHNgOjFpnKickgj4B1lhnrMsFIFoI/ZNgWAACPG6duRz4I2IBHLPOXA68H7EAfrfOXA5sj9wM9SzBqHaYfQEYsiZiIfQskyt11HKs5Y65p6enJ2NuAJ6xTkSXzT+lfck0MELhXAXcC2wDdgOHgc+Ak8BvwCVgXn/+CfgCOATs0/nEFmBVBPPlX4VQHFPATuCoGtx01HNZR1LPAptaNL9SqBjZMwHsAL6JPAsWfXqe03s2NT/7QrgD2A/MJTD+v56McO87G5qfZSEE448YmL6YQr+xvoH5lXbhnHFgRmufOFN4Cl/RNNYxv9LDOOUh4KwDo2UJhTSeafD/J3C4ujnjwFhJqBtxwnXAxw4MkcS6Dwfc1vBRlox1l4fJ1C8OjBADXQTGLM2/G7jgwAgxUlgGMW12zjkwQYz0HXCNZYfb1TZfdN4Q5g9mQ80ujnZE9SNwE4Z0bZwvXmp+NcOVTHVcR2x1Z+hnrM0fz2R5QRYxf7Xm42bgfI1rnFUPzJgpwPyKR2pe62UMl5QvF2I+ur97ouYq6iQGHCnI/Iq9Na97AIPaX5r5gScbXD905sl4o0DzAy80uMfrJJzxzhVoPho9Ufc+s8A6ErCjUPM3t3C/EPoSlZFEoSOS2PzxmiOghfo2drTcVIHmr9bPt3XvjTELYKcDc2UJfQRcbWS+qEfROOrAYHFsftB7MQNl24jVLLHZkQWjoShbkvc4MFmcm1/p/8Ida7PNgdHitNlZqMdiFMC0A7NFow72aKj5yiHSn8p80RDH1jnkZPdpskbaU5ofdDCC/3zuoOZPZmC+6Fs8rfO9cQHsycT8aquydawj3TZmYr7o9mbrWM8BxoZI64ih+UF/d70AVjnorzrdBE0Zp/XnEjvhl4ZIa9293TZjRIschg6Wkc6Bg+by05InYoMlzK/7cl2bihIlsdtBxkRr915t58dUm/V31jW/0otdWowTh3q0a8vR4kzhkJAoGzIXHWROnOsvYAWReNdBBsW53qLjm/JirKdjFsAmBxkU5wpxs1H52kEmxam+JAE5hSZKYj2VogAmMgvOlUQKnlxLIvY7yLA402skZKCnFVpnWpwoeHE7iTnsIOPiRG9iwPpMX9KTCKGI4YwME6w3PsSBTE9LDHuvpx2YIIZnRCw3JjUaDzowQow63vtxQhebomkcMapRytIRfajf8OGKiY70B6dSzniH5RY9Sl4K1XmrcyGGYUuhh/Zd8HAcZVePrTwXa583JuEQpB8cmCcthJq7b3YWY52OGCRTfeC5w10uVwDPZ7h6us/jULMJD2RyruhpTzPctlmpT8OsA6NlgWb1Nai2vnXJNQMNYJ13YPy8ruebLSlbcivwqtG+wpxWgg3WJnhgLfCExtXHNv4rDTC73jrTXtmgoS/vtBSLGmI139aItehBU6WxQmegWzXm/qB+0XP4MrZf9X2ASzrrPql/O6Cf3ar/Gy1Qtqenp6enp6enh5r8A20UCYTJ30HrAAAAAElFTkSuQmCC");
  background-color: currentColor;
  background-image: none;
  -webkit-mask-image: var(--kanban-timer-icon);
  mask-image: var(--kanban-timer-icon);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  filter: none;
}

.kanban__col-timer-value {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.kanban__tags-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 26px;
  height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 11px;
  background: rgba(148, 163, 184, 0.08);
  box-shadow: none;
  color: rgba(58, 68, 84, 0.98);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  flex: 0 0 auto;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.kanban__tags-badge:hover,
.kanban__tags-badge:focus-visible,
.kanban__tags-badge[aria-expanded='true'] {
  background: rgba(var(--accent-rgb), 0.1);
  border-color: rgba(var(--accent-rgb), 0.24);
  color: rgba(19, 87, 60, 0.96);
  outline: none;
}

.kanban__col-strip .kanban__tags-badge:hover,
.kanban__col-strip .kanban__tags-badge:focus-visible,
.kanban__col-strip .kanban__tags-badge[aria-expanded='true'] {
  border-color: color-mix(in srgb, var(--stage-color, #97a2b0) 24%, rgba(255, 255, 255, 0.72));
  background: #fff;
  color: rgba(15, 23, 42, 0.96);
}

.kanban__col-strip .kanban__tags-badge-label {
  background-color: var(--kanban-icon-stage);
}

.kanban__tags-badge-label,
.kanban__tags-badge-value {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.kanban__tags-badge-label {
  justify-content: center;
  width: 15px;
  min-width: 15px;
  height: 15px;
  font-size: 0;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0;
  background-color: currentColor;
  --tags-badge-icon: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAC3klEQVR4nO3cQWoUQRTG8f/e4E68gG5E0JXGa+giLtwpvWrBK4gn0OxEEDyF4B28gAtR41ZURBPFV1JQDW7MZGY69vdevQ8+CMkQquaXqu6emQ5kMplMJpOZch54ALwC3gLfgLJw6xheA4+Ac3SUW8AnAYDj+gW4SQcZARN4wk/S39FRRkcYUz9H3b5GhxhTHxIso2OM0g70YTI4x6j9SpAMATCmus8QCKPOw3WGQBjuQYZgGK5BhoAYbkFGEYxD4DFwHTjTWr9+0n626e91lVEE4wC4csw4r7bHhAYZRTAOV2D8jXIYdcsaRTBK26ZOmv2IIKMQRu21Nca+Gw1kEMOo3Vlj/DuRQAZBjHVBzkYBUdumSs9bljJGadcZ3RzU1TFKO5Wtp7SrUh9z5BnEA0ZpPViBsumFoQyIJ4zSetS2pN12oK+90b637sqQAlE9myoLffokMdDpoiCJgQ5IYqADkhjogCQGOiCJgQ5IYqADkhjogCQGOiCJgQ5IYqAD4vGFwhIVJDHYqrO+2pvbFFv311wYuTKY7XbprZMrg9n6JlcGUn2ZKwOp1j/wXBno3PBZ/w1IYrB86/N5ZxOM3KY4FYz7iYFvjHuJwWlgbHQQvwz8FJhACdSNMWpeCEygBOpWGDUfBSZRgnRrDLb4nGqW+TFq3gtMpjjvbBg1zwQmVBx3Voyai8APgYkVh50dY8pee3tx6QkWRz01jCm32ztaS0+0RL4CTxT8YiQKehiJgh5GoqCHMSVR0MGY0jOKqWH0jGKqGD2imDpGTyjmBaMHFPOGERnFvGJERDHvGJFQLApGBBSLhuEZxaJieESx6BieUKwXDA8o1huGMor1iqGIYr1jKKFYYuigWGLooFhi6KBYYuigWGLooFhi6KBYYuigWGLooFhi6KBYYuigWGLooFhi6KBYYvzf7AHf/4FRb+G+u/QAe8wF4CnwriF8AJ4Dl5YeWCaTyWQyiOQPAto5rHSsbA4AAAAASUVORK5CYII=");
  -webkit-mask-image: var(--tags-badge-icon);
  mask-image: var(--tags-badge-icon);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  transform: none;
}

.kanban__col-strip .kanban__tags-badge-label,
.kanban__col-strip .kanban__tags-badge:hover .kanban__tags-badge-label,
.kanban__col-strip .kanban__tags-badge:focus-visible .kanban__tags-badge-label,
.kanban__col-strip .kanban__tags-badge[aria-expanded='true'] .kanban__tags-badge-label {
  color: var(--stage-color, #97a2b0);
}

.kanban__tags-badge-value {
  min-width: 18px;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.lead-card-menu.lead-kanban-issue-menu {
  width: min(420px, calc(100vw - 20px));
  padding: 14px;
  gap: 12px;
  border-radius: 18px;
  border-color: rgba(95, 108, 123, 0.14);
  z-index: 165;
  background:
    radial-gradient(circle at top right, rgba(var(--accent-rgb), 0.07), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 251, 249, 0.975)),
    var(--popover-bg);
  box-shadow:
    0 22px 54px rgba(15, 23, 42, 0.16),
    0 4px 14px rgba(15, 23, 42, 0.08);
}

.lead-kanban-issue-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lead-kanban-issue-menu__title {
  min-width: 0;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.25;
  color: rgba(58, 68, 84, 0.98);
}

.lead-kanban-issue-menu__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.1);
  color: rgba(19, 87, 60, 0.96);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  flex: 0 0 auto;
}

.lead-kanban-issue-menu__refs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
  max-height: min(320px, 46vh);
  overflow-y: auto;
}

.lead-kanban-issue-menu__empty {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.lead-card-menu.lead-kanban-tags-menu {
  width: min(860px, calc(100vw - 28px));
  padding: 16px;
  gap: 14px;
  border-radius: 22px;
  border-color: rgba(95, 108, 123, 0.14);
  z-index: 165;
  background:
    radial-gradient(circle at top right, rgba(var(--accent-rgb), 0.08), transparent 38%),
    radial-gradient(circle at bottom left, rgba(148, 163, 184, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 251, 249, 0.975)),
    var(--popover-bg);
  box-shadow:
    0 28px 68px rgba(15, 23, 42, 0.18),
    0 4px 14px rgba(15, 23, 42, 0.08);
}

.lead-kanban-tags-menu__header {
  display: grid;
  gap: 8px;
  padding: 2px 2px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.lead-kanban-tags-menu__title {
  font-size: 16px;
  font-weight: 850;
  line-height: 1.2;
  color: rgba(58, 68, 84, 0.98);
}

.lead-kanban-tags-menu__summary {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.lead-kanban-tags-menu__metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lead-kanban-tags-menu__metric {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: rgba(58, 68, 84, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.lead-kanban-tags-menu__metric--accent {
  border-color: rgba(var(--accent-rgb), 0.18);
  background: rgba(var(--accent-rgb), 0.1);
  color: rgba(19, 87, 60, 0.96);
}

.lead-kanban-tags-menu__metric-label,
.lead-kanban-tags-menu__metric-value {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.lead-kanban-tags-menu__metric-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.lead-kanban-tags-menu__metric-value {
  font-size: 13px;
  font-weight: 900;
}

.lead-kanban-tags-menu__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  gap: 16px;
  min-width: 0;
  align-items: start;
}

.lead-kanban-tags-menu__list,
.lead-kanban-tags-menu__details {
  min-width: 0;
}

.lead-kanban-tags-menu__list {
  display: grid;
  align-content: flex-start;
  gap: 8px;
  max-height: min(420px, 56vh);
  overflow-y: auto;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.74)),
    rgba(148, 163, 184, 0.06);
}

.lead-kanban-tags-menu__details {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 280px;
  padding: 16px 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.74)),
    rgba(148, 163, 184, 0.07);
}

.lead-kanban-tags-menu__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.76)),
    rgba(148, 163, 184, 0.05);
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.lead-kanban-tags-menu__item:hover,
.lead-kanban-tags-menu__item:focus-visible,
.lead-kanban-tags-menu__item.is-active {
  border-color: rgba(var(--accent-rgb), 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.84)),
    rgba(var(--accent-rgb), 0.09);
  color: rgba(19, 87, 60, 0.96);
  box-shadow:
    0 10px 20px rgba(var(--accent-rgb), 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  outline: none;
}

.lead-kanban-tags-menu__item-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.lead-kanban-tags-menu__item-label > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-kanban-tags-menu__item-dot {
  --tag-rgb: 148, 163, 184;
  width: 9px;
  min-width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(var(--tag-rgb), 0.95);
  box-shadow: 0 0 0 2px rgba(var(--tag-rgb), 0.14);
}

.lead-kanban-tags-menu__item-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: inherit;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.lead-kanban-tags-menu__detail-title {
  font-size: 16px;
  font-weight: 850;
  line-height: 1.25;
  color: rgba(58, 68, 84, 0.98);
  overflow-wrap: anywhere;
}

.lead-kanban-tags-menu__detail-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.lead-kanban-tags-menu__detail-tag-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.lead-kanban-tags-menu__detail-tag-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.1);
  color: rgba(19, 87, 60, 0.96);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.lead-kanban-tags-menu__lead-refs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 10px;
}

.lead-kanban-tags-menu__lead-ref {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 249, 251, 0.92)),
    rgba(255, 255, 255, 0.84);
  color: rgba(58, 68, 84, 0.98);
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.lead-kanban-tags-menu__lead-ref:hover,
.lead-kanban-tags-menu__lead-ref:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 249, 0.94)),
    rgba(var(--accent-rgb), 0.08);
  color: rgba(19, 87, 60, 0.96);
  box-shadow:
    0 10px 20px rgba(var(--accent-rgb), 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  outline: none;
}

.lead-kanban-tags-menu__empty {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .lead-card-menu.lead-kanban-issue-menu,
  .lead-card-menu.lead-kanban-tags-menu {
    width: min(calc(100vw - 16px), 100%);
    padding: 14px;
  }

  .lead-kanban-tags-menu__body {
    grid-template-columns: minmax(0, 1fr);
  }

  .lead-kanban-tags-menu__details {
    min-height: 0;
    padding: 14px;
  }

  .lead-kanban-tags-menu__list {
    padding: 12px;
  }
}

.kanban__col .badge__icon,
.kanban__col .badge__icon svg,
.kanban__col .lead-card__tasks-icon,
.kanban__col .lead-card__tasks-icon svg,
.kanban__col .kanban__col-timer-icon,
.kanban__col .kanban__col-timer-icon svg {
  width: 16px;
  min-width: 16px;
  height: 16px;
}

.kanban__col-meta .badge__icon,
.kanban__col-meta .badge__icon svg,
.settings-preview-stage-header__metrics .badge__icon,
.settings-preview-stage-header__metrics .badge__icon svg {
  width: 14px;
  min-width: 14px;
  height: 14px;
}

.kanban__col-meta .kanban__col-timer-icon,
.kanban__col-meta .kanban__col-timer-icon svg,
.settings-preview-stage-header__metrics .kanban__col-timer-icon,
.settings-preview-stage-header__metrics .kanban__col-timer-icon svg {
  width: 14px;
  min-width: 14px;
  height: 14px;
}

.kanban__count-badge-dot,
.kanban__col-meta .badge__icon,
.settings-preview-stage-header__metrics .badge__icon,
.kanban__col-meta .kanban__col-timer-icon,
.settings-preview-stage-header__metrics .kanban__col-timer-icon {
  transform: translateY(-0.5px);
}

.badge,
.status-badge {
  --badge-rgb: 148, 163, 184;
  --badge-color: rgba(30, 41, 59, 0.88);
  --badge-border: rgba(var(--badge-rgb), 0.16);
  --badge-bg-start: rgba(var(--badge-rgb), 0.12);
  --badge-bg-end: rgba(var(--badge-rgb), 0.06);
  --badge-accent: rgba(var(--badge-rgb), 0.92);
  --badge-accent-soft: rgba(var(--badge-rgb), 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--badge-border);
  border-radius: 11px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.72)),
    linear-gradient(180deg, var(--badge-bg-start), var(--badge-bg-end));
  color: var(--badge-color);
  font-weight: 800;
  letter-spacing: 0.015em;
  line-height: 1;
  white-space: nowrap;
  box-shadow:
    inset 4px 0 0 var(--badge-accent),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.badge {
  min-height: 26px;
  min-width: 30px;
  padding: 0 10px 0 8px;
  font-size: 11px;
  border-radius: 999px;
  border-color: rgba(var(--badge-rgb), 0.2);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.88)),
    linear-gradient(135deg, rgba(var(--badge-rgb), 0.18), rgba(var(--badge-rgb), 0.08));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 8px 18px rgba(15, 23, 42, 0.06);
}

.badge__icon,
.lead-card__tasks-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  min-width: 14px;
  height: 14px;
  flex: 0 0 auto;
  align-self: center;
  vertical-align: middle;
  line-height: 0;
  transform: translateY(-0.5px);
}

.badge__icon {
  width: 16px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(var(--badge-rgb), 0.14);
  box-shadow: inset 0 0 0 1px rgba(var(--badge-rgb), 0.12);
}

.badge__icon svg,
.lead-card__tasks-icon svg {
  display: block;
  width: 14px;
  height: 14px;
}

.task-semantic-icon {
  display: block;
  width: 100%;
  height: 100%;
  flex: 0 0 auto;
  color: currentColor;
}

.kanban__col-timer-image {
  align-self: center;
  vertical-align: middle;
  line-height: 0;
  background-image: none;
  filter: none;
}

.badge__icon .kanban__col-timer-image {
  width: 100%;
  height: 100%;
}

.lead-card__tasks-icon {
  color: currentColor;
}

.badge--warn {
  --badge-rgb: var(--kanban-icon-warning-rgb);
  --badge-color: var(--kanban-icon-warning);
  --badge-border: rgba(var(--kanban-icon-warning-rgb), 0.18);
  --badge-bg-start: rgba(254, 243, 199, 0.26);
  --badge-bg-end: rgba(254, 243, 199, 0.12);
}

.badge--danger {
  --badge-rgb: var(--kanban-icon-danger-rgb);
  --badge-color: var(--kanban-icon-danger);
  --badge-border: rgba(var(--kanban-icon-danger-rgb), 0.18);
  --badge-bg-start: rgba(var(--kanban-icon-danger-rgb), 0.22);
  --badge-bg-end: rgba(var(--kanban-icon-danger-rgb), 0.1);
}

.badge--success {
  --badge-rgb: var(--kanban-icon-success-rgb);
  --badge-color: var(--kanban-icon-success);
  --badge-border: rgba(var(--kanban-icon-success-rgb), 0.18);
  --badge-bg-start: rgba(var(--kanban-icon-success-rgb), 0.2);
  --badge-bg-end: rgba(var(--kanban-icon-success-rgb), 0.08);
}

.badge--soft {
  --badge-rgb: 148, 163, 184;
  --badge-color: rgba(51, 65, 85, 0.8);
  --badge-border: rgba(148, 163, 184, 0.14);
  --badge-bg-start: rgba(148, 163, 184, 0.14);
  --badge-bg-end: rgba(148, 163, 184, 0.06);
  --badge-accent: rgba(148, 163, 184, 0.72);
}

.kanban__col-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  min-height: 0;
  padding: 0;
  scrollbar-gutter: stable;
  overscroll-behavior-y: contain;
  overscroll-behavior-x: auto;
}

.shell .kanban__col-body {
  gap: 6px;
}

body[data-page='leads'] .kanban__col-body {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

body[data-page='leads'] .kanban__col-body::-webkit-scrollbar {
  width: 10px;
}

body[data-page='leads'] .kanban__col-body::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 999px;
  box-shadow: none;
}

body[data-page='leads'] .kanban__col-body::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 0;
}

body[data-page='leads'] .kanban__col-body::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

.lead-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 8px 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  position: relative;
  overflow: hidden;
  line-height: 1.35;
  isolation: isolate;
}

.lead-card.lead-card--viewed-today {
  background: rgba(148, 163, 184, 0.09);
  border-color: rgba(148, 163, 184, 0.2);
}

.kanban__col-body > .lead-card {
  flex: 0 0 auto;
}

.shell .lead-card {
  border-radius: 10px;
  padding: 6px 6px 6px 10px;
}

.lead-card::before {
  content: '';
  position: absolute;
  inset: 0;
  /* Don't tint the whole card by stage color: keep only the stripe (::after). */
  background: transparent;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.lead-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: var(--stage-color, rgba(255, 255, 255, 0.1));
  opacity: 0.9;
  pointer-events: none;
  z-index: 0;
}

.lead-card > * {
  position: relative;
  z-index: 1;
}

.lead-card__title {
  display: grid;
  gap: 6px;
  font-weight: 600;
  line-height: 1.2;
}

.lead-card__fields {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  row-gap: 0;
  font-weight: 400;
  min-width: 0;
}

.lead-card__fields .lead-card__name {
  font-weight: 600;
  line-height: 1.2;
}

.lead-card__fields .lead-card__time {
  margin-top: 0;
}

.lead-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
}

.lead-card__top-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}

.lead-card__top-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.lead-card__indicators {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 4px 10px;
  min-width: 0;
  width: fit-content;
  max-width: 100%;
  padding: 6px 9px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(248, 250, 252, 0.74)),
    linear-gradient(180deg, rgba(148, 163, 184, 0.12), rgba(148, 163, 184, 0.05));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 6px 14px rgba(15, 23, 42, 0.035);
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
}

.lead-card__num {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  min-height: 0;
  border: 0;
  background: none;
  color: rgba(17, 24, 39, 0.96);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
  white-space: nowrap;
  box-shadow: none;
  transform-origin: left center;
  transition:
    transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 180ms ease;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .lead-card__num {
    color: transparent;
    background-image: linear-gradient(
      120deg,
      rgba(17, 24, 39, 0.98) 0%,
      rgba(99, 102, 241, 0.86) 24%,
      rgba(59, 130, 246, 0.88) 48%,
      rgba(245, 158, 11, 0.9) 72%,
      rgba(236, 72, 153, 0.82) 100%
    );
    background-size: 220% 220%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: lead-modal-num-color-flow 18s ease-in-out infinite;
  }
}

.lead-card__tasks,
.lead-card__comments,
.lead-card__issue {
  --lead-card-indicator-rgb: 148, 163, 184;
  --lead-card-indicator-color: var(--kanban-icon-muted);
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  min-height: 16px;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: var(--lead-card-indicator-color);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  flex: 0 0 auto;
  opacity: 1;
  box-shadow: none;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
}

.lead-card__metric-label {
  opacity: 0.88;
  font-weight: 600;
}

.lead-card__metric-value {
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.lead-card__tasks--active {
  --lead-card-indicator-rgb: var(--kanban-icon-success-rgb);
  --lead-card-indicator-color: var(--kanban-icon-success);
}

.lead-card__tasks--overdue {
  --lead-card-indicator-rgb: var(--kanban-icon-danger-rgb);
  --lead-card-indicator-color: var(--kanban-icon-danger);
}

.lead-card__tasks--completed {
  --lead-card-indicator-rgb: var(--kanban-icon-info-rgb);
  --lead-card-indicator-color: var(--kanban-icon-info);
}

.lead-card__comments {
  --lead-card-indicator-rgb: var(--kanban-icon-muted-rgb);
  --lead-card-indicator-color: var(--kanban-icon-muted);
}

.lead-card__issue--warn {
  --lead-card-indicator-rgb: var(--kanban-icon-warning-rgb);
  --lead-card-indicator-color: var(--kanban-icon-warning);
}

.lead-card__issue--danger {
  --lead-card-indicator-rgb: var(--kanban-icon-danger-rgb);
  --lead-card-indicator-color: var(--kanban-icon-danger);
}

.lead-card__name {
  min-width: 0;
}

.lead-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 6px;
}

.lead-card__title .lead-card__tags {
  margin-top: 0;
}

.lead-card__timer {
  margin-top: 0;
  font-size: 13px;
  line-height: 1.2;
  color: var(--muted);
}

.lead-card__timer.is-overdue {
  color: var(--kanban-icon-danger);
}

.lead-tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  min-height: 24px;
  padding: 3px 10px 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: none;
  transition:
    border-color 120ms ease,
    background 120ms ease,
    color 120ms ease;
}

.lead-tag:hover {
  border-color: rgba(17, 24, 39, 0.14);
  background: rgba(255, 255, 255, 0.88);
}

.lead-tag--colored {
  border-color: rgba(var(--tag-rgb), 0.2);
  background: rgba(var(--tag-rgb), 0.1);
  color: rgba(var(--tag-rgb), 0.9);
}

.lead-tag--colored:hover {
  border-color: rgba(var(--tag-rgb), 0.28);
  background: rgba(var(--tag-rgb), 0.14);
}

.lead-tag--outline {
  border-color: rgba(95, 108, 123, 0.18);
  background: rgba(255, 255, 255, 0.66);
  color: var(--text);
}

.lead-tag--outline:hover {
  border-color: rgba(95, 108, 123, 0.26);
  background: rgba(255, 255, 255, 0.82);
}

.lead-card__tags .lead-tag,
.lead-card__tags .lead-tag:hover,
.lead-card__tags .lead-tag--colored,
.lead-card__tags .lead-tag--colored:hover,
.lead-card__tags .lead-tag--outline,
.lead-card__tags .lead-tag--outline:hover {
  border-color: transparent;
}

.lead-tag-menu,
.lead-card-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: min(260px, calc(100% - 16px));
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--popover-bg);
  box-shadow: var(--popover-shadow);
  z-index: 90;
  display: grid;
  gap: 6px;
}

.lead-assignee-menu {
  width: min(320px, calc(100% - 16px));
  padding: 10px;
  gap: 8px;
  border-radius: 14px;
  border-color: rgba(95, 108, 123, 0.16);
  z-index: 160;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(248, 251, 249, 0.95)),
    var(--popover-bg);
  box-shadow:
    0 18px 44px rgba(15, 23, 42, 0.14),
    0 2px 8px rgba(15, 23, 42, 0.06);
}

.lead-assignee-menu > .muted {
  padding: 0 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(95, 108, 123, 0.72);
}

.dt-menu {
  width: min(320px, calc(100% - 16px));
}

.dt-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.dt-menu__month {
  flex: 1 1 auto;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  user-select: none;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dt-menu__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.dt-menu__dow {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 2px 0;
  user-select: none;
}

.dt-menu__day {
  height: 32px;
  padding: 0;
  border-radius: 8px;
  border-color: transparent;
  background: transparent;
  color: var(--text);
  display: inline-grid;
  place-items: center;
  line-height: 1;
  font-size: 13px;
}

.dt-menu__day:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

.dt-menu__day.is-selected {
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.65);
}

.dt-menu__day.is-today:not(.is-selected) {
  border-color: rgba(var(--accent-rgb), 0.35);
}

.dt-menu__day.is-out {
  opacity: 0.45;
}

.dt-menu__time {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.dt-menu__time input {
  width: 64px;
  text-align: center;
  box-shadow: none;
  background-color: rgba(0, 0, 0, 0.18);
}

.dt-menu__time-sep {
  color: var(--muted);
  font-weight: 600;
  user-select: none;
}

.dt-menu__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.confirm-menu__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px 36px;
  gap: 6px;
  align-items: center;
}

.confirm-menu__text {
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.lead-tag-menu__item,
.lead-card-menu__item {
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  border-radius: 10px;
  border-color: transparent;
  background: transparent;
  color: var(--text);
}

.lead-tag-menu__item:hover,
.lead-card-menu__item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

.lead-tag-menu__item.is-disabled,
.lead-card-menu__item.is-disabled {
  opacity: 0.45;
}

.lead-assignee-menu .lead-card-menu__item {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 12px;
}

.lead-assignee-menu .lead-card-menu__item:hover {
  background: rgba(var(--accent-rgb), 0.08);
  border-color: rgba(var(--accent-rgb), 0.18);
}

.lead-assignee-menu .lead-card-menu__item.is-disabled {
  opacity: 1;
  color: rgba(19, 87, 60, 0.96);
  background: rgba(var(--accent-rgb), 0.08);
  border-color: rgba(var(--accent-rgb), 0.18);
}

.leads-add-host {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.leads-add-menu {
  width: min(320px, calc(100% - 16px));
  padding: 10px;
  border-radius: 16px;
  border-color: rgba(95, 108, 123, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 249, 0.96)),
    var(--popover-bg);
  box-shadow:
    0 22px 52px rgba(15, 23, 42, 0.16),
    0 4px 12px rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 8px;
  transform-origin: right top;
  animation: leads-add-menu-enter 0.14s ease-out;
}

.leads-add-menu .lead-card-menu__item,
.leads-add-menu__item {
  width: 100%;
  min-height: 56px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(95, 108, 123, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.9)),
    rgba(255, 255, 255, 0.72);
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 6px 16px rgba(15, 23, 42, 0.04);
}

.leads-add-menu .lead-card-menu__item:hover,
.leads-add-menu__item:hover {
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.12), rgba(var(--accent-rgb), 0.08)),
    rgba(255, 255, 255, 0.96);
  border-color: rgba(var(--accent-rgb), 0.24);
  color: var(--text);
}

.leads-add-menu .lead-card-menu__item.is-disabled,
.leads-add-menu__item.is-disabled {
  cursor: not-allowed;
  opacity: 1;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(245, 247, 250, 0.94)),
    rgba(255, 255, 255, 0.92);
  border-color: rgba(95, 108, 123, 0.1);
  color: rgba(95, 108, 123, 0.92);
}

.leads-add-menu .lead-card-menu__item.is-disabled:hover,
.leads-add-menu__item.is-disabled:hover {
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(245, 247, 250, 0.94)),
    rgba(255, 255, 255, 0.92);
  border-color: rgba(95, 108, 123, 0.1);
}

.leads-add-menu__item[data-variant='primary'] {
  border-color: rgba(95, 108, 123, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.9)),
    rgba(255, 255, 255, 0.72);
}

.leads-add-menu__item-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(var(--accent-rgb), 0.12);
  color: rgba(19, 87, 60, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.leads-add-menu__item[data-variant='muted'] .leads-add-menu__item-icon {
  background: rgba(148, 163, 184, 0.12);
  color: rgba(71, 85, 105, 0.78);
}

.leads-add-menu__item-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.leads-add-menu__item-text {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.leads-add-menu__item-title {
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.leads-add-menu__item-meta {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

@keyframes leads-add-menu-enter {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.lead-task-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 56px;
}

.lead-task-notify {
  display: grid;
  gap: 6px;
}

.lead-task-notify__options {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.lead-task-notify__option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.stage-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  margin-right: 8px;
  vertical-align: middle;
}

.pipeline-menu__edit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px 36px;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.pipeline-menu__edit input {
  box-shadow: none;
}

.pipeline-menu__item {
  line-height: 1.35;
  padding: 8px 10px;
}

.pipeline-menu__item.is-active {
  background: rgba(var(--accent-rgb), 0.14);
  border-color: rgba(var(--accent-rgb), 0.35);
}

.lead-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
  padding: 12px;
  display: flex;
}

body[data-page='leads'] .leads-board .lead-modal {
  position: absolute;
  border-radius: inherit;
  background: transparent;
  backdrop-filter: none;
}

body[data-page='deals'] .deals-board .deal-modal {
  position: absolute;
  border-radius: inherit;
  padding: 0;
}

body[data-page='deals'] .deals-board .deal-modal__panel {
  border-radius: inherit;
}

.shell .lead-modal {
  padding: 6px;
}

body[data-page='tasks'] #tasks-board > .task-lead-modal {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: transparent;
  backdrop-filter: none;
}

body[data-page='tasks'] #tasks-board > .task-modal {
  position: absolute;
  inset: 0;
  padding: 0;
  border-radius: inherit;
}

.lead-modal__panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--popover-shadow);
  overflow: hidden;
}

.shell .lead-modal__panel {
  border-radius: 10px;
}

.lead-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.shell .lead-modal__header {
  padding: 6px;
}

.lead-modal__title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.lead-modal__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: rgba(31, 41, 55, 0.94);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
  white-space: nowrap;
}

.shell .lead-modal__num {
  font-size: 22px;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .lead-modal__num {
    color: transparent;
    background-image: linear-gradient(
      120deg,
      rgba(17, 24, 39, 0.98) 0%,
      rgba(99, 102, 241, 0.86) 24%,
      rgba(59, 130, 246, 0.88) 48%,
      rgba(245, 158, 11, 0.9) 72%,
      rgba(236, 72, 153, 0.82) 100%
    );
    background-size: 220% 220%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: lead-modal-num-color-flow 18s ease-in-out infinite;
  }
}

@keyframes lead-modal-num-color-flow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lead-modal__num {
    animation: none;
  }
}

.lead-modal__name {
  font-weight: 700;
  font-size: 17px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-modal__stage-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.select-like.lead-modal__stage-btn {
  width: auto;
  min-width: 0;
  max-width: 220px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-left: 10px;
  padding-right: 30px;
}

.lead-modal__stage-btn-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  flex: 0 0 auto;
}

.lead-modal__stage-btn.has-color {
  border-color: rgba(var(--stage-rgb), 0.55);
  background-color: rgba(var(--stage-rgb), 0.1);
}

.lead-modal__stage-btn.has-color:hover {
  border-color: rgba(var(--stage-rgb), 0.75);
  background-color: rgba(var(--stage-rgb), 0.16);
}

.lead-modal__stage-btn.has-color .lead-modal__stage-btn-dot {
  background: rgb(var(--stage-rgb));
}

.lead-modal__stage-switch {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 26px;
  line-height: 1;
}

.lead-modal__stage-switch .icon-btn__glyph {
  transform: translateY(-2px);
}

.lead-modal__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: wrap;
}

.lead-modal__action-btn {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: rgba(61, 73, 87, 0.8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.16s ease, opacity 0.16s ease;
}

.lead-modal__action-btn:hover,
.lead-modal__action-btn:focus-visible,
.lead-modal__action-btn:active {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: rgba(33, 42, 54, 0.96);
  outline: none;
}

.lead-modal__action-btn:disabled {
  cursor: default;
  opacity: 0.55;
}

.lead-modal__action-btn--danger {
  color: rgba(var(--danger-rgb), 0.9);
}

.lead-modal__action-btn--danger:hover,
.lead-modal__action-btn--danger:focus-visible,
.lead-modal__action-btn--danger:active {
  color: rgba(var(--danger-rgb), 1);
}

.lead-modal__action-glyph {
  display: block;
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
  transform: translateY(-2px);
}

.lead-modal__action-glyph--tag {
  font-size: 28px;
  font-weight: 700;
  transform: translateY(-1px);
}

.lead-modal__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  overflow: auto;
}

.lead-modal__body--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  overflow: hidden;
}

.lead-modal__side {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lead-modal__side--right {
  gap: 0;
  padding: 6px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.86)),
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.045), rgba(148, 163, 184, 0.04));
  box-shadow:
    inset 0 0 0 1px rgba(148, 163, 184, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 22px rgba(15, 23, 42, 0.035);
}

.lead-modal__contact {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.lead-modal__tab-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lead-modal__tab-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.lead-modal__tab-scroll--tasks {
  overflow: hidden;
}

.lead-modal__tab-scroll--tasks > .lead-tasks-tab {
  flex: 1 1 auto;
  min-height: 0;
}

.lead-modal__tab-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.lead-modal__tab-action {
  flex: 1 1 220px;
}

.lead-modal__tabs {
  display: flex;
  gap: 2px;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  padding: 4px;
  border: 0;
  border-radius: 10px;
  background: rgba(226, 232, 240, 0.42);
  box-shadow:
    inset 0 0 0 1px rgba(148, 163, 184, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  min-height: 38px;
  isolation: isolate;
}

.shell .lead-modal__tabs {
  border-radius: 9px;
}

.lead-modal__tabs::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.lead-modal__tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: rgba(71, 85, 105, 0.82);
  padding: 6px 7px 6px 9px;
  min-height: 30px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 740;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  z-index: 1;
  box-shadow: none;
  transition:
    border-color 160ms ease,
    color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.lead-modal__tab:hover {
  background: rgba(255, 255, 255, 0.48);
  color: rgba(30, 41, 59, 0.98);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 1px 3px rgba(15, 23, 42, 0.025);
}

.lead-modal__tab.is-active {
  z-index: 3;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.88)),
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.12), rgba(var(--accent-rgb), 0.035));
  color: rgba(15, 23, 42, 0.98);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.82),
    inset 0 -2px 0 rgba(var(--accent-rgb), 0.62),
    0 2px 5px rgba(15, 23, 42, 0.045);
}

.lead-modal__tab-label {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.lead-modal__tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 18px;
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(100, 116, 139, 0.1);
  color: rgba(51, 65, 85, 0.82);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.lead-modal__tab.is-active .lead-modal__tab-count {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.08);
}

.lead-modal__tab-count.is-loading {
  color: rgba(100, 116, 139, 0.72);
}

.lead-modal__tab::after {
  display: none;
}

.lead-modal__tab.is-active::after {
  opacity: 0;
}

.lead-modal__side--right .lead-modal__tab-content {
  margin-top: 6px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  position: relative;
  z-index: 2;
}

.lead-tasks-tab {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.shell .lead-tasks-tab {
  gap: 6px;
}

.lead-tasks-tab__toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.lead-deals-tab__toolbar {
  justify-content: space-between;
}

.lead-deals-tab__toolbar-label {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.lead-tasks-tab__list {
  flex: 1 1 auto;
  min-height: 0;
}

.lead-modal__tab-scroll--tasks .lead-tasks-tab__list {
  overflow: auto;
  padding-right: 4px;
}

.lead-task-list {
  display: grid;
  gap: 6px;
}

.lead-task-groups {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.lead-task-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 8px;
}

.lead-task-overview__card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  min-width: 0;
}

.lead-task-overview__card.is-empty {
  opacity: 0.72;
}

.lead-task-overview__card--overdue {
  border-color: rgba(var(--danger-rgb), 0.24);
  background: rgba(var(--danger-rgb), 0.055);
}

.lead-task-overview__card--active {
  border-color: rgba(var(--accent-rgb), 0.22);
  background: rgba(var(--accent-rgb), 0.055);
}

.lead-task-overview__card--completed {
  border-color: rgba(104, 130, 193, 0.24);
  background: rgba(104, 130, 193, 0.08);
}

.lead-task-overview__value {
  order: 2;
  font-size: 20px;
  line-height: 1;
  font-weight: 800;
  color: var(--text);
  flex: 0 0 auto;
}

.lead-task-overview__label {
  order: 1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  word-break: normal;
  overflow-wrap: break-word;
  min-width: 0;
}

.lead-task-overview__action {
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.lead-task-overview__action .icon-btn {
  align-self: stretch;
  min-height: 100%;
}

.lead-task-section {
  display: grid;
  gap: 6px;
}

.lead-task-section--group {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.028);
}

.lead-task-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lead-task-section__title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.lead-task-section__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 12px;
  line-height: 1;
}

.shell .lead-task-list {
  gap: 5px;
}

.lead-task-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.lead-task-item.is-overdue {
  border-color: rgba(var(--danger-rgb), 0.28);
  background: rgba(var(--danger-rgb), 0.05);
}

.lead-task-item.lead-call-item--missed {
  border-color: rgba(var(--danger-rgb), 0.3);
  background: rgba(var(--danger-rgb), 0.06);
}

.lead-task-item.lead-call-item--failed {
  border-color: rgba(var(--warning-rgb), 0.3);
  background: rgba(var(--warning-rgb), 0.08);
}

.lead-task-item.lead-call-item--incoming-answered {
  border-color: rgba(108, 176, 124, 0.28);
  background: rgba(164, 217, 174, 0.18);
}

.lead-task-item.lead-call-item--outgoing-answered {
  border-color: rgba(97, 175, 239, 0.28);
  background: rgba(97, 175, 239, 0.12);
}

.lead-task-item.is-active {
  border-color: rgba(108, 176, 124, 0.28);
  background: rgba(164, 217, 174, 0.18);
}

.lead-task-item.is-completed {
  border-color: rgba(104, 130, 193, 0.24);
  background: rgba(104, 130, 193, 0.08);
}

.shell .lead-task-item {
  padding: 8px 10px;
  border-radius: 10px;
}

.lead-task-item__meta {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.lead-task-item__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.lead-call-item__summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.lead-call-item__summary-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.lead-call-item__summary-head {
  justify-content: flex-start;
  align-items: flex-start;
  gap: 0;
}

.lead-call-item__summary-head .lead-task-item__title {
  flex: 1 1 auto;
  min-width: 0;
}

.lead-call-item__summary > .lead-task-item__state,
.lead-call-item__summary > .lead-call-status-badge {
  justify-self: end;
  align-self: center;
}

.lead-task-item__title {
  font-weight: 600;
  line-height: 1.3;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  word-break: normal;
  overflow-wrap: break-word;
}

.lead-task-item__state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  flex: 0 0 auto;
}

.lead-call-status-badge {
  width: 31px;
  min-width: 31px;
  height: 31px;
  padding: 0;
  border-radius: 999px;
  font-size: 0;
  line-height: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.lead-call-status-badge svg {
  width: 16px;
  height: 16px;
  display: block;
}

.lead-call-status-badge--incoming-answered {
  border-color: rgba(108, 176, 124, 0.34);
  background: rgba(164, 217, 174, 0.18);
  color: #86d894;
}

.lead-call-status-badge--outgoing-answered {
  border-color: rgba(97, 175, 239, 0.34);
  background: rgba(97, 175, 239, 0.16);
  color: #7ec3ff;
}

.lead-call-status-badge--incoming-missed {
  border-color: rgba(var(--danger-rgb), 0.35);
  background: rgba(var(--danger-rgb), 0.12);
  color: var(--danger);
}

.lead-call-status-badge--outgoing-failed {
  border-color: rgba(var(--warning-rgb), 0.38);
  background: rgba(var(--warning-rgb), 0.14);
  color: var(--warning);
}

.lead-task-item__metric {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.lead-task-item__metric--duration {
  border-color: rgba(101, 163, 255, 0.22);
  background: rgba(101, 163, 255, 0.1);
  color: #cfe2ff;
}

.lead-task-item__state.is-overdue {
  border-color: rgba(var(--danger-rgb), 0.35);
  background: rgba(var(--danger-rgb), 0.12);
  color: var(--danger);
}

.lead-task-item__state.is-missed {
  border-color: rgba(var(--danger-rgb), 0.35);
  background: rgba(var(--danger-rgb), 0.12);
  color: var(--danger);
}

.lead-task-item__state.is-failed {
  border-color: rgba(var(--warning-rgb), 0.38);
  background: rgba(var(--warning-rgb), 0.14);
  color: var(--warning);
}

.lead-task-item__state.is-active {
  border-color: rgba(108, 176, 124, 0.32);
  background: rgba(164, 217, 174, 0.16);
  color: #b6f2bf;
}

.lead-task-item__state.is-completed {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.lead-task-item__state.is-canceled {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.lead-task-item__state.is-deal-stage {
  border-color: rgba(var(--deal-stage-rgb), 0.26);
  background: rgba(var(--deal-stage-rgb), 0.12);
  color: rgb(var(--deal-stage-rgb));
}

.lead-task-item__desc {
  font-size: 13px;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.lead-deal-history-item {
  padding: 11px 12px 12px;
}

.lead-deal-history__stage-chip {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 48%;
}

.lead-deal-history__summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.lead-deal-history__summary-item {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.lead-deal-history__summary-item.is-total {
  background: rgba(145, 205, 112, 0.08);
}

.lead-deal-history__summary-label {
  font-size: 10px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lead-deal-history__summary-value {
  min-width: 0;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.lead-deal-history__products {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.lead-deal-history__products-head,
.lead-deal-history__product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(62px, auto) minmax(78px, auto) minmax(86px, auto);
  gap: 10px;
  align-items: start;
}

.lead-deal-history__products-head {
  font-size: 10px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lead-deal-history__products-head-name,
.lead-deal-history__products-head-value {
  min-width: 0;
}

.lead-deal-history__products-head-value {
  text-align: right;
}

.lead-deal-history__product-name {
  min-width: 0;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.lead-deal-history__product-value {
  min-width: 0;
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
  white-space: nowrap;
}

.lead-deal-history__product-value--qty {
  font-variant-numeric: tabular-nums;
}

.lead-deal-history__product-value--total {
  font-weight: 600;
}

.lead-deal-history__more {
  font-size: 12px;
  line-height: 1.3;
}

@media (max-width: 760px) {
  .lead-deal-history__summary {
    grid-template-columns: 1fr;
  }

  .lead-deal-history__products-head,
  .lead-deal-history__product {
    grid-template-columns: minmax(0, 1fr) repeat(3, minmax(58px, auto));
    gap: 8px;
  }

  .lead-call-item__summary {
    grid-template-columns: 1fr;
  }

  .lead-call-item__summary .lead-task-item__recording {
    max-width: 100%;
    justify-self: stretch;
  }
}

.lead-task-item__due {
  font-size: 12px;
  line-height: 1.35;
}

.lead-task-item__actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.lead-task-item__recording {
  display: grid;
  gap: 6px;
  margin-top: 6px;
  max-width: min(100%, 360px);
}

.lead-call-item__summary .lead-task-item__recording {
  margin-top: 2px;
  width: 100%;
  max-width: min(100%, 360px);
  justify-self: start;
}

.lead-task-item__audio {
  display: block;
  width: 100%;
  min-width: 0;
  height: 34px;
  border-radius: 999px;
  filter: saturate(0.92) brightness(1.01);
}

.lead-task-item__recording-link {
  width: fit-content;
}

.lead-tab-placeholder {
  padding: 8px 2px;
}

.shell .lead-modal__body {
  padding: 6px;
  gap: 6px;
}

.lead-modal__stages {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  min-width: 0;
}

.lead-modal__metrics {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.025));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  min-height: var(--lead-modal-top-row-height, 42px);
  min-width: 0;
}

.shell .lead-modal__metrics {
  border-radius: 10px;
}

.lead-modal__metrics::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.lead-metric {
  --lead-metric-rgb: 148, 163, 184;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 8px;
  min-height: 32px;
  border-radius: 9px;
  border: 1px solid rgba(var(--lead-metric-rgb), 0.16);
  background: rgba(var(--lead-metric-rgb), 0.06);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: default;
}

.lead-metric__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: rgba(var(--lead-metric-rgb), 0.94);
  background: transparent;
  box-shadow: none;
  opacity: 1;
  flex: 0 0 auto;
}

.lead-metric__icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.lead-metric__value {
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.lead-metric--warn {
  --lead-metric-rgb: var(--warning-rgb);
  border-color: rgba(var(--warning-rgb), 0.35);
  background: rgba(var(--warning-rgb), 0.08);
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  gap: 0;
}

.lead-metric--warn .lead-metric__icon {
  color: var(--warning);
  width: 16px;
  height: 16px;
}

.lead-metric--warn .lead-metric__value {
  color: var(--warning);
}

.lead-metric--danger {
  --lead-metric-rgb: var(--danger-rgb);
  border-color: rgba(var(--danger-rgb), 0.35);
  background: rgba(var(--danger-rgb), 0.08);
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  gap: 0;
}

.lead-metric--danger .lead-metric__icon {
  color: var(--danger);
  width: 16px;
  height: 16px;
}

.lead-metric--danger .lead-metric__value {
  color: var(--danger);
}

.lead-metric--task-active {
  --lead-metric-rgb: 77, 137, 93;
  border-color: rgba(108, 176, 124, 0.24);
  background: rgba(164, 217, 174, 0.12);
}

.lead-metric--task-active .lead-metric__icon,
.lead-metric--task-active .lead-metric__value {
  color: rgb(77, 137, 93);
}

.lead-metric--task-overdue {
  --lead-metric-rgb: var(--danger-rgb);
  border-color: rgba(var(--danger-rgb), 0.28);
  background: rgba(var(--danger-rgb), 0.08);
}

.lead-metric--task-overdue .lead-metric__icon,
.lead-metric--task-overdue .lead-metric__value {
  color: var(--danger);
}

.lead-metric--task-completed {
  --lead-metric-rgb: 88, 112, 171;
  border-color: rgba(104, 130, 193, 0.24);
  background: rgba(104, 130, 193, 0.1);
}

.lead-metric--task-completed .lead-metric__icon,
.lead-metric--task-completed .lead-metric__value {
  color: rgb(88, 112, 171);
}

.lead-modal__stage {
  flex: 0 0 auto;
  position: relative;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font: inherit;
  text-align: left;
  min-width: 140px;
}

.lead-modal__stage::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--stage-color, rgba(255, 255, 255, 0.08));
  border-radius: inherit;
  opacity: 0.9;
  pointer-events: none;
}

.lead-modal__stage:hover {
  background: rgba(255, 255, 255, 0.04);
}

.lead-modal__stage.is-active {
  background: rgba(var(--accent-rgb), 0.14);
  border-color: rgba(var(--accent-rgb), 0.35);
}

.lead-modal__details {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.02);
  min-width: 0;
}

.shell .lead-modal__details {
  border-radius: 10px;
  padding: 6px;
}

.lead-modal__meta {
  display: grid;
  gap: 8px;
}

.lead-modal__meta--object-details {
  position: relative;
  gap: 10px;
  padding: 10px 12px 12px 14px;
  border: 1px solid rgba(61, 73, 87, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.lead-modal__meta--object-details .lead-modal__meta-row {
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
}

.lead-modal__meta--object-details .lead-modal__meta-key {
  padding-top: 2px;
}

.lead-modal__profile-block {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding: 10px;
  border: 1px solid rgba(61, 73, 87, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.lead-modal__meta-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.lead-modal__meta-row--interactive {
  cursor: pointer;
}

.lead-modal__meta-row--interactive:hover .lead-modal__meta-val,
.lead-modal__meta-row--interactive:focus-within .lead-modal__meta-val {
  background: rgba(255, 255, 255, 0.035);
  border-radius: 12px;
}

.lead-modal__meta-val {
  --lead-inline-action-size: 34px;
  overflow-wrap: anywhere;
}

.lead-modal__meta-val--interactive {
  display: flex;
  align-items: center;
  min-width: 0;
  width: 100%;
}

.lead-modal__meta-val--interactive > .assignee-btn,
.lead-modal__meta-val--interactive > .select-like {
  flex: 1 1 auto;
}

.lead-modal__meta-val--action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--lead-inline-action-size);
  align-items: center;
  width: 100%;
}

.lead-modal__meta-val--action .icon-btn--plus-accent {
  grid-column: 2;
  justify-self: end;
}

.lead-modal__meta-val--object-create {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.lead-modal__meta-val--object-create .lead-object-create__btn {
  width: var(--lead-inline-action-size, 34px);
  min-width: var(--lead-inline-action-size, 34px);
  height: var(--lead-inline-action-size, 34px);
}

.lead-modal__meta-row--tags {
  align-items: flex-start;
}

.lead-modal__meta-val--tags {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--lead-inline-action-size);
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.lead-modal__meta-val--tags .icon-btn--plus-accent {
  grid-column: 2;
  justify-self: end;
  margin-right: -6px;
}

.lead-card__tags--inline {
  margin-top: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.lead-meta-card {
  display: grid;
  gap: 14px;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid rgba(59, 130, 246, 0.16);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.88)),
    linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(99, 102, 241, 0.06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.lead-modal__tab-scroll--source {
  display: grid;
  align-content: start;
}

.lead-block--source {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
}

.lead-source-tab {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(71, 85, 105, 0.08);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.42);
}

.lead-source-tab__row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.lead-source-tab__label {
  font-size: 12px;
  font-weight: 700;
}

.lead-source-tab__value {
  min-width: 0;
}

.lead-source-tab__value > .select-like {
  width: 100%;
}

.lead-source-locked {
  min-height: 36px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid rgba(71, 85, 105, 0.16);
  border-radius: var(--field-radius);
  background: rgba(71, 85, 105, 0.055);
  box-shadow: var(--field-shadow);
  color: var(--text);
}

.lead-source-locked__main {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 750;
}

.lead-source-locked__note {
  flex: 0 0 auto;
  color: rgba(71, 85, 105, 0.82);
  font-size: 11px;
  font-weight: 700;
  text-transform: lowercase;
}

.lead-source-tab__empty {
  padding: 10px;
  border: 1px dashed rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.06);
}

.lead-meta-card--source-tab {
  margin-top: 0;
}

.lead-meta-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.lead-meta-card__head-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.lead-meta-card__title {
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
  color: rgba(15, 23, 42, 0.96);
}

.lead-meta-card__subtitle {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  color: rgba(71, 85, 105, 0.76);
}

.lead-meta-card__grid {
  display: grid;
  gap: 10px;
}

.lead-meta-card__row {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.66);
}

.lead-meta-card__icon {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.07);
  color: rgba(15, 23, 42, 0.78);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.lead-meta-card__icon[data-tone='meta'] {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: linear-gradient(135deg, #1877f2, #2563eb 48%, #8b5cf6);
  color: #fff;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.18);
}

.lead-meta-card__icon[data-tone='campaign'] {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.lead-meta-card__icon[data-tone='adset'] {
  background: rgba(99, 102, 241, 0.1);
  color: #4338ca;
}

.lead-meta-card__icon[data-tone='ad'] {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

.lead-meta-card__icon[data-tone='answer'] {
  background: rgba(139, 92, 246, 0.12);
  color: #6d28d9;
}

.lead-meta-card__row-body {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.lead-meta-card__key,
.lead-meta-card__id,
.lead-meta-card__answer-key {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  color: rgba(71, 85, 105, 0.72);
}

.lead-meta-card__value,
.lead-meta-card__answer-value {
  font-size: 14px;
  font-weight: 750;
  line-height: 1.35;
  color: rgba(15, 23, 42, 0.9);
  overflow-wrap: anywhere;
}

.lead-meta-card__id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: rgba(71, 85, 105, 0.62);
}

.lead-meta-card__answers {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.lead-meta-card__answers-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 900;
  color: rgba(15, 23, 42, 0.9);
}

.lead-meta-card__answers-list {
  display: grid;
  gap: 8px;
}

.lead-meta-card__answer {
  display: grid;
  grid-template-columns: minmax(160px, 0.42fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 10px 11px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.64);
}

@media (max-width: 640px) {
  .lead-source-tab__row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .lead-source-locked {
    align-items: flex-start;
    flex-direction: column;
  }

  .lead-meta-card__answer {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

.lead-contact-list {
  display: grid;
  width: 100%;
  justify-items: stretch;
  gap: 4px;
}

.lead-copyable {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--lead-inline-action-size);
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.lead-copyable__main {
  min-width: 0;
  flex: 1 1 auto;
}

.lead-copyable__value {
  font-weight: 700;
  color: var(--text);
}

.lead-copyable .lead-link__text {
  font-weight: 700;
  color: var(--text);
}

.lead-address-list {
  width: 100%;
  justify-items: stretch;
}

.lead-address-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--lead-inline-action-size);
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.lead-address-item__text {
  min-width: 0;
  flex: 1 1 auto;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.lead-address-item__label {
  font-weight: 500;
}

.lead-address-item__value {
  font-weight: 700;
  color: var(--text);
}

.lead-address-copy {
  justify-self: end;
  flex: 0 0 auto;
  width: var(--lead-inline-action-size);
  height: var(--lead-inline-action-size);
  min-width: var(--lead-inline-action-size);
  min-height: var(--lead-inline-action-size);
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: rgba(61, 73, 87, 0.42);
  font-size: 18px;
  line-height: 1;
}

.lead-address-copy:hover,
.lead-address-copy:focus-visible,
.lead-address-copy:active {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: rgba(33, 42, 54, 0.96);
  outline: none;
}

.lead-address-copy.is-copied {
  color: var(--accent);
}

.lead-copy-btn {
  justify-self: end;
  flex: 0 0 auto;
  width: var(--lead-inline-action-size);
  height: var(--lead-inline-action-size);
  min-width: var(--lead-inline-action-size);
  min-height: var(--lead-inline-action-size);
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: rgba(61, 73, 87, 0.42);
  font-size: 18px;
  line-height: 1;
}

.lead-copy-btn:hover,
.lead-copy-btn:focus-visible,
.lead-copy-btn:active {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: rgba(33, 42, 54, 0.96);
  outline: none;
}

.lead-copy-btn.is-copied {
  color: var(--accent);
}

.lead-object-phone-editor {
  display: grid;
  gap: 8px;
}

.lead-object-inline-add-btn {
  align-self: end;
  flex: 0 0 auto;
}

@media (max-width: 760px) {
  .lead-task-overview {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .lead-task-item {
    flex-direction: column;
  }

  .lead-task-item__head {
    flex-wrap: wrap;
  }

  .lead-task-item__actions {
    width: 100%;
    justify-content: flex-end;
  }

  .lead-task-item__recording {
    max-width: 100%;
  }
}

.lead-modal__tags {
  margin-top: 0;
  display: grid;
  gap: 6px;
}

.shell .lead-modal__tags {
  margin-top: 0;
}

.lead-block {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 8px;
}

.lead-block--object-details {
  gap: 10px;
}

.lead-block--comments {
  min-height: 0;
}

.lead-modal__details .lead-block:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.shell .lead-block {
  margin-top: 8px;
  padding-top: 8px;
  gap: 6px;
}

.lead-block__head {
  --lead-inline-action-size: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) calc(var(--lead-inline-action-size) * 2 + 4px);
  align-items: center;
  gap: 8px;
}

.lead-block__head--solo {
  grid-template-columns: minmax(0, 1fr);
}

.lead-block__head--object-select {
  grid-template-columns: minmax(0, 1fr);
}

.lead-block__head--object-select .lead-block__actions--lead-object {
  display: none;
}

.lead-block--edit-select .lead-block__head--object-select {
  grid-template-columns: minmax(0, 1fr) auto;
}

.lead-block--edit-select .lead-block__head--object-select .lead-block__actions--lead-object {
  display: flex;
}

.lead-block__actions {
  display: grid;
  grid-template-columns: repeat(2, var(--lead-inline-action-size));
  align-items: center;
  justify-content: end;
  justify-items: end;
  gap: 4px;
}

.lead-block__actions--lead-object {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.lead-block--edit-select {
  cursor: pointer;
}

.lead-block--edit-select .lead-block__title {
  color: var(--accent);
}

.lead-block--edit-select .lead-modal__meta--object-details {
  background: rgba(var(--accent-rgb), 0.05);
  border-color: rgba(var(--accent-rgb), 0.16);
}

.lead-block--edit-select:hover .lead-modal__meta--object-details {
  background: rgba(var(--accent-rgb), 0.08);
  border-color: rgba(var(--accent-rgb), 0.24);
}

.lead-block__title {
  min-width: 0;
  font-weight: 600;
  line-height: 1.2;
}

.lead-block__actions .icon-btn--plus-accent {
  grid-column: 2;
}

.lead-block__actions .icon-btn--danger {
  grid-column: 1;
}

.lead-object__remove-btn {
  opacity: 0;
  pointer-events: none;
}

.lead-block--edit-select .lead-object__remove-btn {
  opacity: 1;
  pointer-events: auto;
}

.lead-object__make-main-btn {
  opacity: 0;
  pointer-events: none;
  min-height: auto;
  padding: 0;
  white-space: nowrap;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition:
    color 0.18s ease,
    opacity 0.18s ease;
}

.lead-block--edit-select .lead-object__make-main-btn {
  opacity: 1;
  pointer-events: auto;
}

.lead-object__make-main-btn:hover,
.lead-object__make-main-btn:focus-visible,
.lead-object__make-main-btn:active {
  color: var(--success);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.lead-object-edit-mode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--lead-inline-action-size, 34px);
  min-width: var(--lead-inline-action-size, 34px);
  height: var(--lead-inline-action-size, 34px);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  line-height: 0;
}

.lead-object-edit-mode-btn:hover,
.lead-object-edit-mode-btn:focus-visible,
.lead-object-edit-mode-btn:active {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.lead-object-edit-mode-btn__img {
  display: block;
  width: 26px;
  height: 26px;
  pointer-events: none;
  filter: brightness(0) saturate(0) invert(74%);
  opacity: 0.95;
}

.lead-object-edit-mode-btn.is-active {
  outline: 2px solid rgba(22, 163, 74, 0.25);
  outline-offset: 2px;
  border-radius: 8px;
}

.lead-object-create__btn {
  width: 100%;
  justify-content: center;
}

.lead-block--object-create .lead-block__head {
  align-items: center;
}

.lead-block--object-create .lead-object-create__btn {
  width: var(--lead-inline-action-size);
  justify-self: end;
  grid-column: 2;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.18);
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.2px;
  line-height: 1;
  flex: 0 0 auto;
}

.avatar--sm {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.avatar--md {
  width: 52px;
  height: 52px;
  font-size: 16px;
  border-radius: 999px;
}

.avatar-img {
  display: block;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.18);
  flex: 0 0 auto;
}

.avatar-img--sm {
  width: 28px;
  height: 28px;
  border-radius: 10px;
}

.avatar-img--md {
  width: 52px;
  height: 52px;
  border-radius: 999px;
}

.assignee-btn {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 4px 8px;
  height: 60px;
  min-height: 60px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  max-width: 100%;
}

.assignee-btn:hover {
  background: rgba(255, 255, 255, 0.04);
}

.assignee-btn.is-empty {
  color: var(--muted);
}

.assignee-btn__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.comments {
  display: grid;
  gap: 8px;
}

.comment {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.shell .comment {
  padding: 7px 8px;
  border-radius: 10px;
}

.comment-form__actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lead-object-form-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  gap: 8px;
}

.lead-object-form-actions__ai {
  grid-column: 1 / -1;
}

.lead-object-form-actions > .ghost,
.lead-object-form-actions > .btn {
  width: 100%;
  min-width: 0;
  min-height: 40px;
}

.chat {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.lead-block--comments .chat {
  overflow: hidden;
}

.shell .chat {
  padding: 7px 8px;
  border-radius: 10px;
  gap: 6px;
}

.chat__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  overflow: auto;
  max-height: 340px;
  padding-right: 4px;
}

.shell .chat__list {
  gap: 6px;
  max-height: 320px;
}

.lead-modal__tab-content .chat__list {
  overflow: auto;
  max-height: 340px;
  padding-right: 4px;
}

.lead-modal__tab-content .lead-block--comments {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
}

.lead-modal__tab-content .lead-block--comments .chat {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
}

.lead-modal__tab-content .lead-block--comments .chat__list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.shell .lead-modal__tab-content .chat__list {
  max-height: 320px;
}

.shell .lead-modal__tab-content .lead-block--comments .chat {
  height: auto;
  max-height: none;
}

.shell .lead-modal__tab-content .lead-block--comments .chat__list {
  max-height: none;
}

.chat-msg {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  max-width: 100%;
}

.chat-msg.is-me {
  flex-direction: row-reverse;
  margin-left: auto;
}

.chat-msg.is-editing {
  scroll-margin-block-end: 156px;
}

.chat-msg__avatar {
  flex: 0 0 auto;
}

.chat-msg__avatar .avatar--sm,
.chat-msg__avatar .avatar-img--sm {
  border-radius: 999px;
}

.chat-msg__avatar .chat-msg__avatar-meta {
  position: relative;
  border-radius: 9px;
  border: 1px solid rgba(37, 99, 235, 0.28);
  background:
    radial-gradient(circle at 72% 24%, rgba(255, 255, 255, 0.72), transparent 18px),
    linear-gradient(135deg, #1877f2 0%, #2563eb 48%, #8b5cf6 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow:
    0 6px 14px rgba(37, 99, 235, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.chat-msg__avatar .chat-msg__avatar-meta::after {
  content: '';
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.16);
}

.chat-msg__content {
  min-width: 0;
  max-width: min(560px, 100%);
  display: grid;
  gap: 4px;
}

.chat-msg.is-me .chat-msg__content {
  align-items: end;
}

.chat-msg__meta {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 12px;
  line-height: 1.2;
  color: var(--muted);
}

.chat-msg.is-me .chat-msg__meta {
  justify-content: flex-end;
}

.chat-msg__author {
  font-weight: 600;
  color: var(--text);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-msg__time {
  flex: 0 0 auto;
  white-space: nowrap;
}

.chat-msg__bubble {
  position: relative;
  border: 0;
  border-radius: 12px;
  background: rgba(132, 204, 22, 0.16);
  padding: 8px 10px;
}

.chat-msg.is-me .chat-msg__bubble {
  background: rgba(132, 204, 22, 0.16);
}

.chat-msg__bubble--editing {
  min-width: min(420px, 100%);
  padding: 10px;
}

.chat-msg__bubble--canceled {
  background: rgba(132, 204, 22, 0.16);
}

.chat-msg__text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.chat-msg--meta-lead .chat-msg__content {
  max-width: min(680px, 100%);
}

.chat-msg__bubble--meta-lead {
  width: min(680px, calc(100vw - 64px));
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(59, 130, 246, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.92)),
    linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(99, 102, 241, 0.08));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 10px 24px rgba(15, 23, 42, 0.06);
}

.chat-msg__text--meta-lead {
  white-space: normal;
  overflow-wrap: normal;
}

.meta-lead-comment {
  display: grid;
  gap: 10px;
  padding: 12px;
  color: rgba(15, 23, 42, 0.92);
}

.meta-lead-comment__head {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.meta-lead-comment__head-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.meta-lead-comment__title {
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
  color: rgba(15, 23, 42, 0.96);
}

.meta-lead-comment__subtitle {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  color: rgba(71, 85, 105, 0.78);
}

.meta-lead-comment__summary,
.meta-lead-comment__section {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.meta-lead-comment__section {
  grid-template-columns: 1fr;
  padding-top: 9px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.meta-lead-comment__row {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 7px 8px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.meta-lead-comment__section .meta-lead-comment__row {
  background: rgba(248, 250, 252, 0.78);
}

.meta-lead-comment__icon {
  --meta-lead-icon-rgb: 59, 130, 246;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(var(--meta-lead-icon-rgb), 0.24);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(var(--meta-lead-icon-rgb), 0.15), rgba(var(--meta-lead-icon-rgb), 0.06));
  color: rgba(var(--meta-lead-icon-rgb), 0.98);
  font-size: 9px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.meta-lead-comment__icon[data-tone='meta'] {
  --meta-lead-icon-rgb: 29, 78, 216;
}

.meta-lead-comment__icon[data-tone='page'],
.meta-lead-comment__icon[data-tone='form'] {
  --meta-lead-icon-rgb: 99, 102, 241;
}

.meta-lead-comment__icon[data-tone='campaign'],
.meta-lead-comment__icon[data-tone='adset'],
.meta-lead-comment__icon[data-tone='ad'] {
  --meta-lead-icon-rgb: 245, 158, 11;
}

.meta-lead-comment__icon[data-tone='answer'] {
  --meta-lead-icon-rgb: 124, 99, 216;
}

.meta-lead-comment__row-body {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.meta-lead-comment__label,
.meta-lead-comment__answer-key {
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
  color: rgba(71, 85, 105, 0.72);
}

.meta-lead-comment__value,
.meta-lead-comment__answer-value {
  font-size: 12px;
  font-weight: 750;
  line-height: 1.28;
  color: rgba(15, 23, 42, 0.9);
  overflow-wrap: anywhere;
}

.meta-lead-comment__answers {
  display: grid;
  gap: 7px;
  padding-top: 9px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.meta-lead-comment__answers-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  color: rgba(15, 23, 42, 0.92);
}

.meta-lead-comment__answers-list {
  display: grid;
  gap: 6px;
}

.meta-lead-comment__answer {
  display: grid;
  grid-template-columns: minmax(116px, 0.55fr) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 7px 8px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.78);
}

@media (max-width: 720px) {
  .chat-msg__bubble--meta-lead {
    width: min(680px, calc(100vw - 42px));
  }

  .meta-lead-comment__summary {
    grid-template-columns: 1fr;
  }

  .meta-lead-comment__answer {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

.chat-msg__text--canceled {
  color: var(--muted);
  font-style: italic;
}

.chat-msg.has-actions .chat-msg__bubble {
  min-height: 40px;
  padding-right: 74px;
}

.chat-msg.has-countdown .chat-msg__bubble {
  min-height: 40px;
  padding-right: 116px;
}

.chat-msg__actions {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}

.chat-msg__countdown {
  font-size: 10px;
  line-height: 1;
  color: rgba(71, 85, 105, 0.9);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.chat-msg__action.icon-btn {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  opacity: 1;
}

.chat-msg__action.icon-btn:not(.icon-btn--danger) {
  color: rgba(148, 163, 184, 0.96);
}

.chat-msg__action.icon-btn:not(.icon-btn--danger):hover,
.chat-msg__action.icon-btn:not(.icon-btn--danger):focus-visible {
  color: rgba(203, 213, 225, 0.98);
}

.chat-msg__action.icon-btn:hover,
.chat-msg__action.icon-btn:focus-visible,
.chat-msg__action.icon-btn:active {
  background: transparent;
  box-shadow: none;
}

.chat-msg__action.icon-btn.icon-btn--danger,
.chat-msg__action.icon-btn.icon-btn--danger:hover,
.chat-msg__action.icon-btn.icon-btn--danger:focus-visible,
.chat-msg__action.icon-btn.icon-btn--danger:active {
  color: rgba(var(--danger-rgb), 0.92);
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.chat-msg__editor {
  display: grid;
  gap: 8px;
}

.chat-msg__editor-input {
  width: 100%;
  height: 124px;
  min-height: 124px;
  max-height: 124px;
  resize: none;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
  line-height: 1.35;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.chat-msg__editor-input:focus {
  outline: none;
  background-color: var(--field-focus-bg);
  border-color: var(--field-focus-border);
  box-shadow: var(--field-focus-shadow);
}

.chat-msg__editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.chat-msg__editor-btn.icon-btn {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
  font-size: 14px;
}

.chat-msg__editor-btn.icon-btn:hover,
.chat-msg__editor-btn.icon-btn:focus-visible,
.chat-msg__editor-btn.icon-btn:active {
  box-shadow: none;
}

.chat-msg__editor-btn--cancel.icon-btn {
  color: rgba(148, 163, 184, 0.82);
}

.chat-msg__editor-btn--cancel.icon-btn:hover,
.chat-msg__editor-btn--cancel.icon-btn:focus-visible {
  background: rgba(148, 163, 184, 0.12);
  color: rgba(226, 232, 240, 0.92);
}

.chat-msg__editor-btn--save.icon-btn {
  color: rgba(var(--accent-rgb), 0.96);
}

.chat-msg__editor-btn--save.icon-btn:hover,
.chat-msg__editor-btn--save.icon-btn:focus-visible {
  background: rgba(var(--accent-rgb), 0.14);
  color: rgba(var(--accent-rgb), 1);
}

.chat-composer {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.chat-composer--deal {
  position: relative;
  display: block;
}

.chat-composer__input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 124px;
  min-height: 124px;
  max-height: 124px;
  resize: none;
  overflow-y: auto;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
  font: inherit;
  line-height: 1.35;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.chat-composer--deal .chat-composer__input {
  height: 124px;
  min-height: 124px;
  max-height: 124px;
  padding-right: 50px;
  padding-bottom: 40px;
}

.chat-composer__input:focus {
  outline: none;
  background-color: var(--field-focus-bg);
  border-color: var(--field-focus-border);
  box-shadow: var(--field-focus-shadow);
}

.chat-composer--deal .chat-composer__send {
  position: absolute;
  right: 10px;
  bottom: 10px;
  margin: 0;
}

.chat-composer__send.icon-btn--ok {
  width: 48px;
  height: 48px;
  font-size: 28px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.chat-composer__send.icon-btn--ok:hover,
.chat-composer__send.icon-btn--ok:focus-visible {
  border-color: transparent;
  background: transparent;
}

.attachments {
  display: grid;
  gap: 6px;
}

.lead-attachment-editor {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.14);
}

.attachment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.14);
  min-width: 0;
}

.attachment__main {
  min-width: 0;
  overflow: hidden;
}

.attachment__name {
  color: var(--text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment__meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment__actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.attachment__action.ghost {
  min-height: 30px;
  padding: 6px 10px;
  text-decoration: none;
}

.attachment:hover {
  background: rgba(0, 0, 0, 0.22);
}

.attachment__action.ghost:hover,
.attachment__action.ghost:focus-visible {
  text-decoration: none;
}

@media (max-width: 640px) {
  .attachment {
    align-items: flex-start;
    flex-direction: column;
  }

  .attachment__actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .lead-modal {
    padding: 8px;
  }

  .lead-modal__body--split {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .lead-modal__contact {
    overflow: visible;
  }

  .lead-modal__tab-content {
    overflow: visible;
    display: block;
  }

  .lead-modal__tab-scroll {
    overflow: visible;
  }

  .lead-modal__tab-scroll--tasks {
    overflow: visible;
  }

  .lead-modal__tab-scroll--tasks .lead-tasks-tab__list {
    overflow: visible;
    padding-right: 0;
  }

  .lead-modal__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .lead-modal__actions {
    width: 100%;
  }

  .lead-modal__meta-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.lead-card__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  row-gap: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.15;
  margin-top: 3px;
}

.lead-card__time {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.3;
  margin-top: 3px;
}

.lead-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 8px;
  min-height: 30px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  text-decoration: none;
  max-width: 100%;
  min-width: 0;
}

.lead-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.lead-link--phone-search-match,
.lead-link--phone-search-partial {
  background: rgba(250, 204, 21, 0.18);
  color: #7c4a03;
  box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.2);
}

.lead-link--phone-search-match:hover,
.lead-link--phone-search-partial:hover {
  color: #6f4300;
  background: rgba(250, 204, 21, 0.24);
}

.lead-link--phone-search-exact {
  background: rgba(34, 197, 94, 0.16);
  color: #166534;
  box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.2);
}

.lead-link--phone-search-exact:hover {
  color: #14532d;
  background: rgba(34, 197, 94, 0.22);
}

.lead-link--phone-duplicate {
  background: rgba(239, 68, 68, 0.14);
  color: #991b1b;
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.2);
}

.lead-link--phone-duplicate:hover {
  color: #7f1d1d;
  background: rgba(239, 68, 68, 0.2);
}

.lead-link--phone-duplicate .lead-link__icon,
.lead-link--phone-duplicate .lead-link__text {
  color: inherit;
  font-weight: inherit;
}

.lead-link--static {
  cursor: default;
}

.lead-link--static:hover {
  color: var(--muted);
}

.lead-link__icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
  flex: 0 0 auto;
}

.lead-link--assignee .lead-link__icon {
  width: 34px;
  height: 34px;
}

.lead-link--assignee .avatar--sm,
.lead-link--assignee .avatar-img--sm {
  width: 34px;
  height: 34px;
  border-radius: 999px;
}

.lead-link--assignee .avatar--sm {
  font-size: 13px;
}

.lead-link__icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.lead-link__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu {
  display: grid;
  gap: 1px;
  padding: 0;
  --menu-item-height: 34px;
}

.menu__group {
  display: grid;
  gap: 1px;
}

.menu__item {
  position: relative;
  display: flex;
  align-items: center;
  min-height: var(--menu-item-height);
  height: var(--menu-item-height);
  padding: 3px 8px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
  overflow: hidden;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 220ms ease;
}

.menu__item::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(var(--accent-rgb), 0.13), rgba(var(--accent-rgb), 0.04) 62%, rgba(255, 255, 255, 0));
  opacity: 0;
  transform: scaleX(0.88);
  transform-origin: left center;
  transition:
    opacity 180ms ease,
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.menu__item--toggle {
  width: 100%;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.menu__item--sub {
  min-height: var(--menu-item-height);
  height: var(--menu-item-height);
  margin-left: 12px;
  padding: 3px 8px 3px 24px;
  font-size: 13px;
}

.menu__submenu {
  display: grid;
  gap: 1px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    max-height 260ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms ease,
    transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.menu__group.is-open .menu__submenu {
  max-height: 420px;
  opacity: 1;
  transform: translateY(0);
}

.menu__chevron {
  position: relative;
  z-index: 1;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex: 0 0 auto;
  transform-origin: 50% 50%;
  transition:
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    color 180ms ease,
    opacity 180ms ease,
    width 240ms cubic-bezier(0.22, 1, 0.36, 1),
    margin-left 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.menu__chevron svg {
  width: 16px;
  height: 16px;
  display: block;
}

.menu__group.is-open .menu__chevron,
.menu__item:hover .menu__chevron,
.menu__item.is-active .menu__chevron {
  color: var(--text);
}

.menu__group.is-open .menu__chevron {
  transform: rotate(180deg);
}
.menu__icon {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  color: var(--muted);
  flex: 0 0 auto;
  transition:
    color 180ms ease,
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    margin-right 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.menu__icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.menu__item:hover .menu__icon,
.menu__item.is-active .menu__icon {
  color: var(--text);
}

.menu__item:hover .menu__icon {
  transform: none;
}

body.menu-customize-mode .menu__item.is-active[data-customizable='1'] .menu__icon {
  color: var(--danger);
}


.menu__label {
  position: relative;
  z-index: 1;
  min-width: 0;
  max-width: 176px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition:
    opacity 180ms ease,
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    max-width 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.menu__count {
  position: relative;
  z-index: 1;
  display: none;
  margin-left: auto;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: auto;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: rgba(95, 108, 123, 0.82);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  flex: 0 0 auto;
  box-shadow: none;
  transition: color 180ms ease, opacity 180ms ease;
  opacity: 0.9;
}

.menu__item:hover .menu__count {
  color: rgba(58, 68, 84, 0.9);
  opacity: 1;
}

.menu__item.is-active .menu__count {
  color: rgba(var(--accent-rgb), 0.9);
  opacity: 1;
}

body.menu-customize-mode .menu__item.is-active[data-customizable='1'] .menu__count {
  color: rgba(var(--danger-rgb), 0.9);
}

.menu__item:hover {
  text-decoration: none;
  background: rgba(248, 250, 252, 0.9);
  border-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.menu__item:hover::before,
.menu__item.is-active::before {
  opacity: 1;
  transform: scaleX(1);
}

.menu__item:active::before {
  opacity: 0.72;
  transform: scaleX(0.96);
}

.menu__item.is-active {
  background: rgba(var(--accent-rgb), 0.08);
  border-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.08);
}


.sidebar-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.sidebar-action__icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  flex: 0 0 auto;
}

.sidebar-action__icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar .auth-actions {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.sidebar .auth-actions form,
.sidebar .auth-actions button {
  width: 100%;
}

.sidebar__bottom .auth-actions,
.sidebar__bottom .auth-actions form {
  width: 100%;
}

.sidebar__bottom .auth-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar__bottom .gear-btn.is-active {
  border-color: transparent;
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--text);
}

.sidebar__bottom .gear-btn.is-active:hover {
  border-color: transparent;
  background: rgba(var(--accent-rgb), 0.14);
}

body.menu-customize-mode .sidebar__bottom .gear-btn.gear-btn--customize.is-active {
  border-color: transparent;
  background: rgba(var(--danger-rgb), 0.12);
  color: var(--danger);
}

body.menu-customize-mode .sidebar__bottom .gear-btn.gear-btn--customize.is-active:hover {
  border-color: transparent;
  background: rgba(var(--danger-rgb), 0.12);
}

.sidebar__bottom .sidebar-action:hover .sidebar-action__icon,
.sidebar__bottom .gear-btn:hover .gear-btn__icon,
.sidebar__bottom .gear-btn.is-active .gear-btn__icon {
  color: currentColor;
}

.sidebar__bottom .sidebar-action.sidebar-action--logout {
  color: rgba(165, 64, 91, 0.96);
}

.sidebar__bottom .sidebar-action.sidebar-action--logout:hover {
  border-color: transparent;
  background: rgba(244, 114, 182, 0.12);
}


.ghost {
  background: transparent;
  border-color: var(--border);
}

.leads-toolbar-icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: rgba(176, 186, 198, 0.92);
}

.leads-toolbar-icon-btn--filters {
  width: auto;
  min-width: 36px;
  flex: 0 0 auto;
  padding: 0 8px;
  gap: 6px;
  justify-content: flex-start;
}

.leads-toolbar-icon-btn:hover,
.leads-toolbar-icon-btn:focus-visible,
.leads-toolbar-icon-btn:active {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: rgba(176, 186, 198, 0.92);
}

.leads-toolbar-icon-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12);
}

.leads-toolbar-icon-btn--filters.is-active,
.leads-toolbar-icon-btn--filters.is-active:hover,
.leads-toolbar-icon-btn--filters.is-active:focus-visible,
.leads-toolbar-icon-btn--filters.is-active:active {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: rgba(176, 186, 198, 0.92);
}

.leads-toolbar-filter-main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.leads-toolbar-icon-btn__icon {
  width: 24px;
  height: 24px;
  display: block;
}

.leads-toolbar-icon-btn__icon--kanban {
  width: 20px;
  height: 20px;
}

.leads-toolbar-icon-btn__icon path,
.leads-toolbar-icon-btn__icon rect {
  stroke-width: 3.2;
}

.leads-toolbar-icon-btn__icon--kanban rect {
  stroke-width: 2.6;
}

.leads-toolbar-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.leads-toolbar-filter-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: var(--muted);
  pointer-events: auto;
}

.leads-toolbar-filter-clear .leads-toolbar-icon-btn__icon {
  width: 14px;
  height: 14px;
}

.leads-toolbar-icon-btn--filters.is-active .leads-toolbar-filter-clear {
  color: var(--text);
}

.leads-toolbar-add-btn {
  flex: 0 0 36px;
  font-size: 24px;
}

.leads-toolbar-add-btn .icon-btn__glyph {
  transform: translateY(-2px);
  font-weight: 500;
}

main.container {
  padding: 12px 0;
  display: grid;
  gap: 10px;
  align-content: start;
}

.shell main.container {
  padding: 6px 0;
  gap: 6px;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    overflow: visible;
  }

  .sidebar__bottom {
    margin-top: 0;
    flex-direction: row;
    align-items: center;
    gap: 6px;
  }

  .sidebar__bottom .gear-btn,
  .sidebar__bottom .sidebar-action {
    width: 42px;
  }

  .menu {
    display: flex;
    gap: 6px;
    overflow: auto;
    padding: 0;
    flex: 1;
  }

  .menu__item {
    white-space: nowrap;
  }

  .sidebar .auth-actions {
    flex-direction: row;
    align-items: center;
  }


  .sidebar .auth-actions form {
    width: auto;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
  min-width: 0;
}

.shell .card {
  border-radius: 8px;
  padding: 6px;
}

.shell .card > p {
  margin: 0 0 8px 0;
}

.shell .card > p:last-child {
  margin-bottom: 0;
}

.muted {
  color: var(--muted);
}

.notice {
  border: 1px solid rgba(151, 32, 49, 0.38);
  background: linear-gradient(180deg, rgba(255, 239, 242, 0.98) 0%, rgba(255, 224, 229, 0.98) 100%);
  color: #7b1625;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 8px 20px rgba(149, 36, 51, 0.08);
}

.banner {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 700;
  line-height: 1.4;
}

.banner--danger {
  border-color: rgba(151, 32, 49, 0.46);
  background: linear-gradient(180deg, rgba(255, 239, 242, 0.98) 0%, rgba(255, 224, 229, 0.98) 100%);
  color: #7b1625;
  box-shadow: 0 10px 24px rgba(149, 36, 51, 0.1);
}

.banner--confirm {
  border-color: rgba(151, 32, 49, 0.52);
  background: linear-gradient(180deg, rgba(255, 241, 243, 0.99) 0%, rgba(255, 228, 233, 0.99) 100%);
  box-shadow: 0 12px 28px rgba(149, 36, 51, 0.12);
}

.banner__confirm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.banner__confirm-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
}

.banner__confirm-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.banner__confirm-btn {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.16s ease, opacity 0.16s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.banner__confirm-btn:disabled {
  cursor: default;
  opacity: 0.6;
}

.banner__confirm-btn-glyph {
  display: block;
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
  transform: translateY(-2px);
}

.banner__confirm-btn--ghost {
  color: rgba(123, 22, 37, 0.72);
}

.banner__confirm-btn--ghost:hover:not(:disabled) {
  color: rgba(123, 22, 37, 0.94);
}

.banner__confirm-btn--danger {
  color: rgba(var(--accent-rgb), 0.82);
}

.banner__confirm-btn--danger:hover:not(:disabled) {
  color: rgba(15, 23, 42, 0.96);
}

.banner__confirm-btn--danger .banner__confirm-btn-glyph {
  font-size: 29px;
  font-weight: 700;
  transform: translateY(-1px);
}

.shell .notice {
  padding: 8px 9px;
  border-radius: 8px;
}

@media (max-width: 640px) {
  .banner__confirm {
    flex-direction: column;
    align-items: stretch;
  }

  .banner__confirm-actions {
    justify-content: flex-end;
  }
}

.hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

.form-row {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.form-row--pipelines {
  grid-template-columns: minmax(0, 1fr) auto;
}

.form-row--movement {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.form-row--filters {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-row--filters-main {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-row--filters-dates {
  margin-top: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field--filter-picker {
  min-width: 0;
}

.leads-filter-picker {
  display: inline-flex;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.leads-filter-picker.is-active {
  border-color: rgba(var(--accent-rgb), 0.34);
  background-color: rgba(var(--accent-rgb), 0.07);
}

.leads-filter-picker__value {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leads-filter-picker__value.is-placeholder {
  color: var(--muted);
}

.leads-filters-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.leads-filter-menu {
  width: min(320px, calc(100% - 16px));
  gap: 8px;
}

.leads-filter-menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.leads-filter-menu__title {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.leads-filter-menu__reset {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.leads-filter-menu__reset:hover,
.leads-filter-menu__reset:focus-visible {
  color: var(--text);
}

.leads-filter-menu__list {
  display: grid;
  gap: 6px;
  max-height: min(320px, 55vh);
  overflow: auto;
}

.leads-filter-menu__empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.leads-filter-menu__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
  text-align: left;
  padding: 7px 9px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--text);
}

.leads-filter-menu__item:hover,
.leads-filter-menu__item:focus-visible {
  background: rgba(255, 255, 255, 0.04);
}

.leads-filter-menu__item.is-selected {
  background: rgba(var(--accent-rgb), 0.09);
}

.leads-filter-menu__item-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.leads-filter-menu__item-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leads-filter-menu__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  color: rgba(var(--accent-rgb), 0.92);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 120ms ease, transform 120ms ease;
}

.leads-filter-menu__item.is-selected .leads-filter-menu__check {
  opacity: 1;
  transform: scale(1);
}

@media (max-width: 900px) {
  .form-row--filters-main,
  .form-row--filters-dates {
    grid-template-columns: minmax(0, 1fr);
  }
}

.form-row--auth-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-row--auth-code {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
}

.form-row--auth-code > button {
  height: 36px;
  white-space: nowrap;
}

.auth-code-timer {
  height: 36px;
  min-width: 76px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--control-bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.auth-code-timer.is-active {
  color: var(--text);
  border-color: rgba(var(--danger-rgb), 0.42);
}

.auth-code-timer.is-expired {
  color: var(--danger);
  border-color: rgba(var(--danger-rgb), 0.6);
}

.auth-code-timer.is-idle {
  opacity: 0.88;
}

.auth-code-status {
  min-height: 18px;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
  opacity: 0;
  transition: opacity 160ms ease;
}

.auth-code-status.is-visible {
  opacity: 1;
}

.auth-code-status.is-success {
  color: var(--accent);
}

.auth-code-status.is-error {
  color: var(--danger);
}

.form-row--user-profile {
  grid-template-columns: minmax(0, 1fr) auto;
}

.form-row--user-password {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
}

.form-row--user-owner-extra {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
}

.form-row--finance {
  grid-template-columns: minmax(0, 160px) minmax(0, 180px) minmax(0, 220px) minmax(0, 1fr) auto;
}

.form-row--goods-services {
  grid-template-columns: minmax(0, 1fr) minmax(0, 160px) minmax(0, 260px) minmax(0, 180px) auto auto;
}

.parsing-layout {
  display: grid;
  gap: 16px;
}

.parsing-workspace {
  display: grid;
  gap: 16px;
}

.parsing-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.parsing-page-head--workspace {
  align-items: center;
  margin-bottom: 10px;
}

.parsing-page-head__intro {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.parsing-page-head__top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.parsing-page-title {
  margin: 0;
}

.parsing-backlink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  text-decoration: none;
}

.parsing-backlink:hover {
  color: var(--accent);
  text-decoration: none;
}

.parsing-source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.parsing-source-card {
  display: grid;
  gap: 14px;
  min-height: 220px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.02);
  color: var(--text);
  text-decoration: none;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
  cursor: pointer;
  outline: none;
}

.parsing-source-card:hover {
  transform: none;
  border-color: rgba(var(--accent-rgb), 0.34);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
  text-decoration: none;
}

.parsing-source-card:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.5);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.16);
}

.parsing-source-card.is-active {
  border-color: rgba(63, 209, 124, 0.32);
  background:
    linear-gradient(180deg, rgba(63, 209, 124, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.02);
}

.parsing-source-card.is-disabled,
.parsing-source-card.is-unavailable {
  opacity: 0.72;
  cursor: default;
}

.parsing-source-card.is-disabled:hover,
.parsing-source-card.is-unavailable:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: none;
}

.parsing-source-card__top {
  display: grid;
  gap: 10px;
}

.parsing-source-card__badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 28px;
  padding: 0 11px 0 13px;
  border-radius: 11px;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.72)),
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.2), rgba(var(--accent-rgb), 0.08));
  box-shadow:
    inset 4px 0 0 rgba(var(--accent-rgb), 0.92),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  color: #166534;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.parsing-source-card.is-active .parsing-source-card__badge {
  border-color: rgba(var(--accent-rgb), 0.2);
  color: #166534;
}

.parsing-source-card.is-disabled .parsing-source-card__badge,
.parsing-source-card.is-unavailable .parsing-source-card__badge {
  border-color: rgba(148, 163, 184, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.68)),
    linear-gradient(180deg, rgba(148, 163, 184, 0.14), rgba(148, 163, 184, 0.06));
  box-shadow:
    inset 4px 0 0 rgba(148, 163, 184, 0.72),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  color: rgba(51, 65, 85, 0.72);
}

.parsing-source-card__title {
  font-size: 22px;
  line-height: 1.2;
}

.parsing-source-card__desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.parsing-source-card__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.parsing-source-card__status {
  max-width: 220px;
  line-height: 1.4;
}

.parsing-source-card__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  white-space: nowrap;
  text-decoration: none;
  border: 0;
}

.parsing-source-card__action:hover {
  text-decoration: none;
}

.parsing-session {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

.parsing-session__state,
.parsing-session__title,
.parsing-session__sep {
  color: var(--muted);
}

.parsing-session__timer {
  font-variant-numeric: tabular-nums;
}

.parsing-indicator {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  transition: background 160ms ease, box-shadow 160ms ease;
}

.parsing-indicator.is-active {
  background: #3fd17c;
  box-shadow: 0 0 0 6px rgba(63, 209, 124, 0.12);
  animation: parsing-pulse 1.4s ease-in-out infinite;
}

@keyframes parsing-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(63, 209, 124, 0.16);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 8px rgba(63, 209, 124, 0.05);
  }
}

.parsing-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
  gap: 16px;
}

.parsing-primary-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.parsing-intro-note {
  display: grid;
  gap: 4px;
}

.parsing-lead-target {
  display: grid;
  gap: 12px;
}

.parsing-lead-target__head {
  display: grid;
  gap: 6px;
}

.parsing-lead-target__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.parsing-primary-fields > .field {
  align-content: start;
}

.parsing-fields-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.parsing-fields-row .parsing-choice {
  flex: 1 1 auto;
  min-width: 0;
}

.parsing-toolbar-inline {
  flex: 0 0 auto;
  min-width: max-content;
  margin-left: auto;
  align-self: flex-start;
}

.parsing-action-btn {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  font-weight: 700;
}

.parsing-action-btn--start {
  background: rgba(63, 209, 124, 0.96);
  border-color: rgba(63, 209, 124, 0.98);
  color: #0d1711;
}

.parsing-action-btn--start:hover {
  background: rgba(76, 224, 136, 1);
}

.parsing-action-btn--stop {
  background: rgba(222, 93, 93, 0.92);
  border-color: rgba(222, 93, 93, 0.96);
  color: #fff;
}

.parsing-action-btn--stop:hover {
  background: rgba(234, 104, 104, 0.98);
}

.parsing-choice {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.parsing-choice--wide {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
}

.parsing-choice .choice__item {
  display: inline-flex;
  flex: 0 0 auto;
  max-width: 100%;
}

.parsing-choice .choice__item + .choice__item {
  border-left: 0;
}

.parsing-choice .choice__item > span {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: auto;
  min-height: 0;
  max-width: 100%;
  padding: 0;
  box-sizing: border-box;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
  line-height: 1.35;
}

.parsing-choice.choice--compact .choice__item > span {
  padding: 0;
}

.parsing-choice__mark {
  position: relative;
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.03);
}

.parsing-choice__mark::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border-right: 2px solid rgba(12, 18, 24, 0.88);
  border-bottom: 2px solid rgba(12, 18, 24, 0.88);
  transform: rotate(45deg);
  opacity: 0;
}

.parsing-choice__text {
  min-width: 0;
  color: var(--muted);
  line-height: 1.35;
}

.parsing-choice .choice__item:hover > span {
  background: transparent;
}

.parsing-choice .choice__item > input:checked + span {
  border-color: transparent;
  background: transparent;
}

.parsing-choice .choice__item > input:checked + span .parsing-choice__mark {
  border-color: rgba(var(--accent-rgb), 0.24);
  background: rgba(var(--accent-rgb), 0.92);
}

.parsing-choice .choice__item > input:checked + span .parsing-choice__mark::after {
  opacity: 1;
}

.parsing-choice .choice__item > input:checked + span .parsing-choice__text {
  color: var(--text);
}

.parsing-hints {
  margin-top: 6px;
}

.parsing-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
  height: 46vh;
  min-height: 46vh;
  max-height: 46vh;
}

.parsing-dashboard__main,
.parsing-dashboard__side {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.parsing-kpis {
  display: grid;
  gap: 10px;
}

.parsing-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  min-height: 0;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

.parsing-panel--overview {
  grid-template-rows: minmax(0, 1fr);
}

.parsing-panel--events {
  grid-template-rows: auto minmax(0, 1fr);
}

.parsing-panel__title {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.parsing-section {
  display: grid;
  gap: 8px;
  min-height: 0;
}

.parsing-panel--overview .parsing-section {
  align-content: start;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  scrollbar-gutter: stable;
}

.parsing-kpis .kpi,
.parsing-kpis .kpi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.parsing-kpis .kpi {
  box-sizing: border-box;
}

.parsing-kpis .kpi__label,
.parsing-kpis .kpi__label {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.parsing-kpis .kpi__value,
.parsing-kpis .kpi__value {
  min-width: 0;
  font-size: 14px;
  line-height: 1.25;
  text-align: right;
}

.parsing-kpis .kpi__value {
  margin-top: 0;
  font-weight: 600;
}

.parsing-events-card {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 6px;
  min-height: 0;
  height: 100%;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.parsing-events {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 14px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.parsing-events-rail {
  position: absolute;
  top: 0;
  right: 1px;
  bottom: 0;
  width: 8px;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.parsing-events-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 28px;
  border-radius: 999px;
  background: var(--scrollbar-thumb);
  box-shadow:
    0 0 0 1px var(--scrollbar-thumb-border) inset,
    0 1px 6px rgba(0, 0, 0, 0.28);
  transform: translateY(0);
}

.parsing-events-rail.is-hidden {
  opacity: 0;
}

.parsing-events.is-empty {
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 12px;
}

.parsing-event {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 8px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  min-width: 0;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.parsing-event__time {
  flex: 0 0 78px;
  align-self: center;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.15;
}

.parsing-event__message {
  flex: 0 0 auto;
  align-self: center;
  min-width: max-content;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  font-size: 13px;
  line-height: 1.15;
}

.parsing-event::-webkit-scrollbar {
  display: none;
}

.parsing-event--success {
  background: rgba(63, 209, 124, 0.08);
}

.parsing-event--warn {
  background: rgba(232, 183, 68, 0.08);
}

.parsing-event--error {
  background: rgba(222, 93, 93, 0.08);
}

.user-profile {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.settings-shell {
  display: grid;
  gap: 20px;
}

.settings-hero {
  display: grid;
  gap: 12px;
  padding: 22px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 251, 249, 0.96)),
    var(--card-bg);
  box-shadow:
    0 18px 42px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.settings-hero__copy {
  display: grid;
  gap: 8px;
  align-content: start;
}

.settings-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.12);
  color: rgba(19, 87, 60, 0.96);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-hero__nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.settings-hero__group-link {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(95, 108, 123, 0.14);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 250, 252, 0.9)),
    rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 8px 18px rgba(15, 23, 42, 0.035);
  color: rgba(33, 42, 54, 0.94);
  text-decoration: none;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.settings-hero__group-link:hover,
.settings-hero__group-link:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 250, 246, 0.94)),
    rgba(255, 255, 255, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 12px 22px rgba(15, 23, 42, 0.05);
  transform: none;
  outline: none;
}

.settings-hero__group-link-label {
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.settings-hero__group-link-count {
  min-width: 30px;
  height: 30px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.12);
  color: rgba(19, 87, 60, 0.96);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  flex: 0 0 auto;
}

.settings-hero h1,
.settings-style-group__head h2 {
  margin: 0;
}

.settings-hero p,
.settings-style-group__head p {
  margin: 0;
}

.settings-style-group {
  display: grid;
  gap: 16px;
  scroll-margin-top: 88px;
}

.settings-style-group__head {
  display: grid;
  gap: 8px;
}

.settings-style-group__topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.settings-style-group__head-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.settings-count-pill {
  min-width: 34px;
  height: 34px;
  padding: 0 12px 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 11px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.72)),
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.2), rgba(var(--accent-rgb), 0.08));
  box-shadow:
    inset 4px 0 0 rgba(var(--accent-rgb), 0.92),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  color: rgba(19, 87, 60, 0.96);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.015em;
}

.settings-style-table {
  border: 1px solid rgba(95, 108, 123, 0.14);
  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(248, 251, 249, 0.94)),
    rgba(255, 255, 255, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 10px 24px rgba(15, 23, 42, 0.04);
}

.settings-style-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(220px, 1.15fr) minmax(180px, 0.9fr) minmax(280px, 1.35fr);
  border-top: 1px solid rgba(95, 108, 123, 0.12);
}

.settings-style-row:first-child {
  border-top: 0;
}

.settings-style-row--head {
  background:
    linear-gradient(180deg, rgba(244, 247, 250, 0.98), rgba(239, 244, 248, 0.94)),
    rgba(255, 255, 255, 0.7);
}

.settings-style-cell {
  min-width: 0;
  padding: 14px 16px;
  border-left: 1px solid rgba(95, 108, 123, 0.12);
}

.settings-style-row > .settings-style-cell:first-child {
  border-left: 0;
}

.settings-style-head-label {
  color: rgba(95, 108, 123, 0.92);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-style-cell__label {
  display: none;
  margin-bottom: 8px;
  color: rgba(95, 108, 123, 0.92);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-style-row__title {
  color: rgba(33, 42, 54, 0.96);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.settings-style-row__text {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.settings-style-cell--tokens .settings-style-card__tokens {
  align-content: flex-start;
}

.settings-style-cell--preview {
  padding: 12px;
}

.settings-style-card__head {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.settings-style-card__copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.settings-style-card__tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.settings-style-card__meta {
  display: grid;
  gap: 8px;
}

.settings-style-card__meta-label {
  color: rgba(95, 108, 123, 0.92);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-style-card__token {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.04);
  color: rgba(43, 54, 69, 0.9);
  font-size: 11px;
  font-weight: 700;
}

.settings-style-card__preview-block {
  display: grid;
  gap: 8px;
}

.settings-style-card__preview {
  display: grid;
}

.settings-style-preview {
  min-height: 124px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 10px;
  padding: 16px;
  border-radius: 16px;
  border: 1px dashed rgba(95, 108, 123, 0.18);
  background:
    linear-gradient(180deg, rgba(247, 250, 252, 0.92), rgba(241, 245, 249, 0.88)),
    rgba(255, 255, 255, 0.7);
}

.settings-style-preview::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(var(--accent-rgb), 0.08), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.settings-style-preview > * {
  position: relative;
  z-index: 1;
}

.settings-style-preview--stack {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}

.settings-style-preview__caption {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.settings-preview-panel {
  width: 100%;
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.92)),
    rgba(255, 255, 255, 0.74);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 10px 18px rgba(15, 23, 42, 0.04);
}

.settings-preview-panel--compact {
  width: auto;
  min-width: 0;
}

.settings-preview-panel__eyebrow {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-preview-panel__row,
.settings-preview-actions,
.settings-preview-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.settings-preview-panel__row {
  justify-content: space-between;
}

.settings-preview-panel__value {
  color: rgba(33, 42, 54, 0.92);
  font-size: 13px;
  font-weight: 600;
}

.settings-preview-panel__field {
  min-height: 36px;
  flex: 1 1 180px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 11px;
  background: rgba(248, 250, 252, 0.96);
  color: rgba(71, 85, 105, 0.92);
  font-size: 13px;
}

.settings-preview-panel__field--ghost {
  background: rgba(241, 245, 249, 0.92);
}

.settings-preview-note {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.settings-preview-note--body {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
  color: rgba(43, 54, 69, 0.92);
}

.settings-preview-stack {
  display: grid;
  gap: 10px;
  width: 100%;
}

.settings-preview-stack--summary {
  gap: 12px;
}

.settings-preview-actions--summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, max-content));
  align-items: start;
  justify-content: start;
  gap: 8px;
  width: 100%;
}

.settings-preview-lead-modal-metrics {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding: 5px;
  overflow: visible;
}

.settings-preview-open-lead-shell {
  width: min(100%, 420px);
  display: grid;
  gap: 8px;
}

.settings-preview-summary-group {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 10px;
  border: 1px solid rgba(95, 108, 123, 0.12);
  border-radius: 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 252, 0.94)),
    rgba(255, 255, 255, 0.78);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 6px 18px rgba(15, 23, 42, 0.035);
}

.settings-preview-summary-group .settings-preview-actions {
  gap: 8px;
}

.settings-preview-card {
  width: min(100%, 320px);
  display: grid;
  gap: 6px;
}

.settings-preview-card__title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.settings-preview-lead-card {
  width: min(100%, 320px);
}

.settings-preview-funnel-card {
  width: min(100%, 340px);
  display: grid;
  gap: 8px;
}

.settings-preview-funnel-card .lead-card__top {
  margin-bottom: 2px;
}

.settings-preview-sidebar {
  width: min(100%, 320px);
  display: grid;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94)),
    rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.settings-preview-sidebar__state {
  display: grid;
  gap: 6px;
}

.settings-preview-sidebar__state-label {
  color: rgba(95, 108, 123, 0.92);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-preview-sidebar .menu__group,
.settings-preview-sidebar .menu__submenu {
  gap: 1px;
}

.settings-preview-sidebar .menu__submenu {
  display: grid;
  max-height: none;
  opacity: 1;
  overflow: visible;
}

.settings-preview-sidebar .menu__item {
  box-sizing: border-box;
}

.settings-preview-sidebar .menu__item.is-preview-hover {
  text-decoration: none;
  background: rgba(239, 242, 246, 0.9);
  border-color: transparent;
}

.settings-preview-sidebar .menu__item.is-preview-hover .menu__icon,
.settings-preview-sidebar .menu__item.is-preview-hover .menu__chevron {
  color: var(--text);
}

.settings-preview-sidebar .menu__item.is-preview-hover .menu__count {
  color: rgba(58, 68, 84, 0.9);
  opacity: 1;
}

.settings-preview-footer-elements {
  width: min(100%, 340px);
  display: grid;
  gap: 12px;
}

.settings-preview-footer-elements--single {
  width: auto;
}

.settings-preview-footer-elements__item {
  display: grid;
  gap: 6px;
}

.settings-preview-footer-elements__label {
  color: rgba(95, 108, 123, 0.92);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-preview-footer-elements__host.sidebar__bottom {
  margin-top: 0;
  padding: 0;
  gap: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.settings-preview-footer-elements__item--customize .gear-btn.gear-btn--customize.is-active {
  border-color: transparent;
  background: rgba(var(--danger-rgb), 0.12);
  color: var(--danger);
}

.settings-preview-footer-elements__item--customize .gear-btn.gear-btn--customize.is-active .gear-btn__icon,
.settings-preview-footer-elements__item--customize .gear-btn.gear-btn--customize.is-active .gear-btn__label {
  color: currentColor;
}

.settings-static-menu {
  position: static;
  inset: auto;
  width: min(100%, 320px);
  max-width: 100%;
  animation: none;
  transform: none;
}

.settings-svg-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  flex: 0 0 auto;
}

.settings-svg-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.settings-svg-icon--sm {
  width: 14px;
  height: 14px;
}

.settings-svg-icon--chevron {
  width: 16px;
  height: 16px;
}

.settings-svg-icon--lg {
  width: 20px;
  height: 20px;
}

.settings-preview-add-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: rgba(43, 54, 69, 0.7);
}

.settings-preview-add-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.settings-preview-add-copy strong {
  font-size: 13px;
  line-height: 1.25;
}

.settings-preview-add-copy span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.settings-preview-indicator-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.settings-preview-icon-grid {
  width: min(100%, 340px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  gap: 10px;
}

.settings-preview-icon-item {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 10px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.16);
  color: rgba(43, 54, 69, 0.76);
}

.settings-preview-icon-item .settings-svg-icon {
  width: 24px;
  height: 24px;
}

.settings-preview-icon-item .settings-svg-icon--chevron {
  width: 20px;
  height: 20px;
}

.settings-preview-icon-item .settings-svg-icon--lg {
  width: 24px;
  height: 24px;
}

.settings-preview-icon-label {
  color: rgba(71, 85, 105, 0.9);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-wrap: balance;
}

.settings-preview-inline-host {
  width: min(100%, 240px);
}

.settings-preview-lead-indicators {
  width: 100%;
}

.settings-preview-actions--task-states,
.settings-preview-actions--task-statuses {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-preview-task-status-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 10px;
}

.settings-preview-task-status-item {
  display: grid;
  justify-items: center;
  gap: 7px;
  min-width: 0;
}

.settings-preview-task-status-label {
  color: rgba(71, 85, 105, 0.9);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-wrap: balance;
}

.settings-style-preview .action-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(19, 87, 60, 0.96);
  font: inherit;
}

.settings-style-preview .btn,
.settings-style-preview .ghost {
  min-width: 118px;
}

.settings-style-preview .btn-outline-danger,
.settings-style-preview .btn-danger {
  min-width: 118px;
}

.settings-style-preview .select-like {
  width: auto;
  min-width: 190px;
  max-width: 100%;
}

.settings-style-preview .deals-add-toggle {
  transform: none;
}

.settings-style-preview .lead-modal__action-btn {
  flex: 0 0 auto;
}

.settings-style-preview .deal-modal__close-btn,
.settings-style-preview .lead-copy-btn,
.settings-style-preview .lead-address-copy,
.settings-style-preview .lead-create-card__action,
.settings-style-preview .deals-ttn-btn {
  flex: 0 0 auto;
}

.settings-style-preview .field__action {
  border-color: rgba(148, 163, 184, 0.24);
}

.settings-style-preview .table-wrap,
.settings-style-preview .lead-card-menu,
.settings-style-preview .lead-tag-menu,
.settings-style-preview .leads-add-menu,
.settings-style-preview .lead-assignee-menu,
.settings-style-preview .pipeline-menu,
.settings-style-preview .deal-payment-menu,
.settings-style-preview .leads-filter-menu,
.settings-style-preview .deals-stage-menu,
.settings-style-preview .confirm-menu {
  width: 100%;
  max-width: 100%;
}

.settings-style-preview .menu__item {
  max-width: 320px;
}

.settings-style-preview .gear-btn {
  width: auto;
  max-width: 100%;
}

.settings-style-preview .assignee-btn {
  min-height: 44px;
  height: auto;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.92)),
    rgba(255, 255, 255, 0.72);
}

.settings-style-preview .lead-card-menu__item,
.settings-style-preview .lead-tag-menu__item,
.settings-style-preview .leads-add-menu__item {
  cursor: default;
}

.settings-style-preview .leads-filter-menu__item,
.settings-style-preview .deal-modal__delete-control,
.settings-style-preview .deals-tags__add,
.settings-style-preview .deals-tags__remove {
  cursor: default;
}

.settings-style-preview .choice {
  max-width: 100%;
}

.settings-style-preview input[type='checkbox'] {
  flex: 0 0 auto;
}

.settings-style-preview .deals-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-type-sample {
  color: var(--text);
}

.settings-type-sample--section {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

@media (max-width: 900px) {
  .settings-hero__nav {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .settings-style-group__topline {
    flex-direction: column;
    align-items: flex-start;
  }

  .settings-style-row {
    grid-template-columns: minmax(170px, 0.9fr) minmax(220px, 1.1fr);
  }

  .settings-style-cell--preview,
  .settings-style-cell--tokens {
    grid-column: span 2;
  }

  .settings-style-preview {
    min-height: 100px;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .settings-hero__nav {
    grid-template-columns: 1fr;
  }

  .settings-style-row {
    grid-template-columns: 1fr;
  }

  .settings-style-row--head {
    display: none;
  }

  .settings-style-cell {
    border-left: 0;
    border-top: 1px solid rgba(95, 108, 123, 0.12);
  }

  .settings-style-row > .settings-style-cell:first-child {
    border-top: 0;
  }

  .settings-style-cell__label {
    display: block;
  }

  .settings-style-cell--preview,
  .settings-style-cell--tokens {
    grid-column: auto;
  }

  .settings-preview-panel__row {
    align-items: stretch;
  }

  .settings-preview-actions,
  .settings-preview-badges {
    align-items: flex-start;
  }

  .settings-style-preview .select-like {
    min-width: 0;
    width: 100%;
  }
}

.lead-form {
  display: grid;
  gap: 8px;
}

#leads-create-panel.card {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.shell #leads-create-panel.card {
  padding: 0;
}

.leads-create-form {
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: start;
}

.lead-create-card {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  position: static;
  overflow: visible;
  isolation: auto;
  display: grid;
  gap: 8px;
}

.shell .lead-create-card {
  border-radius: 0;
  padding: 0;
}

.lead-create-card::before {
  content: none;
}

.lead-create-card::after {
  content: none;
}

.lead-create-card > * {
  position: static;
  z-index: auto;
}

.lead-create-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.94) 68%, rgba(255, 255, 255, 0.92) 100%),
    linear-gradient(
      90deg,
      rgba(var(--accent-rgb), 0.06) 0%,
      rgba(var(--warning-rgb), 0.05) 52%,
      rgba(var(--danger-rgb), 0.045) 100%
    );
  box-shadow: 0 10px 22px rgba(26, 36, 53, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  position: relative;
  overflow: hidden;
}

.lead-create-card__head::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -8px;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(var(--accent-rgb), 0.12) 0%,
    rgba(var(--warning-rgb), 0.1) 52%,
    rgba(var(--danger-rgb), 0.08) 100%
  );
  filter: blur(12px);
  opacity: 0.55;
  pointer-events: none;
}

.lead-create-card__head > * {
  position: relative;
  z-index: 1;
}

.lead-create-card__title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-weight: 600;
  line-height: 1.2;
  min-height: 36px;
}

.lead-create-card__title-label {
  color: rgba(43, 54, 69, 0.82);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.lead-create-card__num {
  flex: 0 0 auto;
}

.lead-create-card__head .lead-create-card__source {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 280px;
  min-width: 220px;
  margin: 0;
}

.lead-create-card__head .lead-create-card__source > span {
  flex: 0 0 auto;
  white-space: nowrap;
}

.lead-create-card__head .lead-create-card__source > select {
  flex: 1 1 auto;
  min-width: 0;
}

.lead-create-card__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 36px;
  white-space: nowrap;
}

.lead-create-card__submit {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 16px;
  white-space: nowrap;
}

.lead-create-card__action--ai {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.18);
  background: rgba(var(--accent-rgb), 0.06);
}

.lead-create-card__action--ai:hover,
.lead-create-card__action--ai:focus-visible,
.lead-create-card__action--ai:active {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.24);
  background: rgba(var(--accent-rgb), 0.1);
}

.lead-ai-modal {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lead-ai-modal.hidden {
  display: none;
}

.lead-ai-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(3px);
}

.lead-ai-modal__panel {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(86vh, 860px);
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, rgba(248, 250, 252, 0.98) 100%),
    linear-gradient(120deg, rgba(var(--accent-rgb), 0.06) 0%, rgba(var(--warning-rgb), 0.05) 100%);
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.lead-ai-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.lead-ai-modal__title {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
}

.lead-ai-modal__subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.lead-ai-modal__close {
  min-width: 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  border-radius: 12px;
}

.lead-ai-modal__body {
  display: grid;
  gap: 12px;
}

.lead-ai-modal__body textarea {
  width: 100%;
  min-height: 180px;
  resize: vertical;
}

.lead-ai-modal__file-block {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px dashed rgba(var(--accent-rgb), 0.24);
  border-radius: 14px;
  background: rgba(var(--accent-rgb), 0.04);
}

.lead-ai-modal__file-head {
  display: grid;
  gap: 4px;
}

.lead-ai-modal__file-save-hint {
  font-size: 12px;
  line-height: 1.45;
}

.lead-ai-modal__file-title {
  font-weight: 600;
}

.lead-ai-modal__dropzone {
  display: grid;
  place-items: center;
  min-height: 112px;
  padding: 14px;
  border: 1px dashed rgba(var(--accent-rgb), 0.28);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--text);
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.lead-ai-modal__dropzone:hover,
.lead-ai-modal__dropzone:focus-visible,
.lead-ai-modal__dropzone.is-dragover {
  border-color: rgba(var(--accent-rgb), 0.42);
  background: rgba(var(--accent-rgb), 0.08);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.08);
}

.lead-ai-modal__dropzone.is-disabled {
  cursor: default;
  opacity: 0.7;
}

.lead-ai-modal__dropzone-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.lead-ai-modal__file-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lead-ai-modal__file-name {
  min-height: 20px;
  word-break: break-word;
}

.lead-ai-modal__file-list {
  display: grid;
  gap: 8px;
}

.lead-ai-modal__file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
}

.lead-ai-modal__file-item-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.lead-ai-modal__file-item-name {
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}

.lead-ai-modal__file-item-size {
  font-size: 12px;
}

.lead-ai-modal__file-item-remove {
  min-width: 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
  border-radius: 10px;
}

.lead-ai-modal__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.leads-create-top__row {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.lead-extras {
  display: grid;
  gap: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.shell .lead-extras {
  padding: 0;
  border-radius: 0;
}

.leads-create-top {
  padding-top: 0;
}

.lead-extras__actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.lead-extras__actions > button {
  width: 100%;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lead-extras__body {
  display: grid;
  gap: 8px;
}

.lead-extras__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lead-extras__title {
  font-weight: 600;
  line-height: 1.2;
}

.lead-extras__editor {
  display: grid;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.16);
}

.lead-extras__editor textarea {
  width: 100%;
  resize: vertical;
  min-height: 72px;
}

.lead-extras__editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.lead-extras__summary {
  display: grid;
  gap: 6px;
}

.lead-extras__item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.14);
}

.lead-extras__item-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.lead-extras__item-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.lead-avatar-preview {
  display: flex;
  align-items: center;
  gap: 10px;
}

.users-editor {
  display: grid;
  gap: 14px;
}

.users-editor__head {
  display: grid;
  gap: 4px;
}

.users-editor__head .muted {
  margin: 0;
}

.users-editor__form {
  gap: 12px;
}

.users-editor__actions {
  justify-content: flex-start;
}

.users-editor__actions > button[type='submit'] {
  flex: 0 0 auto;
}

.users-editor__actions--inline {
  align-self: end;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.users-editor__actions--inline > button {
  white-space: nowrap;
}

.users-table-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.users-table-identity__avatar,
.users-table-identity__avatar-img {
  width: 48px;
  height: 48px;
  border-radius: 999px;
}

.users-table-identity__avatar-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 999px;
  flex: 0 0 auto;
}

.users-table-identity__avatar-static {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.users-table-identity__avatar-btn:hover .avatar,
.users-table-identity__avatar-btn:hover .avatar-img,
.users-table-identity__avatar-btn:focus-visible .avatar,
.users-table-identity__avatar-btn:focus-visible .avatar-img {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1), 0 0 0 4px rgba(53, 118, 254, 0.28);
}

.users-table-identity__meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.users-table-identity__name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.users-table-identity__login {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.users-page {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
  height: var(--users-page-height, auto);
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

body[data-page='users-team'] .shell__main {
  overflow: hidden;
}

body[data-page='users-team'] .shell__main > main.container {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  align-content: stretch;
}

.users-table-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.users-editor-card,
.users-table-card {
  box-shadow: none;
}

.users-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.users-table-wrap::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.users-table-wrap::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

.users-table-wrap::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 2px solid var(--scrollbar-thumb-border);
}

.users-table-wrap::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

.users-team-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 14px;
  line-height: 1.25;
}

.users-team-table__col--handle {
  width: 52px;
}

.users-team-table__col--employee {
  width: 34%;
}

.users-team-table__col--role {
  width: 24%;
}

.users-team-table__col--status {
  width: 132px;
}

.users-team-table__col--created {
  width: 180px;
}

.users-team-table__col--actions {
  width: 250px;
}

.users-team-table__row > .users-team-table__th,
.users-team-table__row > .users-team-table__td {
  padding: 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  text-align: left;
}

.users-team-table__row > * + * {
  border-left: 1px solid var(--border);
}

.users-team-table__head .users-team-table__th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--popover-bg);
  box-shadow: inset 0 -1px 0 var(--border);
}

.users-team-table__body .users-team-table__row:last-child > .users-team-table__td {
  border-bottom: 0;
}

.users-team-table__body .users-team-table__row:nth-child(even) > .users-team-table__td {
  background: rgba(255, 255, 255, 0.01);
}

.users-team-table__body .users-team-table__row:hover > .users-team-table__td {
  background: rgba(255, 255, 255, 0.03);
}

.users-team-table__body .users-team-table__row.is-editing > .users-team-table__td {
  background: rgba(var(--accent-rgb), 0.08);
}

.users-team-table__body .users-team-table__row.is-dragging {
  opacity: 0.45;
}

.users-team-table__body .users-team-table__row.is-drag-before > .users-team-table__td {
  box-shadow: inset 0 2px 0 rgba(var(--accent-rgb), 0.85);
}

.users-team-table__body .users-team-table__row.is-drag-after > .users-team-table__td {
  box-shadow: inset 0 -2px 0 rgba(var(--accent-rgb), 0.85);
}

.users-team-table__cell {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 68px;
  padding: 10px 12px;
}

.users-team-table__cell--head {
  min-height: 46px;
  padding-top: 8px;
  padding-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.users-team-table__cell--handle {
  justify-content: center;
  padding-left: 8px;
  padding-right: 4px;
}

.users-team-table__cell--employee,
.users-team-table__cell--role,
.users-team-table__cell--status,
.users-team-table__cell--created,
.users-team-table__cell--actions {
  min-width: 0;
}

.users-team-table__cell--status,
.users-team-table__cell--created {
  white-space: nowrap;
}

.users-team-table__cell--actions {
  overflow: visible;
}

.users-team-table__select {
  width: 100%;
  min-width: 0;
}

.users-team-table__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  width: 100%;
}

.users-team-table__actions .ghost,
.users-team-table__select,
.users-team-table__role-badge,
.status-badge {
  min-height: 36px;
}

.users-team-table__actions .ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.users-team-table__role-badge {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px 0 14px;
  border-radius: 11px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.72)),
    linear-gradient(180deg, rgba(148, 163, 184, 0.14), rgba(148, 163, 184, 0.06));
  box-shadow:
    inset 4px 0 0 rgba(148, 163, 184, 0.72),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.users-team-table__role-badge--owner {
  color: #7a5420;
  border-color: rgba(214, 165, 84, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.72)),
    linear-gradient(180deg, rgba(214, 165, 84, 0.2), rgba(214, 165, 84, 0.08));
  box-shadow:
    inset 4px 0 0 rgba(214, 165, 84, 0.92),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.users-team-table__owner-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.users-team-table__handle {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  min-height: 32px;
  color: var(--muted);
  cursor: grab;
  user-select: none;
  font-size: 16px;
  line-height: 1;
  letter-spacing: -1px;
}

.users-team-table__handle:hover {
  background: transparent;
  color: var(--text);
}

.users-team-table__handle:active {
  cursor: grabbing;
}

@media (max-width: 900px) {
  .users-page {
    height: auto;
    overflow: visible;
  }

  body[data-page='users-team'] .shell__main,
  body[data-page='users-team'] .shell__main > main.container,
  .users-table-card {
    overflow: visible;
  }

  .users-team-table {
    min-width: 960px;
  }
}

.users-roles-matrix__toggle--static {
  cursor: default;
}

.form-row--users-create {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
}

.users-roles-card {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.users-roles-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.users-roles-toolbar__add {
  min-height: 36px;
}

.users-role-list {
  display: grid;
  gap: 8px;
}

.users-role-card {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.users-role-card__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.users-role-card__name {
  min-width: 0;
}

.users-role-card__action {
  min-height: 36px;
  white-space: nowrap;
}

.users-role-card__action--danger {
  color: var(--danger);
  border-color: rgba(var(--danger-rgb), 0.35);
  background: rgba(var(--danger-rgb), 0.08);
}

.users-role-card__action--danger:hover {
  background: rgba(var(--danger-rgb), 0.12);
}

.users-role-card__meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.users-roles-table {
  min-height: 140px;
  overflow: auto;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.users-roles-table::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.users-roles-table::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

.users-roles-table::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 2px solid var(--scrollbar-thumb-border);
}

.users-roles-table::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

.users-roles-empty {
  padding: 4px 0;
}

.users-roles-matrix {
  width: 100%;
  min-width: 560px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 12px;
  line-height: 1.2;
}

.users-roles-matrix__col--permission {
  width: 220px;
}

.users-roles-matrix__col--role {
  width: 88px;
}

.users-roles-matrix__head,
.users-roles-matrix__cell {
  padding: 0;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: center;
  vertical-align: middle;
}

.users-roles-matrix__head:last-child,
.users-roles-matrix__cell:last-child {
  border-right: 0;
}

.users-roles-matrix__head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--popover-bg);
  box-shadow: inset 0 -1px 0 var(--border);
}

.users-roles-matrix__head--permission {
  left: 0;
  z-index: 4;
  text-align: left;
  box-shadow: inset -1px 0 0 var(--border), inset 0 -1px 0 var(--border);
}

.users-roles-matrix__head-content,
.users-roles-matrix__cell-content {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 3px 6px;
  box-sizing: border-box;
}

.users-roles-matrix__head-content {
  min-height: 30px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.users-roles-matrix__head-content--permission,
.users-roles-matrix__cell-content--permission {
  justify-content: flex-start;
}

.users-roles-matrix__body .users-roles-matrix__row .users-roles-matrix__cell {
  background: rgba(255, 255, 255, 0.01);
}

.users-roles-matrix__body .users-roles-matrix__row:nth-child(even) .users-roles-matrix__cell {
  background: rgba(255, 255, 255, 0.03);
}

.users-roles-matrix__body .users-roles-matrix__row:hover .users-roles-matrix__cell {
  background: rgba(var(--accent-rgb), 0.08);
}

.users-roles-matrix__cell--permission {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
  box-shadow: inset -1px 0 0 var(--border);
}

.users-roles-matrix__permission-label {
  color: var(--text);
  font-weight: 600;
  line-height: 1.15;
}

.users-roles-matrix__role-name {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.users-roles-matrix__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 32px;
  padding: 0;
  cursor: pointer;
}

.users-roles-matrix__toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.users-roles-matrix__check {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.03);
  position: relative;
  box-shadow: none;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.users-roles-matrix__check::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 1px;
  width: 4px;
  height: 7px;
  border-right: 2px solid transparent;
  border-bottom: 2px solid transparent;
  transform: rotate(45deg);
  transition: border-color 160ms ease;
}

.users-roles-matrix__toggle:hover .users-roles-matrix__check {
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.08);
}

.users-roles-matrix__toggle input:focus-visible + .users-roles-matrix__check {
  border-color: rgba(var(--accent-rgb), 0.48);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.14);
}

.users-roles-matrix__toggle input:checked + .users-roles-matrix__check {
  background: rgba(var(--accent-rgb), 0.16);
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.08);
  transform: none;
}

.users-roles-matrix__toggle input:checked + .users-roles-matrix__check::after {
  border-color: var(--accent);
}

.users-roles-matrix__toggle input:disabled + .users-roles-matrix__check {
  opacity: 0.55;
}

@media (max-width: 900px) {
  .users-role-card__head {
    grid-template-columns: minmax(0, 1fr);
  }

  .users-roles-matrix {
    min-width: 520px;
  }

  .users-roles-matrix__col--permission {
    width: 200px;
  }
}

.lead-form .actions {
  flex-wrap: nowrap;
}

.lead-form .actions > button[type='submit'] {
  flex: 1 1 auto;
  min-width: 0;
}

.lead-form .actions > #leads-create-cancel {
  flex: 0 0 auto;
  padding-left: 10px;
  padding-right: 10px;
  white-space: nowrap;
}

.lead-objects {
  display: grid;
  gap: 6px;
}

.lead-object {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  padding: 6px;
  display: grid;
  gap: 6px;
}

.lead-object__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  position: relative;
  padding-right: 46px;
}

.lead-object__title {
  font-weight: 600;
}

.lead-object__head > button[data-lead-object-remove] {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  border-color: transparent;
}

.lead-form button[data-phone-remove],
.lead-object-edit button[data-phone-remove] {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.lead-object__controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.lead-object__head-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
  height: 36px;
  padding: 0;
  gap: 0;
}

.lead-object__head-actions > .field__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0;
  height: 100%;
  padding: 0 8px;
  background: transparent;
  color: var(--muted);
  font-size: inherit;
  font-weight: inherit;
  line-height: 1;
  opacity: 1;
}

.lead-object__head-actions > .field__action + .field__action {
  border-left: 1px solid var(--border);
}

.lead-object__head-actions > .field__action:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.lead-object__head-actions > .field__action:disabled {
  opacity: 0.45;
}

.form-row--lead-object {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-row--lead-meta {
  grid-template-columns: auto;
  justify-content: end;
}

.form-row--lead-source {
  grid-template-columns: minmax(0, 1fr);
}

.addresses {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
}

.addresses__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.addresses__list {
  display: grid;
  gap: 4px;
}

.addresses--inline-add .addresses__head {
  justify-content: flex-start;
}

.lead-object__extras {
  grid-column: 1 / -1;
}

.lead-object__comment {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.16);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.address-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) 36px;
  gap: 6px;
  align-items: end;
}

.addresses--inline-add .address-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) 36px 36px;
}

.addresses--inline-add .address-row > .field {
  min-width: 0;
}

.addresses--inline-add .address-row__purpose > select,
.addresses--inline-add .address-row__value > input {
  width: 100%;
  min-width: 0;
}

.addresses--inline-add .address-row__add,
.addresses--inline-add .address-row__remove {
  align-self: end;
  justify-self: end;
}

.addresses--inline-add .address-row__add {
  grid-column: 3 / 4;
}

.addresses--inline-add .address-row__remove {
  grid-column: 4 / 5;
}

.lead-form .address-row > .icon-btn--danger,
.lead-form .address-row > .icon-btn--danger:hover,
.lead-form .address-row > .icon-btn--danger:focus-visible,
.lead-form .address-row > .icon-btn--danger:active,
.lead-object-edit .address-row > .icon-btn--danger,
.lead-object-edit .address-row > .icon-btn--danger:hover,
.lead-object-edit .address-row > .icon-btn--danger:focus-visible,
.lead-object-edit .address-row > .icon-btn--danger:active,
.lead-object-edit button[data-phone-remove]:hover,
.lead-object-edit button[data-phone-remove]:focus-visible,
.lead-object-edit button[data-phone-remove]:active {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.pipeline-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: end;
  justify-self: end;
}

@media (max-width: 900px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .form-row--pipelines {
    grid-template-columns: 1fr;
  }

  .form-row--filters {
    grid-template-columns: 1fr;
  }

  .parsing-kpis .kpi,
  .parsing-kpis .kpi {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-height: auto;
  }

  .parsing-kpis .kpi__value,
  .parsing-kpis .kpi__value {
    text-align: left;
  }

  .parsing-dashboard {
    display: grid;
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .parsing-dashboard__main,
  .parsing-dashboard__side {
    display: grid;
  }

  .parsing-page-head {
    flex-direction: column;
  }

  .parsing-source-grid {
    grid-template-columns: 1fr;
  }

  .parsing-source-card {
    min-height: auto;
  }

  .parsing-event {
    gap: 8px;
  }

  .parsing-session {
    flex-wrap: wrap;
    border-radius: 16px;
  }

  .parsing-settings-grid {
    grid-template-columns: 1fr;
  }

  .parsing-primary-fields {
    grid-template-columns: 1fr;
  }

  .parsing-fields-row {
    flex-direction: column;
    align-items: stretch;
  }

  .parsing-toolbar-inline {
    margin-left: 0;
    min-width: 0;
  }

  .parsing-lead-target__grid {
    grid-template-columns: 1fr;
  }

  .parsing-choice {
    gap: 8px;
  }

  .auth-inline-check {
    grid-template-columns: 1fr;
  }

  .address-row {
    grid-template-columns: 1fr;
  }

  .addresses--inline-add .address-row {
    grid-template-columns: minmax(0, 1fr) 36px 36px;
  }

  .addresses--inline-add .address-row__purpose {
    grid-column: 1 / 4;
  }

  .addresses--inline-add .address-row__value {
    grid-column: 1 / 2;
  }

  .leads-create-top__row {
    grid-template-columns: 1fr;
  }

  .lead-create-card__source {
    flex-basis: 100%;
    min-width: 0;
  }

  .lead-extras__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lead-ai-modal {
    padding: 12px;
  }

  .lead-ai-modal__panel {
    width: 100%;
    max-height: calc(100vh - 24px);
    padding: 14px;
    border-radius: 16px;
  }

  .lead-ai-modal__actions {
    justify-content: stretch;
  }

  .lead-ai-modal__actions > button {
    flex: 1 1 0;
  }
}

.customize-editor {
  display: grid;
  gap: 10px;
}

.customize-block {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.shell .customize-block {
  border-radius: 8px;
  padding: 8px;
  gap: 6px;
}

.customize-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.customize-block__title {
  font-weight: 600;
}

.hint {
  position: relative;
  flex: 0 0 auto;
}

.hint__popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: min(360px, 86vw);
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--popover-bg);
  box-shadow: var(--popover-shadow);
  z-index: 60;
}

.hint__list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.customize-list {
  display: grid;
  gap: 6px;
}

.communications-page {
  display: grid;
  gap: 14px;
}

.communications-page__head,
.communications-page__intro,
.communications-editor,
.communications-panel,
.communications-form__fieldset,
.communications-mappings {
  display: grid;
  gap: 10px;
}

.communications-page__title {
  margin: 0;
}

.communications-note p {
  margin: 0;
}

.communications-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.communications-tabs__btn {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-weight: 600;
}

.communications-tabs__btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.communications-tabs__btn.is-active {
  color: var(--text);
  border-color: rgba(var(--accent-rgb), 0.34);
  background: rgba(var(--accent-rgb), 0.12);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.08);
}

.communications-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.communications-field__hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.communications-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.communications-check input {
  margin: 0;
}

.communications-managers-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: wrap;
}

.communications-managers-head > .muted {
  font-size: 12px;
}

.communications-mapping-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr) auto;
  gap: 10px;
  align-items: end;
}

.communications-mapping-actions,
.communications-form__actions,
.communications-savebar {
  display: flex;
  align-items: center;
}

.communications-mapping-actions {
  justify-content: flex-end;
}

.communications-form__actions {
  justify-content: flex-start;
}

.communications-savebar {
  justify-content: flex-end;
}

.communications-mapping-empty {
  padding: 8px 0;
}

.communications-form__fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

@media (max-width: 900px) {
  .communications-grid,
  .communications-mapping-row {
    grid-template-columns: 1fr;
  }

  .communications-mapping-actions,
  .communications-savebar {
    justify-content: flex-start;
  }
}

.customize-pipeline-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.customize-pipeline-tab {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 10px;
  font: inherit;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.customize-pipeline-tab:hover,
.customize-pipeline-tab:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.36);
  background: rgba(var(--accent-rgb), 0.08);
  outline: none;
}

.customize-pipeline-tab.is-active {
  border-color: rgba(var(--accent-rgb), 0.48);
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.12);
}

.customize-pipeline-tab--add {
  border-style: dashed;
  font-weight: 600;
}

.customize-pipeline-tab:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.customize-pipeline-manage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.customize-pipeline-current {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.customize-pipeline-current strong {
  font-size: 14px;
  line-height: 1.3;
}

.customize-row {
  display: grid;
  grid-template-columns: 1fr 36px 36px;
  gap: 6px;
  align-items: center;
}

.customize-row--stage {
  grid-template-columns: 36px minmax(0, 1fr) 36px 200px 36px;
}

.customize-row--deal-status {
  grid-template-columns: 36px minmax(0, 1fr) 36px 240px 36px;
}

.customize-row--deal-tag {
  grid-template-columns: minmax(0, 1fr) auto 36px 36px;
}

.stage-timer {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.stage-timer__value {
  width: 80px;
  flex: 0 0 auto;
}

.stage-timer__unit {
  min-width: 0;
  flex: 1 1 auto;
}

.stage-config {
  display: grid;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--stage-color, var(--border));
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.08);
  position: relative;
}

.stage-config.is-dragging {
  opacity: 0.75;
}

.stage-config.is-drop-before::before,
.stage-config.is-drop-after::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(var(--accent-rgb), 0.75);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.12);
  border-radius: 3px;
}

.stage-config.is-drop-before::before {
  top: -2px;
}

.stage-config.is-drop-after::after {
  bottom: -2px;
}

.stage-drag-handle {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  min-height: 32px;
  color: var(--muted);
  cursor: grab;
  user-select: none;
  font-size: 16px;
  line-height: 1;
  letter-spacing: -1px;
  border-radius: 8px;
  transition: color 140ms ease, background-color 140ms ease;
}

.stage-drag-handle:hover,
.stage-drag-handle:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.stage-drag-handle:active,
.stage-config.is-dragging .stage-drag-handle {
  cursor: grabbing;
  color: var(--text);
}

.shell .stage-config {
  border-radius: 8px;
}

.stage-config__toggle-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 0 2px;
}

.stage-config__fields {
  display: flex;
  align-items: center;
}

.stage-card-fields {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.card-field-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.card-field-item.is-dragging {
  opacity: 0.6;
}

.card-field-item__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.14);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: grab;
  user-select: none;
}

.card-field-item.is-delete-hover .card-field-item__label {
  color: var(--danger);
  border-color: rgba(var(--danger-rgb), 0.6);
  background: rgba(var(--danger-rgb), 0.08);
}

.customize-row .btn {
  height: 36px;
}

.customize-row--source {
  grid-template-columns: 1fr 36px;
}

.customize-source-editor {
  display: grid;
  gap: 10px;
}

.customize-source-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.customize-source-input-row > input {
  flex: 1 1 240px;
  min-width: 0;
}

.customize-source-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.customize-source-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 36px;
  padding: 6px 10px 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.14);
  color: var(--text);
}

.customize-source-tag__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customize-source-tag__remove,
.customize-source-tag__remove:hover,
.customize-source-tag__remove:active {
  width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
  font-size: 16px;
  line-height: 1;
}

.customize-source-tag__remove:hover,
.customize-source-tag__remove:focus-visible {
  color: var(--danger);
}

.customize-source-tag__remove:focus-visible {
  outline: none;
  box-shadow: none;
}

.columns-editor {
  display: grid;
  gap: 0;
  margin-top: 0;
  min-width: max-content;
}

.columns-editor-wrap {
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.08);
}

.columns-editor__head,
.columns-editor__row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 118px 118px repeat(var(--columns-editor-role-count, 0), 148px);
  gap: 0;
  align-items: stretch;
}

.columns-editor__head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--popover-bg);
  box-shadow: inset 0 -1px 0 var(--border);
}

.columns-editor__head > *,
.columns-editor__row > * {
  min-height: 46px;
  padding: 8px 10px;
  box-sizing: border-box;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.columns-editor__head > *:last-child,
.columns-editor__row > *:last-child {
  border-right: 0;
}

.columns-editor__head > * {
  background: rgba(255, 255, 255, 0.02);
}

.columns-editor__head-cell {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.columns-editor__base-head {
  display: grid;
  gap: 3px;
  justify-items: center;
  min-width: 0;
}

.columns-editor__base-head-role {
  display: block;
  width: 100%;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.columns-editor__base-head-mode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
}

.columns-editor__row {
  background: transparent;
}

.columns-editor__row > * {
  background: rgba(255, 255, 255, 0.01);
}

.columns-editor__row:nth-child(even) > * {
  background: rgba(255, 255, 255, 0.03);
}

.columns-editor__row:hover > * {
  background: rgba(var(--accent-rgb), 0.06);
}

.columns-editor__head-title,
.columns-editor__title {
  position: sticky;
  left: 0;
  justify-content: flex-start;
  text-align: left;
}

.columns-editor__head-title {
  z-index: 4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  background: var(--popover-bg);
  box-shadow: inset -1px 0 0 var(--border), inset 0 -1px 0 var(--border);
}

.columns-editor__title {
  z-index: 1;
  color: var(--text);
  font-weight: 600;
  line-height: 1.2;
  background: rgba(255, 255, 255, 0.02);
  box-shadow: inset -1px 0 0 var(--border);
}

.columns-editor__row:nth-child(even) .columns-editor__title {
  background: rgba(255, 255, 255, 0.04);
}

.columns-editor__row:hover .columns-editor__title {
  background: rgba(var(--accent-rgb), 0.08);
}

.columns-editor__cell--base {
  background: rgba(255, 255, 255, 0.025);
}

.columns-editor__cell--role {
  padding: 6px 8px;
}

.columns-editor__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.columns-editor__head-cell--role {
  min-width: 0;
}

.columns-editor__role-head {
  display: grid;
  gap: 8px;
  justify-items: center;
  min-width: 0;
  width: 100%;
}

.columns-editor__role-name {
  display: block;
  width: 100%;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.columns-editor__role-subhead,
.columns-editor__role-cell {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  align-items: center;
  justify-items: center;
  width: 100%;
}

.columns-editor__role-subhead {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.columns-editor__role-subhead > span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  line-height: 1.1;
  white-space: nowrap;
}

.columns-editor__role-cell {
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.columns-editor__cell .users-roles-matrix__toggle {
  min-height: 34px;
}

.columns-editor__cell .users-roles-matrix__check {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.columns-editor__cell .users-roles-matrix__check::after {
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
}

.columns-editor__cell .users-roles-matrix__toggle:hover .users-roles-matrix__check {
  border-color: rgba(var(--accent-rgb), 0.6);
  background: transparent;
  transform: none;
}

.columns-editor__cell .users-roles-matrix__toggle input:focus-visible + .users-roles-matrix__check {
  border-color: rgba(var(--accent-rgb), 0.6);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.14);
}

.columns-editor__cell .users-roles-matrix__toggle input:checked + .users-roles-matrix__check {
  background: transparent;
  border-color: rgba(var(--accent-rgb), 0.88);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.08);
}

.columns-editor__cell .users-roles-matrix__toggle input:checked + .users-roles-matrix__check::after {
  border-color: var(--accent);
}

.tasks-columns-editor .columns-editor__head,
.tasks-columns-editor .columns-editor__row {
  grid-template-columns: minmax(220px, 1fr) 118px repeat(var(--tasks-columns-editor-role-count, 0), 118px);
}

.tasks-columns-editor__move-cell,
.tasks-columns-editor__width-cell,
.tasks-columns-editor__role-cell {
  padding: 6px 8px;
}

.tasks-columns-editor__move {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}

.tasks-columns-editor__move-btn {
  min-width: 0;
  height: 34px;
  padding: 0;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1;
}

.tasks-columns-editor__width {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  width: 100%;
}

.tasks-columns-editor__width-input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: right;
}

.tasks-columns-editor__width-suffix {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.tasks-columns-editor .columns-editor__head-cell {
  justify-content: center;
  text-align: center;
}

.tasks-columns-editor .columns-editor__head-cell--role {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tasks-columns-editor .columns-editor__cell .users-roles-matrix__toggle {
  min-height: 34px;
}

@media (max-width: 900px) {
  .customize-row {
    grid-template-columns: 1fr;
  }

  .customize-row--source {
    grid-template-columns: 1fr;
  }

  .customize-pipeline-manage {
    align-items: stretch;
  }

  .customize-pipeline-current,
  .pipeline-actions {
    width: 100%;
  }

  .pipeline-actions {
    justify-content: flex-start;
    justify-self: stretch;
  }

  .customize-source-input-row {
    flex-wrap: wrap;
  }

  .customize-source-input-row > input,
  .customize-source-input-row > .btn {
    width: 100%;
  }
}

.field {
  display: grid;
  gap: 3px;
}

.field--full {
  grid-column: 1 / -1;
}

.field > span {
  color: var(--muted);
  font-size: 14px;
}

.field__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.field__head > span {
  color: var(--muted);
  font-size: 14px;
  min-width: 0;
}

.field__action {
  flex: 0 0 auto;
  height: 28px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  background: transparent;
  border-color: var(--border);
  color: var(--text);
  opacity: 0.88;
}

.field__action:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.field__with-icon {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 6px;
  align-items: center;
}

.field__with-icon > input {
  width: 100%;
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field > input {
  width: 100%;
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.52);
  opacity: 0.56;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.password-toggle svg {
  width: 17px;
  height: 17px;
  display: block;
  pointer-events: none;
}

.password-toggle:hover {
  color: rgba(255, 255, 255, 0.66);
  background: rgba(255, 255, 255, 0.02);
  opacity: 0.74;
}

.password-toggle.is-visible {
  color: rgba(var(--danger-rgb), 0.86);
  opacity: 0.9;
}

.password-toggle:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.22);
  outline-offset: 1px;
}
.choice {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
  height: 36px;
  padding: 0;
  gap: 0;
}

.choice--compact {
  height: 36px;
  border-radius: 10px;
}

.choice__item {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  font-size: inherit;
  color: var(--text);
  cursor: pointer;
}

.choice__item + .choice__item {
  border-left: 1px solid var(--border);
}

.choice__item > input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.choice__item > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}

.choice--compact .choice__item > span {
  padding: 0 8px;
}

.choice__item:hover > span {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.choice__item > input:checked + span {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--text);
}

.choice__item > input:focus-visible + span {
  outline: 2px solid rgba(var(--accent-rgb), 0.45);
  outline-offset: -2px;
}

.choice.parsing-choice {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.choice.parsing-choice.choice--compact {
  height: auto;
  border-radius: 0;
}

.choice.parsing-choice.parsing-choice--wide {
  width: 100%;
}

.choice.parsing-choice .choice__item {
  display: inline-flex;
  flex: 0 0 auto;
  max-width: 100%;
}

.choice.parsing-choice .choice__item + .choice__item {
  border-left: 0;
}

.choice.parsing-choice .choice__item > span {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: auto;
  min-height: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
  line-height: 1.35;
}

.choice.parsing-choice.choice--compact .choice__item > span {
  padding: 0;
}

.choice.parsing-choice .choice__item:hover > span {
  background: transparent;
}

.choice.parsing-choice .choice__item > input:checked + span {
  background: transparent;
}

body[data-page='cabinet'] .toolbar__group--stretch {
  flex: 1 1 0;
  width: 100%;
}

body[data-page='cabinet'] #cabinet-metrics-tabs {
  display: flex;
  width: 100%;
}

input,
select,
textarea,
button {
  font: inherit;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
}

input,
select {
  height: 36px;
  line-height: 1.3;
}

input:not([type='checkbox']):not([type='radio']):not([type='color']):not([type='file']),
select,
textarea {
  border-color: var(--field-border);
  border-radius: var(--field-radius);
  background-color: var(--field-bg);
  box-shadow: var(--field-shadow);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

input:not([type='checkbox']):not([type='radio']):not([type='color']):not([type='file']):hover,
select:hover,
textarea:hover {
  border-color: var(--field-hover-border);
  background-color: var(--field-bg-hover);
  box-shadow: var(--field-shadow-hover);
}

input[type='checkbox'] {
  -webkit-appearance: none;
  appearance: none;
  width: 36px;
  height: 36px;
  padding: 0;
  margin: 0;
  border-radius: var(--field-radius);
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  box-shadow: var(--field-shadow);
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  cursor: pointer;
}

input[type='checkbox']:hover {
  border-color: var(--field-border);
  background: var(--field-bg-hover);
  box-shadow: var(--field-shadow-hover);
}

input[type='checkbox']:checked {
  background-color: rgba(var(--accent-rgb), 0.2);
  border-color: rgba(var(--accent-rgb), 0.42);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 6L9 17l-5-5' fill='none' stroke='rgba(255,255,255,0.92)' stroke-width='3.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px 24px;
}

input[type='checkbox']:checked:hover {
  border-color: rgba(var(--accent-rgb), 0.48);
  background-color: rgba(var(--accent-rgb), 0.24);
}

input[type='checkbox']:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

input[type='radio'] {
  width: 16px;
  height: 16px;
  padding: 0;
  background: transparent;
  border-radius: 999px;
  margin: 0;
  accent-color: var(--accent);
}

select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 30px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.select-like {
  width: 100%;
  height: 36px;
  line-height: 1.3;
  text-align: left;
  border-color: var(--field-border);
  border-radius: var(--field-radius);
  background-color: var(--field-bg);
  box-shadow: var(--field-shadow);
  -webkit-appearance: none;
  appearance: none;
  padding-right: 30px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.select-like:hover {
  border-color: var(--field-hover-border);
  background-color: var(--field-bg-hover);
  box-shadow: var(--field-shadow-hover);
}

input[type='color'] {
  padding: 0;
  width: 36px;
  height: 36px;
}

input.color-swatch {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 8px;
  cursor: grab;
}

input.color-swatch:active {
  cursor: grabbing;
}

input.color-swatch::-webkit-color-swatch-wrapper {
  padding: 0;
}

input.color-swatch::-webkit-color-swatch {
  border: 0;
  border-radius: 8px;
}

input.color-swatch::-moz-color-swatch {
  border: 0;
  border-radius: 8px;
}

input:not([type='checkbox']):not([type='radio']):not([type='color']):not([type='file']):focus,
input:not([type='checkbox']):not([type='radio']):not([type='color']):not([type='file']):focus-visible,
select:focus,
select:focus-visible,
textarea:focus,
textarea:focus-visible,
.select-like:focus,
.select-like:focus-visible {
  outline: none;
  background-color: var(--field-focus-bg);
  border-color: var(--field-focus-border);
  box-shadow: var(--field-focus-shadow);
}

button:focus-visible,
a:focus-visible,
[role='button']:focus-visible,
summary:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.28);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
[role='button']:focus:not(:focus-visible),
summary:focus:not(:focus-visible) {
  outline: none;
}

button {
  cursor: pointer;
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.35);
}

button:hover {
  background: rgba(var(--accent-rgb), 0.18);
}

button:disabled,
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

h1,
h2 {
  margin: 0 0 10px 0;
  font-size: 18px;
  line-height: 1.2;
}

.card__section-title {
  margin-top: 12px;
}

.shell .card__section-title {
  margin-top: 10px;
}

.list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.shell .table-wrap {
  border-radius: 8px;
}

.events-table td[data-col-key='at'],
.events-table td[data-col-key='type'],
.events-table td[data-col-key='id'] {
  vertical-align: middle;
}

.events-table__cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.events-table__primary {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.events-table__secondary {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.events-table__label,
.events-table__meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.events-table__code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, monospace;
  overflow-wrap: anywhere;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

th,
td {
  text-align: left;
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.shell th,
.shell td {
  padding: 5px 6px;
}

th {
  color: var(--muted);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.02);
}

.deals-table {
  --deals-side-col-width: 34px;
  table-layout: fixed;
  min-width: 100%;
  font-size: 14px;
  line-height: 1.25;
  border-collapse: separate;
  border-spacing: 0 4px;
}

/* Deals table: compact density */
.deals-table th,
.deals-table td {
  padding: 5px 6px;
  border-bottom: 0;
}

.deals-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--popover-bg);
  vertical-align: middle;
  box-shadow: inset 0 -1px 0 rgba(148, 163, 184, 0.2);
}

.deals-table thead th.deals-th {
  padding-right: 0;
}

.deals-table thead th[data-col-key] {
  text-align: left;
}

.deals-table th + th,
.deals-table td + td {
  border-left: 1px solid var(--border);
}

.deals-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deals-table td[data-col-key='buyerName'] {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: normal;
  word-break: normal;
  line-height: 1.2;
}

.deals-table tbody td {
  vertical-align: middle;
  background: #eef2f5;
  background-clip: padding-box;
}

.deals-table tbody td + td {
  border-left-color: rgba(255, 255, 255, 0.88);
}

.deals-table tbody td:first-child {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

.deals-table tbody td:last-child {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}

.deals-table tbody tr:hover td {
  background: #e6ebf0;
}

.deals-table tbody tr:hover td[data-col-key='stage'].has-stage-color {
  background: #e6ebf0;
}

/* Deals table: selection */
.deals-table tbody tr.is-selected td {
  background: rgba(var(--accent-rgb), 0.1);
}

.deals-table tbody tr.is-selected:hover td {
  background: rgba(var(--accent-rgb), 0.14);
}

.deals-table tbody tr.is-selected td[data-col-key='stage'].has-stage-color {
  background: rgba(var(--accent-rgb), 0.1);
}

.deals-table tbody tr.is-selected:hover td[data-col-key='stage'].has-stage-color {
  background: rgba(var(--accent-rgb), 0.14);
}

.deals-table tbody tr.is-closing-flash > td:not(.deals-col-select):not(.deals-col-open) {
  animation: deals-row-close-flash 1350ms ease-out 1;
}

@keyframes deals-row-close-flash {
  0% {
    background: rgba(var(--accent-rgb), 0.2);
    box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.18);
  }

  40% {
    background: rgba(var(--accent-rgb), 0.11);
    box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.12);
  }

  100% {
    background: transparent;
    box-shadow: inset 0 0 0 1px transparent;
  }
}

.deals-table tbody td:not(.deals-col-select):not(.deals-col-open):hover {
  background: #e6ebf0;
}

.deals-col-select,
.deals-col-open {
  box-sizing: border-box;
  text-align: center;
  vertical-align: middle;
  padding: 0;
  width: var(--deals-side-col-width);
  min-width: var(--deals-side-col-width);
  max-width: var(--deals-side-col-width);
  background: #e5ebf2;
  transition: background-color 180ms ease, box-shadow 180ms ease;
}

.deals-col-select,
.deals-col-open {
  background: #fff;
  border-right: 0;
}

.deals-col-select {
  position: sticky;
  left: 0;
  z-index: 4;
  line-height: 0;
}

.deals-col-open {
  position: sticky;
  left: var(--deals-side-col-width);
  z-index: 3;
  line-height: 0;
  font-size: 0;
  border-left: 0;
  box-shadow: none;
}

.deals-table th.deals-col-open,
.deals-table td.deals-col-open {
  border-left: 0;
}

.deals-col-select::after,
.deals-col-open::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
  pointer-events: none;
}

.deals-table .deals-col-open + th,
.deals-table .deals-col-open + td {
  border-left: 0;
}

.deals-table thead .deals-col-select {
  z-index: 5;
}

.deals-table thead .deals-col-open {
  z-index: 4;
}

.deals-col-select input {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 16px;
  height: 16px;
  margin: 0 auto;
  border: 1px solid rgba(148, 163, 184, 0.58);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.deals-col-select input:hover {
  border-color: rgba(148, 163, 184, 0.58);
  background: #fff;
}

.deals-col-select input:checked {
  border-color: rgba(226, 232, 240, 0.96);
  background: rgba(148, 163, 184, 0.82);
}

.deals-col-select input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.18);
}

.deals-col-select input:disabled {
  opacity: 0.45;
  cursor: default;
}

.deals-row-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(176, 186, 198, 0.92);
  box-shadow: none;
  transition: color 140ms ease, transform 140ms ease;
}

.deals-row-open:hover {
  background: transparent;
  color: rgba(176, 186, 198, 0.92);
  transform: none;
}

.deals-row-open:focus-visible {
  outline: none;
  color: rgba(226, 232, 240, 0.94);
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12);
  border-radius: 6px;
}

.deals-row-open:active {
  transform: translateY(0);
}

.deals-col-open .deals-row-open {
  margin-left: auto;
  margin-right: auto;
}

.deals-row-restore {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  margin: 0 auto;
  border: 0;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.12);
  color: rgba(226, 232, 240, 0.92);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.deals-row-restore:hover,
.deals-row-restore:focus-visible {
  background: rgba(148, 163, 184, 0.18);
  color: rgba(226, 232, 240, 0.96);
}

.deals-row-open__icon {
  width: 16px;
  height: 16px;
  display: block;
  margin: 0 auto;
  flex: 0 0 auto;
}

.deals-table tbody .deals-col-select,
.deals-table tbody .deals-col-open {
  background: #eef2f5;
}

.deals-table tbody tr:hover .deals-col-select,
.deals-table tbody tr:hover .deals-col-open {
  background: #e6ebf0;
}

.deals-table tbody tr.is-selected .deals-col-select,
.deals-table tbody tr.is-selected .deals-col-open,
.deals-table tbody tr.is-selected:hover .deals-col-select,
.deals-table tbody tr.is-selected:hover .deals-col-open {
  background: rgba(var(--accent-rgb), 0.14);
}

.deals-expand {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

@media (max-width: 720px) {
  .deals-expand {
    grid-template-columns: 1fr;
  }
}

.deals-expand__box {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.deals-expand__box > .lead-block {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.shell .deals-expand__box {
  border-radius: 10px;
}

.deals-expand__title {
  font-weight: 700;
  margin-bottom: 8px;
}

.deals-expand__meta {
  display: grid;
  gap: 6px;
}

.deals-expand__meta-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.deals-expand__meta-row--company-code {
  grid-template-columns: 1fr;
  gap: 2px;
}

@media (max-width: 720px) {
  .deals-expand__meta-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .deal-payment-editor__head,
  .deal-payment-editor__actions {
    justify-content: flex-start;
  }
}

.deals-expand__meta-key {
  color: var(--muted);
  font-size: 12px;
}

.deals-expand__meta-val {
  min-width: 0;
  overflow-wrap: anywhere;
}

.deal-company-code {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  font-variant-numeric: tabular-nums;
}

.deal-company-code-copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  white-space: nowrap;
}

.deal-company-code-copy .lead-copy-btn {
  --lead-inline-action-size: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transform: translateY(-1px);
}

.deal-linked-lead-link {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}

.deal-linked-lead-link:hover,
.deal-linked-lead-link:focus-visible {
  color: var(--text);
  text-decoration: underline;
}

.deals-expand__comments {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.deals-table th[data-col-key='amount'],
.deals-table th[data-col-key='profit'],
.deals-table th[data-col-key='costs'],
.deals-table th[data-col-key='seq'],
.deals-table th[data-col-key='products'],
.deals-table th[data-col-key='communications'],
.deals-table th[data-col-key='documents'],
.deals-table th[data-col-key='events'],
.deals-table th[data-col-key='comments'],
.deals-table th[data-col-key='customFields'] {
  text-align: right;
}

.deals-table td[data-col-key='amount'],
.deals-table td[data-col-key='profit'],
.deals-table td[data-col-key='costs'],
.deals-table td[data-col-key='products'],
.deals-table td[data-col-key='communications'],
.deals-table td[data-col-key='documents'],
.deals-table td[data-col-key='events'],
.deals-table td[data-col-key='customFields'] {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.deals-table td[data-col-key='comments'] {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.deals-table th[data-col-key='seq'],
.deals-table td[data-col-key='seq'] {
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
  font-variant-numeric: tabular-nums;
}

.deal-seq-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 22px;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: copy;
  border-radius: 6px;
  transition: color 140ms ease, box-shadow 140ms ease;
}

.deal-seq-copy:hover,
.deal-seq-copy:focus-visible,
.deal-seq-copy:active {
  color: inherit;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.deal-seq-copy:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12);
}

.deal-seq-copy.is-copied {
  color: var(--accent);
}

.deals-table th[data-col-key='products'],
.deals-table td[data-col-key='products'] {
  text-align: left;
}

.deals-table td[data-col-key='products'] {
  font-variant-numeric: normal;
}

.deals-table td[data-col-key='products'] .deals-products {
  display: flex;
  justify-content: flex-start;
}

.deals-table td[data-col-key='tags'] .deals-tags {
  width: 100%;
  min-width: 0;
  flex-wrap: nowrap;
}

.deals-table th[data-col-key='tags'],
.deals-table td[data-col-key='tags'] {
  min-width: 164px;
}

.deals-table td[data-col-key='tags'] .deals-tags__list {
  flex-wrap: wrap;
  overflow: visible;
  gap: 4px;
  align-items: flex-start;
}

.deals-table td[data-col-key='tags'] .deals-tags .chip {
  flex: 0 1 auto;
  max-width: 100%;
  min-height: 21px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 0;
  font-size: 12px;
  letter-spacing: 0;
}

.deals-table td[data-col-key='tags'] .deals-tags {
  gap: 4px;
  align-items: flex-start;
}

.deals-table td[data-col-key='tags'] .deals-tags--cell {
  gap: 0;
}

.deals-table td[data-col-key='tags'] .deals-tags__empty {
  font-size: 12px;
}

.deals-table td[data-col-key='tags'] .deals-tags__trigger {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 100%;
  padding: 2px 0;
  text-align: left;
  border-radius: 7px;
}

.deals-table td[data-col-key='tags'].deals-cell-action--tags {
  cursor: pointer;
}

.deals-table td[data-col-key='tags'].deals-cell-action--tags:hover,
.deals-table td[data-col-key='tags'].deals-cell-action--tags:focus-visible {
  background: rgba(148, 163, 184, 0.055);
  outline: none;
}

.deals-table th[data-col-key='trackingNumber'],
.deals-table td[data-col-key='trackingNumber'] {
  text-align: center;
}

.deals-table td[data-col-key='trackingNumber'] {
  font-variant-numeric: tabular-nums;
}

.deals-table td[data-col-key='deliveryAddress'] {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.deals-table td[data-col-key='deliveryAddress'] .deal-address-btn {
  display: flex;
  width: 100%;
  min-width: 0;
}

.deals-table td[data-col-key='deliveryAddress'] .deal-address-btn.has-value {
  align-items: flex-start;
  justify-content: flex-start;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: normal;
  word-break: normal;
}

.deals-table th[data-col-key='createdAt'],
.deals-table td[data-col-key='createdAt'] {
  white-space: normal;
}

.deals-datetime {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  line-height: 1.15;
  white-space: normal;
}

.deals-datetime__date,
.deals-datetime__time {
  display: block;
}

.deals-datetime__time {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.tracking-number-display {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.tracking-number-display__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  padding: 0 4px 0 6px;
  border-radius: 7px;
  border: 1px solid rgba(196, 87, 80, 0.2);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
  flex: 0 0 auto;
  box-shadow:
    inset 3px 0 0 rgba(196, 87, 80, 0.92),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.tracking-number-display__badge--np {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.72)),
    linear-gradient(180deg, rgba(196, 87, 80, 0.24), rgba(196, 87, 80, 0.1));
  color: #8f2f2a;
}

.tracking-number-display__text {
  min-width: 0;
  font-variant-numeric: tabular-nums;
}

.deals-ttn-btn .tracking-number-display__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deals-ttn-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 28px;
  max-width: 100%;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  font: inherit;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deals-ttn-btn.has-value {
  border: 0;
  background: transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 0.02em;
}

.deals-ttn-btn.deal-address-btn.has-value {
  justify-content: flex-start;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0;
  line-height: 1.25;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deals-ttn-btn.has-value:hover,
.deals-ttn-btn.has-value:focus-visible,
.deals-ttn-btn.has-value:active {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.deals-ttn-btn.is-empty {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  color: var(--muted);
}

.deals-ttn-btn.is-empty-label {
  min-width: 0;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  justify-content: flex-start;
  text-align: left;
}

.deals-ttn-btn.is-empty:hover,
.deals-ttn-btn.is-empty:focus-visible,
.deals-ttn-btn.is-empty:active {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}

.deals-ttn-btn.is-empty-label:hover,
.deals-ttn-btn.is-empty-label:focus-visible,
.deals-ttn-btn.is-empty-label:active {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--text);
}

.deals-ttn-btn:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.08);
}

.deals-ttn-btn:focus-visible {
  outline: none;
  border-color: rgba(var(--accent-rgb), 0.65);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.18);
}

.deals-th {
  position: relative;
  user-select: none;
}

.deals-th__inner {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.deals-th__label {
  flex: 1 1 auto;
  min-width: 0;
  cursor: grab;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deals-th.is-dragging .deals-th__label {
  cursor: grabbing;
  opacity: 0.75;
}

.deals-th__resize {
  flex: 0 0 12px;
  width: 12px;
  margin-right: -6px;
  cursor: col-resize;
  align-self: stretch;
  position: relative;
}

.deals-th__resize::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 6px;
  width: 2px;
  border-radius: 2px;
  background: transparent;
  transition: background 120ms ease;
}

.deals-th:hover .deals-th__resize::before {
  background: rgba(255, 255, 255, 0.12);
}

.deals-th .deals-th__resize:hover::before {
  background: rgba(255, 255, 255, 0.2);
}

body.deals-resizing {
  cursor: col-resize;
  user-select: none;
}

.deals-th.is-drop-before::before,
.deals-th.is-drop-after::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: rgba(var(--accent-rgb), 0.75);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.12);
}

.deals-th.is-drop-before::before {
  left: 0;
}

.deals-th.is-drop-after::after {
  right: 0;
}

.deals-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.deals-tags .chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  max-width: 100%;
  min-height: 26px;
  padding: 3px 10px;
  border-radius: 8px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
}

.deals-tag-chip__label {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
  text-align: center;
}

.deals-tag-chip__suffix {
  flex: 0 0 auto;
  opacity: 0.8;
}

.deals-tags .chip.deals-tag--colored {
  border-color: rgba(var(--tag-rgb), 0.2);
  background: rgba(var(--tag-rgb), 0.1);
  color: rgba(var(--tag-rgb), 0.9);
}

.deals-tags .chip.deals-tag--outline {
  border-color: rgba(95, 108, 123, 0.18);
  background: rgba(255, 255, 255, 0.66);
  color: var(--text);
}

.deals-tags--editable {
  gap: 7px;
}

.deals-tags__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1 1 auto;
}

.deals-tags__empty {
  color: var(--muted);
}

.deal-modal__section--details .deals-tags {
  gap: 8px;
}

.deal-modal__section--details .deals-tags__list {
  gap: 8px;
}

.deal-modal__section--details .deals-tags .chip {
  min-height: 30px;
  padding: 5px 11px;
  border-radius: 9px;
  border: 0;
  font-size: 13px;
}

.deal-modal__section--details .deals-tags__remove {
  width: 20px;
  height: 20px;
  font-size: 16px;
}

.deal-modal__section--details .deals-tags__add {
  width: 24px;
  height: 24px;
  font-size: 18px;
  color: rgba(95, 108, 123, 0.92);
  -webkit-text-fill-color: rgba(95, 108, 123, 0.92);
  font-weight: 700;
}

.deal-modal__section--details .deals-tags__add:hover,
.deal-modal__section--details .deals-tags__add:focus-visible,
.deal-modal__section--details .deals-tags__add:active {
  color: rgba(95, 108, 123, 0.92);
  -webkit-text-fill-color: rgba(95, 108, 123, 0.92);
}

.deals-tags--cell {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
}

.deals-tags--cell .deals-tags__add {
  margin-left: 0;
  flex: 0 0 auto;
  align-self: flex-start;
  justify-self: end;
}

.deals-tags__trigger {
  width: 100%;
  min-width: 0;
}

.deals-tags__trigger .deals-tags__list {
  pointer-events: none;
}

.deals-tags--compact {
  gap: 8px;
}

.deals-tags__summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
  max-width: 100%;
  overflow: visible;
  box-sizing: border-box;
  padding: 0 1px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.deals-tags__summary:hover,
.deals-tags__summary:focus-visible {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.deals-tags__summary .chip {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deals-tags__summary .chip:first-child {
  flex: 1 1 auto;
}

.deals-tag-chip--editable {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  padding-right: 5px;
}

.deals-inline-btn {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.deals-inline-btn:hover,
.deals-inline-btn:focus-visible,
.deals-inline-btn:active {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.deals-inline-btn:focus-visible {
  outline: none;
}

.deals-tags__remove {
  display: inline-flex;
  flex: 0 0 auto;
  align-self: center;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(95, 108, 123, 0.92);
  -webkit-text-fill-color: rgba(95, 108, 123, 0.92);
  font-size: 16px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  opacity: 1;
}

.deals-tags__remove:hover,
.deals-tags__remove:focus-visible,
.deals-tags__remove:active {
  color: rgba(55, 65, 81, 0.96);
  -webkit-text-fill-color: rgba(55, 65, 81, 0.96);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.deals-tags__add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  color: rgba(95, 108, 123, 0.92);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.deals-tags__add:hover,
.deals-tags__add:focus-visible,
.deals-tags__add:active {
  outline: none;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: rgba(95, 108, 123, 0.92);
}

.deals-comments-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  color: var(--muted);
  white-space: nowrap;
}

.deals-comments-cell__count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 7px;
  background: rgba(var(--comments-rgb, 148, 163, 184), 0.08);
  box-shadow: none;
  color: rgba(226, 232, 240, 0.88);
}

.deals-comments-cell__glyph {
  display: block;
  font-size: 13px;
  line-height: 1;
}

.deals-comments-cell__num {
  font-variant-numeric: tabular-nums;
  color: rgba(var(--comments-rgb, 148, 163, 184), 0.82);
}

.deals-comments-cell__alert {
  display: none;
}

.deals-tag-picker {
  min-width: 240px;
  max-height: min(560px, calc(100vh - 16px));
  padding: 10px;
  gap: 10px;
  overflow: auto;
}

.deals-tag-picker__title {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
}

.deals-tag-picker__section {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.06);
}

.deals-tag-picker__section + .deals-tag-picker__section {
  margin-top: 2px;
}

.deals-tag-picker__section-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.deals-tag-picker__assigned {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 0;
}

.deals-tag-picker__available {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: flex-start;
  max-height: 340px;
  overflow: auto;
  padding-right: 2px;
  padding-bottom: 2px;
}

.deals-tag-picker__empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.deals-tag-picker__head {
  margin-top: 10px;
}

.deals-tag-picker__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: 100%;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.deals-tag-picker__item:hover,
.deals-tag-picker__item:focus-visible,
.deals-tag-picker__item:active {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.deals-tag-picker__item:focus-visible {
  outline: none;
}

.deals-tag-picker__item .chip {
  pointer-events: none;
}

.deals-tag-picker__assigned .chip,
.deals-tag-picker__item .chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
  box-shadow: none;
}

.deals-tag-picker__assigned .deals-tag-chip--editable {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 5px;
  padding-right: 5px;
}

.deals-tag-picker__assigned .deals-tag-chip__label {
  display: inline-flex;
  align-items: center;
  align-self: center;
  min-height: 18px;
  text-align: center;
  line-height: 1;
}

.deals-tag-picker__assigned .deals-tags__remove {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  line-height: 1;
  vertical-align: middle;
}

.deals-tag-picker__assigned .chip.deals-tag--colored,
.deals-tag-picker__item .chip.deals-tag--colored {
  border-color: rgba(var(--tag-rgb), 0.2);
  background: rgba(var(--tag-rgb), 0.1);
  color: rgba(var(--tag-rgb), 0.9);
}

.deals-tag-picker__assigned .chip.deals-tag--outline,
.deals-tag-picker__item .chip.deals-tag--outline {
  border-color: rgba(95, 108, 123, 0.18);
  background: rgba(255, 255, 255, 0.66);
  color: var(--text);
}

.deals-tag-picker__assigned .deals-tag-chip--editable {
  padding-right: 6px;
}

.deals-tag-picker__assigned .deals-tags__remove {
  width: 16px;
  height: 16px;
  font-size: 14px;
}

.deal-payment-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(148, 163, 184, 0.08);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.deal-payment-status--paid {
  color: rgba(var(--accent-rgb), 0.96);
  border-color: rgba(var(--accent-rgb), 0.28);
  background: rgba(var(--accent-rgb), 0.12);
}

.deal-payment-status--unpaid {
  color: rgba(var(--danger-rgb), 0.96);
  border-color: rgba(var(--danger-rgb), 0.28);
  background: rgba(var(--danger-rgb), 0.1);
}

.deal-payment-status--partial {
  color: rgba(var(--warning-rgb), 0.96);
  border-color: rgba(var(--warning-rgb), 0.32);
  background: rgba(var(--warning-rgb), 0.12);
}

.deal-payment-status--overpaid,
.deal-payment-status--refunded {
  color: rgba(30, 64, 175, 0.94);
  border-color: rgba(30, 64, 175, 0.24);
  background: rgba(30, 64, 175, 0.1);
}

.deal-payment-status--neutral {
  color: var(--muted);
  border-color: rgba(148, 163, 184, 0.26);
  background: rgba(148, 163, 184, 0.08);
}

.deals-table td[data-col-key='paymentStatus'] {
  padding: 0;
  text-align: center;
}

.deals-table td[data-col-key='paymentStatus'] .deal-payment-status {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  justify-content: center;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  box-sizing: border-box;
  border: 0;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0;
  box-shadow: none;
}

.deal-payment-menu__item {
  justify-content: flex-start;
}

.deal-payment-menu__item .deal-payment-status {
  pointer-events: none;
}

.deal-payment-editor {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.deal-payment-editor__head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.deal-payment-editor__summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.deal-payment-editor__total {
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
}

.deal-payment-editor__debt {
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
}

.deal-payment-editor__form {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.deal-payment-editor__field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-start;
  flex-wrap: nowrap;
}

.deal-payment-editor__field > span {
  font-size: 12px;
  white-space: nowrap;
}

.deal-payment-editor__field > input {
  width: 92px;
  min-width: 92px;
}

.deal-payment-editor__field > input[type='date'] {
  width: 138px;
  min-width: 138px;
}

.deal-payment-editor__field--comment > input {
  width: 180px;
  min-width: 180px;
}

.deal-payment-editor__actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.deal-payment-editor__save {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  color: var(--accent, #475569);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: none;
}

.deal-payment-editor__save:hover,
.deal-payment-editor__save:focus-visible,
.deal-payment-editor__save:active {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--accent-strong, var(--accent, #475569));
}

.deal-payment-editor__save:focus-visible {
  outline: none;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.deal-payment-editor__summary-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  padding: 5px 10px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.08);
}

.deal-payment-editor__summary-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.deal-payment-editor__summary-metric {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  white-space: nowrap;
}

.deal-payment-editor__summary-metric--debt {
  color: rgba(var(--danger-rgb), 0.96);
}

.deal-payment-editor__summary-extra {
  font-size: 11px;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
}

.deal-payment-editor__close,
.deal-payment-editor__cancel {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: none;
}

.deal-payment-editor__close {
  color: rgba(var(--accent-rgb), 0.96);
}

.deal-payment-editor__cancel {
  color: var(--muted);
}

.deal-payment-editor__close:hover,
.deal-payment-editor__close:focus-visible,
.deal-payment-editor__close:active,
.deal-payment-editor__cancel:hover,
.deal-payment-editor__cancel:focus-visible,
.deal-payment-editor__cancel:active {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.deal-payment-editor__close:hover,
.deal-payment-editor__close:focus-visible,
.deal-payment-editor__close:active {
  color: var(--accent-strong, var(--accent, #475569));
}

.deal-payment-editor__cancel:hover,
.deal-payment-editor__cancel:focus-visible,
.deal-payment-editor__cancel:active {
  color: var(--text);
}

.deal-payment-editor__close:focus-visible,
.deal-payment-editor__cancel:focus-visible {
  outline: none;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.deal-payment-editor__close[hidden] {
  display: none !important;
}

.deals-products {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-start;
}

.deals-products .chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.1;
}

.deals-products .chip::before {
  inset: -1px;
  border-radius: 8px;
}

.deals-products__more {
  font-weight: 600;
}

.deals-pager {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.deals-pager__numbers {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.deals-pager__page {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}

.deals-pager__page.is-current,
.deals-pager__page.is-current:hover {
  background: rgba(var(--accent-rgb), 0.14);
  color: var(--text);
}

.deals-pager__gap {
  width: 16px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.deals-add-toggle,
.deals-add-toggle:hover,
.deals-add-toggle:active {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: rgba(176, 186, 198, 0.92);
  font-size: 38px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.deals-add-toggle:focus-visible {
  outline: none;
  color: rgba(226, 232, 240, 0.94);
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12);
  border-radius: 8px;
}

.deals-add-toggle.is-open,
.deals-add-toggle.is-open:hover,
.deals-add-toggle.is-open:active {
  color: rgba(218, 37, 29, 0.92);
}

.lead-create-close-toggle.deals-add-toggle,
.lead-create-close-toggle.deals-add-toggle:hover,
.lead-create-close-toggle.deals-add-toggle:active {
  width: 36px;
  height: 36px;
  color: rgba(var(--danger-rgb), 0.9);
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
}

.lead-create-close-toggle.deals-add-toggle:focus-visible {
  outline: none;
  color: rgba(var(--danger-rgb), 1);
  box-shadow: none;
  border-radius: 8px;
}

.deals-client-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 10px;
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--text);
  flex: 0 1 auto;
  min-width: 0;
}

.deals-client-filter__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deals-client-filter__clear {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.deals-client-filter__clear:hover {
  color: var(--text);
}

.deals-pager__info {
  min-width: 124px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.deals-stage-filters {
  --deals-stage-filter-width: clamp(96px, 13vw, 140px);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.deals-stage-filters > button {
  flex: 0 0 auto;
  width: auto;
}

.deals-structure-toggle {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
}

.deals-structure-toggle .deal-stage-chip__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 18px;
  line-height: 1;
}

.deals-client-picker {
  position: relative;
}

.deals-create-form {
  display: grid;
  grid-template-columns: minmax(280px, 0.88fr) minmax(360px, 1.12fr);
  gap: 0;
  align-items: start;
}

.deals-create-form__col {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.deals-create-form .field {
  min-width: 0;
}

.deals-create-form .field > input,
.deals-create-form .field > select,
.deals-create-form .field > textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.deals-create-form__col--client {
  padding-right: 12px;
}

.shell .deals-create-form__col--client {
  padding-right: 10px;
}

.deals-create-form__col--order {
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.shell .deals-create-form__col--order {
  padding-left: 10px;
}

.deals-create-form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.shell .deals-create-form__row {
  gap: 6px;
}

.deals-create-form__block--items {
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
}

.shell .deals-create-form__block--items {
  border-radius: 8px;
}

.deals-create-form__block--items > button {
  width: 100%;
  justify-content: center;
}

.deals-create-form__block--items .deal-modal__products {
  gap: 10px;
}

.deals-create-form__block--items .deal-modal__products-table-wrap {
  border-radius: 12px;
}

.deals-create-form__block--items .deal-modal__products-col--idx {
  width: 36px;
}

.deals-create-form__block--items .deal-modal__products-col--qty {
  width: 72px;
}

.deals-create-form__block--items .deal-modal__products-col--unit {
  width: 68px;
}

.deals-create-form__block--items .deal-modal__products-col--price,
.deals-create-form__block--items .deal-modal__products-col--total {
  width: 106px;
}

.deals-create-form__block--items .deal-modal__products-col--actions {
  width: 28px;
}

.deals-create-form__block--items .deal-modal__products-table th:last-child,
.deals-create-form__block--items .deal-modal__products-table td:last-child {
  padding-left: 4px;
  padding-right: 4px;
}

.deals-create-form__block--items .deal-modal__products-actions-col .icon-btn--sm {
  width: 20px;
  height: 20px;
  font-size: 16px;
  border-radius: 6px;
}

.deals-create-form__actions {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .deals-create-form {
    grid-template-columns: 1fr;
  }

  .deals-create-form__col--client {
    padding-right: 0;
  }

  .deals-create-form__col--order {
    padding-left: 0;
    border-left: 0;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
}

.deals-create-form__autofill-textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 62px;
  min-width: 0;
  resize: vertical;
  overflow-x: hidden;
  overflow-y: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#deals-lead-object-select {
  overflow: hidden;
  text-overflow: ellipsis;
}

.deals-create-form textarea[name='comment'] {
  width: 100%;
  min-height: 88px;
  resize: none;
}

.deals-client-picker {
  position: relative;
}

.deals-client-picker__control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.deals-client-picker__control > input {
  flex: 1 1 0;
  min-width: 0;
}

.deals-client-picker__clear {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  opacity: 0.75;
  font-size: 20px;
  line-height: 1;
}

.deals-client-picker__clear:hover {
  background: rgba(255, 255, 255, 0.04);
  opacity: 1;
}

.deals-client-picker__list {
  flex: 0 0 auto;
}

.deals-client-picker__list svg {
  width: 20px;
  height: 20px;
  display: block;
}

.deals-client-picker__manual {
  flex: 0 0 auto;
  white-space: nowrap;
}

.deals-client-picker__manual.is-active {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: rgba(var(--accent-rgb), 0.12);
}

.deals-client-manual {
  display: grid;
  gap: 6px;
  margin-top: 6px;
}

.deals-client-picker__results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
}

.deals-client-picker__results-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-like.deals-stage-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-left: 10px;
  padding-right: 30px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background-clip: padding-box;
}

.select-like.deal-modal__responsible-picker {
  display: inline-flex;
  align-items: center;
  padding-left: 8px;
  padding-right: 30px;
  min-width: 0;
}

.deals-stage-btn__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  flex: 0 0 auto;
}

.deals-stage-btn__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deals-stage-btn.has-color {
  border-color: rgba(var(--stage-rgb), 0.55);
  background-color: rgba(var(--stage-rgb), 0.1);
}

.deals-stage-btn.has-color:hover {
  border-color: rgba(var(--stage-rgb), 0.75);
  background-color: rgba(var(--stage-rgb), 0.16);
}

.deals-stage-btn.has-color .deals-stage-btn__dot {
  background: rgb(var(--stage-rgb));
}

.deals-stage-menu {
  width: min(320px, calc(100% - 16px));
}

.deals-stage-menu > .muted {
  font-size: 12px;
  padding: 0 6px;
}

.deals-stage-menu .lead-card-menu__item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.deals-stage-menu .stage-dot {
  margin-right: 0;
}

.deals-stage-menu .lead-card-menu__item.has-color {
  border-left: 3px solid rgba(var(--stage-rgb), 0.65);
  padding-left: 6px;
}

.deals-stage-menu .lead-card-menu__item.has-color:hover {
  border-color: rgba(var(--stage-rgb), 0.35);
  background: rgba(var(--stage-rgb), 0.12);
}

.deals-responsible-menu {
  width: min(320px, calc(100% - 16px));
}

.deals-responsible-menu > .muted {
  font-size: 12px;
  padding: 0 6px;
}

.deals-responsible-menu .lead-card-menu__item {
  display: flex;
  align-items: center;
}

.deals-responsible-menu .deals-responsible-cell {
  width: 100%;
}

.deals-cell-picker {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.deals-cell-picker:focus-visible {
  outline: none;
}

.deals-table td[data-col-key='responsible'] {
  padding: 0;
}

.deals-cell-picker--responsible .deals-responsible-cell {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  width: 100%;
}

.deals-cell-picker--responsible,
.deals-cell-picker--responsible:hover,
.deals-cell-picker--responsible:focus-visible,
.deals-cell-picker--responsible:active {
  display: flex;
  width: 100%;
  min-height: 44px;
  padding: 5px 8px;
  align-items: center;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.deals-cell-picker--responsible:hover .deals-responsible-cell__label,
.deals-cell-picker--responsible:focus-visible .deals-responsible-cell__label {
  color: inherit;
}

.deals-cell-picker--responsible .deals-responsible-cell__label {
  display: block;
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  line-height: 1.15;
}

.deals-responsible-display {
  width: 100%;
}

.deals-responsible-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.deals-responsible-cell .avatar--sm,
.deals-responsible-cell .avatar-img--sm {
  width: 34px;
  height: 34px;
  border-radius: 999px;
}

.deals-responsible-cell.is-empty {
  color: var(--muted);
}

.deals-responsible-cell__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lead-assignee-menu .deals-responsible-cell__label {
  font-weight: 600;
}

.deals-client-picker__results {
  position: static;
  width: 100%;
  min-height: 220px;
  margin-top: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--popover-bg);
  box-shadow: var(--popover-shadow);
  z-index: 160;
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  pointer-events: auto;
  color: var(--text);
}

.deals-client-picker__results--floating {
  position: static;
}

.shell .deals-client-picker__results {
  padding: 6px;
  border-radius: 10px;
  max-height: 360px;
}

.deals-client-picker__result {
  width: 100%;
  text-align: left;
  padding: 7px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font: inherit;
  display: grid;
  gap: 2px;
  cursor: pointer;
  position: relative;
  z-index: 1;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.deals-client-picker__result--main {
  border-color: rgba(var(--accent-rgb), 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    rgba(var(--accent-rgb), 0.05);
}

.deals-client-picker__result--child {
  margin-left: 14px;
  width: calc(100% - 14px);
  border-left-color: rgba(var(--accent-rgb), 0.18);
  background: rgba(255, 255, 255, 0.02);
}

.deals-client-picker__result--child::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 50%;
  width: 10px;
  height: 1px;
  background: rgba(var(--accent-rgb), 0.28);
}

.shell .deals-client-picker__result {
  padding: 6px 8px;
  border-radius: 8px;
}

.deals-client-picker__result:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.deals-client-picker__result--main:hover {
  border-color: rgba(var(--accent-rgb), 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(var(--accent-rgb), 0.08);
}

.deals-client-picker__result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.deals-client-picker__result-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deals-client-picker__badge {
  flex: 0 0 auto;
  min-height: 25px;
  padding: 0 10px 0 12px;
  border-radius: 11px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.72)),
    linear-gradient(180deg, rgba(148, 163, 184, 0.14), rgba(148, 163, 184, 0.06));
  box-shadow:
    inset 4px 0 0 rgba(148, 163, 184, 0.72),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  color: rgba(51, 65, 85, 0.8);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.015em;
  line-height: 1;
}

.deals-client-picker__result-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.deals-client-picker__group {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(var(--accent-rgb), 0.14);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015)),
    rgba(var(--accent-rgb), 0.035);
}

.shell .deals-client-picker__group {
  padding: 7px;
  border-radius: 12px;
}

.deals-client-picker__group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.deals-client-picker__group-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(var(--accent-rgb), 0.9);
}

.deals-client-picker__group-meta,
.deals-client-picker__group-caption {
  font-size: 12px;
  color: var(--muted);
}

.deals-client-picker__group-children {
  display: grid;
  gap: 6px;
  padding-top: 2px;
}

.deals-client-picker__empty {
  padding: 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
}

.shell .deals-client-picker__empty {
  border-radius: 8px;
}

.deals-structure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: start;
  gap: 8px;
  margin-top: 0;
  margin-bottom: 8px;
}

.deals-structure-actions {
  display: none !important;
}

.shell .deals-structure-grid {
  gap: 6px;
  margin-top: 0;
  margin-bottom: 6px;
}

.deals-structure-stage__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.deals-structure-stage {
  padding: 0;
  gap: 0;
  overflow: hidden;
  background: transparent;
}

.deals-structure-stage__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deals-structure-stage__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 7px 10px;
  border-radius: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell .deals-structure-stage__toggle {
  padding: 6px 10px;
}

.deals-structure-stage__toggle:hover {
  background: rgba(255, 255, 255, 0.03);
}

.deals-structure-stage__toggle.is-active {
  background: rgba(var(--stage-rgb, var(--accent-rgb)), 0.12);
}

.deals-structure-stage__toggle.is-partial {
  background: rgba(var(--stage-rgb, var(--accent-rgb)), 0.06);
}

.deals-structure-stage__toggle:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.45);
  outline-offset: 2px;
}

.deals-structure-stage__choices {
  width: 100%;
  display: flex;
  flex-direction: column;
  height: auto;
  border: 0;
  padding: 6px;
  gap: 4px;
  border-radius: 0;
  background: transparent;
}

.deals-structure-stage__choices .choice__item {
  flex: 0 0 auto;
}

.deals-structure-stage__choices .choice__item + .choice__item {
  border: 0;
}

.deals-structure-stage__choices .choice__item > span {
  justify-content: flex-start;
  height: auto;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  transition:
    background 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}

.deals-structure-stage__choices .choice__item:hover > span {
  background: rgba(var(--stage-rgb, var(--accent-rgb)), 0.12);
  border-color: rgba(var(--stage-rgb, var(--accent-rgb)), 0.35);
  color: var(--text);
}

.deals-structure-stage__choices .choice__item > input:checked + span {
  background: rgba(var(--stage-rgb, var(--accent-rgb)), 0.12);
  border-color: rgba(var(--stage-rgb, var(--accent-rgb)), 0.55);
  color: var(--text);
}

.shell .deals-structure-stage__choices {
  padding: 5px;
  gap: 3px;
}

.shell .deals-structure-stage__choices .choice__item > span {
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 8px;
}

.deals-stage-filters::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.deal-stage-chip.deal-stage-chip--filter {
  white-space: nowrap;
  justify-content: flex-start;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 4px 2px;
  color: var(--muted);
  font-weight: 600;
}

.deal-stage-chip.deal-stage-chip--filter:hover {
  color: var(--text);
}

.deal-stage-chip.deal-stage-chip--filter:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.45);
  outline-offset: 2px;
  border-radius: 6px;
}

.deal-stage-chip.deal-stage-chip--filter.has-color {
  border-color: transparent;
  background-color: transparent;
}

.deal-stage-chip.deal-stage-chip--filter.is-active {
  color: var(--text);
  box-shadow: none;
}

.deal-stage-chip.deal-stage-chip--filter.is-active.has-color {
  border-color: transparent;
  background-color: transparent;
}

.taxonomy-tree {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0;
  margin-bottom: 8px;
}

.shell .taxonomy-tree {
  gap: 6px;
  margin-bottom: 6px;
}

.taxonomy-stage__head {
  justify-content: flex-start;
}

.taxonomy-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.taxonomy-row .taxonomy-toggle {
  flex: 1 1 auto;
  width: auto;
}

.taxonomy-disclosure {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}

.shell .taxonomy-disclosure {
  width: 26px;
  height: 26px;
}

.taxonomy-disclosure:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  opacity: 1;
}

.taxonomy-disclosure:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.45);
  outline-offset: 2px;
}

.taxonomy-disclosure svg {
  width: 16px;
  height: 16px;
  display: block;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: transform 140ms ease;
}

.taxonomy-disclosure.is-collapsed svg {
  transform: rotate(-90deg);
}

.taxonomy-disclosure--spacer {
  opacity: 0;
  pointer-events: none;
}

.taxonomy-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  font-weight: 600;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition:
    background 120ms ease,
    border-color 120ms ease;
}

.shell .taxonomy-toggle {
  padding: 6px 10px;
  border-radius: 8px;
}

.taxonomy-toggle:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.taxonomy-toggle.is-active {
  background: rgba(var(--stage-rgb, var(--accent-rgb)), 0.12);
  border-color: rgba(var(--stage-rgb, var(--accent-rgb)), 0.35);
}

.taxonomy-toggle.is-partial {
  background: rgba(var(--stage-rgb, var(--accent-rgb)), 0.06);
  border-color: rgba(var(--stage-rgb, var(--accent-rgb)), 0.25);
}

.taxonomy-toggle.is-inherited {
  background: rgba(var(--stage-rgb, var(--accent-rgb)), 0.08);
  border-color: rgba(var(--stage-rgb, var(--accent-rgb)), 0.2);
}

.taxonomy-toggle:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.45);
  outline-offset: 2px;
}

.taxonomy-subtree {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 6px;
  margin-left: 18px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.shell .taxonomy-subtree {
  gap: 4px;
  padding-top: 4px;
  margin-left: 16px;
  padding-left: 10px;
}

.taxonomy-node {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.taxonomy-subtree--groups {
  margin-left: 22px;
  padding-left: 12px;
  border-left: 1px dashed rgba(255, 255, 255, 0.08);
}

.shell .taxonomy-subtree--groups {
  margin-left: 20px;
  padding-left: 10px;
}

.taxonomy-leaves {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-left: 18px;
  padding-left: 12px;
  border-left: 1px dotted rgba(255, 255, 255, 0.06);
}

.shell .taxonomy-leaves {
  margin-left: 16px;
  padding-left: 10px;
}

.taxonomy-toggle--leaf {
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
}

.shell .taxonomy-toggle--leaf {
  padding: 5px 10px;
  border-radius: 8px;
}

.taxonomy-toggle--leaf::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  flex: 0 0 auto;
}

.taxonomy-toggle--category::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgb(var(--stage-rgb, var(--accent-rgb)));
  box-shadow: 0 0 0 2px rgba(var(--stage-rgb, var(--accent-rgb)), 0.18);
  flex: 0 0 auto;
}

.taxonomy-toggle--sub::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 2px solid rgba(var(--stage-rgb, var(--accent-rgb)), 0.65);
  background: rgba(var(--stage-rgb, var(--accent-rgb)), 0.12);
  flex: 0 0 auto;
}

.taxonomy-toggle--group::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 3px;
  border: 2px solid rgba(var(--stage-rgb, var(--accent-rgb)), 0.55);
  background: transparent;
  flex: 0 0 auto;
}

.taxonomy-editor__row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 2px;
  border-radius: 10px;
}

.shell .taxonomy-editor__row {
  padding: 1px;
  border-radius: 8px;
}

.taxonomy-editor__row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.taxonomy-editor__name {
  flex: 1 1 0;
  min-width: 0;
}

.taxonomy-editor__toggle.is-empty {
  visibility: hidden;
}

.taxonomy-editor__children {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-left: 14px;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.shell .taxonomy-editor__children {
  margin-left: 12px;
  padding-left: 8px;
}

.module-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.module-card__info {
  min-width: 0;
}

.module-card__title {
  font-weight: 700;
}

.module-card__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.module-card__col {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.06);
}

.module-card__col-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.module-card__list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.module-card__hint {
  margin-top: 10px;
}

@media (max-width: 720px) {
  .module-card__grid {
    grid-template-columns: 1fr;
  }
}

.integrations-head {
  margin-bottom: 12px;
}

.integrations-list {
  padding: 0;
  overflow: hidden;
}

.integration-row {
  border-radius: inherit;
}

.integration-row__summary {
  --integration-row-control-radius: 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto 22px;
  gap: 8px;
  align-items: center;
  min-height: 48px;
  padding: 8px 12px;
  cursor: pointer;
  list-style: none;
}

.integration-row__summary::-webkit-details-marker {
  display: none;
}

.integration-row__summary:hover {
  background: rgba(255, 255, 255, 0.04);
}

.integration-row__service {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.integration-row__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #1877f2;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  line-height: 1;
  flex: 0 0 auto;
}

.integration-row__main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.integration-row__title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integration-row__subtitle {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integration-row__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: var(--integration-row-control-radius, 6px);
  border: 0;
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.integration-row__status::before {
  content: '';
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
}

.integration-row__status--active {
  border-color: transparent;
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
}

.integration-row__status--active::before {
  animation: integration-status-pulse 1.35s ease-out infinite;
}

.integration-row__status--inactive {
  border-color: transparent;
  background: rgba(220, 38, 38, 0.11);
  color: #b42318;
}

.integration-row__summary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.integration-row__summary-actions .btn,
.integration-row__summary-actions .ghost {
  --btn-focus-rgb: 148, 163, 184;
  --btn-bg: rgba(255, 255, 255, 0.72);
  --btn-bg-hover: rgba(248, 250, 252, 0.96);
  --btn-border: rgba(15, 23, 42, 0.1);
  --btn-border-hover: rgba(15, 23, 42, 0.18);
  --btn-color: rgba(15, 23, 42, 0.72);
  --btn-color-hover: rgba(15, 23, 42, 0.92);
  --btn-shadow:
    0 1px 2px rgba(15, 23, 42, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  --btn-shadow-hover:
    0 6px 14px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  min-height: 30px;
  padding: 5px 9px;
  border-radius: var(--integration-row-control-radius, 6px);
  font-size: 12px;
  white-space: nowrap;
}

.integration-row__summary-actions .btn-primary {
  --btn-focus-rgb: var(--accent-rgb);
  --btn-bg: rgba(22, 163, 74, 0.1);
  --btn-bg-hover: rgba(22, 163, 74, 0.16);
  --btn-border: rgba(var(--accent-rgb), 0.24);
  --btn-border-hover: rgba(var(--accent-rgb), 0.36);
  --btn-color: #17603b;
  --btn-color-hover: #13512f;
  --btn-shadow:
    0 1px 2px rgba(var(--accent-rgb), 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.66);
  --btn-shadow-hover:
    0 8px 16px rgba(var(--accent-rgb), 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.integration-row__channel-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: var(--integration-row-control-radius, 6px);
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

@keyframes integration-status-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.42);
  }
  72% {
    box-shadow: 0 0 0 7px rgba(22, 163, 74, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
  }
}

.integration-row__chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: transform 180ms ease, color 180ms ease;
}

.integration-row__chevron svg {
  width: 18px;
  height: 18px;
}

.integration-row[open] .integration-row__chevron {
  transform: rotate(180deg);
  color: var(--text);
}

.integration-row__body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}

.integration-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 8px;
}

.integration-row__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.integrations-editor {
  display: grid;
  gap: 10px;
  padding-top: 10px;
}

.integrations-panel {
  display: grid;
  gap: 10px;
}

.integrations-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.integrations-panel__title {
  font-weight: 700;
  color: var(--text);
}

.integrations-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.integrations-form-editor {
  display: grid;
  gap: 8px;
}

.integrations-meta-app {
  border: 0;
  background: transparent;
  border-radius: 0;
  padding: 0;
}

.integrations-meta-app summary {
  cursor: pointer;
}

.integrations-meta-app .muted {
  margin: 0;
}

.integrations-connect-state {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: var(--control-bg);
}

.integrations-connect-state__title {
  font-weight: 700;
  margin-bottom: 6px;
}

.integrations-tech-details {
  margin-top: 0;
}

.integrations-tech-details summary {
  cursor: pointer;
  color: var(--text);
  font-size: inherit;
}

.integrations-tech-details .integrations-meta-grid {
  margin-top: 10px;
}

.integrations-token-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.integrations-readonly {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.integrations-readonly input {
  font-size: 12px;
}

.integrations-mapping {
  display: grid;
  gap: 6px;
}

.integrations-mapping__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: 10px;
  align-items: center;
}

.integrations-mapping__field {
  min-width: 0;
  color: var(--text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integrations-log {
  display: grid;
  gap: 8px;
}

.integrations-log__item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.integrations-log__status {
  font-weight: 700;
}

.integrations-log__error {
  color: var(--danger);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integrations-savebar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.integrations-channels {
  display: grid;
  gap: 8px;
}

.integrations-channels__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.integrations-channels__head .muted {
  margin: 0;
}

.integrations-channels__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.integrations-channel {
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.integrations-channel__summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  cursor: pointer;
  list-style: none;
}

.integrations-channel__summary::-webkit-details-marker {
  display: none;
}

.integrations-channel__title {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.integrations-channel__route {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integrations-channel__grid {
  padding: 8px 10px 0;
}

.integrations-channel__mapping {
  padding: 8px 10px 0;
}

.integrations-channel__actions {
  padding: 8px 10px 10px;
}

.integrations-routes {
  gap: 6px;
}

.integrations-routes__list {
  display: grid;
  gap: 4px;
}

.integrations-routes__row {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(150px, 1fr) minmax(180px, 1.25fr) auto auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--control-bg);
  color: var(--text);
  text-align: left;
}

button.integrations-routes__row {
  cursor: pointer;
}

button.integrations-routes__row:hover,
button.integrations-routes__row:focus-visible,
.integrations-routes__row.is-selected {
  border-color: var(--accent);
}

.integrations-routes__row--head {
  min-height: 0;
  padding: 0 8px 2px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.integrations-routes__cell,
.integrations-routes__form {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integrations-routes__destination {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.integrations-routes__destination > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.integrations-routes__state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.integrations-routes__state--ready {
  color: #15803d;
  background: rgba(22, 163, 74, 0.1);
  border: 1px solid rgba(22, 163, 74, 0.28);
}

.integrations-routes__state--empty {
  color: #b42318;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.28);
}

.integrations-routes__edit {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .integration-row__summary {
    grid-template-columns: minmax(0, 1fr) 22px;
  }

  .integration-row__status,
  .integration-row__summary-actions,
  .integration-row__channel-count {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .integration-settings-grid {
    grid-template-columns: 1fr;
  }

  .integration-row__actions {
    justify-content: stretch;
    flex-direction: column;
  }

  .integration-row__actions .btn,
  .integration-row__actions .ghost {
    width: 100%;
  }

  .integrations-panel__head,
  .integrations-savebar,
  .integrations-channels__head,
  .integrations-channels__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .integrations-meta-grid,
  .integrations-mapping__row,
  .integrations-log__item,
  .integrations-channel__summary,
  .integrations-routes__row {
    grid-template-columns: 1fr;
  }

  .integrations-routes__row--head {
    display: none;
  }
}

.deal-stage-chip.deal-stage-chip--filter.has-color .deal-stage-chip__dot {
  background: rgba(255, 255, 255, 0.22);
}

.deal-stage-chip.deal-stage-chip--filter.is-active.has-color .deal-stage-chip__dot {
  background: rgb(var(--stage-rgb));
}

.deal-stage-chip.deal-stage-chip--filter.is-active {
  box-shadow: none;
}

.deal-stage-chip.deal-stage-chip--filter.is-active.has-color {
  box-shadow: none;
}

.deal-stage-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.08);
  max-width: 100%;
}

.deals-table td[data-col-key='stage'] {
  padding: 2px 6px;
  text-align: left;
}

.deals-table td[data-col-key='stage'] .deal-stage-chip {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  justify-content: center;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  box-sizing: border-box;
  border: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.1);
  box-shadow: none;
}

.deals-table td[data-col-key='stage'] .deals-cell-picker--stage,
.deals-table td[data-col-key='stage'] .deals-cell-picker--stage:hover,
.deals-table td[data-col-key='stage'] .deals-cell-picker--stage:focus-visible,
.deals-table td[data-col-key='stage'] .deals-cell-picker--stage:active {
  display: flex;
  width: 100%;
  min-height: 28px;
  padding: 0 2px;
  justify-content: flex-start;
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.deals-table td[data-col-key='stage'].has-stage-color {
  background: #eef2f5;
}

.deals-table td[data-col-key='stage'] .deal-stage-chip__dot {
  display: none;
}

.deals-table td[data-col-key='stage'] .deal-stage-chip__label {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.1;
}

.deals-table td[data-col-key='stage'] .deal-stage-chip.has-color {
  border: 1px solid rgba(var(--stage-rgb), 0.18);
  background: rgba(var(--stage-rgb), 0.11);
  color: rgba(var(--stage-rgb), 0.92);
}

.deal-stage-chip__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  flex: 0 0 auto;
}

.deal-stage-chip__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deal-stage-chip.has-color {
  border-color: rgba(var(--stage-rgb), 0.55);
  background-color: rgba(var(--stage-rgb), 0.1);
}

.deal-stage-chip.has-color .deal-stage-chip__dot {
  background: rgb(var(--stage-rgb));
}

tr.is-highlighted {
  background: rgba(var(--accent-rgb), 0.08);
}

.deal-modal {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
  padding: 12px;
  display: flex;
}

.shell .deal-modal {
  padding: 8px;
}

.deal-modal__panel {
  --deal-modal-panel-radius: 12px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--deal-modal-panel-radius);
  background: var(--surface);
  box-shadow: var(--popover-shadow);
  overflow: hidden;
}

.shell .deal-modal__panel {
  --deal-modal-panel-radius: 10px;
}

.deal-modal__header {
  --deal-modal-header-pad-y: 8px;
  --deal-modal-header-pad-x: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: var(--deal-modal-header-pad-y) var(--deal-modal-header-pad-x);
  position: relative;
  z-index: 0;
  border-top-left-radius: var(--deal-modal-panel-radius);
  border-top-right-radius: var(--deal-modal-panel-radius);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.deal-modal__header > * {
  position: relative;
  z-index: 1;
}

.deal-modal__header.has-stage-color {
  margin: 0;
  padding: var(--deal-modal-header-pad-y) var(--deal-modal-header-pad-x);
  background: rgba(255, 255, 255, 0.02);
  border: 0;
  border-bottom: 1px solid var(--border);
  border-top-left-radius: var(--deal-modal-panel-radius);
  border-top-right-radius: var(--deal-modal-panel-radius);
  box-shadow: none;
}

.deal-modal__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
  max-width: 100%;
  margin-left: auto;
}

.deal-modal__delete-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.deal-modal__delete-toggle,
.deal-modal__delete-btn {
  min-height: 36px;
  padding: 0 12px;
  white-space: nowrap;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.deal-modal__delete-toggle {
  flex: 0 0 auto;
  color: var(--muted);
}

.deal-modal__delete-btn {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 0;
  padding-left: 0;
  padding-right: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateX(14px);
  color: var(--danger);
  transition:
    max-width 180ms ease,
    padding 180ms ease,
    opacity 160ms ease,
    transform 180ms ease;
}

.deal-modal__delete-control.is-armed .deal-modal__delete-btn {
  max-width: 160px;
  padding-left: 12px;
  padding-right: 12px;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.deal-modal__delete-toggle:hover,
.deal-modal__delete-toggle:focus-visible,
.deal-modal__delete-toggle:active,
.deal-modal__delete-btn:hover,
.deal-modal__delete-btn:focus-visible,
.deal-modal__delete-btn:active {
  border: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
}

.deal-modal__delete-toggle:hover,
.deal-modal__delete-toggle:focus-visible,
.deal-modal__delete-toggle:active {
  color: var(--text);
}

.deal-modal__delete-btn:hover,
.deal-modal__delete-btn:focus-visible,
.deal-modal__delete-btn:active {
  color: rgba(var(--danger-rgb), 0.92);
}

.deal-modal__close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--danger);
  font: inherit;
  font-size: 0;
  line-height: 0;
}

.deal-modal__close-glyph {
  display: block;
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  transform: translateY(-2px);
}

.deal-modal__close-btn:hover,
.deal-modal__close-btn:focus-visible,
.deal-modal__close-btn:active {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: rgba(var(--danger-rgb), 0.92);
  outline: none;
}

.deal-modal__stage,
.deal-modal__stage-status,
.deal-modal__stage-picker {
  width: fit-content;
  max-width: min(100%, 240px);
  min-width: 0;
  flex: 0 1 auto;
  height: 36px;
  box-shadow: none;
}

.deal-modal__responsible-picker {
  width: fit-content;
  max-width: min(100%, 280px);
  min-width: 0;
  flex: 0 1 auto;
  height: 36px;
  box-shadow: none;
}

.select-like.deal-modal__stage-picker {
  width: fit-content;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background-clip: padding-box;
}

.select-like.deal-modal__responsible-picker {
  width: fit-content;
}

#deals-create-stage.has-color,
.deal-modal__stage.has-color,
.deal-modal__stage-picker.has-color {
  border-color: rgba(var(--stage-rgb), 0.55);
  background-color: rgba(var(--stage-rgb), 0.1);
}

.deal-modal__stage-picker.has-color {
  border-color: rgba(var(--stage-rgb), 0.68);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.86)),
    rgba(var(--stage-rgb), 0.12);
  box-shadow: inset 0 0 0 1px rgba(var(--stage-rgb), 0.18);
}

.deal-modal__stage-picker.has-color .deals-stage-btn__label {
  color: rgba(var(--stage-rgb), 0.96);
}

#deals-create-stage.has-color:hover,
.deal-modal__stage.has-color:hover,
.deal-modal__stage-picker.has-color:hover {
  border-color: rgba(var(--stage-rgb), 0.75);
  background-color: rgba(var(--stage-rgb), 0.16);
}

.deal-modal__stage-picker.has-color:hover {
  border-color: rgba(var(--stage-rgb), 0.82);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.89)),
    rgba(var(--stage-rgb), 0.16);
  box-shadow: inset 0 0 0 1px rgba(var(--stage-rgb), 0.24);
}

.shell .deal-modal__header {
  --deal-modal-header-pad-y: 6px;
  --deal-modal-header-pad-x: 6px;
  padding: var(--deal-modal-header-pad-y) var(--deal-modal-header-pad-x);
}

.deal-modal__title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1 1 220px;
  min-width: 0;
}

.deal-modal__name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 17px;
  line-height: 1.2;
  flex: 1 1 auto;
  min-width: 0;
}

.deal-modal__name-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.deal-modal__name-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deal-modal__inline-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 600;
  white-space: nowrap;
}

.deal-modal__inline-edit:hover,
.deal-modal__inline-edit:focus-visible,
.deal-modal__inline-edit:active {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  outline: none;
}

.deal-modal__chips {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
}

.deal-modal__header-seq {
  font-size: 24px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.03em;
  white-space: nowrap;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.deal-modal__responsible-picker .deals-responsible-cell {
  width: auto;
  max-width: 100%;
}

.deal-modal__responsible-picker .deals-responsible-cell__label {
  flex: 0 1 auto;
}

.deal-modal__responsible-picker .deals-responsible-cell .avatar--sm,
.deal-modal__responsible-picker .deals-responsible-cell .avatar-img--sm {
  width: 28px;
  height: 28px;
  border-radius: 999px;
}

.deal-modal__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  overflow: auto;
}

.shell .deal-modal__body {
  gap: 6px;
  padding: 6px;
}

.deal-modal__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
  gap: 8px;
  align-items: stretch;
}

.deal-modal__meta {
  display: grid;
  gap: 8px;
}

.deal-modal__info {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.deal-modal__info-col {
  min-width: 0;
}

.deal-modal__section {
  margin-top: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  min-width: 0;
  gap: 8px;
}

.deal-modal__section--client {
  min-height: 0;
}

.deal-modal__section--details {
  min-height: 0;
}

.shell .deal-modal__section {
  padding: 6px;
  border-radius: 10px;
  gap: 6px;
}

.shell .deal-modal__section--client {
  min-height: 0;
}

.shell .deal-modal__section--details {
  min-height: 0;
}

.deal-modal__section--client .lead-block__head {
  display: none;
}

.deal-modal__section-body {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.deal-modal__section--details .deal-modal__section-body {
  gap: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.deal-modal__side {
  min-width: 0;
}

.deal-modal__side--right {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.deal-modal__tabs {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  min-height: 42px;
}

.deal-modal__tabs::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.deal-modal__tab {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 4px 0;
  min-height: 0;
  border-radius: 0;
  white-space: nowrap;
  position: relative;
}

.deal-modal__tab:hover {
  background: transparent;
  color: var(--text);
}

.deal-modal__tab.is-active {
  background: transparent;
  color: var(--text);
  font-weight: 600;
}

.deal-modal__tab::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 2px;
  border-radius: 999px;
  background: transparent;
}

.deal-modal__tab.is-active::after {
  background: rgba(var(--accent-rgb), 0.95);
}

.deal-modal__tab-content {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.deal-modal__tab-scroll {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.deal-modal__products-wrap {
  margin-top: 10px;
}

.deal-modal__tab-scroll > .lead-block {
  margin-top: 0;
  padding: 10px;
  border-top: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  height: 580px;
  max-height: 580px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.shell .deal-modal__tabs {
  border-radius: 10px;
}

.shell .deal-modal__tab-scroll > .lead-block {
  padding: 8px;
  border-radius: 10px;
  height: 500px;
  max-height: 500px;
}

.deal-modal__tab-scroll .chat {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  border-color: rgba(var(--stage-rgb, 148, 163, 184), 0.16);
  background:
    linear-gradient(180deg, rgba(var(--stage-rgb, 148, 163, 184), 0.05), rgba(var(--stage-rgb, 148, 163, 184), 0.02)),
    rgba(255, 255, 255, 0.02);
}

.deal-modal__tab-scroll .chat__list,
.deal-modal__tab-scroll .lead-task-list {
  flex: 1 1 auto;
  overflow: auto;
  max-height: none;
  min-height: 0;
}

.deal-modal__tab-scroll .chat-composer--deal {
  margin-top: auto;
}

.deal-modal__tab-scroll .chat-composer--deal .chat-composer__input {
  min-height: 62px;
  padding-right: 58px;
  padding-bottom: 34px;
}

.deal-modal__tab-scroll .chat-msg__bubble {
  background: rgba(132, 204, 22, 0.16);
  box-shadow: none;
}

.deal-modal__tab-scroll .chat-msg.is-me .chat-msg__bubble {
  background: rgba(132, 204, 22, 0.16);
  box-shadow: none;
}

.deal-order-history__item.is-current {
  border-color: rgba(var(--accent-rgb), 0.32);
  background: rgba(var(--accent-rgb), 0.06);
}

.deal-order-history__comments {
  margin-top: 6px;
  gap: 6px;
}

.deal-order-history__comments .chat-msg__bubble {
  background: rgba(132, 204, 22, 0.13);
}

@media (max-width: 980px) {
  .deal-modal__top {
    grid-template-columns: 1fr;
  }
}

.deal-modal__products {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  gap: 12px;
}

.deal-modal__products-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.deal-modal__products-lead {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.deal-modal__products-title {
  font-weight: 700;
  line-height: 1.2;
}

.deal-modal__products-meta {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.deal-modal__products-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}

.deal-modal__products-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: rgba(176, 186, 198, 0.92);
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-3px);
}

.deal-modal__products-add-btn:hover,
.deal-modal__products-add-btn:focus-visible,
.deal-modal__products-add-btn:active {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: rgba(226, 232, 240, 0.94);
  outline: none;
}

.deal-modal__products.is-saving .deal-modal__products-add-btn {
  opacity: 0.55;
}

.deal-modal__products-lock-hint {
  font-size: 12px;
  line-height: 1.3;
  text-align: right;
}

.deal-modal__products-table-wrap {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: auto;
}

.deal-modal__products-table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.deal-modal__products-col--idx {
  width: 54px;
}

.deal-modal__products-col--qty {
  width: 86px;
}

.deal-modal__products-col--unit {
  width: 88px;
}

.deal-modal__products-col--price,
.deal-modal__products-col--total {
  width: 152px;
}

.deal-modal__products-col--actions {
  width: 56px;
}

.deal-modal__products-table th,
.deal-modal__products-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  background-clip: padding-box;
}

.deal-modal__products-table th:not(:last-child),
.deal-modal__products-table td:not(:last-child) {
  border-right: 1px solid rgba(148, 163, 184, 0.12);
}

.deal-modal__products-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  background: rgba(255, 255, 255, 0.06);
}

.deal-modal__products-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.025);
}

.deal-modal__products-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.045);
}

.deal-modal__products-table tbody tr:last-child td {
  border-bottom: 0;
}

.deal-modal__products-index {
  text-align: center;
  white-space: nowrap;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.deal-modal__products-name {
  min-width: 0;
  font-weight: 600;
  line-height: 1.35;
}

.deal-modal__products-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.deal-modal__products-picker-toggle {
  flex: 0 0 auto;
}

.deal-modal__products-actions-col {
  text-align: center;
}

.deal-modal__products-num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.deal-modal__products-qty {
  text-align: center;
}

.deal-modal__products-unit {
  text-align: center;
}

.deal-modal__products-input {
  width: 100%;
  min-height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 6px 8px;
  font: inherit;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.deal-modal__products-input:focus {
  outline: none;
  background-color: var(--field-focus-bg);
  border-color: var(--field-focus-border);
  box-shadow: var(--field-focus-shadow);
}

.deal-modal__products-input--name {
  text-align: left;
}

.deal-modal__products-input--num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.deal-modal__products-input--unit {
  text-align: center;
}

.deal-modal__products.is-readonly .deal-modal__products-table tbody tr:hover td {
  background: inherit;
}

.deal-products-picker {
  width: min(420px, calc(100% - 16px));
}

.deal-products-picker__list {
  display: grid;
  gap: 4px;
  max-height: min(360px, calc(100vh - 160px));
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.deal-products-picker__item {
  display: grid;
  gap: 2px;
}

.deal-products-picker__item-title {
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.deal-products-picker__item-meta {
  font-size: 12px;
  line-height: 1.25;
}

.deal-modal__products-summary {
  width: min(100%, 360px);
  margin-left: auto;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
}

.deal-modal__products-summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 11px 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.deal-modal__products-summary-row:first-child {
  border-top: 0;
}

.deal-modal__products-summary-row.is-grand {
  background: rgba(255, 255, 255, 0.045);
}

.deal-modal__products-summary-label {
  color: var(--muted);
  font-size: 13px;
}

.deal-modal__products-summary-row.is-grand .deal-modal__products-summary-label {
  color: var(--text);
  font-weight: 700;
}

.deal-modal__products-summary-value {
  text-align: right;
  white-space: nowrap;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.deal-modal__products-summary-row.is-grand .deal-modal__products-summary-value {
  font-size: 16px;
}

@media (max-width: 560px) {
  .deal-modal__products-table {
    min-width: 560px;
  }

  .deal-modal__products-table th,
  .deal-modal__products-table td {
    padding: 7px 8px;
  }

  .deal-modal__products-summary {
    width: 100%;
  }
}

.deal-modal__meta-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.deal-modal__meta-row--company-code {
  grid-template-columns: 160px minmax(0, 1fr);
}

.deal-modal__meta-row--address,
.deal-modal__meta-row--tags {
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: start;
}

.deal-modal__meta-row--tracking,
.deal-modal__meta-row--payment {
  grid-template-columns: 160px minmax(0, 1fr);
}

.deal-modal__meta-row--empty {
  opacity: 0.9;
}

.deal-modal__meta-key {
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: 0.01em;
  text-transform: none;
  font-weight: 600;
}

.deal-modal__meta-row--company-code .deal-modal__meta-key,
.deal-modal__meta-row--address .deal-modal__meta-key,
.deal-modal__meta-row--tags .deal-modal__meta-key,
.deal-modal__meta-row--tracking .deal-modal__meta-key,
.deal-modal__meta-row--payment .deal-modal__meta-key {
  font-size: 12px;
  letter-spacing: 0.01em;
}

.deal-modal__meta-val {
  --lead-inline-action-size: 34px;
  min-width: 0;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.deal-modal__meta-row--company-code .deal-modal__meta-val,
.deal-modal__meta-row--tracking .deal-modal__meta-val,
.deal-modal__meta-row--payment .deal-modal__meta-val {
  display: block;
}

.deal-modal__meta-row--company-code .deal-modal__meta-val {
  display: flex;
  align-items: center;
  overflow-wrap: normal;
}

.deal-modal__meta-row--address .deal-modal__meta-val,
.deal-modal__meta-row--tags .deal-modal__meta-val {
  display: block;
}

.deal-modal__section--details .deal-modal__meta-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.deal-modal__section--details .deal-modal__meta-row:first-child {
  padding-top: 0;
}

.deal-modal__meta-row--empty .deal-modal__meta-val {
  color: var(--muted);
  font-weight: 400;
}

.deal-modal__ttn-btn,
.deal-modal__address-btn,
.deal-modal__payment-btn {
  justify-content: flex-start;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.3;
}

.deal-modal__section--details .deal-modal__ttn-btn,
.deal-modal__section--details .deal-modal__address-btn {
  width: 100%;
}

.deal-modal__ttn-btn:hover,
.deal-modal__ttn-btn:focus-visible,
.deal-modal__ttn-btn:active,
.deal-modal__address-btn:hover,
.deal-modal__address-btn:focus-visible,
.deal-modal__address-btn:active,
.deal-modal__payment-btn:hover,
.deal-modal__payment-btn:focus-visible,
.deal-modal__payment-btn:active {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.deal-modal__ttn-btn .tracking-number-display__text {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.deal-modal__address-btn.has-value {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  color: var(--text);
  line-height: 1.45;
}

.deal-modal__section--details .deal-modal__ttn-btn.is-empty-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px dashed rgba(148, 163, 184, 0.38);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  font-size: 12px;
}

.deal-modal__section--details .deal-modal__payment-btn {
  width: fit-content;
  max-width: 100%;
}

.deal-modal__section--details .deal-payment-status {
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.deal-modal__section--details .deals-tags {
  width: 100%;
  align-items: flex-start;
}

.deal-modal__section--details .deals-tags__list {
  width: 100%;
}

.deal-modal__section--details .deals-tags__empty {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
}

@media (max-width: 720px) {
  .deal-modal__meta-row {
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 5px 0;
  }
}

.deal-client-deals {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.deal-modal__client-contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.deal-modal__client-contact-value.is-empty {
  color: var(--muted);
}

.deal-client-deals__count {
  font-weight: 600;
  color: var(--text);
}

.deal-client-deals__action {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  line-height: 1.3;
  text-decoration: none;
}

.deal-client-deals__action:hover {
  text-decoration: underline;
}

.deal-client-deals__lead {
  display: inline-flex;
  align-items: center;
}

.deal-client-deals .deal-linked-lead-link {
  font-size: 13px;
  line-height: 1.3;
}

@media (max-width: 560px) {
  .deal-modal__meta-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.shell .grid {
  gap: 6px;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.kpi {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.kpi--placeholder {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.015);
}

.kpi--action {
  text-align: left;
  width: 100%;
}

.kpi--action:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.kpi--action:active {
  background: rgba(255, 255, 255, 0.04);
}

.shell .kpi {
  border-radius: 10px;
  padding: 8px;
}

.kpi__label {
  color: var(--muted);
  font-size: 14px;
}

.kpi__value {
  font-size: 22px;
  font-weight: 700;
  margin-top: 5px;
}

.kpi__hint {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cabinet-panel__note {
  margin-top: 10px;
}

.chart-panel {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.shell .chart-panel {
  margin-top: 10px;
  border-radius: 10px;
  padding: 8px;
}

.chart-panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.chart-panel__title {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.chart-panel__meta {
  font-weight: 700;
  color: var(--text);
  opacity: 0.92;
  white-space: nowrap;
}

.chart-panel__body {
  margin-top: 8px;
  display: grid;
  gap: 10px;
}

.chart-panel__body--split {
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
  align-items: center;
}

@media (max-width: 720px) {
  .chart-panel__body--split {
    grid-template-columns: 1fr;
  }
}

.chart {
  width: 100%;
  min-height: 200px;
}

.chart svg {
  width: 100%;
  height: auto;
  display: block;
}

.chart-legend {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.chart-legend--inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.chart-legend__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.chart-legend--inline .chart-legend__item {
  justify-content: flex-start;
  gap: 8px;
}

.chart-legend__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
}

.chart-legend__swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--swatch, rgba(255, 255, 255, 0.22));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  flex: 0 0 auto;
}

.chart-legend__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-legend__value {
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

.cabinet-meta-log {
  display: grid;
  gap: 6px;
}

.cabinet-meta-log__item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--control-bg);
}

.cabinet-meta-log__item--error {
  border-color: rgba(220, 38, 38, 0.24);
}

.cabinet-meta-log__status {
  font-weight: 700;
  color: var(--text);
}

.cabinet-meta-log__status--error {
  color: var(--danger);
}

.cabinet-meta-log__main {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cabinet-meta-log__date {
  white-space: nowrap;
  font-size: 12px;
}

@media (max-width: 720px) {
  .cabinet-meta-log__item {
    grid-template-columns: 1fr;
  }
}

.gauge {
  display: grid;
  gap: 6px;
}

.gauge__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.gauge__title {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.gauge__value {
  font-weight: 700;
  white-space: nowrap;
}

.gauge__bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  overflow: hidden;
}

.gauge__fill {
  height: 100%;
  width: var(--pct, 0%);
  background: var(--fill, rgba(var(--accent-rgb), 0.85));
  border-radius: 999px;
}

.gauge__hint {
  color: var(--muted);
  font-size: 14px;
}

.funnel-section {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.shell .funnel-section {
  margin-top: 10px;
  gap: 6px;
}

.funnel-section__title {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.funnel-items {
  display: grid;
  gap: 10px;
}

.funnel-items--cols {
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  align-items: start;
}

.shell .funnel-items--cols {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.shell .funnel-items {
  gap: 8px;
}

.funnel-item,
.funnel-summary {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
  position: relative;
  overflow: hidden;
}

.shell .funnel-item,
.shell .funnel-summary {
  border-radius: 10px;
  padding: 8px;
}

.funnel-item::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: var(--stage-color, rgba(255, 255, 255, 0.08));
  opacity: 0.9;
  pointer-events: none;
}

.funnel-item__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.funnel-item__label {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.3px;
  color: var(--text);
  text-transform: uppercase;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funnel-item__meta {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.funnel-item__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.shell .funnel-item__stats {
  margin-top: 6px;
  gap: 6px;
}

@media (max-width: 560px) {
  .funnel-item__stats {
    grid-template-columns: 1fr;
  }
}

.funnel-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.funnel-stat__label {
  color: var(--muted);
  font-size: 13px;
  min-width: 0;
}

.funnel-stat__value {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.funnel-stat__pct {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.funnel-item__bar {
  margin-top: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.shell .funnel-item__bar {
  margin-top: 6px;
}

.funnel-item__bar > span {
  display: block;
  height: 100%;
  width: var(--pct, 0%);
  background: var(--stage-color, rgba(var(--accent-rgb), 0.9));
  border-radius: inherit;
}

.funnel-item__bar.is-danger > span {
  background: rgba(var(--danger-rgb), 0.85);
}

.funnel-reasons {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 6px;
}

.shell .funnel-reasons {
  margin-top: 6px;
  padding-top: 6px;
  gap: 5px;
}

.funnel-reason {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  font-size: 13px;
  padding-left: 12px;
  position: relative;
}

.funnel-reason::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 3px;
  transform: translateY(-50%);
  background: var(--stage-color, rgba(255, 255, 255, 0.18));
}

.funnel-reason__name {
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funnel-reason__meta {
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}


.funnels-list {
  margin-top: 12px;
  display: grid;
  gap: 12px;
}

.shell .funnels-list {
  margin-top: 10px;
  gap: 10px;
}

.funnels-pipeline {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.shell .funnels-pipeline {
  border-radius: 10px;
  padding: 8px;
}

.funnels-pipeline__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.funnels-pipeline__name {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.2px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funnels-pipeline__meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  white-space: nowrap;
}

.funnels-pipeline__kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
  gap: 8px;
  margin-top: 8px;
}

.shell .funnels-pipeline__kpis {
  gap: 6px;
  margin-top: 6px;
}

.funnels-kpi {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.12);
}

:root[data-theme='light'] .funnels-kpi {
  background: rgba(16, 24, 40, 0.04);
}

.funnels-kpi.is-warn {
  border-color: rgba(var(--warning-rgb), 0.45);
}

.funnels-kpi.is-danger {
  border-color: rgba(var(--danger-rgb), 0.45);
}

.funnels-kpi__label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.funnels-kpi__value {
  margin-top: 3px;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}

.funnels-pipeline__tables {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.shell .funnels-pipeline__tables {
  margin-top: 8px;
  gap: 8px;
}

@media (max-width: 900px) {
  .funnels-pipeline__tables {
    grid-template-columns: 1fr;
  }
}

.funnels-table-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  margin: 0 0 6px;
}

.shell .funnels-table-title {
  margin-bottom: 5px;
}

.funnels-stage {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.funnels-stage__dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  flex: 0 0 auto;
}

:root[data-theme='light'] .funnels-stage__dot {
  background: rgba(17, 24, 39, 0.12);
  box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.14) inset;
}

.funnels-stage__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.funnels-matrix th,
.funnels-matrix td {
  white-space: nowrap;
}

.funnels-matrix__th-stage {
  min-width: 140px;
}

.funnels-pipeline td.is-danger {
  color: var(--danger);
  font-weight: 800;
}

.funnels-pipeline td.is-warn {
  color: var(--warning);
  font-weight: 800;
}

.funnels-note {
  margin-top: 8px;
}

.auth-card {
  width: min(520px, 100%);
  margin: 0 auto;
}

.entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.entry-brand {
  font-weight: 800;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0.2px;
  color: var(--text);
  text-decoration: none;
}

.entry-brand:hover {
  text-decoration: none;
}

.entry-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.entry-actions .btn {
  font-weight: 700;
}

@media (max-width: 560px) {
  .entry-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .entry-actions .btn {
    width: 100%;
    padding: 7px 8px;
  }

  .auth-form .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-form .actions__right {
    margin-left: 0;
  }

  .auth-form .actions > button,
  .auth-form .actions > a {
    width: 100%;
  }

  .auth-form .action-link {
    justify-content: center;
  }

  .form-row--auth-2 {
    grid-template-columns: 1fr;
  }

  .form-row--auth-code {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .form-row--users-create {
    grid-template-columns: 1fr;
  }

  .users-editor__actions--inline {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .form-row--auth-code > button {
    width: 100%;
  }

  .auth-code-timer {
    width: 100%;
    justify-content: flex-start;
  }
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 10px;
  align-items: start;
}

.chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 5px;
  margin-top: 6px;
}

.chip {
  display: block;
  padding: 3px 8px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: inherit;
  line-height: 1.15;
  text-decoration: none;
  position: relative;
  z-index: 0;
}

.chip::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 10px;
  background: transparent;
  transition: background 120ms ease;
  z-index: -1;
  pointer-events: none;
}

.chip__icon {
  opacity: 0.9;
}

.chip:hover {
  text-decoration: none;
}

.chip:hover::before {
  background: rgba(var(--accent-rgb), 0.12);
}

.chip--muted {
  color: var(--muted);
}

.chip--muted:hover::before {
  background: rgba(255, 255, 255, 0.06);
}

.chip:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.35);
  outline-offset: 2px;
}

.task-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.task-title__open {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.task-title__open--main {
  flex: 1 1 auto;
  min-width: 0;
}

.task-title__open:hover {
  color: var(--accent);
}

.task-title__open:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.35);
  outline-offset: 2px;
  border-radius: 6px;
}

.task-title__lead-jump {
  appearance: none;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.task-title__lead-jump:hover {
  background: rgba(var(--accent-rgb), 0.14);
}

.task-title__lead-jump:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.35);
  outline-offset: 2px;
}

.task-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.task-refs .chip {
  display: inline-block;
  max-width: 100%;
}

.task-modal__panel {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  align-self: stretch;
}

.task-modal__body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.task-modal__top {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.task-modal__top[hidden] {
  display: none;
}

.task-modal__top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.task-modal__top-grid--single {
  grid-template-columns: 1fr;
}

.task-modal__subtitle {
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-modal .deal-modal__name {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.task-modal__lead-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.28);
}

.task-modal__lead-link:hover {
  color: var(--accent);
  border-bottom-color: rgba(var(--accent-rgb), 0.55);
}

.task-modal__lead-link:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.35);
  outline-offset: 2px;
  border-radius: 4px;
}

.task-modal__lead-summary {
  display: inline-flex;
  align-items: center;
  align-content: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  min-width: 0;
}

.task-modal__lead-summary-link {
  flex: 0 0 auto;
  width: fit-content;
  max-width: 100%;
  font-weight: 600;
}

.task-modal__lead-summary-name {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.35;
}

.task-modal__context-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.task-modal__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
}

.task-modal__main,
.task-modal__sidebar {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
  min-height: 0;
}

.task-modal__main {
  overflow: auto;
}

.task-modal__sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.task-modal__section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.task-modal__section-body {
  display: grid;
  gap: 6px;
}

.task-modal__section-body .deal-modal__meta-row {
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 8px;
}

.task-modal__section-body .deal-modal__meta-key {
  font-size: 12px;
}

.task-modal__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.task-modal__followup-toggle.is-active {
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--text);
}

.task-modal__comment-tabs {
  min-height: 36px;
  padding: 4px 6px;
}

.task-modal__comment-pane {
  display: grid;
  gap: 8px;
  min-height: 0;
}

.task-modal__links,
.task-modal__text-list {
  display: grid;
  gap: 4px;
}

.task-modal__text-item {
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.task-modal__comments {
  display: grid;
  gap: 6px;
}

.task-modal__section--comments .task-modal__comments {
  max-height: none;
  overflow: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

.task-modal__section--comments {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.task-modal__section--comments .chat {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.task-modal__section--comments .chat__list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.task-modal__section--comments .task-modal__comments::-webkit-scrollbar {
  width: 10px;
}

.task-modal__section--comments .task-modal__comments::-webkit-scrollbar-track {
  background: transparent;
}

.task-modal__section--comments .task-modal__comments::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 2px solid transparent;
}

.task-modal__section--comments .task-modal__comments::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

.task-modal__comment {
  display: grid;
  gap: 5px;
  padding: 8px 10px;
  border: 0;
  border-radius: 12px;
  background: rgba(132, 204, 22, 0.16);
}

.shell .task-modal__comment {
  border-radius: 12px;
}

.task-modal__comment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.task-modal__comment-author {
  font-weight: 600;
}

.task-modal__comment-time {
  font-size: 12px;
}

.task-modal__comment-text {
  line-height: 1.42;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.task-modal__comment-text--canceled {
  color: var(--muted);
  font-style: italic;
}

.task-modal__form {
  display: grid;
  gap: 6px;
}

.task-modal__form textarea {
  min-height: 72px;
  resize: vertical;
}

.task-modal__form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.task-modal {
  padding: 0;
}

.shell .task-modal {
  padding: 0;
}

.task-modal__followup-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.task-modal__followup-panel {
  margin-top: 0;
}

.task-modal__section--followup .field:first-child {
  grid-column: 1 / -1;
}

.task-modal__date-btn {
  width: 100%;
}

@media (max-width: 980px) {
  .task-modal__top-grid {
    grid-template-columns: 1fr;
  }

  .task-modal__layout {
    grid-template-columns: 1fr;
  }

  .task-modal__section--comments .task-modal__comments {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}

@media (max-width: 720px) {
  .task-modal__followup-form {
    grid-template-columns: 1fr;
  }
}

body[data-page='tasks'] {
  overflow: hidden;
}

body[data-page='tasks'] .shell {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body[data-page='tasks'] .shell__main {
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

body[data-page='tasks'] .shell__main > main.container {
  flex: 1 1 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-content: stretch;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.tasks-toolbar-card {
  flex: 0 0 auto;
  position: sticky;
  top: 6px;
  z-index: 6;
  overflow: hidden;
}

.tasks-toolbar-card {
  border-color: rgba(17, 24, 39, 0.06);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.94));
  box-shadow:
    0 10px 28px rgba(15, 23, 42, 0.07),
    0 2px 6px rgba(15, 23, 42, 0.04);
}

body[data-page='tasks'] .tasks-board {
  border-color: rgba(17, 24, 39, 0.06);
  background: var(--surface);
  box-shadow:
    0 10px 28px rgba(15, 23, 42, 0.06),
    0 2px 6px rgba(15, 23, 42, 0.04);
}

body[data-page='tasks'] .shell .tasks-toolbar-card,
body[data-page='tasks'] .shell .tasks-board {
  border-radius: 12px;
}

body[data-page='tasks'] .tasks-board {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 8px;
  overflow: hidden;
}

body[data-page='tasks'] .tasks-board > #tasks-table {
  flex: 1 1 auto;
  min-height: 0;
}

.tasks-head__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
  justify-content: flex-start;
}

.tasks-summary-panel {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
  margin-bottom: 6px;
}

.tasks-summary-panel .tasks-head__summary {
  width: 100%;
  justify-content: flex-start;
  padding: 0;
}

body[data-page='tasks'] .tasks-summary-panel .tasks-summary-card--today {
  margin-left: auto;
}

.tasks-summary-card {
  display: flex;
  align-items: stretch;
  min-width: 0;
  padding: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
}

.tasks-summary-card--active {
  box-shadow: none;
}

.tasks-summary-card--overdue {
  box-shadow: none;
}

.tasks-summary-card--today,
.tasks-summary-card--completed,
.tasks-summary-card--tomorrow {
  box-shadow: none;
}

.tasks-pager {
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 0 0 1px rgba(148, 163, 184, 0.08);
}

.tasks-toolbar {
  margin: 0;
  padding: 6px 8px;
  border: 0;
  background: transparent;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.tasks-toolbar::-webkit-scrollbar {
  display: none;
}

@media (max-width: 900px) {
  .tasks-summary-panel {
    padding: 0;
  }

  .tasks-summary-panel .tasks-head__summary {
    padding: 0;
  }
}

body[data-page='tasks'] .tasks-pager .ghost,
body[data-page='tasks'] .tasks-pager .deals-pager__page {
  min-width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 0;
  color: rgba(71, 85, 105, 0.96);
  background: rgba(255, 255, 255, 0.66);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.08);
}

body[data-page='tasks'] .tasks-pager .ghost:hover,
body[data-page='tasks'] .tasks-pager .deals-pager__page:hover {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--text);
}

body[data-page='tasks'] .tasks-pager .deals-pager__page.is-current,
body[data-page='tasks'] .tasks-pager .deals-pager__page.is-current:hover {
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--text);
  box-shadow:
    inset 0 0 0 1px rgba(var(--accent-rgb), 0.14),
    0 4px 10px rgba(var(--accent-rgb), 0.08);
}

body[data-page='tasks'] .tasks-pager .deals-pager__info {
  min-width: 118px;
  padding: 0 8px;
  color: rgba(100, 116, 139, 0.96);
  font-size: 12px;
  font-weight: 700;
}

.tasks-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.tasks-table-wrap::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.tasks-table-wrap::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

.tasks-table-wrap::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 2px solid var(--scrollbar-thumb-border);
}

.tasks-table-wrap::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

.tasks-table-grid {
  --tasks-side-col-width: 34px;
  width: 100%;
  min-width: 1240px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 14px;
  line-height: 1.25;
  background: #fff;
}

.tasks-table-grid th,
.tasks-table-grid td {
  padding: 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  text-align: left;
}

.tasks-table-grid th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--popover-bg);
  box-shadow: inset 0 -1px 0 var(--border);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  padding: 6px 12px;
}

.tasks-table-grid thead th.tasks-th {
  padding-right: 0;
}

.tasks-table-grid th + th,
.tasks-table-grid td + td {
  border-left: 1px solid var(--border);
}

.tasks-table-grid th[data-col-key='id'],
.tasks-table-grid td[data-col-key='id'] {
  width: 76px;
  white-space: nowrap;
}

.tasks-table-grid th[data-col-key='title'],
.tasks-table-grid td[data-col-key='title'] {
  width: 22%;
}

.tasks-table-grid th[data-col-key='description'],
.tasks-table-grid td[data-col-key='description'] {
  width: 28%;
}

.tasks-table-grid th[data-col-key='relation'],
.tasks-table-grid td[data-col-key='relation'] {
  width: 132px;
}

.tasks-table-grid th[data-col-key='responsible'],
.tasks-table-grid td[data-col-key='responsible'] {
  width: 180px;
}

.tasks-table-grid th[data-col-key='dueAt'],
.tasks-table-grid td[data-col-key='dueAt'],
.tasks-table-grid th[data-col-key='remindAt'],
.tasks-table-grid td[data-col-key='remindAt'] {
  width: 152px;
  white-space: nowrap;
}

.tasks-table-grid th[data-col-key='status'],
.tasks-table-grid td[data-col-key='status'] {
  width: var(--tasks-side-col-width);
  min-width: var(--tasks-side-col-width);
  max-width: var(--tasks-side-col-width);
  vertical-align: middle;
  text-align: center;
}

.tasks-table-grid th[data-col-key='actions'],
.tasks-table-grid td[data-col-key='actions'] {
  width: 148px;
  vertical-align: middle;
  text-align: center;
}

.tasks-col-select,
.tasks-col-open {
  box-sizing: border-box;
  text-align: center;
  vertical-align: middle;
  padding: 0;
  width: var(--tasks-side-col-width);
  min-width: var(--tasks-side-col-width);
  max-width: var(--tasks-side-col-width);
  background: #fff;
  transition: background-color 180ms ease, box-shadow 180ms ease;
}

.tasks-col-select {
  position: sticky;
  left: 0;
  z-index: 4;
  line-height: 0;
}

.tasks-col-open {
  position: sticky;
  left: var(--tasks-side-col-width);
  z-index: 3;
  line-height: 0;
  font-size: 0;
  border-left: 0;
  box-shadow: none;
}

.tasks-table-grid th.tasks-col-open,
.tasks-table-grid td.tasks-col-open {
  border-left: 0;
}

.tasks-col-select::after,
.tasks-col-open::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
  pointer-events: none;
}

.tasks-table-grid .tasks-col-open + th,
.tasks-table-grid .tasks-col-open + td {
  border-left: 0;
}

.tasks-table-grid thead .tasks-col-select {
  z-index: 5;
}

.tasks-table-grid thead .tasks-col-open {
  z-index: 4;
}

.tasks-col-select input {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 16px;
  height: 16px;
  margin: 0 auto;
  border: 1px solid rgba(148, 163, 184, 0.58);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.tasks-col-select input:hover {
  border-color: rgba(148, 163, 184, 0.58);
  background: #fff;
}

.tasks-col-select input:checked {
  border-color: rgba(226, 232, 240, 0.96);
  background: rgba(148, 163, 184, 0.82);
}

.tasks-col-select input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.18);
}

.tasks-col-select input:disabled {
  opacity: 0.45;
  cursor: default;
}

.tasks-th {
  position: relative;
  user-select: none;
}

.tasks-th__inner {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.tasks-th__label {
  flex: 1 1 auto;
  min-width: 0;
  cursor: grab;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tasks-th__sort {
  flex: 0 0 auto;
  min-width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(226, 232, 240, 0.72);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition:
    color 120ms ease,
    background 120ms ease,
    transform 120ms ease;
}

.tasks-th__sort:hover {
  color: #fff;
  background: rgba(148, 163, 184, 0.14);
}

.tasks-th__sort:focus-visible {
  outline: none;
  color: #fff;
  background: rgba(var(--accent-rgb), 0.16);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.28);
}

.tasks-th__sort.is-active {
  color: #fff;
}

.tasks-th__sort:active {
  transform: translateY(1px);
}

.tasks-th.is-dragging .tasks-th__label {
  cursor: grabbing;
  opacity: 0.75;
}

.tasks-th__resize {
  flex: 0 0 12px;
  width: 12px;
  margin-right: -6px;
  cursor: col-resize;
  align-self: stretch;
  position: relative;
}

.tasks-th__resize::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 6px;
  width: 2px;
  border-radius: 2px;
  background: transparent;
  transition: background 120ms ease;
}

.tasks-th:hover .tasks-th__resize::before {
  background: rgba(255, 255, 255, 0.12);
}

.tasks-th .tasks-th__resize:hover::before {
  background: rgba(255, 255, 255, 0.2);
}

body.tasks-resizing {
  cursor: col-resize;
  user-select: none;
}

.tasks-th.is-drop-before::before,
.tasks-th.is-drop-after::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: rgba(var(--accent-rgb), 0.75);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.12);
}

.tasks-th.is-drop-before::before {
  left: -1px;
}

.tasks-th.is-drop-after::after {
  right: -1px;
}

.tasks-table-grid tbody td {
  background: #fff;
  vertical-align: middle;
}

.tasks-table-grid tbody tr:nth-child(even) > td:not(.tasks-col-select):not(.tasks-col-open) {
  background: #fff;
}

.tasks-table-grid tbody tr:hover {
  background: transparent;
}

.tasks-table-grid tbody td:not(.tasks-col-select):not(.tasks-col-open):hover {
  background: rgba(148, 163, 184, 0.055);
}

.tasks-table-grid tbody tr.is-selected > td:not(.tasks-col-select):not(.tasks-col-open) {
  background: rgba(var(--accent-rgb), 0.06);
}

.tasks-table-grid tbody tr.is-selected > td:not(.tasks-col-select):not(.tasks-col-open):hover {
  background: rgba(var(--accent-rgb), 0.09);
}

.tasks-table-grid tbody tr:hover .tasks-col-select,
.tasks-table-grid tbody tr:hover .tasks-col-open,
.tasks-table-grid tbody tr.is-selected .tasks-col-select,
.tasks-table-grid tbody tr.is-selected .tasks-col-open,
.tasks-table-grid tbody tr.is-selected:hover .tasks-col-select,
.tasks-table-grid tbody tr.is-selected:hover .tasks-col-open {
  background: #fff;
}

.tasks-table-grid__cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 54px;
  padding: 6px 12px;
  text-align: center;
}

.tasks-table-grid__cell--id,
.tasks-table-grid__cell--dueAt,
.tasks-table-grid__cell--remindAt,
.tasks-table-grid__cell--status {
  white-space: nowrap;
}

.tasks-table-grid__cell--status {
  width: 100%;
  padding-left: 0;
  padding-right: 0;
}

.tasks-table-grid__cell--title,
.tasks-table-grid__cell--description,
.tasks-table-grid__cell--relation,
.tasks-table-grid__cell--responsible,
.tasks-table-grid__cell--actions {
  min-width: 0;
}

.tasks-table-grid__cell--title,
.tasks-table-grid__cell--description,
.tasks-table-grid__cell--relation,
.tasks-table-grid__cell--responsible {
  align-items: center;
  padding-top: 8px;
  padding-bottom: 8px;
}

.tasks-table-grid__cell--actions {
  display: grid;
  width: 100%;
  place-items: center;
  overflow: visible;
}

.tasks-table-grid .task-title {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tasks-table-grid__text--id {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.tasks-table-grid .task-title__open {
  width: 100%;
  max-width: 100%;
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

.tasks-table-grid__text {
  display: block;
  width: 100%;
  min-width: 0;
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
  line-height: 1.35;
  text-align: center;
}

.tasks-table-grid__text--description {
  color: var(--muted);
}

.tasks-table-grid__relation {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  justify-content: center;
}

.tasks-table-grid .deals-responsible-cell {
  justify-content: center;
  text-align: center;
}

.tasks-table-grid .deals-responsible-cell__label {
  text-align: center;
}

.tasks-table-grid__relation-link {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 0;
  border-radius: 10px;
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}

.tasks-table-grid__relation-link:hover {
  background: rgba(var(--accent-rgb), 0.14);
}

.tasks-table-grid__relation-link:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.35);
  outline-offset: 2px;
}

.tasks-table-grid .row-actions {
  display: inline-flex;
  width: auto;
  margin: 0 auto;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
}

.tasks-table-grid__cell--actions .ghost {
  margin: 0 auto;
}

.tasks-table-grid__cell--status .badge,
.tasks-table-grid__cell--status .status-badge,
.tasks-table-grid__cell--actions .row-actions,
.tasks-table-grid__cell--actions .ghost {
  min-height: 30px;
  align-items: center;
}

.tasks-table-grid__cell--status .task-state-indicator {
  width: auto;
  height: auto;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.tasks-table-grid .task-refs {
  gap: 4px;
}

.tasks-table-grid .task-refs .chip {
  padding-inline: 7px;
}

.tasks-col-open .tasks-row-open {
  display: flex;
  margin-left: auto;
  margin-right: auto;
}

.auth-form {
  display: grid;
  gap: 4px;
  margin-top: 6px;
}

.auth-inline-check {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.auth-form__gated {
  display: grid;
  gap: 4px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.auth-form__gated[disabled] {
  opacity: 0.56;
}

.password-group {
  display: grid;
  gap: 8px;
  margin-block: 12px;
  padding: 10px 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  box-shadow: none;
}

.password-group__fields {
  display: grid;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.password-group__fields input[name='password'],
.password-group__fields input[name='passwordConfirm'],
.password-group__fields .password-field > input {
  background: transparent;
  background-color: transparent;
  box-shadow: none;
}

.password-group .password-strength {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.password-group .password-strength.is-mismatch {
  background: transparent;
  border: 0;
}

.password-strength {
  --password-strength-percent: 0%;
  --password-strength-color: rgba(var(--danger-rgb), 0.9);
  --password-strength-track: rgba(255, 255, 255, 0.12);
  display: grid;
  gap: 6px;
  margin-top: 8px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.08)),
    rgba(0, 0, 0, 0.18);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 10px 18px rgba(0, 0, 0, 0.16);
}

.password-strength__meter {
  position: relative;
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--password-strength-track);
  overflow: hidden;
}

.password-strength__meter::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 72%);
  pointer-events: none;
}

.password-strength__meter > span {
  display: block;
  height: 100%;
  width: var(--password-strength-percent);
  max-width: 100%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.22),
    var(--password-strength-color) 34%,
    var(--password-strength-color)
  );
  box-shadow: 0 0 12px color-mix(in srgb, var(--password-strength-color) 42%, transparent);
  transition: width 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}
.password-strength__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.password-strength__status {
  margin: 0;
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.84);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.password-strength__hint {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.54);
}

.password-strength.is-empty {
  --password-strength-color: rgba(255, 255, 255, 0.32);
  --password-strength-track: rgba(255, 255, 255, 0.1);
}

.password-strength.is-weak {
  --password-strength-color: rgba(var(--danger-rgb), 0.9);
  --password-strength-track: rgba(var(--danger-rgb), 0.16);
}

.password-strength.is-medium {
  --password-strength-color: #d6a44a;
  --password-strength-track: rgba(214, 164, 74, 0.2);
}

.password-strength.is-strong {
  --password-strength-color: #42b369;
  --password-strength-track: rgba(66, 179, 105, 0.2);
}

.password-strength.is-weak .password-strength__status {
  color: rgba(var(--danger-rgb), 0.92);
}

.password-strength.is-medium .password-strength__status {
  color: #d6a44a;
}

.password-strength.is-strong .password-strength__status {
  color: #42b369;
}

.password-strength.is-mismatch {
  border-color: rgba(var(--danger-rgb), 0.42);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(var(--danger-rgb), 0.06)),
    rgba(0, 0, 0, 0.2);
}

.password-strength.is-mismatch .password-strength__status {
  color: rgba(var(--danger-rgb), 0.95);
}

:root[data-theme='light'] .password-group__fields {
  border-top-color: rgba(17, 24, 39, 0.12);
}

:root[data-theme='light'] .password-strength {
  --password-strength-track: rgba(17, 24, 39, 0.12);
}

:root[data-theme='light'] .password-strength__status {
  color: rgba(17, 24, 39, 0.82);
}

:root[data-theme='light'] .password-strength__hint {
  color: rgba(17, 24, 39, 0.62);
}

:root[data-theme='light'] .password-strength.is-empty {
  --password-strength-color: rgba(17, 24, 39, 0.3);
  --password-strength-track: rgba(17, 24, 39, 0.1);
}

:root[data-theme='light'] .password-toggle {
  color: rgba(17, 24, 39, 0.66);
  opacity: 0.88;
}

:root[data-theme='light'] .password-toggle:hover {
  color: rgba(17, 24, 39, 0.88);
  background: rgba(17, 24, 39, 0.07);
  opacity: 1;
}

:root[data-theme='light'] .password-toggle.is-visible {
  color: rgba(var(--danger-rgb), 0.9);
  opacity: 0.96;
}

:root[data-theme='light'] .password-toggle:focus-visible {
  outline: 2px solid rgba(var(--danger-rgb), 0.38);
}

.actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.actions__right {
  margin-left: auto;
}

.action-link {
  display: inline-flex;
  align-items: center;
  padding: 7px 0;
  white-space: nowrap;
}

.btn,
button:not([class]),
input[type='submit']:not([class]),
input[type='button']:not([class]),
.btn-primary,
.ghost,
.btn-danger,
.btn-outline-danger {
  --btn-focus-rgb: var(--accent-rgb);
  --btn-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9));
  --btn-bg-hover: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(241, 245, 249, 0.96));
  --btn-border: rgba(100, 116, 139, 0.22);
  --btn-border-hover: rgba(71, 85, 105, 0.34);
  --btn-color: rgba(51, 65, 85, 0.94);
  --btn-color-hover: var(--btn-color);
  --btn-shadow:
    0 8px 18px rgba(26, 36, 53, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  --btn-shadow-hover:
    0 12px 24px rgba(26, 36, 53, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease;
  background: var(--btn-bg);
  border-color: var(--btn-border);
  color: var(--btn-color);
  box-shadow: var(--btn-shadow);
}

.btn:hover,
button:not([class]):hover,
input[type='submit']:not([class]):hover,
input[type='button']:not([class]):hover,
.btn-primary:hover,
.ghost:hover,
.btn-danger:hover,
.btn-outline-danger:hover {
  transform: none;
  text-decoration: none;
  background: var(--btn-bg-hover);
  border-color: var(--btn-border-hover);
  color: var(--btn-color-hover);
  box-shadow: var(--btn-shadow-hover);
}

.btn:active,
button:not([class]):active,
input[type='submit']:not([class]):active,
input[type='button']:not([class]):active,
.btn-primary:active,
.ghost:active,
.btn-danger:active,
.btn-outline-danger:active {
  transform: translateY(0);
}

.btn:focus-visible,
button:not([class]):focus-visible,
input[type='submit']:not([class]):focus-visible,
input[type='button']:not([class]):focus-visible,
.btn-primary:focus-visible,
.ghost:focus-visible,
.btn-danger:focus-visible,
.btn-outline-danger:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.98),
    0 0 0 4px rgba(var(--btn-focus-rgb), 0.15),
    var(--btn-shadow-hover);
}

.btn,
button:not([class]),
input[type='submit']:not([class]),
input[type='button']:not([class]) {
  --btn-focus-rgb: var(--accent-rgb);
  --btn-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.9));
  --btn-bg-hover: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(241, 245, 249, 0.96));
  --btn-border: rgba(100, 116, 139, 0.22);
  --btn-border-hover: rgba(71, 85, 105, 0.34);
  --btn-color: rgba(51, 65, 85, 0.94);
  --btn-color-hover: rgba(15, 23, 42, 0.96);
  --btn-shadow:
    0 10px 22px rgba(15, 23, 42, 0.055),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  --btn-shadow-hover:
    0 14px 28px rgba(15, 23, 42, 0.075),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.btn-primary {
  --btn-focus-rgb: var(--accent-rgb);
  --btn-bg: linear-gradient(180deg, rgba(71, 85, 105, 0.98), rgba(30, 41, 59, 0.98));
  --btn-bg-hover: linear-gradient(180deg, rgba(51, 65, 85, 1), rgba(15, 23, 42, 0.98));
  --btn-border: rgba(51, 65, 85, 0.72);
  --btn-border-hover: rgba(15, 23, 42, 0.82);
  --btn-color: rgba(255, 255, 255, 0.98);
  --btn-color-hover: rgba(255, 255, 255, 1);
  --btn-shadow:
    0 14px 28px rgba(15, 23, 42, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  --btn-shadow-hover:
    0 16px 30px rgba(15, 23, 42, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.ghost {
  --btn-focus-rgb: 148, 163, 184;
  --btn-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 246, 250, 0.94));
  --btn-bg-hover: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(236, 242, 247, 0.98));
  --btn-border: rgba(148, 163, 184, 0.24);
  --btn-border-hover: rgba(148, 163, 184, 0.36);
  --btn-color: rgba(32, 42, 53, 0.82);
  --btn-color-hover: var(--text);
  --btn-shadow:
    0 8px 18px rgba(26, 36, 53, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
  --btn-shadow-hover:
    0 12px 24px rgba(26, 36, 53, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.btn-danger {
  --btn-focus-rgb: var(--danger-rgb);
  --btn-bg: linear-gradient(180deg, rgba(212, 104, 116, 0.98), rgba(197, 88, 98, 0.98));
  --btn-bg-hover: linear-gradient(180deg, rgba(205, 95, 108, 1), rgba(187, 77, 89, 0.98));
  --btn-border: rgba(var(--danger-rgb), 0.88);
  --btn-border-hover: rgba(var(--danger-rgb), 0.96);
  --btn-color: rgba(255, 255, 255, 0.96);
  --btn-color-hover: rgba(255, 255, 255, 0.98);
  --btn-shadow:
    0 14px 28px rgba(var(--danger-rgb), 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  --btn-shadow-hover:
    0 16px 30px rgba(var(--danger-rgb), 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.btn-outline-danger {
  --btn-focus-rgb: var(--danger-rgb);
  --btn-bg: linear-gradient(180deg, rgba(252, 242, 244, 0.94), rgba(248, 226, 230, 0.82));
  --btn-bg-hover: linear-gradient(180deg, rgba(251, 236, 239, 0.98), rgba(244, 213, 219, 0.9));
  --btn-border: rgba(var(--danger-rgb), 0.22);
  --btn-border-hover: rgba(var(--danger-rgb), 0.34);
  --btn-color: rgba(var(--danger-rgb), 0.96);
  --btn-color-hover: rgba(var(--danger-rgb), 1);
  --btn-shadow:
    0 10px 22px rgba(var(--danger-rgb), 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --btn-shadow-hover:
    0 14px 28px rgba(var(--danger-rgb), 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.btn:disabled,
button:not([class]):disabled,
input[type='submit']:not([class]):disabled,
input[type='button']:not([class]):disabled,
.btn-primary:disabled,
.ghost:disabled,
.btn-danger:disabled,
.btn-outline-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.icon-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  line-height: 1;
  font-size: 20px;
  font-weight: 600;
}

.icon-btn--sm {
  width: 28px;
  height: 28px;
  font-size: 18px;
  border-radius: 8px;
}

.icon-btn__glyph {
  display: block;
  line-height: 1;
  transform: translateY(-1px);
}

.icon-btn--danger {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--danger);
}

.icon-btn--danger:hover,
.icon-btn--danger:focus-visible,
.icon-btn--danger:active {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.customize-row .btn-outline-danger,
.customize-row .btn-outline-danger:hover,
.customize-row .btn-outline-danger:focus-visible,
.customize-row .btn-outline-danger:active {
  padding: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.icon-btn--ok {
  background: rgba(var(--accent-rgb), 0.12);
  border-color: rgba(var(--accent-rgb), 0.55);
  color: var(--accent);
}

.icon-btn--ok:hover {
  background: rgba(var(--accent-rgb), 0.18);
  border-color: rgba(var(--accent-rgb), 0.85);
}

.lead-form .lead-object-inline-add-btn,
.lead-form .lead-object-inline-add-btn:hover,
.lead-form .lead-object-inline-add-btn:focus-visible,
.lead-form .lead-object-inline-add-btn:active,
.lead-object-edit .lead-object-inline-add-btn,
.lead-object-edit .lead-object-inline-add-btn:hover,
.lead-object-edit .lead-object-inline-add-btn:focus-visible,
.lead-object-edit .lead-object-inline-add-btn:active {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--accent);
}

.icon-btn--info {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}

.icon-btn--info:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.icon-btn--plus:hover,
.icon-btn--plus:focus-visible,
.icon-btn--plus:active {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
  box-shadow: none;
}

.icon-btn--plus-accent {
  width: var(--lead-inline-action-size, 34px);
  height: var(--lead-inline-action-size, 34px);
  background: transparent;
  border-color: transparent;
  color: var(--accent);
  box-shadow: none;
}

.icon-btn--plus-accent:hover,
.icon-btn--plus-accent:focus-visible,
.icon-btn--plus-accent:active {
  background: transparent;
  border-color: transparent;
  color: rgba(15, 23, 42, 0.92);
  box-shadow: none;
}

.icon-btn--plus-accent .icon-btn__glyph {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  transform: translateY(-1px);
}

.icon-btn--sm.icon-btn--plus-accent {
  width: var(--lead-inline-action-size, 34px);
  height: var(--lead-inline-action-size, 34px);
}

.icon-btn--sm.icon-btn--plus-accent .icon-btn__glyph {
  font-size: 30px;
}

.admin-shell {
  min-height: 100vh;
}

.admin-shell--auth {
  background: #ffffff;
}

.admin-shell--panel {
  background: var(--bg);
}

.admin-shell__topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(15, 23, 30, 0.92);
  backdrop-filter: blur(12px);
}

.admin-shell__topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.admin-shell__topbar-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-shell__admin {
  color: var(--text);
  font-weight: 600;
}

.admin-shell__main {
  display: grid;
  gap: 16px;
  padding-top: 24px;
  padding-bottom: 32px;
}

.admin-shell__main--auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}

.admin-shell__main--panel {
  width: min(1380px, calc(100% - 32px));
  padding-top: 18px;
  padding-bottom: 24px;
}

.admin-auth {
  width: min(100%, 400px);
  display: grid;
}

.admin-card {
  display: grid;
  gap: 14px;
}

.admin-auth .admin-card {
  padding: 22px 24px;
  border-radius: 18px;
  border-color: rgba(17, 24, 39, 0.1);
  box-shadow: 0 24px 48px rgba(17, 24, 39, 0.08);
}

.admin-card__head {
  display: grid;
  gap: 6px;
}

.admin-auth__hint {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.admin-panel {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 36px rgba(17, 24, 39, 0.08);
}

.admin-sidebar__head {
  display: grid;
  gap: 4px;
}

.admin-sidebar__email {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.admin-menu {
  display: grid;
  gap: 6px;
}

.admin-menu__link {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--text);
  background: rgba(16, 24, 40, 0.04);
  text-decoration: none;
}

.admin-menu__link:hover {
  background: rgba(16, 24, 40, 0.08);
  text-decoration: none;
}

.admin-sidebar__logout {
  margin-top: 6px;
}

.admin-sidebar__logout .btn {
  width: 100%;
}

.admin-inline-code {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.08);
  color: var(--text);
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.04em;
}

.admin-content {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.admin-inline-form {
  display: inline-flex;
}

.admin-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.admin-list__item {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.admin-list__primary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-badge {
  min-height: 27px;
  padding: 0 12px;
  font-size: 12px;
  --badge-color: rgba(30, 41, 59, 0.9);
  --badge-border: rgba(var(--badge-rgb), 0.19);
  --badge-bg-start: rgba(var(--badge-rgb), 0.18);
  --badge-bg-end: rgba(var(--badge-rgb), 0.08);
  padding-left: 14px;
}

.status-badge--tag {
  min-height: 28px;
  padding: 0 12px 0 16px;
  border-radius: 10px 14px 14px 10px;
  clip-path: polygon(11px 0, 100% 0, 100% 100%, 11px 100%, 0 50%);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 255, 255, 0.9)),
    linear-gradient(135deg, rgba(var(--badge-rgb), 0.2), rgba(var(--badge-rgb), 0.08));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 8px 18px rgba(15, 23, 42, 0.04);
}

.status-badge--tag::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 0 0 1.5px rgba(var(--badge-rgb), 0.3);
  transform: translateY(-50%);
}

.status-badge--green {
  --badge-rgb: var(--kanban-icon-success-rgb);
  --badge-color: var(--kanban-icon-success);
  --badge-border: rgba(var(--kanban-icon-success-rgb), 0.19);
  --badge-bg-start: rgba(var(--kanban-icon-success-rgb), 0.2);
  --badge-bg-end: rgba(var(--kanban-icon-success-rgb), 0.08);
}

.status-badge--red {
  --badge-rgb: var(--kanban-icon-danger-rgb);
  --badge-color: var(--kanban-icon-danger);
  --badge-border: rgba(var(--kanban-icon-danger-rgb), 0.19);
  --badge-bg-start: rgba(var(--kanban-icon-danger-rgb), 0.2);
  --badge-bg-end: rgba(var(--kanban-icon-danger-rgb), 0.08);
}

.status-badge--blue {
  --badge-rgb: var(--kanban-icon-info-rgb);
  --badge-color: var(--kanban-icon-info);
  --badge-border: rgba(var(--kanban-icon-info-rgb), 0.19);
  --badge-bg-start: rgba(var(--kanban-icon-info-rgb), 0.2);
  --badge-bg-end: rgba(var(--kanban-icon-info-rgb), 0.08);
}

.task-state-indicator {
  --task-indicator-rgb: 148, 163, 184;
  --task-indicator-color: rgba(71, 85, 105, 0.96);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 11px;
  border: 1px solid rgba(var(--task-indicator-rgb), 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.92)),
    linear-gradient(180deg, rgba(var(--task-indicator-rgb), 0.15), rgba(var(--task-indicator-rgb), 0.05));
  color: var(--task-indicator-color);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 18px rgba(15, 23, 42, 0.04);
}

.task-state-indicator--active {
  --task-indicator-rgb: var(--kanban-icon-success-rgb);
  --task-indicator-color: var(--kanban-icon-success);
  border-color: rgba(var(--task-indicator-rgb), 0.4);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 252, 247, 0.93)),
    linear-gradient(180deg, rgba(var(--task-indicator-rgb), 0.34), rgba(var(--task-indicator-rgb), 0.13));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 22px rgba(var(--kanban-icon-success-rgb), 0.16);
}

.task-state-indicator--overdue {
  --task-indicator-rgb: var(--kanban-icon-danger-rgb);
  --task-indicator-color: var(--kanban-icon-danger);
}

.task-state-indicator--today {
  --task-indicator-rgb: var(--kanban-icon-warning-rgb);
  --task-indicator-color: var(--kanban-icon-warning);
}

.task-state-indicator--done {
  --task-indicator-rgb: var(--kanban-icon-info-rgb);
  --task-indicator-color: var(--kanban-icon-info);
}

.task-state-indicator--completed {
  --task-indicator-rgb: var(--kanban-icon-info-rgb);
  --task-indicator-color: var(--kanban-icon-info);
}

.task-state-indicator--canceled {
  --task-indicator-rgb: var(--kanban-icon-muted-rgb);
  --task-indicator-color: var(--kanban-icon-muted);
}

.task-state-indicator--tomorrow {
  --task-indicator-rgb: var(--kanban-icon-info-rgb);
  --task-indicator-color: var(--kanban-icon-info);
}

.task-state-indicator__icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.task-state-indicator__icon svg {
  width: 15px;
  height: 15px;
  display: block;
  flex: 0 0 auto;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.kpi-grid--compact .kpi {
  min-height: 0;
  padding: 12px 14px;
}

.admin-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .admin-panel {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .admin-shell__topbar-inner {
    align-items: start;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .admin-shell__topbar-meta {
    justify-content: start;
  }
}

@media (max-width: 560px) {
  .admin-shell__main--auth {
    padding: 16px 0;
  }

  .admin-shell__main--panel {
    width: calc(100% - 20px);
    padding-top: 12px;
  }

  .admin-auth {
    width: 100%;
  }

  .admin-auth .admin-card {
    padding: 18px;
    border-radius: 14px;
  }
}

/* Compact page density: leads / deals / tasks */
body[data-page='leads'] .toolbar,
body[data-page='deals'] .toolbar {
  gap: 3px;
}

body[data-page='leads'] .toolbar__group,
body[data-page='deals'] .toolbar__group,
body[data-page='tasks'] .toolbar__group {
  gap: 3px;
}

body[data-page='leads'] .toolbar button,
body[data-page='leads'] .toolbar input,
body[data-page='leads'] .toolbar select,
body[data-page='deals'] .toolbar button,
body[data-page='deals'] .toolbar input,
body[data-page='deals'] .toolbar select {
  height: 34px;
  min-height: 34px;
  padding: 5px 8px;
}

body[data-page='leads'] .field-inline > span,
body[data-page='deals'] .field-inline > span {
  font-size: 13px;
}

body[data-page='leads'] .toolbar .field-inline.field-inline--search,
body[data-page='deals'] .toolbar .field-inline.field-inline--search {
  height: 34px;
  min-height: 34px;
  align-self: stretch;
}

body[data-page='leads'] .toolbar .field-inline.field-inline--search > input,
body[data-page='deals'] .toolbar .field-inline.field-inline--search > input {
  height: 34px;
  min-height: 34px;
  padding-top: 0;
  padding-bottom: 0;
  background-color: transparent;
  box-shadow: none;
}

body[data-page='leads'] .toolbar .field-inline.field-inline--search > input:hover,
body[data-page='deals'] .toolbar .field-inline.field-inline--search > input:hover {
  background-color: var(--field-bg-hover);
  border-color: var(--field-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

body[data-page='leads'] .toolbar .field-inline.field-inline--search > input:focus,
body[data-page='leads'] .toolbar .field-inline.field-inline--search > input:focus-visible,
body[data-page='deals'] .toolbar .field-inline.field-inline--search > input:focus,
body[data-page='deals'] .toolbar .field-inline.field-inline--search > input:focus-visible {
  background-color: transparent;
}

body[data-page='leads'] #leads-pipeline,
body[data-page='leads'] #leads-pipeline:hover,
body[data-page='leads'] #leads-pipeline:focus,
body[data-page='leads'] #leads-pipeline:focus-visible {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: none;
  color: rgba(15, 23, 42, 0.9);
  font-size: 15px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: none;
  appearance: none;
  -webkit-appearance: none;
}

body[data-page='leads'] #leads-pipeline:hover {
  background: rgba(248, 250, 252, 0.86);
  border-color: rgba(148, 163, 184, 0.28);
}

body[data-page='leads'] #leads-pipeline:focus,
body[data-page='leads'] #leads-pipeline:focus-visible {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(var(--accent-rgb), 0.34);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.1);
}

body[data-page='leads'] .toolbar .leads-toolbar-icon-btn,
body[data-page='leads'] .toolbar .leads-toolbar-icon-btn:hover,
body[data-page='leads'] .toolbar .leads-toolbar-icon-btn:active {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

body[data-page='leads'] .toolbar .leads-toolbar-icon-btn {
  color: rgba(176, 186, 198, 0.92);
}

body[data-page='leads'] .toolbar .leads-toolbar-icon-btn:hover,
body[data-page='leads'] .toolbar .leads-toolbar-icon-btn:active,
body[data-page='leads'] .toolbar .leads-toolbar-icon-btn:focus-visible {
  color: rgba(176, 186, 198, 0.92);
}

body[data-page='leads'] .toolbar .leads-toolbar-icon-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12);
}

body[data-page='leads'] .toolbar .leads-toolbar-icon-btn--filters.is-active,
body[data-page='leads'] .toolbar .leads-toolbar-icon-btn--filters.is-active:hover,
body[data-page='leads'] .toolbar .leads-toolbar-icon-btn--filters.is-active:focus-visible,
body[data-page='leads'] .toolbar .leads-toolbar-icon-btn--filters.is-active:active {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: rgba(176, 186, 198, 0.92);
}

body[data-page='leads'] #leads-view-toggle,
body[data-page='leads'] #leads-view-toggle:hover,
body[data-page='leads'] #leads-view-toggle:focus-visible,
body[data-page='leads'] #leads-view-toggle:active,
body[data-page='leads'] #leads-filters-toggle,
body[data-page='leads'] #leads-filters-toggle:hover,
body[data-page='leads'] #leads-filters-toggle:focus-visible,
body[data-page='leads'] #leads-filters-toggle:active {
  -webkit-appearance: none !important;
  appearance: none !important;
  border: 0 !important;
  border-color: transparent !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  outline: none !important;
}

body[data-page='leads'] #leads-view-toggle,
body[data-page='leads'] #leads-view-toggle:hover,
body[data-page='leads'] #leads-view-toggle:focus-visible,
body[data-page='leads'] #leads-view-toggle:active,
body[data-page='leads'] #leads-filters-toggle,
body[data-page='leads'] #leads-filters-toggle:hover,
body[data-page='leads'] #leads-filters-toggle:focus-visible,
body[data-page='leads'] #leads-filters-toggle:active {
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  line-height: 1 !important;
  align-self: stretch;
}

body[data-page='leads'] #leads-view-toggle,
body[data-page='leads'] #leads-view-toggle:hover,
body[data-page='leads'] #leads-view-toggle:focus-visible,
body[data-page='leads'] #leads-view-toggle:active {
  width: 34px !important;
  min-width: 34px !important;
}

body[data-page='leads'] .toolbar__meta,
body[data-page='deals'] .deals-pager__info,
body[data-page='tasks'] .tasks-pager .deals-pager__info {
  font-size: 11px;
}

body[data-page='leads'] .panel,
body[data-page='deals'] .panel {
  margin-top: 6px;
  padding: 6px;
}

body[data-page='tasks'] #tasks-filters-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  gap: 6px 8px;
  align-items: end;
  overflow-x: auto;
}

body[data-page='tasks'] #tasks-filters-panel > .form-row {
  display: contents;
}

body[data-page='tasks'] #tasks-filters-panel .form-row--filters-dates {
  margin-top: 0;
}

body[data-page='tasks'] #tasks-filters-panel .field {
  min-width: 0;
}

body[data-page='tasks'] #tasks-filters-panel .leads-filters-actions {
  grid-column: auto;
  margin-top: 0;
  justify-content: flex-end;
  white-space: nowrap;
}

body[data-page='leads'] #leads-filters-panel {
  display: grid;
  grid-template-columns: repeat(8, minmax(150px, 1fr)) auto;
  gap: 6px 8px;
  align-items: end;
  overflow-x: auto;
}

body[data-page='leads'] #leads-filters-panel > .form-row {
  display: contents;
}

body[data-page='leads'] #leads-filters-panel .form-row--filters-dates {
  margin-top: 0;
}

body[data-page='leads'] #leads-filters-panel .field {
  min-width: 0;
}

body[data-page='leads'] #leads-filters-panel .leads-filters-actions {
  grid-column: auto;
  margin-top: 0;
  justify-content: flex-end;
  white-space: nowrap;
}

body[data-page='leads'] .leads-board__meta {
  justify-content: flex-end;
  gap: 0;
  margin-bottom: 4px;
}

body[data-page='leads'] .leads-task-metrics-cluster {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-page='leads'] .leads-task-metrics-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  min-width: 0;
  padding: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
}

body[data-page='leads'] .leads-task-metrics-group--filters {
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-page='leads'] .leads-task-metrics-group--info {
  display: none;
}

body[data-page='leads'] .leads-task-metrics-group__kind {
  display: none;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

body[data-page='leads'] .leads-task-metrics-group__kind[data-group-kind='filters'] {
  color: rgba(19, 87, 60, 0.9);
  background: rgba(var(--accent-rgb), 0.1);
}

body[data-page='leads'] .leads-task-metrics-group__kind[data-group-kind='info'] {
  color: rgba(71, 85, 105, 0.76);
  background: rgba(148, 163, 184, 0.08);
}

body[data-page='leads'] .leads-task-metrics-group__kind-dot {
  width: 6px;
  min-width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.8;
}

body[data-page='leads'] .leads-task-metrics-group__kind-text {
  display: inline-flex;
  align-items: center;
}

body[data-page='leads'] .leads-task-metric__main {
  gap: 5px;
  min-height: 28px;
  padding: 4px 7px;
  border-radius: 10px;
  transition:
    padding 180ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease;
}

body[data-page='leads'] .leads-task-metric--loading::before {
  width: 60px;
  height: 28px;
  border-radius: 10px;
}

body[data-page='leads'] .leads-task-metric__value {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  min-width: 1ch;
}

body[data-page='leads'] .leads-task-metric__label {
  font-size: 10px;
  line-height: 1;
  max-width: 0;
  margin-left: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateX(-4px);
  white-space: nowrap;
  transition:
    max-width 220ms ease,
    margin-left 220ms ease,
    opacity 160ms ease,
    transform 160ms ease;
}

body[data-page='leads'] .leads-task-metric__content {
  gap: 0;
}

body[data-page='leads'] .leads-task-metric[data-metric-mode='filter'] .leads-task-metric__main {
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(248, 250, 252, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 1px 0 rgba(15, 23, 42, 0.025);
}

body[data-page='leads'] .leads-task-metric[data-metric-mode='filter'] .leads-task-metric__label {
  display: none;
}

body[data-page='leads'] .leads-task-metric[data-metric-mode='info'] .leads-task-metric__main {
  min-height: 24px;
  padding: 0 2px 0 4px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body[data-page='leads'] .leads-task-metric[data-metric-mode='info'] .leads-task-metric__icon {
  width: 14px;
  min-width: 14px;
  height: 14px;
  color: rgba(var(--metric-rgb), 0.72);
}

body[data-page='leads'] .leads-task-metric[data-metric-mode='info'] .leads-task-metric__value {
  color: rgba(51, 65, 85, 0.88);
  font-size: 12px;
}

body[data-page='leads'] .leads-task-metric[data-metric-mode='info'] .leads-task-metric__label {
  display: none;
}

body[data-page='leads'] .leads-task-metric[data-metric-mode='info']:hover .leads-task-metric__main,
body[data-page='leads'] .leads-task-metric[data-metric-mode='info']:focus-within .leads-task-metric__main {
  padding-right: 2px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body[data-page='leads'] .leads-task-metric[data-metric-mode='filter'].is-filter-selected .leads-task-metric__main {
  border-color: rgba(var(--metric-rgb), 0.34);
  background: rgba(var(--metric-rgb), 0.18);
  box-shadow:
    0 4px 12px rgba(15, 23, 42, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

body[data-page='leads'] .leads-task-metric[data-metric-mode='filter']:hover .leads-task-metric__main,
body[data-page='leads'] .leads-task-metric[data-metric-mode='filter']:focus-within .leads-task-metric__main {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(244, 247, 250, 0.96);
  box-shadow:
    0 6px 14px rgba(15, 23, 42, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

body[data-page='leads'] .leads-task-metric--loading::before {
  width: 42px;
  height: 28px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  background: rgba(246, 248, 251, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 1px 0 rgba(15, 23, 42, 0.025);
  animation: leads-task-metric-loading-pulse 1.1s ease-in-out infinite;
}

@keyframes leads-task-metric-loading-pulse {
  0%, 100% {
    opacity: 0.72;
    border-color: rgba(148, 163, 184, 0.18);
  }
  50% {
    opacity: 1;
    border-color: rgba(148, 163, 184, 0.3);
  }
}

@media (hover: none), (max-width: 980px) {
  body[data-page='leads'] .leads-board__meta {
    justify-content: flex-start;
  }

  body[data-page='leads'] .leads-task-metrics-cluster {
    width: 100%;
    justify-content: space-between;
  }

  body[data-page='leads'] .leads-task-metrics-group {
    flex: 1 1 100%;
    flex-wrap: wrap;
  }

  body[data-page='leads'] .leads-task-metrics-group--info {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }
}

body[data-page='leads'] .kanban__col {
  gap: 5px;
}

body[data-page='leads'] .kanban__col::before {
  display: none;
}

body[data-page='leads'] .kanban__col-body {
  gap: 5px;
}

body[data-page='leads'] .lead-card {
  padding: 5px 5px 5px 9px;
}

body[data-page='leads'] .lead-card__title,
body[data-page='leads'] .lead-card__top-left,
body[data-page='leads'] .lead-card__top-head {
  gap: 4px;
}

body[data-page='leads'] .lead-card__top,
body[data-page='leads'] .lead-card__indicators,
body[data-page='leads'] .lead-card__tags {
  gap: 6px;
}

body[data-page='leads'] .lead-card__indicators {
  gap: 4px 10px;
  padding: 6px 9px;
}

body[data-page='leads'] .lead-card__num {
  min-height: 0;
  padding: 0;
  font-size: 17px;
}

body[data-page='leads'] .lead-card:hover .lead-card__num {
  filter: saturate(1.08);
  transform: scale(1.06);
}

body[data-page='leads'] .lead-card {
  padding: 9px 9px 10px 13px;
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.88);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.68),
    0 4px 12px rgba(15, 23, 42, 0.035);
  transition:
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

body[data-page='leads'] .lead-card:hover {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 8px 18px rgba(15, 23, 42, 0.055);
}

body[data-page='leads'] .lead-card.lead-card--viewed-today {
  border-color: rgba(148, 163, 184, 0.2);
  border-color: color-mix(in srgb, var(--stage-color, #94a3b8) 12%, rgba(148, 163, 184, 0.16));
  background: color-mix(in srgb, var(--stage-color, #94a3b8) 8%, rgba(255, 255, 255, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 0 0 1px color-mix(in srgb, var(--stage-color, #94a3b8) 4%, rgba(255, 255, 255, 0.7)),
    0 3px 10px rgba(15, 23, 42, 0.032);
}

body[data-page='leads'] .lead-card.lead-card--viewed-today:hover {
  border-color: rgba(148, 163, 184, 0.24);
  border-color: color-mix(in srgb, var(--stage-color, #94a3b8) 18%, rgba(148, 163, 184, 0.18));
  background: color-mix(in srgb, var(--stage-color, #94a3b8) 10%, rgba(255, 255, 255, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 0 0 1px color-mix(in srgb, var(--stage-color, #94a3b8) 5%, rgba(255, 255, 255, 0.74)),
    0 7px 16px rgba(15, 23, 42, 0.046);
}

body[data-page='leads'] .lead-card::after {
  width: 4px;
  opacity: 0.82;
}

body[data-page='leads'] .lead-card::before {
  background: transparent;
  opacity: 0;
}

body[data-page='leads'] .lead-card.lead-card--viewed-today::before {
  background: transparent;
  opacity: 0;
}

body[data-page='leads'] .lead-card__title {
  gap: 7px;
}

body[data-page='leads'] .lead-card__top-head {
  width: 100%;
  justify-content: space-between;
  align-items: center;
}

body[data-page='leads'] .lead-card__top-head .icon-btn--plus {
  width: 29px;
  height: 24px;
  min-width: 29px;
  border-radius: 6px;
  border-color: transparent;
  background: transparent;
  color: rgba(15, 23, 42, 0.66);
  box-shadow: none;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateX(4px) scale(0.72);
  transform-origin: center;
  transition:
    opacity 170ms ease,
    transform 190ms cubic-bezier(0.2, 0.8, 0.2, 1),
    color 170ms ease,
    filter 170ms ease;
}

body[data-page='leads'] .lead-card:hover .lead-card__top-head .icon-btn--plus,
body[data-page='leads'] .lead-card:focus-within .lead-card__top-head .icon-btn--plus {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

body[data-page='leads'] .lead-card__top-head .icon-btn--plus:hover,
body[data-page='leads'] .lead-card__top-head .icon-btn--plus:focus-visible {
  border-color: transparent;
  background: transparent;
  color: var(--accent);
  filter: saturate(1.12);
}

body[data-page='leads'] .lead-card__top-head .icon-btn--plus .icon-btn__glyph {
  font-size: 31px;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-2px);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  body[data-page='leads'] .lead-card__top-head .icon-btn--plus .icon-btn__glyph {
    color: transparent;
    background-image: linear-gradient(
      120deg,
      rgba(17, 24, 39, 0.98) 0%,
      rgba(99, 102, 241, 0.86) 24%,
      rgba(59, 130, 246, 0.88) 48%,
      rgba(245, 158, 11, 0.9) 72%,
      rgba(236, 72, 153, 0.82) 100%
    );
    background-size: 220% 220%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: lead-modal-num-color-flow 18s ease-in-out infinite;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-page='leads'] .lead-card__num,
  body[data-page='leads'] .lead-card__top-head .icon-btn--plus,
  body[data-page='leads'] .lead-card__top-head .icon-btn--plus .icon-btn__glyph {
    animation: none;
    transition: none;
  }

  body[data-page='leads'] .lead-card:hover .lead-card__num {
    transform: none;
  }
}

body[data-page='leads'] .lead-card__indicators {
  padding: 4px 7px;
  border: 0;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.12);
  box-shadow: none;
}

body[data-page='leads'] .lead-card.lead-card--viewed-today .lead-card__indicators {
  background: rgba(255, 255, 255, 0.74);
}

body[data-page='leads'] .lead-card__fields {
  width: 100%;
  gap: 3px;
  padding-top: 7px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

body[data-page='leads'] .lead-card__name {
  width: 100%;
  color: rgba(15, 23, 42, 0.94);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.24;
  overflow-wrap: anywhere;
}

body[data-page='leads'] .lead-card__time {
  max-width: 100%;
  color: rgba(71, 85, 105, 0.78);
  font-size: 13px;
  line-height: 1.28;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-page='leads'] .lead-card__fields .lead-link {
  min-height: 27px;
  padding: 2px 6px;
  gap: 6px;
  border-radius: 6px;
  color: rgba(71, 85, 105, 0.86);
}

body[data-page='leads'] .lead-card__fields .lead-link:hover {
  background: rgba(15, 23, 42, 0.035);
  color: rgba(15, 23, 42, 0.9);
}

body[data-page='leads'] .lead-card__fields .lead-link__icon,
body[data-page='leads'] .lead-card__fields .lead-link__icon svg {
  width: 16px;
  height: 16px;
}

body[data-page='leads'] .lead-card__fields .lead-link__text {
  font-size: 13px;
  line-height: 1.28;
}

body[data-page='leads'] .lead-card__fields .lead-link--assignee {
  align-items: center;
  gap: 7px;
}

body[data-page='leads'] .lead-card__fields .lead-link--assignee .lead-link__icon,
body[data-page='leads'] .lead-card__fields .lead-link--assignee .lead-link__icon svg {
  width: 28px;
  height: 28px;
}

body[data-page='leads'] .lead-card__fields .lead-link--assignee .avatar--sm,
body[data-page='leads'] .lead-card__fields .lead-link--assignee .avatar-img--sm {
  width: 28px;
  height: 28px;
}

body[data-page='leads'] .lead-card__fields .lead-link--assignee .lead-link__text {
  display: grid;
  gap: 1px;
  justify-items: start;
  text-align: left;
  white-space: normal;
  line-height: 1.06;
}

body[data-page='leads'] .lead-card__fields .lead-link--assignee .lead-link__text-line {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-page='leads'] .lead-card__fields .lead-link--phone-search-match,
body[data-page='leads'] .lead-card__fields .lead-link--phone-search-partial,
body[data-page='leads'] .lead-card__fields .lead-link--phone-search-match:hover,
body[data-page='leads'] .lead-card__fields .lead-link--phone-search-partial:hover {
  background: rgba(250, 204, 21, 0.18);
  color: #7c4a03;
}

body[data-page='leads'] .lead-card__fields .lead-link--phone-search-exact,
body[data-page='leads'] .lead-card__fields .lead-link--phone-search-exact:hover {
  background: rgba(34, 197, 94, 0.16);
  color: #166534;
}

body[data-page='leads'] .lead-card__fields .lead-link--phone-duplicate,
body[data-page='leads'] .lead-card__fields .lead-link--phone-duplicate:hover {
  background: rgba(239, 68, 68, 0.14);
  color: #991b1b;
}

body[data-page='leads'] .lead-card__fields .lead-link--phone-duplicate .lead-link__text {
  color: #991b1b;
}

body[data-page='leads'] .lead-card__tags {
  gap: 4px;
}

body[data-page='leads'] .lead-card__tags .lead-tag {
  min-height: 22px;
  padding: 2px 8px;
  border-color: rgba(148, 163, 184, 0.28);
  border-radius: 5px;
  background: transparent;
  color: rgba(51, 65, 85, 0.9);
  font-size: 12px;
  font-weight: 650;
  box-shadow: none;
}

body[data-page='leads'] .lead-card__tags .lead-tag:hover {
  border-color: rgba(148, 163, 184, 0.38);
  background: transparent;
}

body[data-page='leads'] .lead-card__tags .lead-tag--colored {
  border-color: rgba(var(--tag-rgb), 0.42);
  background: transparent;
  color: rgba(var(--tag-rgb), 0.96);
}

body[data-page='leads'] .lead-card__tags .lead-tag--colored:hover {
  border-color: rgba(var(--tag-rgb), 0.58);
  background: transparent;
}

body[data-page='leads'] .lead-card__tags .lead-tag--outline,
body[data-page='leads'] .lead-card__tags .lead-tag--outline:hover {
  border-color: rgba(148, 163, 184, 0.34);
  background: transparent;
  color: rgba(51, 65, 85, 0.9);
}

body[data-page='deals'] .deals-stage-filters {
  gap: 6px;
}

body[data-page='deals'] .deal-stage-chip.deal-stage-chip--filter {
  padding-top: 3px;
  padding-bottom: 3px;
}

body[data-page='deals'] .deals-view-toggle {
  gap: 8px;
}

body[data-page='deals'] .deals-view-toggle__track {
  width: 36px;
  height: 20px;
}

body[data-page='deals'] .deals-view-toggle__thumb {
  width: 16px;
  height: 16px;
}

body[data-page='deals'] .deals-view-toggle__input:checked + .deals-view-toggle__track .deals-view-toggle__thumb {
  transform: translateX(16px);
}

body[data-page='deals'] .deals-view-toggle__label {
  font-size: 12px;
}

body[data-page='deals'] .toolbar,
body[data-page='deals'] .toolbar__group,
body[data-page='deals'] .toolbar__group--right,
body[data-page='deals'] .deals-view-switch {
  min-height: 34px;
  align-items: center;
}

body[data-page='deals'] #deals-structure-toggle {
  height: 34px;
  flex-basis: 34px;
}

body[data-page='deals'] .deals-stage-filters {
  min-height: 34px;
  align-items: center;
}

body[data-page='deals'] .deals-stage-filters .deal-stage-chip.deal-stage-chip--filter {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding-top: 0;
  padding-bottom: 0;
}

body[data-page='deals'] .deals-client-filter,
body[data-page='deals'] .deals-view-toggle {
  min-height: 34px;
}

body[data-page='deals'] .deals-client-filter {
  padding-left: 8px;
  padding-right: 8px;
}

body[data-page='deals'] .deals-pager {
  min-height: 30px;
  align-self: center;
}

body[data-page='leads'] .leads-pager,
body[data-page='deals'] .deals-pager,
body[data-page='tasks'] .tasks-pager {
  gap: 4px;
  margin-top: 8px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-page='leads'] .leads-pager {
  align-self: flex-end;
}

body[data-page='leads'] .toolbar__group--right .leads-pager {
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
}

body[data-page='deals'] .toolbar__group--right .deals-pager {
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
}

body[data-page='leads'] .leads-pager .ghost,
body[data-page='leads'] .leads-pager .deals-pager__page,
body[data-page='deals'] .deals-pager__page,
body[data-page='deals'] .ghost#deals-page-prev,
body[data-page='deals'] .ghost#deals-page-next,
body[data-page='tasks'] .tasks-pager .ghost,
body[data-page='tasks'] .tasks-pager .deals-pager__page {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 0;
  min-height: 34px;
  color: rgba(71, 85, 105, 0.96);
  background: rgba(255, 255, 255, 0.66);
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.08);
}

body[data-page='leads'] .leads-pager .ghost:hover,
body[data-page='leads'] .leads-pager .deals-pager__page:hover,
body[data-page='deals'] .deals-pager__page:hover,
body[data-page='deals'] .ghost#deals-page-prev:hover,
body[data-page='deals'] .ghost#deals-page-next:hover,
body[data-page='tasks'] .tasks-pager .ghost:hover,
body[data-page='tasks'] .tasks-pager .deals-pager__page:hover {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--text);
}

body[data-page='leads'] .leads-pager .deals-pager__page.is-current,
body[data-page='leads'] .leads-pager .deals-pager__page.is-current:hover,
body[data-page='deals'] .deals-pager__page.is-current,
body[data-page='deals'] .deals-pager__page.is-current:hover,
body[data-page='tasks'] .tasks-pager .deals-pager__page.is-current,
body[data-page='tasks'] .tasks-pager .deals-pager__page.is-current:hover {
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--text);
  box-shadow:
    inset 0 0 0 1px rgba(var(--accent-rgb), 0.14),
    0 4px 10px rgba(var(--accent-rgb), 0.08);
}

body[data-page='leads'] .leads-pager .deals-pager__info,
body[data-page='deals'] .deals-pager__info,
body[data-page='tasks'] .tasks-pager .deals-pager__info {
  min-width: 104px;
  padding: 0 6px;
  color: rgba(100, 116, 139, 0.96);
  font-size: 11px;
  font-weight: 700;
}

body[data-page='deals'] .deals-table th,
body[data-page='deals'] .deals-table td {
  padding: 4px 6px;
}

body[data-page='tasks'] .tasks-toolbar {
  padding: 2px 4px;
  gap: 8px;
}

body[data-page='tasks'] .tasks-head__summary {
  gap: 5px;
}

body[data-page='tasks'] .tasks-summary__badge-main {
  gap: 8px;
  min-height: 36px;
  padding: 5px 10px 5px 7px;
}

body[data-page='tasks'] .tasks-summary__badge-value {
  font-size: 15px;
}

body[data-page='tasks'] .tasks-summary__badge-label {
  font-size: 12px;
  line-height: 1.2;
}

body[data-page='tasks'] .tasks-board {
  padding: 6px;
}

body[data-page='tasks'] .tasks-table-grid th {
  padding: 5px 10px;
}

body[data-page='tasks'] .tasks-table-grid th[data-col-key='status'] {
  padding-left: 0;
  padding-right: 0;
}

body[data-page='tasks'] .tasks-table-grid__cell {
  min-height: 50px;
  padding: 5px 10px;
}

body[data-page='tasks'] .tasks-table-grid__cell--status {
  padding-left: 0;
  padding-right: 0;
}

body[data-page='tasks'] .tasks-table-grid__cell--title,
body[data-page='tasks'] .tasks-table-grid__cell--description,
body[data-page='tasks'] .tasks-table-grid__cell--relation,
body[data-page='tasks'] .tasks-table-grid__cell--responsible {
  padding-top: 7px;
  padding-bottom: 7px;
}

/* Deals stage filter dots/text: match tasks filter principle */
body[data-page='deals'] .deals-stage-filters .deal-stage-chip.deal-stage-chip--filter {
  color: rgba(51, 65, 85, 0.9);
  font-weight: 700;
}

body[data-page='deals'] .deals-stage-filters .deal-stage-chip.deal-stage-chip--filter:not(.is-active) {
  opacity: 0.92;
}

body[data-page='deals'] .deals-stage-filters .deal-stage-chip.deal-stage-chip--filter:hover {
  color: rgba(15, 23, 42, 0.96);
}

body[data-page='deals'] .deals-stage-filters .deal-stage-chip.deal-stage-chip--filter.is-active {
  color: rgba(15, 23, 42, 0.98);
}

body[data-page='deals'] .deals-stage-filters .deal-stage-chip__dot {
  background: rgba(var(--stage-rgb, var(--accent-rgb)), 0.78);
  opacity: 0.42;
  transform: none;
  box-shadow: none;
}

body[data-page='deals'] .deals-stage-filters .deal-stage-chip.deal-stage-chip--filter.has-color .deal-stage-chip__dot {
  background: rgba(var(--stage-rgb, var(--accent-rgb)), 0.78);
}

body[data-page='deals'] .deals-stage-filters .deal-stage-chip.deal-stage-chip--filter.is-active .deal-stage-chip__dot {
  opacity: 1;
  transform: none;
  background: rgb(var(--stage-rgb, var(--accent-rgb)));
  box-shadow: 0 0 0 3px rgba(var(--stage-rgb, var(--accent-rgb)), 0.18);
}

/* Global compact density: align the app with the CRM funnel/card scale. */
.page-head {
  gap: 8px;
  margin-bottom: 6px;
}

.shell .page-head {
  margin-bottom: 5px;
}

.toolbar,
.toolbar__group,
.actions,
.customize-bar__inner {
  gap: 4px;
}

.toolbar__meta {
  height: var(--ui-control-height);
  padding: 0 5px;
  font-size: 12px;
}

.card,
.panel,
.admin-card,
.settings-card,
.lead-block,
.task-modal__section,
.deal-modal__section {
  border-radius: var(--ui-radius-md);
}

.card {
  padding: var(--ui-card-padding);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.shell .card {
  border-radius: var(--ui-radius-sm);
  padding: 6px;
}

.form-row {
  gap: 3px;
}

.form-row--filters-dates,
.leads-filters-actions {
  margin-top: 5px;
}

.field {
  gap: 2px;
}

.field > span,
.field__head > span,
.field-inline > span {
  font-size: 13px;
  line-height: 1.15;
}

input,
select,
textarea,
button {
  border-radius: var(--ui-radius-sm);
}

input,
select {
  height: var(--ui-control-height);
  min-height: var(--ui-control-height);
  padding: 5px 8px;
  line-height: 1.25;
}

textarea {
  padding: 6px 8px;
  line-height: 1.35;
}

.select-like {
  height: var(--ui-control-height);
  min-height: var(--ui-control-height);
  padding-top: 5px;
  padding-bottom: 5px;
  border-radius: var(--ui-radius-sm);
}

input[type='checkbox'],
input[type='color'],
input.color-swatch {
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  border-radius: var(--ui-radius-sm);
}

input.color-swatch::-webkit-color-swatch,
input.color-swatch::-moz-color-swatch {
  border-radius: var(--ui-radius-sm);
}

.btn,
button:not([class]),
input[type='submit']:not([class]),
input[type='button']:not([class]),
.btn-primary,
.ghost,
.btn-danger,
.btn-outline-danger {
  gap: 6px;
  min-height: var(--ui-control-height);
  padding: 0 var(--ui-control-padding-x);
  border-radius: var(--ui-radius-sm);
  font-size: 13px;
}

.action-link {
  padding: 5px 0;
}

.icon-btn,
.lead-modal__action-btn,
.lead-modal__stage-switch {
  width: 32px;
  height: 32px;
  min-width: 32px;
  flex-basis: 32px;
  border-radius: var(--ui-radius-sm);
}

.icon-btn--sm {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: var(--ui-radius-sm);
}

.choice,
.choice--compact {
  height: var(--ui-control-height);
  border-radius: var(--ui-radius-sm);
}

.choice__item > span {
  padding: 0 8px;
}

.menu__item,
.sidebar__bottom .gear-btn,
.sidebar__bottom .sidebar-action {
  min-height: 32px;
  height: 32px;
  padding: 3px 7px;
  border-radius: var(--ui-radius-sm);
  gap: 7px;
}

.lead-tag-menu,
.lead-card-menu,
.lead-assignee-menu,
.leads-add-menu,
.dt-menu,
.leads-filter-menu {
  padding: 6px;
  gap: 5px;
  border-radius: var(--ui-radius-md);
}

.lead-card-menu__item,
.lead-tag-menu__item,
.leads-filter-menu__item {
  padding: 5px 7px;
  border-radius: var(--ui-radius-sm);
}

.lead-assignee-menu .lead-card-menu__item {
  min-height: 38px;
  padding: 6px 8px;
  border-radius: var(--ui-radius-sm);
}

.leads-add-menu .lead-card-menu__item,
.leads-add-menu__item {
  min-height: 46px;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  padding: 8px 9px;
  border-radius: var(--ui-radius-md);
}

.leads-add-menu__item-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--ui-radius-md);
}

.kanban__col {
  border-radius: var(--ui-radius-md);
  padding: 5px 1px;
  gap: 4px;
}

.shell .kanban__col {
  border-radius: var(--ui-radius-sm);
  padding: 5px 1px;
}

.kanban__col-head,
.kanban__col-meta {
  padding-left: 8px;
  padding-right: 8px;
}

.kanban__col-strip,
.kanban__col-meta {
  min-height: 26px;
  border-radius: var(--ui-radius-sm);
}

.kanban__col-strip .kanban__count-badge,
.kanban__col-strip .kanban__tags-badge,
.kanban__col-strip .kanban__col-timer,
.kanban__col-meta .badge {
  min-height: 22px;
  padding: 0 6px;
  border-radius: var(--ui-radius-sm);
}

body[data-page='leads'] .kanban__col-body {
  gap: 4px;
}

body[data-page='leads'] .lead-card {
  padding: 7px 7px 8px 11px;
  border-radius: var(--ui-radius-md);
}

body[data-page='leads'] .lead-card__title {
  gap: 5px;
}

body[data-page='leads'] .lead-card__fields {
  gap: 2px;
  padding-top: 5px;
}

body[data-page='leads'] .lead-card__name {
  font-size: 14px;
}

body[data-page='leads'] .lead-card__time,
body[data-page='leads'] .lead-card__fields .lead-link__text {
  font-size: 12px;
}

body[data-page='leads'] .lead-card__indicators {
  gap: 3px 8px;
  padding: 3px 6px;
  border-radius: var(--ui-radius-sm);
}

body[data-page='leads'] .lead-card__fields .lead-link {
  min-height: 24px;
  padding: 1px 5px;
  border-radius: var(--ui-radius-sm);
}

body[data-page='leads'] .lead-card__tags .lead-tag {
  min-height: 20px;
  padding: 1px 6px;
  border-radius: var(--ui-radius-xs);
  font-size: 11px;
}

.lead-modal__panel {
  border-radius: var(--ui-radius-md);
}

.shell .lead-modal__panel {
  border-radius: var(--ui-radius-sm);
}

.lead-modal__header {
  gap: 6px;
  padding: 6px;
}

.shell .lead-modal__header {
  padding: 5px;
}

.lead-modal__body {
  gap: 6px;
  padding: 6px;
}

.shell .lead-modal__body {
  gap: 5px;
  padding: 5px;
}

.lead-modal__side {
  gap: 6px;
}

.lead-modal__side--right {
  padding: 5px;
  border-radius: var(--ui-radius-md);
}

.lead-modal__tabs {
  min-height: 34px;
  padding: 3px;
  border-radius: var(--ui-radius-sm);
}

.lead-modal__tab {
  min-height: 28px;
  padding: 5px 6px 5px 8px;
  border-radius: var(--ui-radius-sm);
  font-size: 11px;
}

.lead-modal__tab-count {
  height: 17px;
  min-width: 18px;
  padding: 0 5px;
  border-radius: var(--ui-radius-xs);
  font-size: 10px;
}

.lead-modal__side--right .lead-modal__tab-content,
.lead-modal__details,
.lead-modal__profile-block,
.lead-modal__meta--object-details,
.lead-block,
.lead-source-tab,
.lead-meta-card {
  border-radius: var(--ui-radius-md);
}

.lead-modal__details,
.lead-source-tab {
  padding: 6px;
}

.lead-modal__profile-block,
.lead-modal__meta--object-details {
  gap: 6px;
  padding: 8px;
}

.lead-modal__meta,
.lead-modal__meta-row,
.lead-source-tab__row {
  gap: 6px;
}

.lead-modal__meta-val {
  --lead-inline-action-size: 30px;
}

.lead-modal__metrics {
  min-height: 34px;
  padding: 4px;
  gap: 4px;
  border-radius: var(--ui-radius-md);
}

.lead-metric {
  min-height: 28px;
  padding: 3px 7px;
  border-radius: var(--ui-radius-sm);
}

.lead-metric--warn,
.lead-metric--danger {
  width: 28px;
  height: 28px;
  min-height: 28px;
}

.deal-modal__panel {
  --deal-modal-panel-radius: var(--ui-radius-md);
}

.shell .deal-modal__panel {
  --deal-modal-panel-radius: var(--ui-radius-sm);
}

.deal-modal__header,
.deal-modal__body,
.deal-modal__section,
.task-modal__panel,
.task-modal__body,
.task-modal__section {
  gap: 6px;
}

.task-modal__section,
.deal-modal__section {
  padding: 8px;
}

body[data-page='leads'] .toolbar button,
body[data-page='leads'] .toolbar input,
body[data-page='leads'] .toolbar select,
body[data-page='deals'] .toolbar button,
body[data-page='deals'] .toolbar input,
body[data-page='deals'] .toolbar select,
body[data-page='goods-services'] .toolbar button,
body[data-page='goods-services'] .toolbar input,
body[data-page='goods-services'] .toolbar select,
body[data-page='tasks'] .toolbar button,
body[data-page='tasks'] .toolbar input,
body[data-page='tasks'] .toolbar select {
  height: var(--ui-control-height);
  min-height: var(--ui-control-height);
  padding: 5px 8px;
}

body[data-page='leads'] #leads-refresh,
body[data-page='deals'] #deals-refresh,
body[data-page='deals'] #deals-structure-toggle,
body[data-page='goods-services'] #goods-services-refresh,
body[data-page='goods-services'] #goods-services-structure-toggle,
body[data-page='leads'] #leads-view-toggle,
body[data-page='leads'] #leads-filters-toggle {
  width: 32px !important;
  min-width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  flex-basis: 32px;
}

body[data-page='leads'] .leads-pager .ghost,
body[data-page='leads'] .leads-pager .deals-pager__page,
body[data-page='deals'] .deals-pager__page,
body[data-page='deals'] .ghost#deals-page-prev,
body[data-page='deals'] .ghost#deals-page-next,
body[data-page='tasks'] .tasks-pager .ghost,
body[data-page='tasks'] .tasks-pager .deals-pager__page {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  border-radius: var(--ui-radius-sm);
}

/* Final radius clamp: keep the whole product on the same compact radius scale. */
:where(
  .card,
  .panel,
  [class*='card'],
  [class*='panel'],
  [class*='section'],
  [class*='block'],
  [class*='box'],
  [class*='menu'],
  [class*='modal__panel'],
  [class*='modal__body'],
  [class*='modal__section'],
  [class*='popover'],
  [class*='dropdown'],
  [class*='notice'],
  [class*='banner']
) {
  border-radius: var(--ui-radius-md) !important;
}

:where(
  button,
  input:not([type='radio']),
  select,
  textarea,
  .btn,
  .btn-primary,
  .ghost,
  .select-like,
  .choice,
  [class*='btn'],
  [class*='button'],
  [class*='toggle'],
  [class*='tab'],
  [class*='item'],
  [class*='chip'],
  [class*='badge'],
  [class*='pill'],
  [class*='tag'],
  [class*='control']
) {
  border-radius: var(--ui-radius-sm) !important;
}

:where(
  .lead-tag,
  .lead-card__tags .lead-tag,
  [class*='swatch']
) {
  border-radius: var(--ui-radius-xs) !important;
}

:where(
  .avatar,
  [class*='avatar'],
  [class*='dot'],
  [class*='thumb'],
  [class*='spinner'],
  input[type='radio'],
  .uniform-scrollbar-track,
  .uniform-scrollbar-thumb
) {
  border-radius: 999px !important;
}

/* Kanban header metrics: keep cards, tags and timer icons visually one size. */
.kanban__col-strip {
  --kanban-header-metric-icon-size: 15px;
}

.kanban__col-strip .kanban__count-badge-dot,
.kanban__col-strip .kanban__tags-badge-label,
.kanban__col-strip .kanban__col-timer-icon,
.kanban__col-strip .kanban__col-timer-image {
  width: var(--kanban-header-metric-icon-size) !important;
  min-width: var(--kanban-header-metric-icon-size) !important;
  height: var(--kanban-header-metric-icon-size) !important;
}

.kanban__col-strip .kanban__count-badge-dot,
.kanban__col-strip .kanban__tags-badge-label,
.kanban__col-strip .kanban__col-timer-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 var(--kanban-header-metric-icon-size);
  transform: none;
}

.kanban__col-strip .kanban__count-badge-dot,
.kanban__col-strip .kanban__tags-badge-label,
.kanban__col-strip .kanban__col-timer-image {
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-position: center;
  mask-position: center;
}

.kanban__col-strip .kanban__tags-badge-label {
  --kanban-header-tag-icon-size: 14px;
  width: var(--kanban-header-metric-icon-size) !important;
  min-width: var(--kanban-header-metric-icon-size) !important;
  height: var(--kanban-header-metric-icon-size) !important;
  flex: 0 0 var(--kanban-header-metric-icon-size);
  -webkit-mask-size: var(--kanban-header-tag-icon-size) var(--kanban-header-tag-icon-size);
  mask-size: var(--kanban-header-tag-icon-size) var(--kanban-header-tag-icon-size);
}
