/* CRM v2 redesign — dark shell, top nav, dashboard */
.crm-v2-shell {
  --crm-bg-start: #131A26;
  --crm-bg-end: #080B11;
  --crm-surface: rgba(17, 22, 34, 0.702);
  --crm-surface-hover: rgba(17, 22, 34, 0.82);
  --crm-surface-solid: #111622;
}

#dashboard-screen.crm-fullscreen {
  min-height: 100dvh;
}

#dashboard-screen.crm-fullscreen > .header {
  display: none !important;
}

#dashboard-screen.crm-fullscreen .dashboard-main,
#dashboard-screen.crm-fullscreen #section-view {
  min-height: 100dvh;
}

body.crm-fullscreen-active {
  background: #080B11;
}

body.crm-fullscreen-active:not(.theme-dark) {
  background: #eef2f7;
}

body.crm-fullscreen-active .bg-blobs {
  display: none !important;
}

body.crm-fullscreen-active .privacy-fab {
  display: none !important;
}

.dashboard-main.crm-layout-active {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

#section-view.crm-active {
  padding-top: 0;
  width: 100%;
}

#section-view.crm-active .back-btn {
  display: none;
}

.crm-v2-shell {
  margin: 0;
  width: 100%;
  min-height: 100dvh;
  background: radial-gradient(ellipse 100% 78% at 50% 40%, var(--crm-bg-start) 0%, var(--crm-bg-end) 100%);
  border-radius: 0;
  overflow: hidden;
  color: #e8eaed;
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
}

.crm-v2-shell::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 52% 38% at 50% 36%, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.035) 32%, transparent 68%);
}

.crm-v2-topbar,
.crm-v2-main {
  position: relative;
  z-index: 1;
}

#dashboard-screen.crm-fullscreen .crm-v2-shell {
  height: 100dvh;
}

#dashboard-screen.crm-fullscreen .crm-v2-main {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.crm-v2-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(17, 20, 24, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  z-index: 40;
  flex-wrap: wrap;
}

.crm-v2-topbar-start {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.crm-v2-logo-btn {
  border: 0;
  background: transparent;
  padding: 4px 8px 4px 0;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 8px;
  transition: background 0.15s ease, transform 0.12s ease;
}

.crm-v2-logo-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.crm-v2-logo-btn:active {
  background: rgba(0, 179, 65, 0.16);
  transform: scale(0.97);
}

.crm-v2-logo-img {
  height: 28px;
  width: auto;
  display: block;
}

.crm-v2-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  min-width: 0;
}

.crm-v2-nav-link {
  border: 0;
  background: transparent;
  color: #9aa0a6;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 8px;
  position: relative;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.crm-v2-nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.crm-v2-nav-link:active {
  color: var(--primary);
  background: rgba(0, 179, 65, 0.22);
  transform: scale(0.97);
}

.crm-v2-nav-link.is-active {
  color: var(--primary);
  background: rgba(0, 179, 65, 0.12);
}

.crm-v2-nav-link.is-active::after {
  content: '';
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 2px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

.crm-v2-more-wrap {
  position: relative;
}

.crm-v2-more-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 160px;
  padding: 6px;
  background: rgba(17, 22, 34, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  z-index: 50;
}

.crm-v2-more-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #e8eaed;
  font: inherit;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.crm-v2-more-item:hover,
.crm-v2-more-item.is-active {
  background: rgba(0, 179, 65, 0.12);
  color: var(--primary);
}

.crm-v2-more-item:active {
  background: rgba(0, 179, 65, 0.24);
  transform: scale(0.98);
}

.crm-v2-topbar-end {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.crm-v2-icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.07) 0%, rgba(17, 22, 34, 0.92) 72%);
  color: #c4c7cc;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.crm-v2-icon-btn:hover {
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
  background: radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.12) 0%, #22262e 72%);
}

.crm-v2-icon-btn:active {
  border-color: rgba(0, 179, 65, 0.55);
  color: var(--primary);
  background: radial-gradient(circle at 50% 42%, rgba(0, 179, 65, 0.35) 0%, rgba(0, 179, 65, 0.14) 72%);
  transform: scale(0.92);
  box-shadow: 0 0 0 3px rgba(0, 179, 65, 0.18);
}

.crm-v2-theme-btn .icon-theme-sun {
  display: none;
}

.crm-v2-theme-btn .icon-theme-moon {
  display: block;
}

body.theme-dark .crm-v2-theme-btn .icon-theme-moon {
  display: none;
}

body.theme-dark .crm-v2-theme-btn .icon-theme-sun {
  display: block;
}

.crm-v2-icon-btn svg {
  width: 18px;
  height: 18px;
}

.crm-v2-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.crm-v2-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  border: 1px solid rgba(0, 179, 65, 0.35);
  background: rgba(0, 179, 65, 0.08);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.crm-v2-user-pill:hover {
  background: rgba(0, 179, 65, 0.14);
  border-color: rgba(0, 179, 65, 0.5);
}

.crm-v2-user-pill:active {
  background: rgba(0, 179, 65, 0.24);
  border-color: rgba(0, 179, 65, 0.75);
  transform: scale(0.97);
  box-shadow: 0 0 0 3px rgba(0, 179, 65, 0.16);
}

.crm-v2-main {
  padding: 20px 24px 32px;
  width: 100%;
}

.crm-v2-page {
  max-width: none;
  width: 100%;
}

.crm-v2-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.crm-v2-page-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.crm-v2-page-bar {
  width: 4px;
  height: 22px;
  border-radius: 4px;
  background: var(--primary);
  flex-shrink: 0;
}

.crm-v2-page-meta {
  font-size: 13px;
}

.crm-v2-block-head {
  margin-top: 8px;
}

.crm-v2-dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.crm-v2-dashboard {
  max-width: none;
}

.crm-v2-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.crm-v2-stats-compact {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.crm-v2-stat-card {
  position: relative;
  background: var(--crm-surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 18px 18px 52px;
  min-width: 0;
  min-height: 148px;
  overflow: hidden;
}

.crm-v2-stat-icon-wrap {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.04);
}

.crm-v2-icon-btn svg,
.crm-v2-icon-btn .crm-v2-icon {
  width: 20px;
  height: 20px;
}

.crm-v2-icon {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}

.crm-v2-section-icon .crm-v2-icon {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.crm-v2-stat-icon-wrap .crm-v2-icon {
  width: 22px;
  height: 22px;
}

.crm-v2-stat-card.is-green .crm-v2-stat-icon-wrap .crm-v2-icon { color: var(--primary); }
.crm-v2-stat-card.is-orange .crm-v2-stat-icon-wrap .crm-v2-icon { color: #fb923c; }
.crm-v2-stat-card.is-blue .crm-v2-stat-icon-wrap .crm-v2-icon { color: #60a5fa; }
.crm-v2-stat-card.is-teal .crm-v2-stat-icon-wrap .crm-v2-icon { color: #2dd4bf; }

.crm-v2-stat-icon-wrap .ui-icon,
.crm-v2-stat-icon-wrap svg:not(.crm-v2-icon) {
  width: 22px;
  height: 22px;
}

.crm-v2-stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  letter-spacing: -0.02em;
}

.crm-v2-stat-label {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.crm-v2-stat-sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #9aa0a6;
}

.crm-v2-stat-sub.is-accent {
  color: var(--primary);
  font-weight: 600;
}

.crm-v2-stat-visual {
  position: absolute;
  right: 14px;
  bottom: 12px;
  pointer-events: none;
}

.crm-v2-stat-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.crm-v2-stat-badge.is-green {
  background: rgba(0, 179, 65, 0.14);
  color: #00b341;
}

.crm-v2-stat-badge.is-amber {
  background: rgba(251, 191, 36, 0.14);
  color: #fbbf24;
}

.crm-v2-team-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.crm-v2-team-toolbar {
  align-items: stretch;
}

.crm-v2-team-search-wrap {
  flex: 1;
  min-width: 220px;
  max-width: 420px;
}

.crm-v2-team-add {
  margin-left: auto;
  white-space: nowrap;
}

.crm-v2-team-table-wrap {
  margin-top: 4px;
}

.crm-v2-team-person {
  display: flex;
  align-items: center;
  gap: 12px;
}

.crm-v2-team-person strong {
  font-weight: 600;
  color: #fff;
}

.crm-v2-team-avatar {
  flex-shrink: 0;
}

.crm-v2-team-email {
  color: #9aa0a6;
  font-size: 13px;
}

.crm-v2-team-role,
.crm-v2-team-dept {
  font-size: 13px;
  color: #e8eaed;
}

.crm-v2-team-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  white-space: nowrap;
}

.crm-v2-team-actions .crm-v2-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #9aa0a6;
}

.crm-v2-team-actions .crm-v2-icon-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 900px) {
  .crm-v2-team-stats {
    grid-template-columns: 1fr;
  }

  .crm-v2-team-add {
    width: 100%;
    margin-left: 0;
  }

  .crm-v2-team-setup-grid {
    grid-template-columns: 1fr;
  }

  .crm-v2-team-perm-row {
    flex-wrap: wrap;
  }
}

.crm-v2-team-setup-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.crm-v2-team-role-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.crm-v2-team-role-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(15, 17, 21, 0.72);
  color: #e8eaed;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.crm-v2-team-role-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.crm-v2-team-role-card.is-active {
  border-color: rgba(0, 179, 65, 0.55);
  background: rgba(0, 179, 65, 0.08);
  box-shadow: inset 0 0 0 1px rgba(0, 179, 65, 0.2);
}

.crm-v2-team-role-radio {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  flex: none;
  position: relative;
}

.crm-v2-team-role-card.is-active .crm-v2-team-role-radio {
  border-color: var(--primary);
}

.crm-v2-team-role-card.is-active .crm-v2-team-role-radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--primary);
}

.crm-v2-team-role-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.crm-v2-team-role-body strong {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.crm-v2-team-role-body small {
  font-size: 12px;
  line-height: 1.45;
  color: #9aa0a6;
}

.crm-v2-team-perms-table-wrap {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(17, 22, 34, 0.55);
}

.crm-v2-team-perms-table {
  width: 100%;
  border-collapse: collapse;
}

.crm-v2-team-perms-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #9aa0a6;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

.crm-v2-team-perms-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.crm-v2-team-perms-table tbody tr:last-child td {
  border-bottom: none;
}

.crm-v2-team-perm-module {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  width: 140px;
}

.crm-v2-team-perm-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 24px;
}

.crm-v2-team-perm-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.crm-v2-team-perm-label {
  font-size: 12px;
  color: #9aa0a6;
  min-width: 84px;
}

.crm-v2-team-create-foot .crm-v2-lead-layer-foot-inner {
  justify-content: flex-start;
  gap: 12px;
}

.crm-v2-team-row {
  cursor: pointer;
}

.crm-v2-team-detail-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.crm-v2-team-back {
  align-self: flex-start;
  padding-left: 0;
}

.crm-v2-team-detail-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.crm-v2-team-detail-card {
  padding: 24px 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--crm-surface);
}

.crm-v2-team-detail-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  margin-bottom: 20px;
}

.crm-v2-team-detail-identity h3 {
  margin: 0;
  font-size: 1.15rem;
  color: #fff;
}

.crm-v2-team-detail-avatar {
  width: 88px;
  height: 88px;
  font-size: 1.6rem;
}

.crm-v2-team-detail-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.crm-v2-team-detail-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.crm-v2-team-detail-row > span {
  font-size: 11px;
  color: #9aa0a6;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.crm-v2-team-detail-row strong {
  font-size: 13px;
  color: #e8eaed;
  font-weight: 500;
}

.crm-v2-team-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.crm-v2-team-detail-actions .btn {
  width: 100%;
  justify-content: center;
}

.crm-v2-team-detail-section h4 {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.crm-v2-team-detail-section + .crm-v2-team-detail-section {
  margin-top: 28px;
}

.crm-v2-team-detail-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.crm-v2-team-detail-stat {
  padding: 18px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(17, 22, 34, 0.72);
}

.crm-v2-team-detail-stat strong {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-bottom: 8px;
}

.crm-v2-team-detail-stat span {
  display: block;
  font-size: 12px;
  color: #9aa0a6;
  line-height: 1.4;
}

.crm-v2-team-conversion-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  color: #00b341;
  background: rgba(0, 179, 65, 0.14);
}

.crm-v2-team-activity-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(17, 22, 34, 0.55);
}

.crm-v2-team-activity-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.crm-v2-team-activity-item:last-child {
  border-bottom: none;
}

.crm-v2-team-activity-item time {
  font-size: 12px;
  color: #9aa0a6;
  white-space: nowrap;
}

.crm-v2-team-activity-item strong {
  display: block;
  font-size: 13px;
  color: #fff;
  margin-bottom: 2px;
}

.crm-v2-team-activity-item .muted {
  font-size: 12px;
}

.crm-v2-team-login {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.crm-v2-team-login strong {
  font-size: 13px;
  color: #fff;
}

.crm-v2-team-login small {
  font-size: 11px;
}

.crm-v2-client-access-card {
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: 12px;
  padding: 16px 18px;
}

.crm-v2-client-access-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.crm-v2-client-cred-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.crm-v2-client-cred-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

.crm-v2-client-access-current {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 4px;
}

@media (max-width: 1100px) {
  .crm-v2-team-detail-layout {
    grid-template-columns: 1fr;
  }

  .crm-v2-team-detail-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .crm-v2-team-detail-stats {
    grid-template-columns: 1fr;
  }

  .crm-v2-team-activity-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

.crm-v2-stat-spark,
.crm-v2-stat-bars {
  width: 88px;
  height: 36px;
  display: block;
}

.crm-v2-stat-ring {
  width: 40px;
  height: 40px;
  display: block;
}

.crm-v2-stat-avatars {
  display: inline-flex;
  align-items: center;
}

.crm-v2-stat-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #2a3140;
  border: 2px solid var(--crm-bg-end);
  margin-left: -8px;
}

.crm-v2-stat-avatar:first-child {
  margin-left: 0;
}

.crm-v2-stat-avatars-empty {
  color: #6b7280;
  font-size: 12px;
}

.crm-v2-stat-card.is-green { border-color: rgba(0, 179, 65, 0.18); }
.crm-v2-stat-card.is-green .crm-v2-stat-icon-wrap { background: rgba(0, 179, 65, 0.12); color: var(--primary); }
.crm-v2-stat-card.is-orange { border-color: rgba(251, 146, 60, 0.18); }
.crm-v2-stat-card.is-orange .crm-v2-stat-icon-wrap { background: rgba(251, 146, 60, 0.12); color: #fb923c; }
.crm-v2-stat-card.is-blue { border-color: rgba(96, 165, 250, 0.18); }
.crm-v2-stat-card.is-blue .crm-v2-stat-icon-wrap { background: rgba(96, 165, 250, 0.12); color: #60a5fa; }
.crm-v2-stat-card.is-teal { border-color: rgba(45, 212, 191, 0.18); }
.crm-v2-stat-card.is-teal .crm-v2-stat-icon-wrap { background: rgba(45, 212, 191, 0.12); color: #2dd4bf; }

.crm-v2-sections-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.crm-v2-section-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  padding: 16px 14px 14px;
  min-height: 118px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--crm-surface);
  color: inherit;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.crm-v2-section-card:hover {
  border-color: rgba(0, 179, 65, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  background: rgba(17, 22, 34, 0.92);
}

.crm-v2-section-card:active {
  border-color: rgba(0, 179, 65, 0.55);
  background: rgba(0, 179, 65, 0.14);
  transform: scale(0.98);
  box-shadow: 0 0 0 3px rgba(0, 179, 65, 0.14);
}

.crm-v2-section-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(0, 179, 65, 0.12);
  border: 1px solid rgba(0, 179, 65, 0.18);
  flex-shrink: 0;
}

.crm-v2-section-body {
  flex: 1;
  min-width: 0;
  padding-right: 4px;
}

.crm-v2-section-body strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
}

.crm-v2-section-body small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.35;
  color: #9aa0a6;
}

.crm-v2-section-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.crm-v2-section-badge.is-green {
  background: rgba(0, 179, 65, 0.14);
  color: var(--primary);
}

.crm-v2-section-badge.is-blue {
  background: rgba(96, 165, 250, 0.14);
  color: #60a5fa;
}

.crm-v2-section-badge.is-amber {
  background: rgba(251, 191, 36, 0.14);
  color: #fbbf24;
}

.crm-v2-section-badge.is-muted {
  background: rgba(255, 255, 255, 0.06);
  color: #9aa0a6;
}

.crm-v2-activity-feed {
  background: var(--crm-surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 4px 0;
}

.crm-v2-activity-item {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.crm-v2-activity-item:last-child {
  border-bottom: 0;
}

.crm-v2-activity-time {
  flex: 0 0 52px;
  width: 52px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: #9aa0a6;
  padding-right: 14px;
  margin-right: 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.crm-v2-activity-body {
  flex: 1;
  min-width: 0;
}

.crm-v2-activity-title {
  display: block;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.crm-v2-activity-meta {
  margin: 3px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: #9aa0a6;
}

.crm-v2-activity-meta span,
.crm-v2-activity-meta strong {
  display: inline;
  font-size: inherit;
  line-height: inherit;
}

.crm-v2-activity-accent {
  color: var(--primary);
  font-weight: 600;
}

.crm-v2-activity-sep {
  color: #6b7280;
}

.crm-v2-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.crm-v2-toolbar-end {
  justify-content: flex-end;
}

.crm-v2-search {
  flex: 1;
  min-width: 200px;
  max-width: 420px;
}

.crm-v2-search .field-input,
.crm-v2-search input {
  background: var(--crm-surface);
  border-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.crm-v2-table-wrap {
  margin-bottom: 20px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.crm-v2-table {
  background: var(--crm-surface);
}

.crm-v2-table th {
  color: #9aa0a6;
  font-size: 12px;
  font-weight: 600;
}

.crm-v2-table td {
  color: #e8eaed;
  border-color: rgba(255, 255, 255, 0.04);
}

.crm-v2-status-pill {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 179, 65, 0.12);
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
}

.crm-v2-status-pill.is-green { background: rgba(0, 179, 65, 0.14); color: #00b341; }
.crm-v2-status-pill.is-amber { background: rgba(251, 191, 36, 0.14); color: #fbbf24; }
.crm-v2-status-pill.is-orange { background: rgba(251, 146, 60, 0.14); color: #fb923c; }
.crm-v2-status-pill.is-teal { background: rgba(45, 212, 191, 0.14); color: #2dd4bf; }
.crm-v2-status-pill.is-red { background: rgba(248, 113, 113, 0.14); color: #f87171; }
.crm-v2-status-pill.is-muted { background: rgba(255, 255, 255, 0.06); color: #9aa0a6; }

.crm-v2-source-pill {
  display: inline-block;
  margin-left: 8px;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #9aa0a6;
  vertical-align: middle;
}

.crm-v2-lead-title-cell {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.crm-v2-filter-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.crm-v2-chip {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #c4c7cc;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.crm-v2-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.crm-v2-chip.is-active {
  background: rgba(0, 179, 65, 0.14);
  border-color: rgba(0, 179, 65, 0.35);
  color: var(--primary);
}

.crm-v2-funnel-toolbar {
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 5;
}

.crm-v2-leads-toolbar {
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  position: relative;
  z-index: 5;
}

.crm-v2-leads-search,
.crm-v2-funnel-search {
  flex: 1 1 320px;
  min-width: 220px;
  max-width: 420px;
}

.crm-v2-leads-create,
.crm-v2-funnel-create {
  margin-left: auto;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .crm-v2-funnel-toolbar,
  .crm-v2-leads-toolbar {
    flex-wrap: wrap;
  }

  .crm-v2-leads-search,
  .crm-v2-funnel-search {
    flex: 1 1 100%;
    max-width: none;
  }

  .crm-v2-leads-create,
  .crm-v2-funnel-create {
    margin-left: 0;
    width: 100%;
  }
}

.crm-v2-owner-filter {
  position: relative;
  flex: 0 0 auto;
}

.crm-v2-owner-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 190px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: var(--crm-surface);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.crm-v2-owner-filter-btn:hover,
.crm-v2-owner-filter.is-open .crm-v2-owner-filter-btn {
  border-color: rgba(0, 179, 65, 0.35);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 1px rgba(0, 179, 65, 0.08);
}

.crm-v2-owner-filter-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #9aa0a6;
  flex: none;
}

.crm-v2-owner-filter-icon svg {
  width: 16px;
  height: 16px;
}

.crm-v2-owner-filter-label {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crm-v2-owner-filter-chevron {
  color: #9aa0a6;
  font-size: 12px;
  transition: transform 0.15s ease;
}

.crm-v2-owner-filter.is-open .crm-v2-owner-filter-chevron {
  transform: rotate(180deg);
}

.crm-v2-owner-filter-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 100;
  min-width: 100%;
  width: max(100%, 240px);
  max-height: 320px;
  overflow: auto;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: #131a26;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.crm-v2-owner-filter-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #e8eaed;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.crm-v2-owner-filter-item:hover,
.crm-v2-owner-filter-item.is-active {
  background: rgba(0, 179, 65, 0.12);
}

.crm-v2-owner-filter-item.is-active strong {
  color: var(--primary);
}

.crm-v2-owner-filter-item-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.crm-v2-owner-filter-item-body strong {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.crm-v2-owner-filter-item-body small {
  font-size: 11px;
  color: #9aa0a6;
}

.crm-v2-owner-filter-avatar {
  flex: none;
  width: 28px;
  height: 28px;
}

.crm-v2-owner-filter-avatar.crm-avatar {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.crm-v2-owner-filter-avatar-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #9aa0a6;
}

.crm-v2-owner-filter-avatar-all svg {
  width: 14px;
  height: 14px;
}

.crm-v2-funnel-page {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-width: none;
}

.crm-v2-funnel-toolbar {
  width: min(1464px, 100%);
  margin: 0 auto 16px;
}

.crm-v2-funnel-board-wrap {
  width: 100%;
  margin-top: 0;
  padding: 8px 0 24px;
  overflow-x: auto;
  display: flex;
  justify-content: center;
}

.crm-v2-funnel-board-center {
  display: flex;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 8px;
}

.crm-v2-funnel-board {
  display: flex;
  gap: 16px;
  min-height: calc(100dvh - 320px);
  width: fit-content;
  min-width: unset;
  align-items: stretch;
  justify-content: center;
}

.crm-v2-shell .crm-v2-funnel-col {
  flex: 0 0 280px;
  min-width: 280px;
  max-width: 280px;
  display: flex;
  flex-direction: column;
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}

.crm-v2-funnel-stage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: var(--primary);
}

.crm-v2-funnel-col.is-stage-green .crm-v2-funnel-stage-dot { background: #00b341; }
.crm-v2-funnel-col.is-stage-amber .crm-v2-funnel-stage-dot { background: #fbbf24; }
.crm-v2-funnel-col.is-stage-blue .crm-v2-funnel-stage-dot { background: #60a5fa; }
.crm-v2-funnel-col.is-stage-orange .crm-v2-funnel-stage-dot { background: #fb923c; }

.crm-v2-funnel-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 12px;
  background: linear-gradient(180deg, rgba(22, 28, 40, 0.98) 0%, rgba(17, 22, 34, 0.92) 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px 16px 0 0;
  border-bottom: 2px solid rgba(0, 179, 65, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.crm-v2-funnel-col.is-stage-green .crm-v2-funnel-col-head { border-bottom-color: rgba(0, 179, 65, 0.55); }
.crm-v2-funnel-col.is-stage-amber .crm-v2-funnel-col-head { border-bottom-color: rgba(251, 191, 36, 0.55); }
.crm-v2-funnel-col.is-stage-blue .crm-v2-funnel-col-head { border-bottom-color: rgba(96, 165, 250, 0.55); }
.crm-v2-funnel-col.is-stage-orange .crm-v2-funnel-col-head { border-bottom-color: rgba(251, 146, 60, 0.55); }
.crm-v2-funnel-col.is-stage-teal .crm-v2-funnel-col-head { border-bottom-color: rgba(45, 212, 191, 0.55); }
.crm-v2-funnel-col.is-stage-red .crm-v2-funnel-col-head { border-bottom-color: rgba(248, 113, 113, 0.55); }

.crm-v2-funnel-col-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.crm-v2-funnel-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.crm-v2-funnel-sum {
  font-size: 13px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
  white-space: nowrap;
}

.crm-v2-shell .crm-v2-funnel-col-body {
  flex: 1;
  min-height: 320px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(180deg, rgba(10, 13, 19, 0.72) 0%, rgba(8, 11, 17, 0.88) 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
}

.crm-v2-funnel-empty {
  margin: auto;
  text-align: center;
  font-size: 12px;
  padding: 20px 10px;
}

.crm-v2-deal-card {
  position: relative;
  background: rgba(19, 26, 38, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 12px 11px;
  cursor: grab;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.crm-v2-deal-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 179, 65, 0.28);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.crm-v2-deal-card.dragging {
  opacity: 0.55;
  transform: scale(0.98);
  cursor: grabbing;
}

.crm-v2-deal-priority-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.crm-v2-deal-priority {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.crm-v2-deal-priority-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}

.crm-v2-deal-priority.is-urgent { color: #f87171; }
.crm-v2-deal-priority.is-urgent .crm-v2-deal-priority-dot { background: #f87171; }
.crm-v2-deal-priority.is-mid { color: #fbbf24; }
.crm-v2-deal-priority.is-mid .crm-v2-deal-priority-dot { background: #fbbf24; }
.crm-v2-deal-priority.is-low { color: #60a5fa; }
.crm-v2-deal-priority.is-low .crm-v2-deal-priority-dot { background: #60a5fa; }

.crm-v2-deal-grip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.28);
  flex: none;
}

.crm-v2-deal-grip svg {
  width: 14px;
  height: 14px;
}

.crm-v2-deal-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
}

.crm-v2-deal-company {
  font-size: 12px;
  color: #9aa0a6;
  line-height: 1.3;
}

.crm-v2-deal-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.crm-v2-deal-amount {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.crm-v2-deal-days {
  font-size: 11px;
  font-weight: 600;
  color: #9aa0a6;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 4px 8px;
  white-space: nowrap;
}

.crm-v2-funnel-col-body.over {
  outline: 2px dashed rgba(0, 179, 65, 0.45);
  background: rgba(0, 179, 65, 0.06);
}

.crm-v2-kanban .crm-kanban-col-head {
  background: var(--crm-surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px 12px 0 0;
}

.crm-v2-funnel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.crm-v2-col-sum {
  margin-left: auto;
  font-style: normal;
  font-size: 12px;
  color: var(--primary);
  font-weight: 700;
}

.crm-v2-kanban .crm-kanban-col-body {
  background: var(--crm-bg-end);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-top: 0;
  border-radius: 0 0 12px 12px;
}

.crm-v2-kanban .crm-card {
  background: var(--crm-surface-solid);
  border-color: rgba(255, 255, 255, 0.06);
  color: inherit;
}

.crm-v2-clients-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
}

.crm-v2-segments {
  background: var(--crm-surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 14px;
}

.crm-v2-segments h4 {
  margin: 0 0 12px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9aa0a6;
}

.crm-v2-segment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 0;
  background: transparent;
  color: #c4c7cc;
  font: inherit;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 4px;
}

.crm-v2-segment.is-active {
  background: rgba(0, 179, 65, 0.12);
  color: var(--primary);
}

.crm-v2-segment span {
  font-size: 11px;
  opacity: 0.7;
}

.crm-v2-clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.crm-v2-client-card {
  background: var(--crm-surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.crm-v2-client-card:hover {
  border-color: rgba(0, 179, 65, 0.3);
}

.crm-v2-client-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  position: relative;
}

.crm-v2-client-vip {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.16);
  color: #fbbf24;
}

.crm-v2-client-head strong {
  color: #fff;
  font-size: 15px;
}

.crm-v2-client-contacts {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #9aa0a6;
  margin-bottom: 14px;
}

.crm-v2-client-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.crm-v2-client-ltv strong {
  display: block;
  color: #fff;
  font-size: 1.1rem;
}

.crm-v2-cal-page .crm-v2-page-head {
  margin-bottom: 18px;
}

.crm-v2-cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.crm-v2-cal-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.crm-v2-cal-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #c4c7cb;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.crm-v2-cal-nav-btn .crm-v2-icon {
  width: 18px;
  height: 18px;
}

.crm-v2-cal-nav-btn.is-next .crm-v2-icon {
  transform: scaleX(-1);
}

.crm-v2-cal-nav-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.crm-v2-cal-nav-today {
  height: 36px;
  padding: 0 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #e8eaed;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.crm-v2-cal-nav-today:hover {
  background: rgba(0, 179, 65, 0.12);
  color: var(--primary);
}

.crm-v2-cal-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.crm-v2-cal-add-btn .crm-v2-icon {
  width: 16px;
  height: 16px;
}

.crm-v2-cal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}

.crm-v2-cal-grid-wrap {
  background: var(--crm-surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.crm-v2-cal-month-title {
  margin: 0 0 18px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  text-transform: capitalize;
  letter-spacing: -0.02em;
}

.crm-v2-shell .crm-v2-cal-grid {
  gap: 6px;
}

.crm-v2-cal-wd {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9aa0a6;
  padding: 8px 4px 10px;
}

.crm-v2-cal-wd.is-weekend {
  color: #f87171;
  opacity: 0.85;
}

.crm-v2-shell .crm-v2-cal-cell {
  min-height: 74px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 8px 6px 6px;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
  color: #e8eaed;
  transition: border-color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
}

.crm-v2-shell .crm-v2-cal-cell:hover:not(.empty) {
  border-color: rgba(0, 179, 65, 0.35);
  background: rgba(0, 179, 65, 0.06);
  transform: translateY(-1px);
}

.crm-v2-shell .crm-v2-cal-cell.empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
  min-height: 0;
  pointer-events: none;
}

.crm-v2-shell .crm-v2-cal-cell.is-weekend {
  background: rgba(255, 255, 255, 0.015);
}

.crm-v2-shell .crm-v2-cal-cell.has-events:not(.is-selected) {
  background: rgba(0, 179, 65, 0.04);
}

.crm-v2-shell .crm-v2-cal-cell.is-selected {
  border-color: var(--primary);
  background: rgba(0, 179, 65, 0.1);
  outline: none;
  box-shadow: 0 0 0 1px rgba(0, 179, 65, 0.35);
}

.crm-v2-shell .crm-cal-day-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  color: #e8eaed;
}

.crm-v2-shell .crm-v2-cal-cell.today .crm-cal-day-num {
  background: var(--primary);
  color: #041208;
  box-shadow: 0 0 0 3px rgba(0, 179, 65, 0.25);
}

.crm-v2-cal-dots {
  display: flex;
  gap: 3px;
  justify-content: center;
  margin-top: auto;
}

.crm-v2-cal-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
}

.crm-v2-cal-side {
  background: var(--crm-surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  min-height: 420px;
}

.crm-v2-cal-side-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.crm-v2-cal-side-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 1rem;
  color: #fff;
  text-transform: capitalize;
}

.crm-v2-cal-side-count {
  flex-shrink: 0;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(0, 179, 65, 0.15);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.crm-v2-cal-side-count.is-empty {
  display: none;
}

.crm-v2-cal-events {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  flex: 1;
}

.crm-v2-cal-event {
  display: grid;
  grid-template-columns: auto 52px 1fr auto;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--cal-event-color, var(--primary));
  align-items: center;
}

.crm-v2-cal-event.is-deal {
  grid-template-columns: 52px 1fr auto;
  border-left-color: #60a5fa;
}

.crm-v2-cal-event.is-event {
  cursor: grab;
}

.crm-v2-cal-event.is-event.is-dragging {
  opacity: 0.55;
  cursor: grabbing;
}

.crm-v2-cal-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9aa0a6;
  opacity: 0.75;
}

.crm-v2-cal-drag-handle .crm-v2-icon {
  width: 14px;
  height: 14px;
}

.crm-v2-cal-event-time {
  color: var(--cal-event-color, var(--primary));
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.crm-v2-cal-event.is-deal .crm-v2-cal-event-time {
  color: #60a5fa;
}

.crm-v2-cal-event-title {
  display: block;
  color: #fff;
  font-size: 14px;
  line-height: 1.35;
}

.crm-v2-cal-event-client {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
  color: #b8bcc4;
}

.crm-v2-cal-event-client .crm-v2-icon {
  width: 14px;
  height: 14px;
  opacity: 0.85;
}

.crm-v2-cal-event-client.is-empty {
  font-style: italic;
}

.crm-v2-cal-time-input {
  max-width: 160px;
}

.crm-v2-cal-del {
  min-width: 32px;
  padding: 6px;
  color: #9aa0a6;
}

.crm-v2-cal-del .crm-v2-icon {
  width: 16px;
  height: 16px;
}

.crm-v2-cal-del:hover {
  color: #f87171;
}

.crm-v2-cal-del-spacer {
  width: 32px;
}

.crm-v2-cal-event-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.crm-v2-cal-edit {
  min-width: 32px;
  padding: 6px;
  color: #9aa0a6;
}

.crm-v2-cal-edit .crm-v2-icon {
  width: 16px;
  height: 16px;
}

.crm-v2-cal-edit:hover {
  color: var(--primary);
}

.crm-v2-shell .crm-v2-cal-cell.is-drop-target {
  outline: 2px dashed var(--primary);
  outline-offset: -2px;
  background: rgba(0, 179, 65, 0.12);
}

.crm-v2-cal-color-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.crm-v2-cal-color-chip {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid transparent;
  background: var(--cal-color, #00b341);
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.crm-v2-cal-color-chip:hover {
  transform: scale(1.08);
}

.crm-v2-cal-color-chip.is-active {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.crm-v2-cal-repeat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.crm-v2-cal-repeat-row[hidden] {
  display: none;
}

.crm-v2-cal-hint {
  margin: 0;
  flex: 1;
  min-width: 180px;
  font-size: 12px;
  text-align: center;
}

.crm-v2-cal-empty {
  margin: 0;
  padding: 36px 16px;
  text-align: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.08);
}

.crm-v2-cal-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: rgba(0, 179, 65, 0.1);
  color: var(--primary);
}

.crm-v2-cal-empty-icon .crm-v2-icon {
  width: 22px;
  height: 22px;
}

.crm-v2-cal-empty p {
  margin: 0 0 6px;
  font-size: 14px;
  color: #e8eaed;
}

.crm-v2-cal-empty .muted {
  font-size: 12px;
}

.crm-v2-kanban .crm-kanban-col-body.over {
  outline: 2px dashed rgba(0, 179, 65, 0.45);
  background: rgba(0, 179, 65, 0.06);
}

.crm-v2-kanban .crm-card.dragging {
  opacity: 0.55;
  transform: scale(0.98);
}

.crm-v2-shell .crm-empty {
  background: var(--crm-surface);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 28px 20px;
}

.crm-v2-shell .crm-feed-day-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9aa0a6;
  margin: 18px 0 10px;
  padding-left: 2px;
}

.crm-v2-shell .crm-dialog::backdrop {
  background: rgba(4, 6, 10, 0.72);
}

.crm-v2-shell .crm-dialog .crm-dialog-inner {
  background: var(--crm-surface-solid);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e8eaed;
}

.crm-v2-shell .crm-entity-dialog .crm-dialog-inner {
  max-width: 560px;
}

.crm-v2-shell .crm-entity-head h3 {
  font-size: 1.15rem;
  color: #fff;
}

.crm-v2-shell .crm-entity-history {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.crm-v2-shell .crm-entity-history h4 {
  color: #9aa0a6;
}

.crm-v2-shell .crm-history-list li {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.crm-v2-shell .crm-history-list time {
  color: #9aa0a6;
}

.crm-v2-shell .crm-dialog-x {
  color: #9aa0a6;
}

.crm-v2-shell .crm-drive-drop-target,
.crm-v2-shell .crm-drive-row.crm-drive-drop-target,
.crm-v2-shell .crm-drive-empty.crm-drive-drop-target {
  outline: 2px dashed rgba(0, 179, 65, 0.45);
  background: rgba(0, 179, 65, 0.08);
}

.crm-v2-shell .crm-chat-back {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e8eaed;
  border-radius: 10px;
}

.crm-v2-shell .crm-chat-back:hover {
  background: rgba(255, 255, 255, 0.1);
}

.crm-v2-shell .crm-kanban-wrap {
  scrollbar-color: rgba(0, 179, 65, 0.35) transparent;
  scrollbar-width: thin;
}

.crm-v2-shell .crm-kanban-wrap::-webkit-scrollbar {
  height: 8px;
}

.crm-v2-shell .crm-kanban-wrap::-webkit-scrollbar-thumb {
  background: rgba(0, 179, 65, 0.35);
  border-radius: 999px;
}

.crm-v2-table tbody tr.crm-v2-table-row {
  cursor: pointer;
  transition: background 0.12s ease;
}

.crm-v2-table tbody tr.crm-v2-table-row:hover td {
  background: rgba(255, 255, 255, 0.04);
}

.crm-v2-shell .crm-drive-crumbs {
  margin: 0 0 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}

.crm-v2-shell .crm-drive-crumb {
  color: #9aa0a6;
  background: none;
  border: none;
  padding: 4px 6px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}

.crm-v2-shell .crm-drive-crumb:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.crm-v2-shell .crm-drive-crumb.is-current {
  color: #fff;
  font-weight: 600;
}

.crm-v2-shell .crm-drive-crumb-sep {
  color: #5f6368;
}

.crm-v2-shell .crm-upload-dialog .crm-dialog-inner {
  background: var(--crm-surface-solid);
  border-color: rgba(255, 255, 255, 0.08);
}

.crm-v2-shell .crm-upload-drop {
  background: rgba(8, 11, 17, 0.55);
  border-color: rgba(255, 255, 255, 0.1);
}

.crm-v2-shell .crm-upload-drop:hover,
.crm-v2-shell .crm-upload-drop:focus-visible,
.crm-v2-shell .crm-upload-drop.is-dragover {
  border-color: rgba(0, 179, 65, 0.45);
  background: rgba(0, 179, 65, 0.08);
}

.crm-v2-shell .crm-upload-head h3 {
  color: #fff;
}

.crm-v2-shell .crm-profile-stats-grid .crm-profile-stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}

@media (max-width: 960px) {
  .crm-v2-chat-app {
    min-height: calc(100dvh - 140px);
  }

  .crm-v2-chat-page .crm-chat-app.show-active .crm-chat-main {
    min-height: calc(100dvh - 140px);
  }

  .crm-v2-chat-page .crm-chat-app:not(.show-active) {
    grid-template-columns: 1fr;
    min-height: calc(100dvh - 140px);
  }

  .crm-v2-chat-page .crm-chat-app:not(.show-active) .crm-chat-sidebar {
    display: flex;
    flex: 1;
    min-height: 0;
  }

  .crm-v2-chat-page .crm-chat-app:not(.show-active) .crm-chat-list {
    max-height: none;
    flex: 1;
  }

  .crm-v2-chat-page .crm-chat-app:not(.show-active) .crm-chat-main {
    display: none;
  }

  .crm-v2-topbar-end .crm-v2-user-pill > span:last-child {
    display: none;
  }

  .crm-v2-topbar-end .crm-v2-user-pill {
    padding: 4px;
  }
}


.crm-v2-event-tag {
  font-size: 10px;
  text-transform: uppercase;
  color: #9aa0a6;
  display: block;
  margin-bottom: 2px;
}

.crm-v2-chat-app {
  min-height: 520px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  overflow: hidden;
}

.crm-v2-shell .crm-chat-sidebar {
  background: var(--crm-surface);
  border-color: rgba(255, 255, 255, 0.06);
}

.crm-v2-shell .crm-chat-main {
  background: var(--crm-surface);
}

.crm-v2-shell .crm-chat-log {
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(0, 179, 65, 0.06) 0%, transparent 55%),
    color-mix(in srgb, var(--crm-bg-end) 88%, var(--crm-surface));
}

.crm-v2-shell .crm-chat-item.active,
.crm-v2-shell .crm-chat-item-wrap.is-active .crm-chat-item {
  background: rgba(0, 179, 65, 0.1);
  border-color: rgba(0, 179, 65, 0.25);
}

.crm-v2-shell .crm-msg-bubble {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.crm-v2-shell .crm-msg.mine .crm-msg-bubble {
  background: rgba(0, 179, 65, 0.18);
  border-color: rgba(0, 179, 65, 0.22);
}

.crm-v2-feed-composer {
  background: var(--crm-surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
}

.crm-v2-shell .crm-feed-composer textarea {
  background: rgba(8, 11, 17, 0.55);
  border-color: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.crm-v2-shell .crm-feed-post {
  background: var(--crm-surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.crm-v2-shell .crm-profile-card,
.crm-v2-shell .crm-project-grid .crm-panel {
  background: var(--crm-surface);
  border-color: rgba(255, 255, 255, 0.06);
  border-radius: 16px;
}

.crm-v2-shell .crm-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.crm-v2-shell .btn-primary {
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.crm-v2-shell .btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 0 0 3px rgba(0, 179, 65, 0.22);
}

.crm-v2-shell .btn:not(.btn-primary):active {
  background: rgba(255, 255, 255, 0.08);
  transform: scale(0.98);
}

.crm-v2-analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(240px, 280px);
  grid-template-rows: auto auto;
  gap: 16px;
}

.crm-v2-analytics-card {
  background: var(--crm-surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 18px;
  min-width: 0;
}

.crm-v2-analytics-funnel {
  grid-column: 1 / span 2;
  grid-row: 2;
}

.crm-v2-analytics-leaders {
  grid-column: 3;
  grid-row: 1 / span 2;
}

.crm-v2-analytics-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.crm-v2-analytics-label {
  font-size: 13px;
  color: #9aa0a6;
  font-weight: 600;
}

.crm-v2-analytics-delta {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 179, 65, 0.14);
  color: var(--primary);
}

.crm-v2-analytics-delta.is-neutral {
  background: rgba(255, 255, 255, 0.08);
  color: #9aa0a6;
}

.crm-v2-analytics-delta.is-down {
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
}

.crm-v2-funnel-fill.is-zero {
  opacity: 0;
}

.crm-v2-analytics-value {
  display: block;
  font-size: 1.85rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.crm-v2-revenue-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 72px;
  padding-top: 4px;
}

.crm-v2-revenue-bars.is-empty {
  opacity: 0.55;
}

.crm-v2-revenue-bar {
  flex: 1;
  height: 0;
  min-height: 0;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, rgba(0, 179, 65, 0.95) 0%, rgba(0, 179, 65, 0.35) 100%);
  transition: height 0.25s ease;
}

.crm-v2-revenue-bar.is-zero {
  height: 0 !important;
  background: rgba(255, 255, 255, 0.06);
  min-height: 4px;
  opacity: 0.35;
}

.crm-v2-revenue-bars.is-empty .crm-v2-revenue-bar.is-zero {
  min-height: 4px;
  opacity: 1;
}

.crm-v2-analytics-ring-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 8px auto 0;
  display: grid;
  place-items: center;
}

.crm-v2-analytics-ring-wrap .crm-v2-stat-ring {
  width: 120px;
  height: 120px;
}

.crm-v2-analytics-ring-wrap strong {
  position: absolute;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
}

.crm-v2-analytics-subtitle {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.crm-v2-funnel-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.crm-v2-funnel-row {
  display: grid;
  grid-template-columns: 110px 1fr 32px;
  gap: 10px;
  align-items: center;
}

.crm-v2-funnel-label {
  font-size: 12px;
  color: #9aa0a6;
}

.crm-v2-funnel-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.crm-v2-funnel-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.crm-v2-funnel-fill.is-green { background: var(--primary); }
.crm-v2-funnel-fill.is-amber { background: #fbbf24; }
.crm-v2-funnel-fill.is-blue { background: #60a5fa; }
.crm-v2-funnel-fill.is-orange { background: #fb923c; }
.crm-v2-funnel-fill.is-teal { background: #2dd4bf; }

.crm-v2-funnel-row strong {
  text-align: right;
  color: #fff;
  font-size: 13px;
}

.crm-v2-leaders-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.crm-v2-leader-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.crm-v2-leader-row:last-child {
  border-bottom: 0;
}

.crm-v2-leader-rank {
  width: 20px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

.crm-v2-leader-body strong {
  display: block;
  color: #fff;
  font-size: 13px;
}

.crm-v2-leader-body small {
  color: #9aa0a6;
  font-size: 11px;
}

.crm-form-page.crm-dialog {
  max-width: 440px;
  width: min(440px, calc(100vw - 32px));
}

.crm-form-page .crm-dialog-inner,
.crm-form-page-inner {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.crm-v2-shell .crm-dialog.crm-v2-form-dialog {
  max-width: 440px;
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: none;
  border-radius: 16px;
  overflow: hidden;
  background: transparent;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.crm-v2-shell .crm-dialog.crm-v2-form-dialog[open] {
  overflow: hidden;
  max-height: calc(100vh - 32px);
}

.crm-v2-form-dialog .crm-dialog-inner,
.crm-v2-form-dialog-inner {
  max-width: none;
  width: 100%;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  box-sizing: border-box;
  background: #111622;
  color: #e8eaed;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.crm-v2-form-dialog .crm-dialog-inner .field-input {
  width: 100%;
  box-sizing: border-box;
}

.crm-v2-form-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 0;
}

.crm-v2-form-dialog-head-text {
  min-width: 0;
  flex: 1;
}

.crm-v2-form-dialog-head .crm-v2-form-title {
  margin: 0;
}

.crm-v2-cal-dialog-date {
  margin: 6px 0 0 14px;
  font-size: 13px;
  text-transform: capitalize;
}

.crm-v2-form-dialog-body {
  padding: 16px 22px 8px;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: min(52vh, 420px);
}

.crm-v2-form-dialog .crm-v2-form-select {
  position: relative;
  z-index: 1;
}

.crm-v2-form-dialog .crm-v2-form-select.is-open {
  z-index: 30;
}

.crm-v2-form-dialog .crm-v2-form-select-menu {
  z-index: 40;
}

.crm-v2-form-select-menu[hidden] {
  display: none !important;
}

.crm-v2-form-dialog-body .field {
  margin: 0;
}

.crm-v2-form-dialog-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 16px 22px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.14);
}

.crm-v2-form-dialog-actions .btn {
  min-width: 112px;
  white-space: nowrap;
  justify-content: center;
}

.crm-v2-form-dialog .field-input {
  min-height: 42px;
}

.crm-form-field-full {
  grid-column: 1 / -1;
}

.crm-v2-form-field > span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #9aa0a6;
}

.crm-v2-form-select {
  position: relative;
  width: 100%;
}

.crm-v2-form-select-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: #0f1115;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.crm-v2-form-select-btn:hover,
.crm-v2-form-select.is-open .crm-v2-form-select-btn {
  border-color: rgba(0, 179, 65, 0.35);
  box-shadow: 0 0 0 1px rgba(0, 179, 65, 0.08);
}

.crm-v2-form-select-value {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crm-v2-form-select-chevron {
  color: #9aa0a6;
  font-size: 12px;
  flex: none;
}

.crm-v2-form-select.is-open .crm-v2-form-select-chevron {
  transform: rotate(180deg);
}

.crm-v2-form-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 300;
  max-height: 240px;
  overflow: auto;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: #131a26;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.crm-v2-form-select-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #e8eaed;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.crm-v2-form-select-item:hover,
.crm-v2-form-select-item.is-active {
  background: rgba(0, 179, 65, 0.12);
}

.crm-v2-form-select-item-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.crm-v2-form-select-item-body strong {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.crm-v2-form-select-item-body small {
  font-size: 11px;
  color: #9aa0a6;
}

.crm-v2-form-select-avatar {
  flex: none;
  width: 28px;
  height: 28px;
}

.crm-v2-form-select-avatar.crm-avatar {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.crm-v2-form-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-size: 1.2rem;
  color: #fff;
}

.crm-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.crm-form-card {
  background: var(--crm-surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 16px;
}

.crm-form-card h4 {
  margin: 0 0 12px;
  font-size: 13px;
  color: #fff;
}

/* Lead create full-screen centered layer */
.crm-v2-lead-layer[hidden] {
  display: none !important;
}

.crm-v2-lead-layer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  pointer-events: none;
}

.crm-v2-lead-layer.is-open {
  pointer-events: auto;
}

.crm-v2-lead-layer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 12, 0.72);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.32s ease;
}

.crm-v2-lead-layer.is-open .crm-v2-lead-layer-backdrop {
  opacity: 1;
}

.crm-v2-lead-layer-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  background: linear-gradient(180deg, #141a24 0%, #0b0e14 100%);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: translateY(12px);
  opacity: 0;
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.32s ease;
  overflow: hidden;
}

.crm-v2-lead-layer.is-open .crm-v2-lead-layer-panel {
  transform: translateY(0);
  opacity: 1;
}

.crm-v2-lead-layer.is-closing .crm-v2-lead-layer-panel {
  transform: translateY(8px);
  opacity: 0;
}

.crm-v2-lead-layer.is-closing .crm-v2-lead-layer-backdrop {
  opacity: 0;
}

body.crm-lead-create-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  left: 0;
  right: 0;
}

.crm-v2-lead-layer-inner {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
}

.crm-v2-lead-layer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 28px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  background: #141a24;
  z-index: 2;
}

.crm-v2-lead-layer-head .crm-v2-page-title {
  margin: 0;
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
}

.crm-v2-lead-layer-close {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #b4bac2;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.crm-v2-lead-layer-close:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
}

.crm-v2-lead-layer-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 22px clamp(20px, 4vw, 48px) 28px;
}

.crm-v2-lead-setup-body,
.crm-v2-funnel-setup-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

.crm-v2-lead-info-block h4,
.crm-v2-funnel-info-block h4 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.crm-v2-lead-info-block .crm-v2-hint-text:last-child,
.crm-v2-funnel-info-block .crm-v2-hint-text:last-child {
  margin-bottom: 0;
}

.crm-v2-lead-layer-form {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
  gap: 0;
}

.crm-v2-lead-layer-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
  gap: 12px;
  width: 100%;
  padding: 18px clamp(20px, 4vw, 48px) 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(11, 14, 20, 0.96);
}

.crm-v2-lead-layer-foot-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}

.crm-v2-lead-layer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
  gap: 24px;
  align-items: start;
  flex: 1;
}

.crm-v2-lead-layer-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.crm-v2-lead-block {
  padding: 20px 22px;
  border-radius: 16px;
  background: rgba(17, 22, 34, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.crm-v2-lead-block h4 {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.crm-v2-lead-block h4 .crm-v2-page-bar {
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--primary);
  flex-shrink: 0;
}

.crm-v2-lead-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
}

.crm-v2-lead-split-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.crm-v2-lead-field-full {
  grid-column: 1 / -1;
}

.crm-v2-lead-mini-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.crm-v2-lead-layer-aside {
  position: sticky;
  top: 0;
}

.crm-v2-lead-layer .field > span {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #b0b7c0;
}

.crm-v2-lead-layer .field-input,
.crm-v2-lead-layer .crm-v2-form-select-btn {
  min-height: 44px;
  border-radius: 12px;
  font-size: 14px;
}

.crm-v2-lead-layer .field-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.crm-v2-lead-layer .field-input:focus,
.crm-v2-lead-layer .crm-v2-form-select.is-open .crm-v2-form-select-btn {
  border-color: rgba(0, 179, 65, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 179, 65, 0.12);
}

.crm-v2-lead-layer textarea.field-input {
  min-height: 128px;
  padding: 12px 14px;
  line-height: 1.55;
  resize: vertical;
}

.crm-v2-lead-layer input[type='date'].field-input {
  color-scheme: dark;
}

.crm-v2-lead-save {
  min-width: 200px;
  min-height: 46px;
  padding: 0 24px;
  border-radius: 14px;
  font-weight: 700;
  box-shadow: 0 10px 28px rgba(0, 179, 65, 0.28);
}

/* Funnel setup — single full panel flow */
.crm-v2-funnel-setup-form {
  gap: 0;
}

.crm-v2-funnel-stages-head h4 {
  margin: 0;
}

.crm-v2-funnel-stages-head {
  margin-bottom: 14px;
}

.crm-v2-funnel-stages-hint {
  margin: 6px 0 0;
  font-size: 12px;
}

.crm-v2-funnel-stage-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.crm-v2-funnel-stage-row {
  display: grid;
  grid-template-columns: 28px 28px 12px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.crm-v2-funnel-stage-row.is-dragging {
  opacity: 0.45;
}

.crm-v2-funnel-stage-row.is-drop-before {
  border-top-color: rgba(0, 179, 65, 0.65);
}

.crm-v2-funnel-stage-row.is-drop-after {
  border-bottom-color: rgba(0, 179, 65, 0.65);
}

.crm-v2-funnel-stage-grip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  cursor: grab;
}

.crm-v2-funnel-stage-num {
  font-size: 12px;
  font-weight: 700;
  color: #8b939c;
  text-align: center;
}

.crm-v2-funnel-stage-row .crm-v2-funnel-stage-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.crm-v2-funnel-stage-row .crm-v2-funnel-stage-dot.is-blue { background: #60a5fa; }
.crm-v2-funnel-stage-row .crm-v2-funnel-stage-dot.is-amber { background: #fbbf24; }
.crm-v2-funnel-stage-row .crm-v2-funnel-stage-dot.is-green { background: #00b341; }
.crm-v2-funnel-stage-row .crm-v2-funnel-stage-dot.is-cyan { background: #22d3ee; }
.crm-v2-funnel-stage-row .crm-v2-funnel-stage-dot.is-purple { background: #a78bfa; }
.crm-v2-funnel-stage-row .crm-v2-funnel-stage-dot.is-teal { background: #2dd4bf; }
.crm-v2-funnel-stage-row .crm-v2-funnel-stage-dot.is-orange { background: #fb923c; }
.crm-v2-funnel-stage-row .crm-v2-funnel-stage-dot.is-red { background: #f87171; }

.crm-v2-funnel-stage-row .crm-v2-funnel-stage-name {
  min-height: 40px;
  padding: 8px 12px;
}

.crm-v2-funnel-stage-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #8b939c;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.crm-v2-funnel-stage-del svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.crm-v2-funnel-stage-del:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.12);
}

.crm-v2-funnel-stage-add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 10px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: transparent;
  color: #9aa0a6;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.crm-v2-funnel-stage-add:hover {
  color: #fff;
  border-color: rgba(0, 179, 65, 0.45);
  background: rgba(0, 179, 65, 0.06);
}

.crm-v2-funnel-toggles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.crm-v2-toggle-field {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.crm-v2-toggle-switch-btn {
  flex-shrink: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}

.crm-v2-toggle-switch-btn:focus-visible {
  outline: 2px solid rgba(0, 179, 65, 0.55);
  outline-offset: 3px;
  border-radius: 999px;
}

.crm-v2-toggle-switch {
  position: relative;
  display: block;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  transition: background 0.2s ease;
}

.crm-v2-toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.crm-v2-toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.crm-v2-toggle-copy strong {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.crm-v2-toggle-copy small {
  font-size: 12px;
  line-height: 1.45;
  color: #8b939c;
}

.crm-v2-toggle-switch-btn[aria-checked='true'] .crm-v2-toggle-switch {
  background: var(--primary);
}

.crm-v2-toggle-switch-btn[aria-checked='true'] .crm-v2-toggle-switch::after {
  transform: translateX(20px);
}

.crm-v2-funnel-info-block h4 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.crm-v2-funnel-info-block .crm-v2-hint-text:last-child {
  margin-bottom: 0;
}

@media (max-width: 720px) {
  .crm-v2-funnel-toggles {
    grid-template-columns: 1fr;
  }
}

/* Client create — mockup layout */
.crm-v2-client-setup-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
}

.crm-v2-client-setup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.crm-v2-client-type-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.crm-v2-client-type-chip {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: #b4bac2;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.crm-v2-client-type-chip:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16);
}

.crm-v2-client-type-chip.is-active {
  color: #fff;
  border-color: rgba(0, 179, 65, 0.55);
  background: rgba(0, 179, 65, 0.12);
  box-shadow: inset 0 0 0 1px rgba(0, 179, 65, 0.25);
}

.crm-v2-client-cancel-btn {
  min-width: 120px;
}

.crm-v2-client-detail-foot-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.crm-v2-client-detail-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.crm-v2-client-linked-block p {
  margin: 0;
}

.crm-v2-client-history-block .crm-history-list {
  margin: 0;
  padding: 0;
}

@media (max-width: 900px) {
  .crm-v2-client-setup-grid {
    grid-template-columns: 1fr;
  }
}

.crm-v2-hint-card {
  padding: 20px 22px;
  border-radius: 16px;
  background: rgba(17, 22, 34, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.crm-v2-hint-card h4 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.crm-v2-hint-text {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.6;
  color: #9aa0a6;
}

.crm-v2-required {
  color: #f472b6;
  font-weight: 800;
}

.crm-v2-optional {
  margin-left: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  letter-spacing: 0.01em;
}

.crm-v2-hint-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  color: #9aa0a6;
  font-size: 13px;
  line-height: 1.55;
}

.crm-v2-hint-list li {
  position: relative;
  padding-left: 14px;
}

.crm-v2-hint-list li + li {
  margin-top: 8px;
}

.crm-v2-hint-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
}

.crm-v2-priority-chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.crm-v2-priority-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(15, 17, 21, 0.92);
  color: #d1d5db;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.crm-v2-priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.crm-v2-priority-dot.is-low { background: #60a5fa; }
.crm-v2-priority-dot.is-medium { background: #00b341; }
.crm-v2-priority-dot.is-high { background: #fbbf24; }
.crm-v2-priority-dot.is-urgent { background: #f87171; }

.crm-v2-priority-chip:hover {
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.crm-v2-priority-chip.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.crm-v2-priority-chip.is-active[data-crm-priority='low'] {
  border-color: rgba(96, 165, 250, 0.6);
}

.crm-v2-priority-chip.is-active[data-crm-priority='medium'] {
  border-color: rgba(0, 179, 65, 0.65);
  box-shadow: 0 0 0 1px rgba(0, 179, 65, 0.15);
}

.crm-v2-priority-chip.is-active[data-crm-priority='high'] {
  border-color: rgba(251, 191, 36, 0.6);
}

.crm-v2-priority-chip.is-active[data-crm-priority='urgent'] {
  border-color: rgba(248, 113, 113, 0.6);
}

.crm-v2-field-search {
  position: relative;
}

.crm-v2-field-search .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #8b939c;
  pointer-events: none;
}

.crm-v2-field-search .field-input {
  padding-left: 40px;
}

.crm-v2-input-suffix {
  position: relative;
}

.crm-v2-input-suffix .field-input {
  padding-right: 38px;
}

.crm-v2-input-suffix-mark {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #8b939c;
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
}

@media (max-width: 900px) {
  .crm-v2-lead-layer {
    padding: 0;
  }

  .crm-v2-lead-layer-panel {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
  }

  .crm-v2-lead-layer-grid,
  .crm-v2-lead-split,
  .crm-v2-lead-mini-row {
    grid-template-columns: 1fr;
  }

  .crm-v2-priority-chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crm-v2-lead-layer-aside {
    position: static;
  }
}

.crm-v2-shell .field-input,
.crm-v2-shell .field-input:focus,
.crm-v2-shell select.field-input {
  background: #0f1115;
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.crm-v2-shell .muted {
  color: #9aa0a6;
}

.crm-v2-shell .crm-panel {
  background: var(--crm-surface);
  border-color: rgba(255, 255, 255, 0.06);
}

.crm-v2-profile-grid {
  gap: 16px;
}

@media (max-width: 1100px) {
  .crm-v2-sections-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .crm-v2-analytics-grid {
    grid-template-columns: 1fr 1fr;
  }
  .crm-v2-analytics-leaders {
    grid-column: 1 / -1;
    grid-row: auto;
  }
  .crm-v2-analytics-funnel {
    grid-column: 1 / -1;
  }
  .crm-v2-funnel-toolbar {
    width: 100%;
  }
  .crm-v2-funnel-board-center {
    justify-content: flex-start;
  }
}

@media (max-width: 960px) {
  .crm-v2-stats-grid,
  .crm-v2-sections-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .crm-v2-clients-body,
  .crm-v2-cal-layout,
  .crm-form-grid {
    grid-template-columns: 1fr;
  }
  .crm-v2-cal-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .crm-v2-cal-hint {
    text-align: left;
  }
  .crm-v2-cal-add-btn {
    justify-content: center;
  }
  .crm-v2-priority-chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .crm-v2-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }
}

@media (max-width: 600px) {
  .crm-v2-stats-grid,
  .crm-v2-sections-grid {
    grid-template-columns: 1fr;
  }
  .crm-v2-main {
    padding: 14px 10px 24px;
  }
}

/* CRM v2 — светлая тема (глобальный theme-dark выключен) */
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell {
  --crm-bg-start: #eef2f7;
  --crm-bg-end: #f8fafc;
  --crm-surface: rgba(255, 255, 255, 0.96);
  --crm-surface-hover: #ffffff;
  --crm-surface-solid: #ffffff;
  color: #1f2937;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell::before {
  background: radial-gradient(ellipse 52% 38% at 50% 36%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.4) 32%, transparent 68%);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-topbar {
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-nav-link {
  color: #64748b;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-nav-link:hover,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-nav-link.is-active {
  color: #111827;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-page-title,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-form-title,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-stat-value,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-analytics-value,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-section-body strong,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-activity-title,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-leader-body strong,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-analytics-subtitle,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-cal-side-title,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-analytics-ring-wrap strong,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-funnel-row strong {
  color: #111827;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-stat-label,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-analytics-label,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-section-body small,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-activity-meta,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-leader-body small,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-page-meta,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-funnel-label,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-activity-time {
  color: #6b7280;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-activity-time {
  border-right-color: rgba(15, 23, 42, 0.1);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-stat-card,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-section-card,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-activity-feed,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-analytics-card,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-client-card,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-cal-side,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-chat-app,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-segments {
  background: var(--crm-surface);
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-section-card:hover {
  background: #ffffff;
  border-color: rgba(0, 179, 65, 0.35);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-section-card:active {
  background: rgba(0, 179, 65, 0.08);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-icon-btn {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.1);
  color: #475569;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-icon-btn:hover {
  background: #e2e8f0;
  color: #111827;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-more-menu {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-more-item {
  color: #374151;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-kanban .crm-kanban-col {
  background: var(--crm-surface);
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-kanban .crm-kanban-col-body {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.06);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-kanban .crm-card {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.1);
  color: #1f2937;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-kanban .crm-meta,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-kanban .crm-card-owner {
  color: #6b7280;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-table th {
  color: #6b7280;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-table td {
  color: #1f2937;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-search input,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .field-input {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  color: #111827;
}

/* Диалог «Новое событие» монтируется в body — отдельные светлые стили */
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-form-dialog .crm-dialog-inner,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-form-dialog-inner {
  background: #ffffff;
  color: #1f2937;
  border-color: rgba(15, 23, 42, 0.1);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-form-dialog .crm-v2-form-title {
  color: #111827;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-form-dialog .crm-v2-cal-dialog-date {
  color: #6b7280;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-form-dialog .crm-v2-form-field > span {
  color: #475569;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-form-dialog .crm-v2-form-select-btn {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  color: #111827;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-form-dialog .crm-v2-form-select-value {
  color: #111827;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-form-dialog .crm-v2-form-select-menu {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-form-dialog .crm-v2-form-select-item {
  color: #1f2937;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-form-dialog .crm-v2-form-select-item-body strong {
  color: #111827;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-form-dialog .crm-v2-form-select-item-body small {
  color: #6b7280;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-form-dialog .field-input {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  color: #111827;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-form-dialog-actions {
  background: #f8fafc;
  border-top-color: rgba(15, 23, 42, 0.08);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-form-dialog .crm-dialog-x {
  color: #64748b;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-analytics-delta.is-neutral {
  background: rgba(15, 23, 42, 0.06);
  color: #6b7280;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-activity-item {
  border-bottom-color: rgba(15, 23, 42, 0.06);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-leader-row {
  border-bottom-color: rgba(15, 23, 42, 0.06);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-empty {
  color: #6b7280;
}

/* Чат — единый светлый стиль (без чёрной ленты сообщений) */
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-chat-sidebar {
  background: var(--crm-surface);
  border-color: rgba(15, 23, 42, 0.08);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-chat-main {
  background: var(--crm-surface);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-chat-main-head,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-chat-form {
  background: var(--crm-surface-solid);
  border-color: rgba(15, 23, 42, 0.08);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-chat-head-info strong {
  color: #111827;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-chat-log {
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(0, 179, 65, 0.05) 0%, transparent 55%),
    #f8fafc;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-chat-composer {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-chat-input {
  color: #111827;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-msg-bubble {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.1);
  color: #1f2937;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-msg.mine .crm-msg-bubble {
  background: rgba(0, 179, 65, 0.12);
  border-color: rgba(0, 179, 65, 0.22);
  color: #111827;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-chat-item.active,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-chat-item-wrap.is-active .crm-chat-item {
  background: rgba(0, 179, 65, 0.1);
  border-color: rgba(0, 179, 65, 0.25);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-feed-composer,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-feed-post {
  background: var(--crm-surface);
  border-color: rgba(15, 23, 42, 0.08);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-feed-composer textarea {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.1);
  color: #111827;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-profile-card,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-project-grid .crm-panel {
  background: var(--crm-surface);
  border-color: rgba(15, 23, 42, 0.08);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-dialog .crm-dialog-inner {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.1);
  color: #1f2937;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-client-head strong,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-client-ltv strong {
  color: #111827;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-client-contacts {
  color: #6b7280;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-cal-grid-wrap,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-table-wrap {
  background: var(--crm-surface);
  border-color: rgba(15, 23, 42, 0.08);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-cal-nav {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.08);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-cal-nav-btn {
  color: #64748b;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-cal-nav-btn:hover {
  background: rgba(15, 23, 42, 0.06);
  color: #111827;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-cal-nav-today {
  color: #334155;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-v2-cal-cell {
  background: rgba(15, 23, 42, 0.02);
  border-color: rgba(15, 23, 42, 0.08);
  color: #111827;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-cal-day-num {
  color: #111827;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-cal-event {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.08);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-cal-color-chip.is-active {
  border-color: #111827;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.12);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-v2-cal-cell.is-drop-target {
  background: rgba(0, 179, 65, 0.08);
  outline-color: #00b341;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-cal-event-title,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-cal-event strong {
  color: #111827;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-cal-empty {
  background: rgba(15, 23, 42, 0.02);
  border-color: rgba(15, 23, 42, 0.1);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-cal-empty p {
  color: #111827;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-cal-hint,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-segments h4 {
  color: #6b7280;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-segment {
  color: #475569;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-segment.is-active {
  color: var(--primary);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-stat-sub {
  color: #6b7280;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-feed-day-title {
  color: #6b7280;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-chat-sidebar-head h3,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-chat-item-body strong {
  color: #111827;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-chat-item-body small,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-chat-head-info small {
  color: #6b7280;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-msg-author {
  color: #6b7280;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-profile-display-name,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-panel h3,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-form-card h4 {
  color: #111827;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-profile-fields .field > span,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-profile-photo-head .muted {
  color: #6b7280;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-profile-fields .field-input,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-profile-bio {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  color: #111827;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-form-card {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.08);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-kanban .crm-kanban-col-head {
  border-color: rgba(15, 23, 42, 0.06);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-drive-table-wrap {
  background: var(--crm-surface);
  border-color: rgba(15, 23, 42, 0.08);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-shell .crm-drive-row td {
  color: #1f2937;
  border-color: rgba(15, 23, 42, 0.06);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-revenue-bar.is-zero {
  background: rgba(15, 23, 42, 0.08);
  opacity: 1;
}

/* ── Чат v2 (на весь экран под topbar) ── */
.crm-v2-main:has(.crm-v2-chat-page) {
  padding: 0;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.crm-v2-chat-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
  padding: 0;
}

.crm-v2-chat-page .crm-v2-chat-app {
  flex: 1;
  min-height: 0;
  height: 100%;
  max-height: none;
  display: grid;
  grid-template-columns: minmax(300px, 360px) 1fr;
  border: none;
  border-radius: 0;
  overflow: hidden;
  background: var(--crm-surface-solid);
}

.crm-v2-chat-app {
  flex: 1;
  min-height: 0;
  height: 100%;
  max-height: none;
  display: grid;
  grid-template-columns: minmax(300px, 360px) 1fr;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  background: var(--crm-surface-solid);
}

.crm-v2-chat-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(8, 11, 17, 0.35);
}

.crm-v2-chat-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 20px 18px 14px;
}

.crm-v2-chat-sidebar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.crm-v2-chat-create-icon {
  flex-shrink: 0;
  color: #9aa0a6;
}

.crm-v2-chat-create-icon:hover {
  color: var(--primary);
  background: rgba(0, 179, 65, 0.12);
}

.crm-v2-chat-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.crm-v2-chat-item-wrap {
  border-radius: 12px;
  border: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}

.crm-v2-chat-item-wrap.is-active {
  background: rgba(0, 179, 65, 0.08);
  border-color: rgba(0, 179, 65, 0.22);
}

.crm-v2-chat-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.crm-v2-chat-item-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.crm-v2-chat-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.crm-v2-chat-item-top strong {
  font-size: 14px;
  font-weight: 700;
  color: #e8eaed;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crm-v2-chat-item-wrap.has-unread .crm-v2-chat-item-top strong {
  color: #fff;
}

.crm-v2-chat-item-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.crm-v2-chat-item-time {
  font-size: 12px;
  color: #9aa0a6;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.crm-v2-chat-item-preview {
  font-size: 13px;
  color: #9aa0a6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.crm-v2-chat-item-wrap.has-unread .crm-v2-chat-item-preview {
  color: #c4c7cc;
}

.crm-v2-chat-unread {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.crm-v2-chat-list-empty {
  padding: 32px 16px;
  text-align: center;
  color: #9aa0a6;
}

.crm-v2-chat-list-empty p {
  margin: 0 0 4px;
  font-weight: 600;
  color: #e8eaed;
}

.crm-v2-chat-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--crm-surface);
}

.crm-v2-chat-main-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(8, 11, 17, 0.2);
}

.crm-v2-chat-back {
  display: none;
}

.crm-v2-chat-head-info strong {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 2px;
}

.crm-v2-chat-status {
  font-size: 13px;
  color: #9aa0a6;
}

.crm-v2-chat-status.is-online {
  color: var(--primary);
  font-weight: 600;
}

.crm-v2-chat-head-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.crm-v2-chat-more-btn {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.crm-v2-chat-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background:
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(0, 179, 65, 0.05) 0%, transparent 60%),
    color-mix(in srgb, var(--crm-bg-end) 92%, var(--crm-surface));
}

.crm-v2-chat-page .crm-msg {
  max-width: min(72%, 520px);
  gap: 8px;
}

.crm-v2-chat-page .crm-msg .crm-avatar {
  flex-shrink: 0;
  align-self: flex-end;
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.crm-v2-chat-page .crm-msg.mine {
  flex-direction: row-reverse;
}

.crm-v2-chat-page .crm-msg-bubble {
  padding: 12px 14px 10px;
  border-radius: 16px;
  box-shadow: none;
  font-size: 14px;
  line-height: 1.45;
}

.crm-v2-chat-page .crm-msg:not(.mine) .crm-msg-bubble {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #e8eaed;
  border-bottom-left-radius: 6px;
}

.crm-v2-chat-page .crm-msg.mine .crm-msg-bubble {
  background: rgba(0, 179, 65, 0.22);
  border: 1px solid rgba(0, 179, 65, 0.28);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.crm-v2-chat-page .crm-msg-meta {
  justify-content: flex-start;
  margin-top: 6px;
}

.crm-v2-chat-page .crm-msg-meta time {
  font-size: 11px;
  opacity: 0.65;
  color: #9aa0a6;
}

.crm-v2-chat-page .crm-msg.mine .crm-msg-meta time {
  color: rgba(255, 255, 255, 0.72);
}

.crm-v2-chat-form {
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(8, 11, 17, 0.25);
}

.crm-v2-chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.crm-v2-chat-composer:focus-within {
  box-shadow: none;
}

.crm-v2-chat-attach-btn {
  flex: none;
  width: 40px;
  height: 40px;
  margin-bottom: 2px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #9aa0a6;
}

.crm-v2-chat-input {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 11, 17, 0.45);
  color: #fff;
  resize: none;
}

.crm-v2-chat-input:focus {
  outline: none;
  border-color: rgba(0, 179, 65, 0.35);
}

.crm-v2-chat-send-btn {
  flex: none;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.crm-v2-chat-page .crm-chat-item-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.crm-v2-chat-page .crm-chat-item-icon .ui-icon,
.crm-v2-chat-page .crm-chat-item-icon svg {
  width: 16px;
  height: 16px;
}

.crm-v2-chat-page .crm-chat-item-icon-dm {
  width: auto;
  height: auto;
  border: none;
  background: transparent;
  box-shadow: none;
}

.crm-v2-chat-page .crm-chat-item-icon-dm .crm-avatar,
.crm-v2-chat-page .crm-chat-head-icon-dm .crm-avatar {
  width: 36px;
  height: 36px;
  font-size: 13px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.crm-v2-chat-page .crm-chat-head-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.crm-v2-chat-page .crm-chat-head-icon .ui-icon,
.crm-v2-chat-page .crm-chat-head-icon svg {
  width: 16px;
  height: 16px;
}

.crm-v2-chat-page .crm-chat-head-icon-dm {
  width: auto;
  height: auto;
  border: none;
  background: transparent;
  box-shadow: none;
}

.crm-v2-chat-page .crm-chat-head-icon .crm-avatar {
  width: 36px;
  height: 36px;
  font-size: 13px;
}

.crm-v2-chat-page .crm-v2-icon-btn,
.crm-v2-chat-page .crm-v2-chat-create-icon {
  width: 32px;
  height: 32px;
}

.crm-v2-chat-page .crm-v2-icon-btn .crm-v2-icon,
.crm-v2-chat-page .crm-v2-chat-create-icon .crm-v2-icon {
  width: 16px;
  height: 16px;
}

.crm-v2-chat-empty {
  margin: auto;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-chat-app {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.1);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-chat-sidebar {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.08);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-chat-sidebar-title,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-chat-head-info strong,
body.crm-fullscreen-active:not(.theme-dark) .crm-v2-chat-item-top strong {
  color: #111827;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-chat-item-wrap.is-active {
  background: rgba(0, 179, 65, 0.08);
  border-color: rgba(0, 179, 65, 0.2);
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-chat-page .crm-msg:not(.mine) .crm-msg-bubble {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.08);
  color: #1f2937;
}

body.crm-fullscreen-active:not(.theme-dark) .crm-v2-chat-input {
  background: #fff;
  color: #111827;
}

@media (max-width: 960px) {
  .crm-v2-chat-page .crm-v2-chat-app {
    grid-template-columns: 1fr;
  }

  .crm-v2-chat-back {
    display: inline-flex;
  }

  .crm-v2-chat-page .crm-chat-app:not(.show-active) .crm-v2-chat-main {
    display: none;
  }

  .crm-v2-chat-page .crm-chat-app.show-active .crm-v2-chat-sidebar {
    display: none;
  }
}

/* ——— Settings page (mockup layout) ——— */
.crm-v2-settings-page {
  padding-bottom: 24px;
}

.crm-v2-settings-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.crm-v2-settings-sidebar {
  background: var(--crm-surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 16px 12px;
  position: sticky;
  top: 12px;
}

.crm-v2-settings-sidebar-title {
  margin: 0 0 12px;
  padding: 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: #e8eaed;
}

.crm-v2-settings-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.crm-v2-settings-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #9aa0a6;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.crm-v2-settings-nav-item .crm-v2-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.crm-v2-settings-nav-item:hover {
  color: #e8eaed;
  background: rgba(255, 255, 255, 0.04);
}

.crm-v2-settings-nav-item.is-active {
  color: var(--primary);
  border-color: rgba(0, 179, 65, 0.45);
  background: rgba(0, 179, 65, 0.08);
}

.crm-v2-settings-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.crm-v2-settings-section-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  color: #e8eaed;
}

.crm-v2-settings-profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--crm-surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
}

.crm-v2-settings-avatar.crm-avatar {
  width: 56px;
  height: 56px;
  font-size: 20px;
}

.crm-v2-settings-profile-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.crm-v2-settings-profile-info strong {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.crm-v2-settings-email {
  font-size: 13px;
  color: #9aa0a6;
}

.crm-v2-settings-role-badge {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 179, 65, 0.14);
  border: 1px solid rgba(0, 179, 65, 0.28);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.crm-v2-settings-edit-btn {
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #e8eaed;
  border-radius: 12px;
  padding: 8px 16px;
  font-weight: 600;
}

.crm-v2-settings-edit-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.crm-v2-settings-card {
  background: var(--crm-surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.crm-v2-settings-card .crm-v2-settings-row,
.crm-v2-settings-card .crm-v2-toggle-field {
  border: none;
  background: transparent;
  border-radius: 10px;
}

.crm-v2-settings-card .crm-v2-toggle-field + .crm-v2-toggle-field {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0;
  padding-top: 16px;
}

.crm-v2-settings-note {
  padding: 16px 18px;
  color: #9aa0a6;
  font-size: 14px;
  line-height: 1.5;
}

.crm-v2-settings-note p {
  margin: 0 0 12px;
}

.crm-v2-settings-profile-edit {
  margin-top: 14px;
  padding: 18px 20px;
  background: var(--crm-surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
}

.crm-v2-settings-avatar-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.crm-v2-settings-avatar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.crm-v2-settings-integrations {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.crm-v2-settings-integration {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px;
  background: var(--crm-surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  min-height: 110px;
}

.crm-v2-settings-integration.is-muted {
  cursor: pointer;
  opacity: 0.92;
}

.crm-v2-settings-integration.is-muted:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.crm-v2-settings-integration strong {
  font-size: 14px;
  color: #e8eaed;
}

.crm-v2-settings-integration-status {
  font-size: 12px;
  font-weight: 600;
  margin-top: auto;
}

.crm-v2-settings-integration-status.is-green {
  color: var(--primary);
}

.crm-v2-settings-integration-status.is-muted {
  color: #9aa0a6;
}

.crm-v2-settings-integration-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
}

.crm-v2-settings-integration-icon.is-telegram {
  background: rgba(42, 171, 238, 0.18);
  box-shadow: inset 0 0 0 1px rgba(42, 171, 238, 0.35);
}

.crm-v2-settings-integration-icon.is-whatsapp {
  background: rgba(0, 179, 65, 0.16);
  box-shadow: inset 0 0 0 1px rgba(0, 179, 65, 0.32);
}

.crm-v2-settings-integration-icon.is-email {
  background: rgba(234, 67, 53, 0.16);
  box-shadow: inset 0 0 0 1px rgba(234, 67, 53, 0.32);
}

.crm-v2-settings-integration-icon.is-telegram::after {
  content: 'TG';
  font-size: 11px;
  font-weight: 800;
  color: #2aabee;
}

.crm-v2-settings-integration-icon.is-whatsapp::after {
  content: 'WA';
  font-size: 11px;
  font-weight: 800;
  color: var(--primary);
}

.crm-v2-settings-integration-icon.is-email::after {
  content: '@';
  font-size: 16px;
  font-weight: 800;
  color: #ea4335;
}

@media (max-width: 960px) {
  .crm-v2-settings-layout {
    grid-template-columns: 1fr;
  }

  .crm-v2-settings-sidebar {
    position: static;
  }

  .crm-v2-settings-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .crm-v2-settings-nav-item {
    width: auto;
    flex: 1 1 auto;
  }

  .crm-v2-settings-integrations {
    grid-template-columns: 1fr;
  }

  .crm-v2-settings-profile-card {
    flex-wrap: wrap;
  }
}
