:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #111827;
  --muted: #667085;
  --line: #d9e0ea;
  --line-strong: #c4cedc;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --green: #15803d;
  --green-soft: #eaf7ee;
  --orange: #b45309;
  --orange-soft: #fff4df;
  --red: #c2410c;
  --red-soft: #fff0e8;
  --violet: #6d28d9;
  --violet-soft: #f3ecff;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.12), transparent 36%),
    linear-gradient(315deg, rgba(21, 128, 61, 0.1), transparent 34%),
    #f4f6f8;
}

.login-shell {
  width: min(100%, 440px);
}

.login-panel {
  display: grid;
  gap: 22px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-brand span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #10213d;
  color: #ffffff;
  font-weight: 900;
}

.login-brand strong,
.login-brand small {
  display: block;
}

.login-brand small {
  margin-top: 2px;
  color: var(--muted);
}

.login-panel h1 {
  margin: 0;
  color: #10213d;
  font-size: 32px;
  line-height: 1;
}

.login-form,
.login-form label {
  display: grid;
  gap: 8px;
}

.login-form {
  gap: 16px;
}

.login-form label span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.login-form input {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
}

.login-form button {
  min-height: 48px;
}

.login-error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff1f2;
  color: #b91c1c;
  font-size: 14px;
}

body:has(.crm-workbench) .topbar {
  display: none;
}

body.dashboard-body .topbar {
  display: none;
}

body:has(.crm-workbench) .page {
  padding: 14px;
}

body.dashboard-body .page {
  padding: 14px;
}

a {
  color: inherit;
}

.topbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  min-width: 210px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--text);
  color: white;
  font-weight: 800;
  font-size: 14px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.main-nav a {
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  padding: 10px 12px;
  text-decoration: none;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.active {
  background: var(--surface-soft);
  color: var(--text);
}

.channel-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.channel-nav span,
.sync-state {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  padding: 8px 11px;
  white-space: nowrap;
}

.sync-state {
  background: var(--surface-soft);
}

.page {
  padding: 24px;
}

.dashboard-head,
.client-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 17px;
}

h3 {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.dashboard-head p,
.client-head p,
.section-head p,
.operator-note p,
.empty-state p {
  color: var(--muted);
}

.status-search {
  min-width: 360px;
}

.status-search label,
.stack label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.search-line {
  display: flex;
  gap: 8px;
}

input,
select,
textarea,
button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  padding: 10px 12px;
}

input,
select,
textarea {
  background: var(--surface);
  color: var(--text);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

textarea {
  min-height: 116px;
  resize: vertical;
}

button {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

button:hover {
  background: var(--accent-strong);
}

.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 41px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 750;
  padding: 10px 12px;
  text-decoration: none;
  white-space: nowrap;
}

.button-link:hover {
  background: var(--surface-soft);
}

.button-muted {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line-strong);
}

.button-muted:hover {
  background: var(--surface-soft);
}

.button-danger {
  background: var(--red);
  border-color: var(--red);
}

.button-danger:hover {
  background: #9a3412;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 18px;
}

.metric {
  padding: 16px 18px;
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric span,
.metric strong {
  display: block;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  margin-top: 7px;
  font-size: 30px;
  line-height: 1;
}

.metric-hot strong {
  color: var(--orange);
}

.metric-manual strong {
  color: var(--red);
}

.metric-bot strong {
  color: var(--green);
}

.workspace {
  display: grid;
  gap: 18px;
}

.workspace-list {
  grid-template-columns: 260px minmax(0, 1fr);
}

.operator-grid {
  display: grid;
  grid-template-columns: 320px minmax(360px, 1fr) 330px;
  gap: 18px;
  align-items: start;
}

.filters-panel,
.inbox-panel,
.side-panel,
.chat-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.filters-panel,
.side-panel {
  padding: 18px;
}

.inbox-panel,
.chat-panel {
  overflow: hidden;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.section-head p {
  margin-bottom: 0;
  font-size: 13px;
}

.status-filters {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.status-filters a {
  border-radius: 8px;
  color: var(--muted);
  font-weight: 650;
  padding: 10px 12px;
  text-decoration: none;
}

.status-filters a:hover,
.status-filters a.active {
  background: var(--surface-soft);
  color: var(--text);
}

.operator-note {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.operator-note strong {
  display: block;
  margin-bottom: 8px;
}

.operator-note p {
  margin-bottom: 0;
  font-size: 14px;
  line-height: 1.5;
}

.conversation-list {
  display: grid;
}

.conversation-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 74px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background 140ms ease, transform 140ms ease;
}

.conversation-row:hover {
  background: var(--surface-soft);
  transform: translateX(2px);
}

.conversation-row:last-child {
  border-bottom: 0;
}

.contact-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #e7ecf4;
  color: #344054;
  font-weight: 800;
}

.conversation-main {
  min-width: 0;
}

.conversation-main strong,
.conversation-main small,
.row-meta small {
  display: block;
}

.conversation-main strong {
  overflow-wrap: anywhere;
}

.conversation-main small,
.row-meta small {
  color: var(--muted);
  margin-top: 5px;
  font-size: 13px;
}

.row-meta {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  background: #edf2f7;
  color: #344054;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.status-hot_lead,
.status-warm_follow_up {
  background: var(--orange-soft);
  color: var(--orange);
}

.status-human_takeover,
.status-delivery_failed,
.status-stop_list {
  background: var(--red-soft);
  color: var(--red);
}

.status-qualifying,
.status-replied {
  background: #eaf1ff;
  color: var(--accent-strong);
}

.status-sleeping_builder {
  background: var(--violet-soft);
  color: var(--violet);
}

.status-new,
.status-sent_whatsapp,
.status-sent_telegram,
.status-sent_max {
  background: var(--green-soft);
  color: var(--green);
}

.bot-enabled {
  color: var(--green) !important;
}

.bot-disabled {
  color: var(--red) !important;
}

.client-head {
  padding-bottom: 4px;
}

.client-head h1 {
  margin-bottom: 8px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.back-link:hover {
  color: var(--text);
}

.client-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.client-actions form {
  min-width: 160px;
}

.info-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.info-list div {
  display: grid;
  grid-template-columns: minmax(100px, 0.8fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.info-list div:last-child {
  border-bottom: 0;
}

.info-list dt {
  color: var(--muted);
  font-size: 13px;
}

.info-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 650;
}

.test-box {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.stack {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.chat-stream {
  display: grid;
  gap: 10px;
  min-height: 520px;
  max-height: calc(100vh - 220px);
  overflow: auto;
  padding: 18px;
  background: #f7f9fc;
}

.bubble {
  width: min(78%, 680px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.bubble.bot {
  justify-self: end;
  border-color: #bfd2ff;
  background: #eef4ff;
}

.bubble.client {
  justify-self: start;
  background: var(--surface);
}

.bubble.manager,
.bubble.operator {
  justify-self: end;
  border-color: #fdba74;
  background: #fff7ed;
}

.bubble small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 7px;
}

.bubble p {
  margin-bottom: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.crm-section {
  padding-top: 16px;
  border-top: 1px solid var(--line);
  margin-top: 16px;
}

.crm-section:first-of-type {
  border-top: 0;
  margin-top: 0;
}

.crm-item {
  display: grid;
  gap: 5px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

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

.crm-item strong {
  overflow-wrap: anywhere;
}

.crm-item small,
.muted-text {
  color: var(--muted);
}

.workspace-panel {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.task-stack {
  display: grid;
  gap: 8px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.inline-actions form {
  display: inline-flex;
  gap: 6px;
  margin: 0;
}

.inline-actions a,
.inline-actions button,
.stack button {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  font-weight: 750;
  padding: 8px 10px;
  text-decoration: none;
}

.stack input,
.stack textarea,
.inline-actions input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  padding: 10px 11px;
}

.leads-table .big-table-head,
.leads-table .big-table-row {
  grid-template-columns: 1.1fr 1fr 0.9fr 1.4fr 1fr;
}

.muted-text {
  margin-bottom: 0;
  font-size: 14px;
}

.empty-state {
  padding: 24px;
  color: var(--muted);
}

.empty-state strong {
  color: var(--text);
}

.empty-state p {
  margin: 8px 0 0;
}

.settings-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 18px;
}

.settings-head p {
  color: var(--muted);
  margin-bottom: 0;
  max-width: 720px;
}

.settings-form {
  display: grid;
  gap: 18px;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

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

.settings-panel {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.integration-panel {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.integration-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.integration-panel-head p {
  color: var(--muted);
  margin-bottom: 0;
  font-size: 13px;
}

.integration-status {
  align-self: flex-start;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.integration-status.status-not_configured {
  background: #edf2f7;
  color: #475467;
}

.integration-status.status-configured {
  background: var(--orange-soft);
  color: var(--orange);
}

.integration-status.status-live {
  background: var(--green-soft);
  color: var(--green);
}

.integration-status.status-qr_pending {
  background: #e7f0ff;
  color: #1264e8;
}

.settings-fields {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.settings-fields label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.settings-fields input,
.settings-fields textarea {
  color: var(--text);
  font-weight: 500;
}

.settings-savebar {
  position: sticky;
  bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.settings-savebar span {
  color: var(--muted);
  font-size: 14px;
}

.settings-savebar button {
  max-width: 230px;
}

.access-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.access-panel p {
  color: var(--muted);
  margin-bottom: 0;
}

.access-panel button {
  max-width: 240px;
}

.webhook-tools {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  margin-top: 18px;
}

.account-auth-primary {
  grid-template-columns: minmax(460px, 1.3fr) minmax(320px, 0.7fr);
  align-items: start;
  margin-top: 18px;
}

.account-auth-primary .telegram-account-card {
  opacity: 0.78;
}

.integration-admin-details {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f8fbff;
  overflow: hidden;
}

.integration-admin-details summary {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  cursor: pointer;
  color: #10213d;
  font-weight: 850;
  list-style: none;
}

.integration-admin-details summary::-webkit-details-marker {
  display: none;
}

.integration-admin-details summary small {
  color: var(--muted);
  font-weight: 650;
}

.integration-admin-details[open] {
  background: #fff;
}

.integration-admin-details .settings-form,
.integration-admin-details .webhook-tools {
  padding: 0 18px 18px;
}

.webhook-log {
  display: grid;
}

.webhook-log-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.webhook-log-row:last-child {
  border-bottom: 0;
}

.webhook-log-row strong,
.webhook-log-row small {
  display: block;
}

.webhook-log-row small {
  color: var(--muted);
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.error-text {
  color: var(--red) !important;
}

.log-link {
  color: var(--accent);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.crm-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 18px;
}

.crm-title h1 {
  color: #10213d;
  font-size: 46px;
  line-height: 1.02;
  margin: 0;
}

.crm-title p {
  color: #4b5f80;
  font-size: 19px;
  font-weight: 650;
  margin: 8px 0 0;
}

.crm-title .button-link {
  justify-content: center;
  max-width: 190px;
}

.crm-shell {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr 0.95fr 1.08fr;
  gap: 14px;
  align-items: stretch;
}

.crm-module {
  min-width: 0;
  min-height: 280px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.module-head {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.module-head h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.module-head a {
  margin-left: auto;
  color: var(--accent);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.module-index {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-weight: 850;
}

.module-dashboard,
.module-chats {
  grid-column: span 1;
}

.overview-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 14px;
}

.overview-metric {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.overview-metric small {
  color: var(--muted);
  font-size: 12px;
}

.overview-metric strong {
  font-size: 24px;
}

.funnel-board {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.funnel-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.funnel-item span {
  color: var(--muted);
}

.funnel-track {
  height: 24px;
  overflow: hidden;
  background: #eef2f7;
  border-radius: 6px;
}

.funnel-track i {
  display: block;
  height: 100%;
}

.funnel-blue { background: #38bdf8; }
.funnel-green { background: #34d399; }
.funnel-cyan { background: #22d3ee; }
.funnel-orange { background: #f59e0b; }
.funnel-red { background: #fb7185; }

.mini-table,
.client-grid,
.chat-preview-list,
.knowledge-list,
.integration-mini-grid {
  display: grid;
}

.mini-row,
.client-line,
.chat-preview-row {
  min-width: 0;
  min-height: 42px;
  display: grid;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}

.mini-row {
  grid-template-columns: minmax(120px, 1fr) 72px 64px 92px;
  font-size: 12px;
}

.mini-row-head {
  min-height: 36px;
  color: var(--muted);
  background: var(--surface-soft);
  font-weight: 700;
}

.mini-row span,
.client-line strong,
.client-line span,
.chat-preview-row strong,
.chat-preview-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-line {
  padding: 18px;
  color: var(--muted);
  font-size: 14px;
}

.compact-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.compact-filter select,
.compact-filter button {
  min-height: 38px;
  font-size: 13px;
}

.client-line {
  grid-template-columns: minmax(0, 1fr) 120px 118px;
  font-size: 12px;
}

.client-card-preview {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.client-card-preview strong,
.client-card-preview span {
  display: block;
}

.client-card-preview span {
  color: var(--muted);
  margin-top: 4px;
  font-size: 13px;
}

.client-facts {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.client-facts div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.client-facts div:last-child {
  border-bottom: 0;
}

.client-facts dt,
.client-facts dd {
  margin: 0;
  font-size: 12px;
}

.client-facts dt {
  color: var(--muted);
}

.client-facts dd {
  overflow-wrap: anywhere;
  font-weight: 650;
}

.mini-chat {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.mini-message {
  max-width: 92%;
  margin: 0;
  padding: 9px 11px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.mini-message span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.mini-message-bot {
  margin-left: auto;
  background: #eaf1ff;
}

.chat-preview-row {
  grid-template-columns: 38px minmax(0, 1fr) 94px;
}

.chat-preview-row em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  text-align: right;
}

.chat-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px;
}

.chat-actions .button-link {
  justify-content: center;
  font-size: 13px;
}

.bot-flow {
  display: grid;
  gap: 12px;
  padding: 16px 14px 10px;
}

.flow-node,
.flow-branches span,
.flow-results strong {
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  text-align: center;
  font-size: 12px;
}

.flow-start {
  max-width: 180px;
  margin: 0 auto;
  color: var(--accent-strong);
  background: #eaf1ff;
}

.flow-branches,
.flow-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.flow-branches span:nth-child(1),
.flow-results strong:nth-child(1) {
  background: var(--green-soft);
  color: var(--green);
}

.flow-branches span:nth-child(2),
.flow-results strong:nth-child(2) {
  background: var(--orange-soft);
  color: var(--orange);
}

.flow-branches span:nth-child(3),
.flow-results strong:nth-child(3) {
  background: var(--surface-soft);
  color: var(--muted);
}

.module-bot .muted-text {
  padding: 0 14px 14px;
  line-height: 1.45;
}

.knowledge-list article {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}

.knowledge-list strong,
.knowledge-list p {
  display: block;
  margin: 0;
}

.knowledge-list p {
  color: var(--muted);
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.45;
}

.integration-mini-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.integration-mini-grid article {
  min-height: 92px;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.integration-mini-grid strong,
.integration-mini-grid span,
.integration-mini-grid em {
  overflow-wrap: anywhere;
}

.integration-mini-grid span {
  color: var(--muted);
  font-size: 12px;
}

.integration-state {
  width: fit-content;
  margin-top: 3px;
  padding: 5px 7px;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--orange);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.integration-live {
  background: var(--green-soft);
  color: var(--green);
}

.integration-configured {
  background: #eaf1ff;
  color: var(--accent-strong);
}

.integration-not_configured {
  background: var(--surface);
  color: var(--muted);
}

.report-mini {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0 14px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.report-mini div {
  display: grid;
  gap: 5px;
  padding: 11px;
  border-right: 1px solid var(--line);
}

.report-mini div:last-child {
  border-right: 0;
}

.report-mini span {
  color: var(--muted);
  font-size: 12px;
}

.report-mini strong {
  font-size: 18px;
}

.crm-workbench {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.crm-side-nav {
  min-height: calc(100vh - 118px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.side-logo {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 8px 4px 12px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.side-logo span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #10213d;
  color: white;
  font-weight: 850;
}

.side-logo strong {
  font-size: 13px;
}

.crm-side-nav nav {
  display: grid;
  gap: 5px;
}

.crm-side-nav nav a {
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.crm-side-nav nav a:hover,
.crm-side-nav nav a.active {
  background: var(--accent);
  color: white;
}

.side-note {
  display: grid;
  gap: 4px;
  margin-top: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.side-note span,
.side-note small {
  color: var(--muted);
  font-size: 11px;
}

.side-note strong {
  font-size: 13px;
}

.crm-main-stage {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.crm-commandbar {
  min-height: 104px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.crm-commandbar h1 {
  color: #10213d;
  font-size: 34px;
  line-height: 1.05;
  margin: 0;
}

.crm-commandbar p:last-child {
  color: #4b5f80;
  font-size: 15px;
  font-weight: 650;
  margin: 6px 0 0;
}

.command-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.command-actions .button-link {
  justify-content: center;
  min-width: 150px;
}

.crm-board {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 1.12fr) minmax(300px, 1.12fr) minmax(280px, 1.02fr);
  grid-template-areas:
    "dashboard campaigns clients card"
    "chats bot knowledge integrations";
  gap: 14px;
  align-items: stretch;
}

.crm-board .crm-module {
  min-height: 318px;
  display: flex;
  flex-direction: column;
}

.crm-board .module-dashboard { grid-area: dashboard; }
.crm-board .module-campaigns { grid-area: campaigns; }
.crm-board .module-clients { grid-area: clients; }
.crm-board .module-card { grid-area: card; }
.crm-board .module-chats { grid-area: chats; }
.crm-board .module-bot { grid-area: bot; }
.crm-board .module-knowledge { grid-area: knowledge; }
.crm-board .module-integrations { grid-area: integrations; }

.campaign-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.campaign-summary div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.campaign-summary span {
  color: var(--muted);
  font-size: 11px;
}

.campaign-summary strong {
  font-size: 20px;
}

.campaign-layout {
  grid-template-columns: 360px minmax(0, 1fr);
  align-items: start;
}

.campaign-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.step-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 118px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.step-card span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.step-card strong,
.step-card p {
  grid-column: 2;
}

.step-card strong {
  font-size: 15px;
}

.step-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.campaign-form-card h2 {
  margin-bottom: 8px;
}

.campaign-form-card .muted-text {
  line-height: 1.45;
}

.campaign-detail-grid {
  grid-template-columns: 340px minmax(0, 1fr) 300px;
  align-items: start;
}

.campaign-explain-list {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.campaign-list,
.recipient-table {
  display: grid;
}

.campaign-row,
.recipient-row {
  display: grid;
  align-items: center;
  gap: 14px;
  min-height: 74px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}

.campaign-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.recipient-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.campaign-row:hover,
.recipient-row:hover {
  background: var(--surface-soft);
}

.campaign-main,
.campaign-stats,
.recipient-row span {
  min-width: 0;
}

.campaign-main strong,
.campaign-main small,
.campaign-stats small,
.recipient-row strong,
.recipient-row small {
  display: block;
}

.campaign-main small,
.campaign-stats small,
.recipient-row small {
  color: var(--muted);
  margin-top: 5px;
  font-size: 13px;
}

.campaign-stats {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.campaign-recipient-hot_lead {
  background: var(--orange-soft);
  color: var(--orange);
}

.campaign-recipient-bot_active,
.campaign-recipient-replied {
  background: #eaf1ff;
  color: var(--accent-strong);
}

.campaign-recipient-follow_up {
  background: var(--violet-soft);
  color: var(--violet);
}

.campaign-recipient-human_takeover,
.campaign-recipient-error {
  background: var(--red-soft);
  color: var(--red);
}

.campaign-recipient-sent,
.campaign-recipient-delivered,
.campaign-recipient-read,
.campaign-recipient-queued {
  background: var(--green-soft);
  color: var(--green);
}

.campaign-events {
  margin-top: 14px;
}

.demo-reply-form select,
.demo-reply-form textarea {
  font-size: 14px;
}

.demo-replies {
  display: grid;
  gap: 8px;
}

.demo-replies button {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--text);
  text-align: left;
  white-space: normal;
}

.demo-replies button:hover {
  background: var(--surface-soft);
}

@media (max-width: 1180px) {
  .crm-shell {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crm-workbench {
    grid-template-columns: 1fr;
  }

  .crm-side-nav {
    min-height: auto;
    flex-direction: row;
    align-items: center;
  }

  .side-logo {
    min-width: 116px;
    padding: 0 12px 0 0;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .crm-side-nav nav {
    display: flex;
    flex-wrap: wrap;
  }

  .side-note {
    min-width: 180px;
  }

  .crm-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "dashboard campaigns"
      "clients card"
      "chats bot"
      "knowledge integrations";
  }

  .operator-grid {
    grid-template-columns: 300px minmax(360px, 1fr);
  }

  .operator-grid .side-panel:last-child {
    grid-column: 1 / -1;
  }

  .campaign-detail-grid {
    grid-template-columns: 320px minmax(360px, 1fr);
  }

  .campaign-detail-grid .side-panel:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .topbar,
  .dashboard-head,
  .client-head,
  .settings-head,
  .client-actions,
  .search-line,
  .crm-title,
  .crm-commandbar,
  .crm-side-nav {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    position: static;
    padding: 16px;
  }

  .brand {
    min-width: 0;
  }

  .channel-nav {
    flex-wrap: wrap;
  }

  .main-nav {
    flex-wrap: wrap;
  }

  .page {
    padding: 16px;
  }

  .status-search {
    min-width: 0;
    width: 100%;
  }

  .metric-strip,
  .crm-shell,
  .crm-board,
  .workspace-list,
  .operator-grid,
  .settings-grid,
  .integration-grid,
  .campaign-steps,
  .campaign-layout,
  .campaign-detail-grid {
    grid-template-columns: 1fr;
  }

  .metric {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .metric:last-child {
    border-bottom: 0;
  }

  .conversation-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .row-meta {
    grid-column: 1 / -1;
    justify-items: start;
    padding-left: 52px;
  }

  .chat-stream {
    min-height: 360px;
    max-height: none;
  }

  .bubble {
    width: 100%;
  }

  .settings-savebar {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  .settings-savebar button {
    max-width: none;
  }

  .access-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .access-panel button {
    max-width: none;
  }

  .webhook-tools {
    grid-template-columns: 1fr;
  }

  .webhook-log-row {
    grid-template-columns: 1fr;
  }

  .campaign-row,
  .recipient-row {
    grid-template-columns: 1fr;
  }

  .campaign-stats {
    justify-items: start;
  }

  .crm-title h1 {
    font-size: 34px;
  }

  .crm-title p {
    font-size: 16px;
  }

  .crm-commandbar h1 {
    font-size: 28px;
  }

  .command-actions {
    display: grid;
  }

  .side-logo {
    justify-items: start;
    grid-template-columns: 34px minmax(0, 1fr);
    min-width: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 12px;
    text-align: left;
  }

  .side-note {
    min-width: 0;
  }

  .crm-board {
    grid-template-areas:
      "dashboard"
      "campaigns"
      "clients"
      "card"
      "chats"
      "bot"
      "knowledge"
      "integrations";
  }

  .overview-metrics,
  .integration-mini-grid,
  .report-mini,
  .flow-branches,
  .flow-results {
    grid-template-columns: 1fr;
  }

  .mini-row,
  .client-line,
  .chat-preview-row,
  .client-facts div {
    grid-template-columns: 1fr;
  }

  .mini-row-head {
    display: none;
  }

  .chat-preview-row em {
    text-align: left;
  }

  .report-mini div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .report-mini div:last-child {
    border-bottom: 0;
  }
}

/* Polished CRM dashboard */
body:has(.crm-workbench),
body.dashboard-body {
  background:
    linear-gradient(180deg, #eef4fb 0%, #f7f9fc 42%, #edf2f7 100%);
}

body:has(.crm-workbench) .page,
body.dashboard-body .page {
  min-height: 100vh;
  padding: 18px;
}

.crm-workbench {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  gap: 18px;
  min-height: calc(100vh - 36px);
}

.crm-side-nav {
  position: sticky;
  top: 18px;
  min-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 16px;
  background: #0f1f38;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
}

.side-logo {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  justify-items: start;
  padding: 0 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  text-align: left;
}

.side-logo span {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #ffffff;
  color: #0f1f38;
  font-size: 15px;
}

.side-logo strong,
.side-logo small {
  display: block;
  min-width: 0;
}

.side-logo strong {
  color: #ffffff;
  font-size: 15px;
}

.side-logo small {
  grid-column: 2;
  margin-top: -6px;
  color: #aab8d0;
  font-size: 12px;
}

.crm-side-nav nav {
  display: grid;
  gap: 4px;
}

.crm-side-nav nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #c8d3e6;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

.crm-side-nav nav a:hover,
.crm-side-nav nav a.active {
  background: #ffffff;
  color: #0f1f38;
}

.side-note {
  display: grid;
  gap: 5px;
  margin-top: auto;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.side-note span,
.side-note small {
  color: #aab8d0;
  font-size: 12px;
  line-height: 1.4;
}

.side-note strong {
  color: #ffffff;
  font-size: 15px;
}

.crm-main-stage {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.crm-commandbar {
  min-height: 132px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 24px 26px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(196, 206, 220, 0.86);
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px);
}

.crm-commandbar h1 {
  color: #10213d;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1;
  margin: 0;
}

.crm-commandbar p:last-child {
  max-width: 760px;
  color: #5d6b82;
  font-size: 16px;
  font-weight: 650;
  margin: 10px 0 0;
}

.command-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.command-actions .button-link {
  justify-content: center;
  min-width: 152px;
  min-height: 42px;
}

.button-link.button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.button-link.button-primary:hover {
  background: var(--accent-strong);
}

.crm-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.crm-kpi {
  min-height: 108px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  background: #ffffff;
  border: 1px solid rgba(217, 224, 234, 0.95);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.crm-kpi span {
  color: #667085;
  font-size: 13px;
  font-weight: 750;
}

.crm-kpi strong {
  color: #111827;
  font-size: 34px;
  line-height: 1;
}

.crm-kpi.metric-hot strong {
  color: var(--orange);
}

.crm-kpi.metric-manual strong {
  color: var(--red);
}

.crm-kpi.metric-bot strong {
  color: var(--green);
}

.crm-board {
  display: grid;
  grid-template-columns: minmax(420px, 1.08fr) minmax(360px, 0.92fr) minmax(320px, 0.78fr);
  grid-template-areas:
    "dashboard campaigns inspector"
    "clients campaigns inspector"
    "clients chat bot"
    "knowledge integrations integrations";
  gap: 16px;
  align-items: stretch;
}

.crm-panel {
  min-width: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(217, 224, 234, 0.96);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.crm-panel-main {
  grid-area: dashboard;
}

.crm-panel-campaigns {
  grid-area: campaigns;
}

.crm-panel-clients {
  grid-area: clients;
}

.crm-panel-inspector {
  grid-area: inspector;
}

.crm-panel-chat {
  grid-area: chat;
}

.crm-panel-bot {
  grid-area: bot;
}

.crm-panel-knowledge {
  grid-area: knowledge;
}

.crm-panel-integrations {
  grid-area: integrations;
}

.module-head-left {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.module-head-left h2 {
  margin: 0;
  color: #10213d;
  font-size: 17px;
}

.module-head-left p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.module-head-left a {
  margin-left: auto;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.module-index {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 8px;
  background: #eaf1ff;
  color: var(--accent-strong);
  font-size: 14px;
}

.pipeline-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
}

.pipeline-step {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 13px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.pipeline-step div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.pipeline-step span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.pipeline-step strong {
  color: #10213d;
  font-size: 20px;
}

.pipeline-step .funnel-track {
  height: 8px;
  border-radius: 999px;
}

.campaign-summary-polished {
  padding: 16px;
  gap: 10px;
}

.campaign-summary-polished div {
  min-height: 78px;
  align-content: center;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.crm-data-table {
  display: grid;
}

.crm-data-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 62px 62px 106px;
  gap: 12px;
  align-items: center;
  min-height: 54px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
}

.crm-data-row:hover,
.client-table-row:hover,
.chat-preview-row:hover {
  background: #f8fbff;
}

.crm-data-row span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 750;
}

.crm-data-head {
  min-height: 42px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compact-filter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.client-table,
.chat-preview-list {
  display: grid;
}

.client-table-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}

.client-table-row:last-child,
.chat-preview-row:last-child {
  border-bottom: 0;
}

.client-table-row strong,
.client-table-row small,
.chat-preview-row strong,
.chat-preview-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-table-row small,
.chat-preview-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.inspector-hero {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.inspector-hero .status-pill {
  grid-column: 1 / -1;
  width: fit-content;
}

.inspector-hero strong,
.inspector-hero span {
  display: block;
  overflow-wrap: anywhere;
}

.inspector-hero strong {
  color: #10213d;
  font-size: 20px;
}

.inspector-hero span {
  margin-top: 4px;
  color: var(--muted);
}

.contact-avatar-lg {
  width: 54px;
  height: 54px;
  font-size: 18px;
}

.client-facts-polished {
  padding: 4px 18px 18px;
  border-bottom: 0;
}

.client-facts-polished div {
  grid-template-columns: 132px minmax(0, 1fr);
  padding: 13px 0;
}

.mini-chat-polished {
  min-height: 248px;
  align-content: start;
  padding: 16px;
  background: #f8fafc;
}

.mini-message {
  border-radius: 8px;
}

.mini-message-bot {
  background: #eef4ff;
  border: 1px solid #d6e4ff;
}

.mini-message-client {
  background: #ffffff;
  border: 1px solid var(--line);
}

.chat-preview-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}

.chat-preview-row em {
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
  white-space: nowrap;
}

.bot-flow-polished {
  padding: 18px;
}

.flow-node,
.flow-branches span,
.flow-results strong {
  border-radius: 8px;
}

.flow-start {
  max-width: none;
  background: #eef4ff;
}

.knowledge-list-polished {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.knowledge-list-polished article {
  min-height: 116px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.integration-mini-grid-polished {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 16px;
}

.integration-mini-grid-polished article {
  background: #f8fafc;
}

.report-mini-polished {
  margin: 0 16px 16px;
}

@media (max-width: 1320px) {
  .crm-board {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.82fr);
    grid-template-areas:
      "dashboard inspector"
      "campaigns inspector"
      "clients chat"
      "bot bot"
      "knowledge integrations";
  }

  .pipeline-strip,
  .knowledge-list-polished,
  .integration-mini-grid-polished {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  body:has(.crm-workbench) .page,
  body.dashboard-body .page {
    padding: 12px;
  }

  .crm-workbench {
    grid-template-columns: 1fr;
  }

  .crm-side-nav {
    position: static;
    min-height: auto;
  }

  .crm-side-nav nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .crm-commandbar,
  .command-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .command-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crm-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .crm-board {
    grid-template-columns: 1fr;
    grid-template-areas:
      "dashboard"
      "campaigns"
      "clients"
      "inspector"
      "chat"
      "bot"
      "knowledge"
      "integrations";
  }
}

@media (max-width: 640px) {
  .crm-commandbar h1 {
    font-size: 30px;
  }

  .crm-side-nav nav,
  .crm-kpi-strip,
  .pipeline-strip,
  .campaign-summary-polished,
  .knowledge-list-polished,
  .integration-mini-grid-polished,
  .report-mini-polished,
  .command-actions {
    grid-template-columns: 1fr;
  }

  .crm-data-head {
    display: none;
  }

  .crm-data-row,
  .client-table-row,
  .chat-preview-row,
  .client-facts-polished div {
    grid-template-columns: 1fr;
  }

  .client-table-row .contact-avatar,
  .chat-preview-row .contact-avatar {
    display: none;
  }

  .status-pill {
    width: fit-content;
  }
}

/* Reference-style CRM presentation */
body.dashboard-body {
  background: #f7faff;
}

body.dashboard-body .page {
  padding: 0;
}

.crm-reference {
  display: block;
  min-height: 100vh;
  padding: 0 10px 16px;
  background:
    radial-gradient(circle at 50% -20%, rgba(37, 99, 235, 0.14), transparent 30%),
    linear-gradient(180deg, #fbfdff 0%, #f5f8fd 46%, #ffffff 100%);
  color: #10213d;
}

.reference-hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 12px 12px;
  text-align: center;
}

.reference-hero h1 {
  margin: 0;
  color: #10213d;
  font-size: clamp(38px, 4.2vw, 64px);
  line-height: 0.98;
  letter-spacing: 0;
}

.reference-hero p {
  margin: 10px 0 0;
  color: #4c5f7d;
  font-size: clamp(18px, 1.45vw, 25px);
  font-weight: 750;
}

.reference-frame {
  display: grid;
  grid-template-columns: 104px minmax(250px, 1fr) minmax(300px, 1.12fr) minmax(300px, 1.08fr) minmax(390px, 1.32fr);
  grid-template-areas:
    "nav dashboard campaigns clients card"
    "nav chats bot knowledge reports";
  gap: 8px;
  align-items: stretch;
  width: min(100%, 1780px);
  margin: 0 auto;
}

.reference-sidebar {
  grid-area: nav;
  min-height: 390px;
  padding: 10px 6px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d5deeb;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(15, 33, 61, 0.05);
}

.reference-logo {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 4px 10px;
  color: #10213d;
}

.reference-logo span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #10213d;
  color: white;
  font-size: 11px;
  font-weight: 900;
}

.reference-logo strong {
  font-size: 11px;
  white-space: nowrap;
}

.reference-sidebar nav {
  display: grid;
  gap: 5px;
}

.reference-sidebar nav a {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 6px 7px;
  border-radius: 6px;
  color: #42526f;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.reference-sidebar nav a span {
  width: 18px;
  color: #6b7a96;
  font-size: 10px;
}

.reference-sidebar nav a.active,
.reference-sidebar nav a:hover {
  background: #1766e8;
  color: #fff;
}

.reference-sidebar nav a.active span,
.reference-sidebar nav a:hover span {
  color: #dbeafe;
}

.reference-card {
  min-width: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d5deeb;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(15, 33, 61, 0.055);
}

.reference-dashboard { grid-area: dashboard; }
.reference-campaigns { grid-area: campaigns; }
.reference-clients { grid-area: clients; }
.reference-client-card { grid-area: card; }
.reference-chats { grid-area: chats; }
.reference-bot { grid-area: bot; }
.reference-knowledge { grid-area: knowledge; }
.reference-reports { grid-area: reports; }

.reference-card-title {
  position: relative;
  min-height: 46px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid #dfe6f2;
}

.reference-card-title span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #1664d9;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(22, 100, 217, 0.2);
}

.reference-card-title h2 {
  margin: 0;
  color: #10213d;
  font-size: 17px;
  line-height: 1.1;
}

.reference-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border-bottom: 1px solid #edf1f7;
}

.reference-toolbar button,
.reference-toolbar select,
.reference-toolbar input,
.reference-toolbar a {
  min-height: 30px;
  width: auto;
  border: 1px solid #d9e2f0;
  border-radius: 5px;
  background: #fff;
  color: #51607a;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 9px;
  text-decoration: none;
}

.reference-toolbar input {
  flex: 1;
  min-width: 90px;
  font-weight: 500;
}

.reference-toolbar .reference-primary,
.reference-primary {
  background: #1264e8;
  border-color: #1264e8;
  color: #fff;
}

.reference-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  padding: 10px 12px;
}

.reference-kpis article,
.reference-dashboard-row article {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 74px;
  padding: 10px;
  background: #f9fbfe;
  border: 1px solid #dfe6f2;
  border-radius: 6px;
}

.reference-kpis span,
.reference-dashboard-row span,
.reference-funnel > span {
  color: #53627d;
  font-size: 11px;
  font-weight: 800;
}

.reference-kpis strong,
.reference-dashboard-row strong {
  color: #1264e8;
  font-size: 27px;
  line-height: 1;
}

.reference-kpis article.good strong {
  color: #16a34a;
}

.reference-kpis article.hot strong {
  color: #ef4444;
}

.reference-kpis small,
.reference-dashboard-row small {
  color: #70809b;
  font-size: 10px;
}

.reference-dashboard-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr;
  gap: 7px;
  padding: 0 12px 10px;
}

.donut-card {
  grid-template-columns: minmax(0, 1fr) 52px;
  align-items: center;
}

.donut-card span,
.donut-card small {
  grid-column: 1;
}

.donut-card i {
  grid-column: 2;
  grid-row: 1 / span 3;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: conic-gradient(#22c55e 0 52%, #0ea5e9 52% 76%, #f59e0b 76% 90%, #94a3b8 90% 100%);
  position: relative;
}

.donut-card i::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: #f9fbfe;
}

.reference-funnel {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.funnel-ribbon {
  display: flex;
  overflow: hidden;
  height: 36px;
  border-radius: 4px;
  background: #eef3f9;
}

.funnel-ribbon i {
  min-width: 28px;
  height: 100%;
  display: block;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%);
  margin-left: -8px;
}

.funnel-ribbon i:first-child {
  margin-left: 0;
}

.funnel-labels {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.funnel-labels small {
  color: #53627d;
  font-size: 10px;
  text-align: center;
}

.funnel-labels b {
  display: block;
  color: #10213d;
  font-size: 12px;
}

.reference-table {
  display: grid;
}

.reference-table-head,
.reference-table-row {
  display: grid;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 12px;
  border-bottom: 1px solid #edf1f7;
  color: #34435f;
  font-size: 11px;
  text-decoration: none;
}

.reference-table-head {
  min-height: 30px;
  background: #f7f9fd;
  color: #53627d;
  font-size: 10px;
  font-weight: 900;
}

.reference-table-row span,
.reference-table-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-table-row:hover {
  background: #f8fbff;
}

.campaign-table .reference-table-head,
.campaign-table .reference-table-row {
  grid-template-columns: minmax(110px, 1fr) 82px 70px 70px 58px 74px;
}

.clients-table .reference-table-head,
.clients-table .reference-table-row {
  grid-template-columns: minmax(74px, 1fr) 98px 46px 72px 74px minmax(92px, 1fr);
}

.knowledge-table .reference-table-head,
.knowledge-table .reference-table-row {
  grid-template-columns: minmax(120px, 1fr) 82px 82px 88px;
}

.reference-table-row em,
.knowledge-table em {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eaf7ee;
  color: #15803d;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.reference-total,
.reference-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: #53627d;
  font-size: 11px;
}

.reference-total strong {
  color: #10213d;
}

.channel-dot {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
}

.channel-whatsapp {
  background: #16a34a;
}

.client-workspace,
.chat-workspace {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 120px;
  min-height: 318px;
}

.client-workspace > *,
.chat-workspace > * {
  min-width: 0;
  border-right: 1px solid #edf1f7;
}

.client-workspace > *:last-child,
.chat-workspace > *:last-child {
  border-right: 0;
}

.client-name-line {
  display: grid;
  gap: 7px;
  padding: 12px;
}

.client-name-line strong {
  color: #10213d;
  font-size: 17px;
}

.client-workspace dl,
.chat-workspace dl {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0 12px;
}

.client-workspace dl div,
.chat-workspace dl div {
  display: grid;
  gap: 2px;
  padding: 7px 0;
  border-bottom: 1px solid #edf1f7;
}

.client-workspace dt,
.chat-workspace dt {
  color: #70809b;
  font-size: 10px;
}

.client-workspace dd,
.chat-workspace dd {
  margin: 0;
  color: #10213d;
  font-size: 11px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.tag-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 12px;
}

.tag-stack span {
  padding: 5px 7px;
  border-radius: 6px;
  background: #eef4ff;
  color: #2563eb;
  font-size: 10px;
  font-weight: 800;
}

.client-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #edf1f7;
}

.client-tabs span {
  padding: 9px 13px;
  color: #70809b;
  font-size: 11px;
  font-weight: 800;
}

.client-tabs span.active {
  color: #1264e8;
  border-bottom: 2px solid #1264e8;
}

.card-chat,
.big-chat {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 210px;
  padding: 12px;
  background: #fbfdff;
}

.card-chat p,
.big-chat p {
  max-width: 78%;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #dfe6f2;
  border-radius: 8px;
  color: #34435f;
  font-size: 11px;
  line-height: 1.4;
}

.card-chat small {
  display: block;
  color: #70809b;
  margin-bottom: 4px;
  font-size: 9px;
}

.card-chat .bot,
.big-chat .bot {
  justify-self: end;
  background: #eef4ff;
  border-color: #ccdcff;
}

.card-chat .client,
.big-chat .client {
  justify-self: start;
  background: #f0fbf4;
  border-color: #cdeed8;
}

.chat-input {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 12px 12px;
  padding: 9px 11px;
  border: 1px solid #dfe6f2;
  border-radius: 6px;
  color: #a0adc2;
  font-size: 11px;
}

.chat-input span {
  color: #1264e8;
  font-size: 18px;
  font-weight: 900;
}

.task-box {
  display: grid;
  gap: 6px;
  margin: 12px;
  padding: 10px;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  background: #fff8ed;
}

.task-box span,
.task-box small {
  color: #92400e;
  font-size: 10px;
}

.task-box strong {
  color: #10213d;
  font-size: 11px;
}

.task-box a,
.quick-actions a {
  min-height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid #bad0ff;
  border-radius: 5px;
  color: #1264e8;
  font-size: 10px;
  font-weight: 900;
  text-decoration: none;
}

.quick-actions {
  display: grid;
  gap: 7px;
  padding: 0 12px 12px;
}

.quick-actions a.green,
.chat-bottom-actions button:first-child {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.quick-actions a.red,
.chat-bottom-actions button:nth-child(2) {
  border-color: #fecaca;
  color: #dc2626;
}

.chat-workspace {
  grid-template-columns: 134px minmax(0, 1fr) 108px;
}

.chat-search {
  margin: 10px;
  padding: 8px;
  border: 1px solid #dfe6f2;
  border-radius: 6px;
  color: #8a97ad;
  font-size: 11px;
}

.dialog-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 30px;
  gap: 7px;
  align-items: center;
  min-height: 52px;
  padding: 8px 10px;
  border-bottom: 1px solid #edf1f7;
  color: #10213d;
  text-decoration: none;
}

.dialog-row strong,
.dialog-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialog-row strong {
  font-size: 11px;
}

.dialog-row small,
.dialog-row em {
  color: #70809b;
  font-size: 9px;
  font-style: normal;
}

.chat-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #edf1f7;
  color: #10213d;
  font-size: 12px;
}

.chat-title span {
  color: #16a34a;
  font-size: 10px;
  font-weight: 800;
}

.big-chat {
  min-height: 214px;
}

.chat-bottom-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  padding: 0 12px 12px;
}

.chat-bottom-actions button {
  min-height: 30px;
  border-radius: 5px;
  font-size: 10px;
  padding: 6px;
}

.chat-workspace aside:last-child {
  padding: 12px;
}

.chat-workspace aside:last-child strong {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
}

.bot-toolbar,
.knowledge-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid #edf1f7;
}

.bot-toolbar span,
.knowledge-toolbar span {
  color: #34435f;
  font-size: 11px;
  font-weight: 800;
}

.bot-toolbar button,
.knowledge-toolbar a,
.editor-box button {
  width: auto;
  min-height: 30px;
  border-radius: 5px;
  font-size: 10px;
  padding: 6px 10px;
}

.bot-toolbar button:last-child,
.knowledge-toolbar a,
.editor-box button:last-child {
  background: #1264e8;
  border-color: #1264e8;
  color: white;
  text-decoration: none;
}

.flow-canvas {
  display: grid;
  gap: 10px;
  justify-items: center;
  min-height: 322px;
  padding: 16px;
  background-image: radial-gradient(#d8e3f2 1px, transparent 1px);
  background-size: 16px 16px;
}

.flow-node {
  min-width: 116px;
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 7px 10px;
  border: 1px solid #bad0ff;
  border-radius: 6px;
  background: #fff;
  color: #1e3a8a;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.flow-node small {
  color: #53627d;
  font-weight: 700;
}

.flow-branch-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.flow-node.yes {
  background: #eaf7ee;
  border-color: #bbf7d0;
  color: #15803d;
}

.flow-node.wait {
  background: #fff8ed;
  border-color: #fed7aa;
  color: #b45309;
}

.flow-node.no,
.flow-node.handover {
  background: #fff1f2;
  border-color: #fecaca;
  color: #dc2626;
}

.knowledge-toolbar span.active {
  color: #1264e8;
}

.knowledge-toolbar a {
  margin-left: auto;
}

.editor-box {
  display: grid;
  gap: 8px;
  margin: 12px;
  padding: 10px;
  border: 1px solid #dfe6f2;
  border-radius: 6px;
}

.editor-box strong {
  color: #10213d;
  font-size: 13px;
}

.editor-box p {
  margin: 0;
  color: #53627d;
  font-size: 11px;
  line-height: 1.45;
}

.editor-box div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.integration-grid-ref {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.integration-grid-ref article {
  min-height: 86px;
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 10px;
  border: 1px solid #dfe6f2;
  border-radius: 7px;
  background: #fbfdff;
}

.integration-grid-ref i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #eaf1ff;
  color: #1264e8;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.integration-grid-ref strong {
  color: #10213d;
  font-size: 11px;
}

.integration-grid-ref small {
  color: #70809b;
  font-size: 9px;
}

.integration-grid-ref em {
  width: fit-content;
  margin-top: 3px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eaf7ee;
  color: #15803d;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
}

.reports-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(160px, 0.75fr);
  gap: 10px;
  padding: 0 12px 12px;
}

.reports-bottom article {
  min-height: 160px;
  padding: 12px;
  border: 1px solid #dfe6f2;
  border-radius: 7px;
  background: #fbfdff;
}

.bar-chart {
  height: 120px;
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 10px;
}

.bar-chart i {
  flex: 1;
  min-width: 8px;
  display: block;
  border-radius: 4px 4px 0 0;
  background: #2563eb;
}

.reports-bottom small {
  color: #53627d;
  font-size: 11px;
}

.metrics-list {
  display: grid;
  gap: 0;
}

.metrics-list div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid #edf1f7;
}

.metrics-list div:last-child {
  border-bottom: 0;
}

.metrics-list span {
  color: #53627d;
  font-size: 11px;
}

.metrics-list strong {
  color: #10213d;
  font-size: 12px;
}

.reference-footer {
  width: min(100%, 1780px);
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 14px auto 0;
  padding: 12px;
  border: 1px solid #d5deeb;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #53627d;
  font-size: 14px;
}

.reference-footer span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid #93b8ff;
  color: #1264e8;
  font-weight: 900;
}

@media (max-width: 1450px) {
  .reference-frame {
    grid-template-columns: 96px repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "nav dashboard campaigns"
      "nav clients card"
      "nav chats bot"
      "nav knowledge reports";
  }
}

@media (max-width: 900px) {
  .reference-frame {
    grid-template-columns: 1fr;
    grid-template-areas:
      "nav"
      "dashboard"
      "campaigns"
      "clients"
      "card"
      "chats"
      "bot"
      "knowledge"
      "reports";
  }

  .reference-sidebar nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .reference-kpis,
  .reference-dashboard-row,
  .client-workspace,
  .chat-workspace,
  .integration-grid-ref,
  .reports-bottom {
    grid-template-columns: 1fr;
  }

  .reference-table-head {
    display: none;
  }

  .campaign-table .reference-table-row,
  .clients-table .reference-table-row,
  .knowledge-table .reference-table-row {
    grid-template-columns: 1fr;
  }
}

/* Large single-module CRM */
.modular-crm {
  display: block;
  min-height: 100vh;
  padding: 22px;
  background:
    radial-gradient(circle at 50% -30%, rgba(37, 99, 235, 0.16), transparent 34%),
    linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
}

.modular-hero {
  width: min(100%, 1540px);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin: 0 auto 18px;
}

.modular-hero h1 {
  margin: 0;
  color: #10213d;
  font-size: clamp(40px, 4vw, 64px);
  line-height: 1;
}

.modular-hero p:last-child {
  max-width: 920px;
  margin: 10px 0 0;
  color: #53627d;
  font-size: 20px;
  font-weight: 650;
}

.module-open-current {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 18px;
  border-radius: 8px;
  background: #1264e8;
  color: #ffffff;
  font-size: 15px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 14px 28px rgba(18, 100, 232, 0.18);
}

.module-header-actions,
.campaign-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.modular-shell {
  width: min(100%, 1540px);
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  margin: 0 auto;
}

.module-launcher {
  min-height: calc(100vh - 170px);
  padding: 16px;
  background: #ffffff;
  border: 1px solid #d5deeb;
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(15, 33, 61, 0.08);
}

.module-brand {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding-bottom: 16px;
  margin-bottom: 14px;
  border-bottom: 1px solid #e4ebf5;
}

.module-brand span {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #10213d;
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
}

.module-brand strong {
  color: #10213d;
  font-size: 20px;
}

.module-brand small {
  grid-column: 2;
  margin-top: -8px;
  color: #70809b;
  font-size: 13px;
}

.module-launcher nav {
  display: grid;
  gap: 10px;
}

.module-sidebar-form {
  margin-top: 14px;
}

.module-sidebar-form button {
  min-height: 46px;
  border: 1px solid #d5deeb;
  border-radius: 8px;
  background: #ffffff;
  color: #10213d;
  font-size: 15px;
  font-weight: 850;
  box-shadow: none;
}

.module-sidebar-form button:hover {
  background: #eef4ff;
}

.module-launcher nav a {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 72px;
  padding: 12px;
  border: 1px solid #dfe6f2;
  border-radius: 8px;
  background: #fbfdff;
  color: #10213d;
  text-decoration: none;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.module-launcher nav a:hover,
.module-launcher nav a.active {
  transform: translateY(-1px);
  border-color: #93b8ff;
  background: #eef4ff;
  box-shadow: 0 12px 24px rgba(18, 100, 232, 0.1);
}

.module-launcher nav a span {
  width: 42px;
  height: 42px;
  display: grid;
  grid-row: 1 / span 2;
  place-items: center;
  border-radius: 50%;
  background: #1264e8;
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
}

.module-launcher nav a strong,
.module-launcher nav a small {
  display: block;
  min-width: 0;
}

.module-launcher nav a strong {
  font-size: 17px;
  line-height: 1.15;
}

.module-launcher nav a small {
  color: #70809b;
  font-size: 13px;
}

.modular-shell.crm-board {
  grid-template-columns: 92px minmax(0, 1fr);
}

.crm-side-nav.compact-rail {
  position: sticky;
  top: 14px;
  align-self: start;
  min-height: calc(100vh - 28px);
  padding: 10px;
}

.compact-rail .module-brand {
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 0;
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.compact-rail .module-brand span {
  width: 46px;
  height: 46px;
}

.compact-rail .module-brand strong,
.compact-rail .module-brand small {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.compact-rail.module-launcher nav {
  gap: 8px;
}

.compact-rail.module-launcher nav a {
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 6px;
  min-height: 68px;
  padding: 10px 6px;
  text-align: center;
}

.compact-rail.module-launcher nav a span {
  grid-row: auto;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 16px;
}

.compact-rail.module-launcher nav a strong {
  max-width: 100%;
  font-size: 11px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.compact-rail.module-launcher nav a small {
  display: none;
}

.module-stage {
  min-width: 0;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #d5deeb;
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(15, 33, 61, 0.08);
}

.module-stage-head {
  padding: 26px 30px;
  border-bottom: 1px solid #e4ebf5;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.module-stage-head span {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 7px 11px;
  border-radius: 999px;
  background: #eaf1ff;
  color: #1264e8;
  font-size: 14px;
  font-weight: 850;
}

.module-stage-head h2 {
  margin: 0;
  color: #10213d;
  font-size: clamp(32px, 3vw, 48px);
  line-height: 1;
}

.module-stage-head p {
  max-width: 820px;
  margin: 12px 0 0;
  color: #53627d;
  font-size: 18px;
  line-height: 1.45;
}

.module-panel {
  padding: 24px 30px 30px;
}

.settings-workbench {
  grid-template-columns: 320px minmax(0, 1fr);
}

.settings-side-nav {
  position: sticky;
  top: 14px;
  align-self: start;
}

.settings-section-stack {
  display: grid;
  gap: 26px;
}

.settings-anchor-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.settings-anchor-strip a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #d9e3f1;
  border-radius: 999px;
  background: #f8fbff;
  color: #10213d;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.settings-summary-metrics {
  margin-bottom: 0;
}

.settings-summary-metrics article small {
  color: #70809b;
  font-size: 13px;
  font-weight: 700;
}

.settings-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.settings-guide-grid article {
  display: grid;
  gap: 10px;
  min-height: 124px;
  padding: 18px 20px;
  border: 1px solid #dfe6f2;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.settings-guide-grid span {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eaf1ff;
  color: #1264e8;
  font-size: 12px;
  font-weight: 850;
}

.settings-guide-grid strong {
  color: #10213d;
  font-size: 16px;
  line-height: 1.45;
}

.settings-block {
  display: grid;
  gap: 16px;
}

.settings-auth-grid .telegram-account-card {
  opacity: 1;
}

.operator-settings-grid {
  align-items: start;
}

.settings-panel-wide {
  grid-column: 1 / -1;
}

.scenario-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.scenario-fields-grid label small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.settings-inline-note {
  max-width: 420px;
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid #d9e3f1;
  border-radius: 8px;
  background: #f8fbff;
}

.settings-inline-note strong {
  color: #10213d;
  font-size: 14px;
}

.settings-inline-note span {
  color: #53627d;
  font-size: 14px;
  line-height: 1.45;
}

.settings-upload-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.settings-upload-form input[type="file"] {
  width: auto;
}

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

.settings-documents-list article {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid #dfe6f2;
  border-radius: 8px;
  background: #f8fbff;
}

.settings-documents-list strong {
  color: #10213d;
}

.settings-documents-list small {
  color: #70809b;
}

@media (max-width: 1180px) {
  .settings-workbench {
    grid-template-columns: 1fr;
  }

  .settings-side-nav {
    position: static;
  }
}

@media (max-width: 900px) {
  .settings-guide-grid,
  .scenario-fields-grid,
  .settings-documents-list {
    grid-template-columns: 1fr;
  }

  .settings-upload-form,
  .module-header-actions,
  .campaign-hero-actions {
    justify-content: flex-start;
  }
}

.module-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.module-actions .button-link,
.module-actions button,
.module-actions select,
.module-actions input {
  width: auto;
  min-height: 46px;
  border-radius: 8px;
  font-size: 15px;
}

.module-actions input {
  flex: 1;
  min-width: 240px;
}

.module-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.module-metrics article,
.report-large-grid article {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 132px;
  padding: 22px;
  border: 1px solid #dfe6f2;
  border-radius: 8px;
  background: #f8fbff;
}

.module-metrics span,
.report-large-grid span {
  color: #53627d;
  font-size: 16px;
  font-weight: 800;
}

.module-metrics strong,
.report-large-grid strong {
  color: #1264e8;
  font-size: clamp(38px, 4vw, 58px);
  line-height: 1;
}

.module-metrics .metric-hot strong {
  color: #ef4444;
}

.module-metrics .metric-manual strong {
  color: #f97316;
}

.module-metrics .metric-bot strong {
  color: #16a34a;
}

.dashboard-capsule-shell {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 26px;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid rgba(196, 206, 220, 0.95);
  border-radius: 32px;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 36%),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 248, 252, 0.96) 100%);
  box-shadow: 0 30px 72px rgba(15, 23, 42, 0.12);
}

.dashboard-capsule-shell::before {
  content: "";
  position: absolute;
  inset: 0 18% auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.92), transparent);
}

.dashboard-capsule-copy,
.dashboard-capsule-scene {
  position: relative;
  z-index: 1;
}

.dashboard-capsule-copy {
  display: grid;
  gap: 14px;
  max-width: 760px;
}

.dashboard-capsule-copy span {
  display: inline-flex;
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.1);
}

.dashboard-capsule-copy h3 {
  margin: 0;
  color: #10213d;
  font-size: clamp(34px, 4vw, 56px);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.dashboard-capsule-copy p {
  max-width: 620px;
  margin: 0;
  color: #53627d;
  font-size: 17px;
  line-height: 1.55;
}

.dashboard-capsule-scene {
  display: grid;
  place-items: center;
  min-height: 520px;
  padding: 24px 10px 8px;
}

.dashboard-capsule-glow {
  position: absolute;
  inset: 2% 6% 0;
  pointer-events: none;
}

.dashboard-glow-orbit {
  position: absolute;
  inset: 50% auto auto 50%;
  display: block;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(160, 176, 199, 0.28);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.05) 62%, transparent 100%);
  animation: capsuleOrbit 16s ease-in-out infinite;
}

.orbit-a {
  width: min(100%, 760px);
  height: 360px;
}

.orbit-b {
  width: min(100%, 620px);
  height: 280px;
  animation-delay: -4s;
}

.orbit-c {
  width: min(100%, 500px);
  height: 220px;
  animation-delay: -8s;
}

.capsule-funnel-stack {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(100%, 840px);
}

.capsule-layer {
  --capsule-lift: calc(var(--capsule-order) * -8px);
  position: relative;
  width: min(100%, 780px);
  display: grid;
  gap: 12px;
  padding: 18px 24px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  box-shadow:
    0 20px 44px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transform: translateY(var(--capsule-lift));
  animation: capsuleDrift 12s ease-in-out infinite;
  animation-delay: calc(var(--capsule-order) * -1.2s);
}

.capsule-layer::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 58%);
  pointer-events: none;
}

.capsule-layer:nth-child(1) { width: min(100%, 780px); }
.capsule-layer:nth-child(2) { width: min(100%, 700px); }
.capsule-layer:nth-child(3) { width: min(100%, 620px); }
.capsule-layer:nth-child(4) { width: min(100%, 540px); }
.capsule-layer:nth-child(5) { width: min(100%, 460px); }

.capsule-layer-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
}

.capsule-layer-head span {
  color: #334155;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.capsule-layer-head strong {
  color: #10213d;
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1;
}

.capsule-layer-meter {
  position: relative;
  z-index: 1;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 1px 4px rgba(15, 23, 42, 0.1);
}

.capsule-layer-meter i {
  display: block;
  width: var(--capsule-fill);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--capsule-color) 0%, rgba(255, 255, 255, 0.92) 180%);
  box-shadow: 0 0 18px color-mix(in srgb, var(--capsule-color) 52%, transparent);
}

.capsule-tone-blue {
  --capsule-color: #3b82f6;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.28), rgba(255, 255, 255, 0.3) 55%, rgba(191, 219, 254, 0.42) 100%);
}

.capsule-tone-green {
  --capsule-color: #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.26), rgba(255, 255, 255, 0.3) 54%, rgba(167, 243, 208, 0.4) 100%);
}

.capsule-tone-cyan {
  --capsule-color: #06b6d4;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.24), rgba(255, 255, 255, 0.3) 54%, rgba(165, 243, 252, 0.44) 100%);
}

.capsule-tone-orange {
  --capsule-color: #f97316;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.24), rgba(255, 255, 255, 0.3) 54%, rgba(254, 215, 170, 0.42) 100%);
}

.capsule-tone-red {
  --capsule-color: #ef4444;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.22), rgba(255, 255, 255, 0.32) 54%, rgba(254, 202, 202, 0.42) 100%);
}

@keyframes capsuleDrift {
  0%, 100% {
    transform: translateY(var(--capsule-lift));
  }
  50% {
    transform: translateY(calc(var(--capsule-lift) - 6px));
  }
}

@keyframes capsuleOrbit {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.58;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.03);
    opacity: 0.86;
  }
}

.big-table {
  overflow: hidden;
  border: 1px solid #dfe6f2;
  border-radius: 8px;
  background: #ffffff;
}

.big-table-head,
.big-table-row {
  display: grid;
  align-items: center;
  gap: 16px;
  min-height: 58px;
  padding: 14px 18px;
  border-bottom: 1px solid #e4ebf5;
  color: #10213d;
  font-size: 16px;
  text-decoration: none;
}

.big-table-head {
  min-height: 52px;
  background: #f8fbff;
  color: #53627d;
  font-size: 14px;
  font-weight: 900;
}

.big-table-row:last-child {
  border-bottom: 0;
}

.big-table-row:hover {
  background: #f8fbff;
}

.big-table-row span,
.big-table-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.campaigns-big-table .big-table-head,
.campaigns-big-table .big-table-row {
  grid-template-columns: minmax(220px, 1fr) 150px 130px 110px 140px;
}

.clients-big-table .big-table-head,
.clients-big-table .big-table-row {
  grid-template-columns: minmax(180px, 1fr) 170px 150px 140px minmax(220px, 1fr);
}

.large-client-card,
.chat-module-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
}

.large-client-card aside,
.large-client-card main,
.chat-module-grid aside,
.chat-module-grid main {
  min-width: 0;
  padding: 22px;
  border: 1px solid #dfe6f2;
  border-radius: 8px;
  background: #f8fbff;
}

.large-client-card aside strong {
  display: block;
  margin-bottom: 12px;
  color: #10213d;
  font-size: 28px;
}

.large-client-card dl {
  display: grid;
  gap: 0;
  margin: 20px 0;
}

.large-client-card dl div {
  padding: 12px 0;
  border-bottom: 1px solid #dfe6f2;
}

.large-client-card dt {
  color: #70809b;
  font-size: 14px;
}

.large-client-card dd {
  margin: 4px 0 0;
  color: #10213d;
  font-size: 18px;
  font-weight: 800;
}

.large-chat {
  display: grid;
  gap: 14px;
  min-height: 460px;
  align-content: start;
  padding: 20px;
  border: 1px solid #dfe6f2;
  border-radius: 8px;
  background: #ffffff;
}

.large-chat p {
  max-width: 74%;
  margin: 0;
  padding: 14px 16px;
  border-radius: 8px;
  color: #10213d;
  font-size: 17px;
  line-height: 1.45;
  overflow-wrap: anywhere !important;
  word-wrap: break-word !important;
  word-break: break-all !important;
}

.large-chat small {
  display: block;
  margin-bottom: 6px;
  color: #70809b;
  font-size: 13px;
  font-weight: 850;
}

.message-delivery {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  gap: 0;
  color: #94a3b8;
  font-weight: 900;
  line-height: 1;
  vertical-align: middle;
  transform: translateY(1px);
}

.message-delivery-tick {
  display: inline-block;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.message-delivery-double .message-delivery-tick + .message-delivery-tick {
  margin-left: -4px;
}

.message-delivery-sent,
.message-delivery-sent .message-delivery-tick,
.message-delivery[data-delivery-status="sent"],
.message-delivery[data-delivery-status="sent"] .message-delivery-tick,
.message-delivery[data-delivery-status="delivered"],
.message-delivery[data-delivery-status="delivered"] .message-delivery-tick {
  color: #dc2626 !important;
}

.message-delivery-sent .message-delivery-tick:last-child,
.message-delivery[data-delivery-status="sent"] .message-delivery-tick:last-child,
.message-delivery[data-delivery-status="delivered"] .message-delivery-tick:last-child {
  color: #b91c1c !important;
  text-shadow: 0 0 7px rgba(220, 38, 38, 0.22);
}

.message-delivery-pending {
  color: #94a3b8;
}

.message-delivery-read,
.message-delivery-read .message-delivery-tick,
.message-delivery-read[data-delivery-status="read"],
.message-delivery-read[data-delivery-status="read"] .message-delivery-tick,
.message-delivery[data-delivery-status="read"],
.message-delivery[data-delivery-status="read"] .message-delivery-tick {
  color: #dc2626 !important;
}

.message-delivery-read .message-delivery-tick:last-child,
.message-delivery-read[data-delivery-status="read"] .message-delivery-tick:last-child,
.message-delivery[data-delivery-status="read"] .message-delivery-tick:last-child {
  color: #b91c1c !important;
  text-shadow: 0 0 7px rgba(220, 38, 38, 0.22);
}

/* Channel origin badge on each message (which channel the message came via) */
.channel-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.02em;
  vertical-align: middle;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.channel-badge-whatsapp {
  background: #e8f8ee;
  color: #1f8f4e;
  border-color: #bbf7d0;
}

.channel-badge-telegram {
  background: #e7f3fc;
  color: #1d7fc4;
  border-color: #bfe0f6;
}

.channel-badge-max {
  background: #fdeede;
  color: #c2701b;
  border-color: #f6d8b0;
}

.large-chat .client {
  justify-self: start;
  background: #f0fbf4;
  border: 1px solid #bbf7d0;
}

.large-chat .bot {
  justify-self: end;
  background: #eef4ff;
  border: 1px solid #bfdbfe;
}

.large-chat .manager,
.large-chat .operator {
  justify-self: end;
  background: #fff7ed;
  border: 1px solid #fdba74;
}

.large-chat .manager_note {
  justify-self: stretch;
  max-width: 100%;
  background: #fff8db;
  border: 1px dashed #eab308;
  color: #713f12;
}

.large-chat .manager_note small {
  color: #854d0e;
}

.large-input {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #dfe6f2;
  border-radius: 8px;
  background: #ffffff;
  color: #8a97ad;
  font-size: 16px;
}

.large-input span {
  color: #1264e8;
  font-size: 28px;
  font-weight: 900;
}

.dialog-row-large {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 78px;
  padding: 12px 0;
  border-bottom: 1px solid #dfe6f2;
  color: #10213d;
  text-decoration: none;
}

.dialog-row-large > span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eaf1ff;
  color: #1264e8;
  font-size: 18px;
  font-weight: 900;
}

.dialog-row-large strong,
.dialog-row-large small,
.dialog-row-large em {
  display: block;
}

.dialog-row-large strong {
  font-size: 17px;
}

.dialog-row-large small,
.dialog-row-large em {
  color: #70809b;
  font-size: 13px;
  font-style: normal;
}

.dialog-row-large .dialog-inbound-badge {
  color: #0f7a43;
  font-weight: 800;
}

.chat-module-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.chat-module-actions button {
  min-height: 46px;
  border-radius: 8px;
  font-size: 15px;
}

.large-flow {
  display: grid;
  gap: 20px;
  justify-items: center;
  min-height: 600px;
  padding: 34px;
  border: 1px solid #dfe6f2;
  border-radius: 8px;
  background-image: radial-gradient(#d8e3f2 1.2px, transparent 1.2px);
  background-size: 22px 22px;
}

.large-flow .flow-node {
  min-width: 180px;
  min-height: 66px;
  font-size: 17px;
}

.large-flow .flow-node small {
  font-size: 13px;
}

.large-flow .flow-branch-grid {
  gap: 20px;
}

.scenario-script {
  display: grid;
  gap: 18px;
}

.scenario-start {
  display: grid;
  gap: 12px;
  padding: 24px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: linear-gradient(180deg, #eef4ff 0%, #ffffff 100%);
}

.scenario-start span {
  color: #1264e8;
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
}

.scenario-start strong {
  color: #10213d;
  font-size: clamp(24px, 2.2vw, 34px);
  line-height: 1.22;
}

.scenario-start p {
  margin: 0;
  color: #53627d;
  font-size: 17px;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.scenario-node {
  min-height: 230px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  padding: 20px;
  border: 1px solid #dfe6f2;
  border-radius: 8px;
  background: #ffffff;
}

.scenario-node > span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #1264e8;
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
}

.scenario-node h3 {
  margin: 0;
  color: #10213d;
  font-size: 22px;
  line-height: 1.15;
  text-transform: none;
}

.scenario-node small {
  display: block;
  margin-top: 8px;
  color: #70809b;
  font-size: 14px;
  line-height: 1.35;
}

.scenario-node p {
  margin: 14px 0 0;
  color: #34435f;
  font-size: 16px;
  line-height: 1.45;
}

.scenario-node em {
  display: block;
  width: fit-content;
  margin-top: 16px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fbff;
  color: #53627d;
  font-size: 14px;
  font-style: normal;
  font-weight: 850;
  line-height: 1.35;
}

.scenario-yes {
  border-color: #bbf7d0;
  background: #f4fbf6;
}

.scenario-yes > span,
.scenario-builder > span {
  background: #16a34a;
}

.scenario-wait {
  border-color: #fed7aa;
  background: #fff8ed;
}

.scenario-wait > span,
.scenario-price > span {
  background: #f59e0b;
}

.scenario-no,
.scenario-private,
.scenario-stop {
  border-color: #fecaca;
  background: #fff7f7;
}

.scenario-no > span,
.scenario-private > span,
.scenario-stop > span {
  background: #ef4444;
}

.scenario-plant > span {
  background: #0ea5e9;
}

.scenario-handover > span {
  background: #7c3aed;
}

.knowledge-large-grid,
.integration-large-grid,
.report-large-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.knowledge-large-grid article,
.integration-large-grid article {
  min-height: 190px;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 22px;
  border: 1px solid #dfe6f2;
  border-radius: 8px;
  background: #f8fbff;
}

.knowledge-large-grid strong,
.integration-large-grid strong {
  color: #10213d;
  font-size: 24px;
}

.knowledge-large-grid p,
.integration-large-grid span {
  margin: 0;
  color: #53627d;
  font-size: 17px;
  line-height: 1.45;
}

.knowledge-large-grid em,
.integration-large-grid em {
  width: fit-content;
  margin-top: auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eaf7ee;
  color: #15803d;
  font-size: 14px;
  font-style: normal;
  font-weight: 900;
}

.report-large-grid {
  margin-top: 18px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.campaign-module-shell,
.campaign-detail-module {
  padding-top: 18px;
}

.campaign-module-hero {
  align-items: center;
}

.campaign-hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.campaign-hero-actions form {
  margin: 0;
}

.campaign-hero-actions button,
.campaign-create-form button,
.campaign-reply-form > button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: #1264e8;
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(18, 100, 232, 0.18);
}

.module-open-current.secondary {
  background: #ffffff;
  color: #10213d;
  border: 1px solid #d5deeb;
  box-shadow: none;
}

.campaign-create-shell,
.campaign-detail-shell {
  align-items: start;
}

.campaign-flow-sidebar {
  position: sticky;
  top: 18px;
}

.campaign-step-list {
  display: grid;
  gap: 12px;
}

.campaign-step-list article {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 92px;
  padding: 14px;
  border: 1px solid #dfe6f2;
  border-radius: 8px;
  background: #fbfdff;
}

.campaign-step-list.compact article {
  min-height: 78px;
}

.campaign-step-list article > span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #1264e8;
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
}

.campaign-step-list strong,
.campaign-step-list small {
  display: block;
}

.campaign-step-list strong {
  color: #10213d;
  font-size: 17px;
  line-height: 1.2;
}

.campaign-step-list small {
  margin-top: 6px;
  color: #70809b;
  font-size: 13px;
  line-height: 1.35;
}

.campaign-first-message {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff8ed;
}

.campaign-first-message strong {
  color: #9a3412;
  font-size: 15px;
}

.campaign-first-message p {
  margin: 0;
  color: #4b5563;
  font-size: 15px;
  line-height: 1.45;
}

.campaign-create-grid,
.campaign-detail-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.campaign-create-form,
.campaign-preview-panel,
.campaign-recipients-panel,
.campaign-test-panel {
  min-width: 0;
}

.campaign-create-form {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid #dfe6f2;
  border-radius: 8px;
  background: #f8fbff;
}

.campaign-create-form label,
.campaign-reply-form label {
  display: grid;
  gap: 9px;
}

.campaign-create-form label span,
.campaign-reply-form label span {
  color: #53627d;
  font-size: 15px;
  font-weight: 850;
}

.campaign-create-form input,
.campaign-create-form textarea,
.campaign-reply-form select,
.campaign-reply-form textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #10213d;
  font: inherit;
  font-size: 17px;
  line-height: 1.45;
}

.campaign-create-form input,
.campaign-reply-form select {
  min-height: 52px;
  padding: 13px 14px;
}

.campaign-create-form textarea,
.campaign-reply-form textarea {
  min-height: 142px;
  padding: 14px;
  resize: vertical;
}

.campaign-create-form button {
  width: fit-content;
  padding: 0 22px;
}

.campaign-submit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.campaign-submit-actions .secondary-action {
  border-color: #cbd5e1;
  background: #ffffff;
  color: #10213d;
}

.campaign-submit-actions .secondary-action:hover {
  background: #eef4ff;
}

.campaign-preview-panel {
  display: grid;
  gap: 16px;
}

.campaign-create-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0;
}

.campaign-create-metrics article {
  min-height: 116px;
}

.campaign-create-metrics strong {
  font-size: 44px;
}

.campaign-preview-card,
.campaign-mini-list,
.campaign-events,
.test-box {
  border: 1px solid #dfe6f2;
  border-radius: 8px;
  background: #ffffff;
}

.campaign-preview-card {
  padding: 20px;
}

.campaign-preview-card h3,
.campaign-mini-list h3,
.campaign-events h3,
.test-box h3,
.section-title-row h3 {
  margin: 0;
  color: #10213d;
  font-size: 22px;
  line-height: 1.2;
  text-transform: none;
}

.campaign-preview-card p,
.campaign-mini-list p,
.campaign-events p,
.test-box p,
.section-title-row p {
  margin: 10px 0 0;
  color: #53627d;
  font-size: 16px;
  line-height: 1.45;
}

.campaign-mini-list {
  overflow: hidden;
}

.campaign-mini-list h3 {
  padding: 18px 18px 0;
}

.campaign-mini-list > a,
.campaign-mini-list > p {
  display: grid;
  gap: 7px;
  padding: 16px 18px;
  border-top: 1px solid #e4ebf5;
  color: #10213d;
  text-decoration: none;
}

.campaign-mini-list > a:hover {
  background: #f8fbff;
}

.campaign-mini-list strong {
  font-size: 16px;
}

.campaign-mini-list small {
  color: #70809b;
  font-size: 13px;
}

.section-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.campaign-recipients-table .big-table-head,
.campaign-recipients-table .big-table-row {
  grid-template-columns: minmax(170px, 1fr) 155px minmax(170px, 1fr) 145px;
}

/* MAX channel campaigns get an extra precheck column */
.campaign-recipients-table.has-max-column .big-table-head,
.campaign-recipients-table.has-max-column .big-table-row {
  grid-template-columns: minmax(140px, 1fr) 140px minmax(140px, 1fr) 120px minmax(180px, 1fr);
}

.max-precheck-status { font-size: 12px; font-weight: 700; }
.max-precheck-MAX_VERIFIED { color: #15803d; }
.max-precheck-MAX_NOT_FOUND { color: #6b7280; }
.max-precheck-MAX_NEED_CONFIRMATION { color: #b45309; }
.max-precheck-MAX_MISMATCH { color: #b91c1c; }
.max-precheck-MAX_TIMEOUT,
.max-precheck-MAX_WEB_NOT_READY { color: #9333ea; }
.max-precheck-unchecked { color: #9ca3af; }

.max-precheck-detail {
  display: block;
  font-size: 11px;
  color: #6b7280;
  margin-top: 2px;
  line-height: 1.3;
}

.retry-precheck-btn {
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 13px;
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  cursor: pointer;
  color: #6b7280;
  vertical-align: middle;
}
.retry-precheck-btn:hover { background: #f3f4f6; color: #374151; }

.campaign-test-panel {
  display: grid;
  gap: 16px;
}

.test-box {
  padding: 20px;
}

.campaign-reply-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.campaign-recipient-capture {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid #dfe6f2;
  border-radius: 8px;
  background: #f8fbff;
}

.campaign-recipient-capture h3,
.campaign-recipient-capture p {
  margin: 0;
}

.campaign-recipient-capture p {
  color: #60708c;
  line-height: 1.5;
}

.campaign-reply-form textarea {
  min-height: 108px;
}

.campaign-reply-form > button {
  width: 100%;
}

.account-connect-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.account-connect-actions > button {
  flex: 1 1 220px;
}

.account-connect-actions .secondary-action {
  border: 1px solid #d7e7fb;
  background: #ffffff;
  color: #10213d;
  box-shadow: none;
}

.demo-replies {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.demo-replies button {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eef4ff;
  color: #10213d;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
}

.demo-replies button:hover {
  border-color: #93b8ff;
  background: #eaf1ff;
}

.campaign-events {
  display: grid;
  gap: 10px;
  padding: 20px;
}

.compact-events {
  margin-top: 14px;
  padding: 14px;
}

.campaign-events .crm-item {
  padding: 12px;
  border: 1px solid #e4ebf5;
  border-radius: 8px;
  background: #f8fbff;
}

.campaign-events .crm-item strong,
.campaign-events .crm-item small {
  display: block;
}

.campaign-events .crm-item strong {
  color: #10213d;
  font-size: 15px;
}

.campaign-events .crm-item small {
  margin-top: 5px;
  color: #70809b;
  font-size: 13px;
}

.campaign-safe-flow {
  display: grid;
  gap: 16px;
  margin: 18px 20px 0;
  padding: 18px;
  border: 1px solid #dfe6f2;
  border-radius: 8px;
  background: #f8fbff;
}

.campaign-safe-flow h3,
.campaign-safe-flow p {
  margin: 0;
}

.campaign-safe-flow p {
  color: #60708c;
  line-height: 1.5;
}

.campaign-safe-flow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.campaign-safe-flow-grid article {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid #dfe6f2;
  border-radius: 8px;
  background: #ffffff;
}

.campaign-safe-flow-grid span {
  color: #70809b;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.campaign-safe-flow-grid strong {
  color: #10213d;
  font-size: 18px;
  line-height: 1.3;
}

.campaign-safe-flow-note {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.campaign-safe-flow-note span {
  color: #60708c;
  line-height: 1.5;
}

@media (max-width: 1180px) {
  .modular-hero,
  .modular-shell {
    width: 100%;
  }

  .modular-shell,
  .large-client-card,
  .chat-module-grid,
  .dashboard-large-grid,
  .campaign-create-grid,
  .campaign-detail-workspace {
    grid-template-columns: 1fr;
  }

  .module-launcher {
    min-height: auto;
  }

  .campaign-flow-sidebar {
    position: static;
  }

  .campaign-safe-flow-grid {
    grid-template-columns: 1fr;
  }

  .campaign-safe-flow-note {
    flex-direction: column;
    align-items: stretch;
  }

  .module-launcher nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-metrics,
  .scenario-grid,
  .knowledge-large-grid,
  .integration-large-grid,
  .report-large-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .modular-crm {
    padding: 14px;
  }

  .modular-hero,
  .module-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .module-open-current,
  .module-actions .button-link,
  .module-actions button,
  .module-actions select,
  .module-actions input {
    width: 100%;
  }

  .module-launcher nav,
  .module-metrics,
  .scenario-grid,
  .knowledge-large-grid,
  .integration-large-grid,
  .report-large-grid,
  .chat-module-actions,
  .large-flow .flow-branch-grid {
    grid-template-columns: 1fr;
  }

  .big-table-head {
    display: none;
  }

  .campaigns-big-table .big-table-row,
  .clients-big-table .big-table-row,
  .campaign-recipients-table .big-table-row {
    grid-template-columns: 1fr;
  }

  .campaign-hero-actions,
  .campaign-create-form button {
    width: 100%;
  }

  .campaign-hero-actions {
    align-items: stretch;
  }

  .campaign-hero-actions button,
  .campaign-hero-actions form {
    width: 100%;
  }

  .large-chat p {
    max-width: 100%;
  }
}

/* ---- Chat module: interactive elements ---- */

.large-input-form,
.chat-reply-form {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  padding: 10px 14px;
  border: 1px solid #dfe6f2;
  border-radius: 8px;
  background: #ffffff;
}

.large-input-form input[type="text"],
.chat-reply-form input[type="text"] {
  flex: 1;
  min-height: 44px;
  border: 0;
  background: transparent;
  font-size: 16px;
  outline: none;
  box-shadow: none;
}

.large-input-form input[type="text"]:focus,
.chat-reply-form input[type="text"]:focus {
  box-shadow: none;
  border: none;
}

.large-input-form button,
.chat-reply-form button {
  width: auto;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 0;
  background: #1264e8;
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.large-input-form button:hover,
.chat-reply-form button:hover {
  background: #0f4fc4;
}

.chat-send-feedback {
  min-height: 20px;
  margin: 8px 0 0;
  font-size: 14px;
  color: #6b7280;
}

.chat-send-feedback.success {
  color: #15803d;
}

.chat-send-feedback.error {
  color: #b91c1c;
}

.max-mapping-box {
  margin: 0.75rem 0 0;
  padding: 0.85rem;
  border: 1px solid #dfe6f2;
  border-radius: 8px;
  background: #f8fbff;
}

.max-mapping-box-chat {
  margin: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
}

.max-mapping-box strong {
  display: block;
  color: #10213d;
}

.max-mapping-box small {
  display: block;
  margin-top: 0.25rem;
  color: #5f6f89;
  line-height: 1.45;
}

.max-mapping-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.max-mapping-feedback {
  min-height: 20px;
  margin: 8px 0 0;
  font-size: 13px;
  color: #6b7280;
}

.max-mapping-feedback.success {
  color: #15803d;
}

.max-mapping-feedback.error {
  color: #b91c1c;
}

.chat-module-client-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid #dfe6f2;
  background: #f8fbff;
}

.chat-module-client-bar strong {
  font-size: 18px;
  color: #10213d;
}

.dialog-row-large.dialog-active {
  background: #eef4ff;
  border-left: 3px solid #1264e8;
  padding-left: 10px;
}

.inline-form {
  display: inline;
}

.inline-form button {
  min-height: 46px;
  border-radius: 8px;
  font-size: 15px;
}

.chat-module-actions {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.chat-module-actions .inline-form {
  flex: 1;
  min-width: 140px;
}

.chat-module-actions .inline-form button {
  width: 100%;
}

.empty-chat-hint {
  color: #70809b;
  font-size: 16px;
  font-style: italic;
  padding: 20px;
  text-align: center;
}

.chat-search {
  width: 100%;
  min-height: 44px;
  margin-bottom: 10px;
  padding: 10px 14px;
  border: 1px solid #dfe6f2;
  border-radius: 8px;
  background: #f8fbff;
  font: inherit;
  font-size: 15px;
  color: #10213d;
  outline: none;
}

.chat-search:focus {
  border-color: #1264e8;
  box-shadow: 0 0 0 3px rgba(18, 100, 232, 0.12);
}

.telegram-auth-panel {
  margin: 24px 0;
}

.dashboard-launch-panel {
  display: grid;
  gap: 18px;
  margin-bottom: 22px;
}

.dashboard-launch-panel .telegram-account-card {
  box-shadow: none;
}

.telegram-auth-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.connected-account,
.auth-warning {
  display: grid;
  gap: 4px;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid #cfe0f8;
  background: #f5f9ff;
  color: #10213d;
}

.connected-account strong,
.auth-warning strong {
  font-size: 18px;
}

.auth-warning {
  border-color: #f0d2a8;
  background: #fff8ed;
}

.settings-fields button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.inline-action-form {
  margin: 0;
}

.inline-action-form button.button-link {
  border: 0;
  cursor: pointer;
}

.campaign-quick-send {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 1.2fr) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid #cfe0f8;
  border-radius: 18px;
  background: linear-gradient(135deg, #f6fbff, #eef7ff);
}

.campaign-quick-send div {
  display: grid;
  gap: 4px;
}

.campaign-quick-send strong {
  color: #10213d;
  font-size: 18px;
}

.campaign-quick-send span {
  color: #60708c;
}

.campaign-quick-send label {
  margin: 0;
}

.whatsapp-connect-panel {
  border-radius: 24px;
  border-color: #bfe4d0;
  background:
    radial-gradient(circle at 90% 0%, rgba(33, 197, 111, 0.16), transparent 34%),
    #ffffff;
}

.telegram-connect-panel {
  border-radius: 24px;
  border-color: #bfdbfe;
  background:
    radial-gradient(circle at 90% 0%, rgba(0, 136, 204, 0.12), transparent 34%),
    #ffffff;
}

.whatsapp-connect-panel .integration-panel-head {
  border-bottom: 0;
  padding-bottom: 8px;
}

.telegram-connect-panel .integration-panel-head {
  border-bottom: 0;
  padding-bottom: 8px;
}

.whatsapp-connect-panel h2 {
  margin: 2px 0 6px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.telegram-connect-panel h2 {
  margin: 2px 0 6px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.whatsapp-connect-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(280px, 1.1fr);
  gap: 18px;
  align-items: stretch;
  padding: 0 18px 18px;
}

.whatsapp-connect-form {
  align-content: start;
  padding: 18px;
  border-radius: 20px;
  background: #f6fbff;
  border: 1px solid #d7e7fb;
}

.telegram-connect-form {
  background: #f3f9ff;
  border-color: #cfe4ff;
}

.whatsapp-connect-form small {
  color: #60708c;
  line-height: 1.5;
}

.whatsapp-qr-box {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  align-items: center;
  padding: 18px;
  border: 1px solid #bfe4d0;
  border-radius: 22px;
  background: linear-gradient(135deg, #effff5, #f8fff9);
}

.whatsapp-qr-box img,
.whatsapp-qr-empty,
.whatsapp-qr-connected {
  width: 220px;
  height: 220px;
  border-radius: 24px;
  object-fit: cover;
  background: #10213d;
}

.whatsapp-qr-empty {
  display: grid;
  place-items: center;
  border: 1px dashed #9dcfb1;
  color: #8eb89d;
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -0.08em;
}

.whatsapp-qr-connected {
  display: grid;
  place-items: center;
  color: #14532d;
  background: linear-gradient(135deg, #bbf7d0, #ecfdf5);
  border: 1px solid #86efac;
  font-size: 28px;
  font-weight: 900;
}

.whatsapp-qr-box strong {
  display: block;
  color: #10213d;
  font-size: 20px;
  margin-bottom: 8px;
}

.whatsapp-qr-box span {
  display: block;
  color: #28402d;
  line-height: 1.5;
}

.telegram-connect-layout .whatsapp-qr-box {
  border-color: #bfdbfe;
  background: linear-gradient(135deg, #eff7ff, #f9fcff);
}

.telegram-connect-layout .whatsapp-qr-empty {
  border-color: #9ccbf3;
  color: #8bb8df;
}

.telegram-connect-layout .whatsapp-qr-box span {
  color: #48627d;
}

.whatsapp-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 18px 18px;
}

.whatsapp-steps span {
  border-radius: 999px;
  padding: 8px 12px;
  background: #eefaf2;
  color: #1d6d3a;
  font-size: 13px;
  font-weight: 800;
}

.telegram-steps span {
  background: #eef6ff;
  color: #075985;
}

.launch-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.launch-quick-actions a {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid #dfe6f2;
  border-radius: 8px;
  background: #f8fbff;
  color: #10213d;
  text-decoration: none;
}

.launch-quick-actions strong {
  font-size: 17px;
}

.launch-quick-actions span {
  color: #70809b;
}

@media (max-width: 760px) {
  .telegram-auth-grid {
    grid-template-columns: 1fr;
  }

  .launch-quick-actions {
    grid-template-columns: 1fr;
  }

  .campaign-quick-send,
  .whatsapp-qr-box,
  .whatsapp-connect-layout,
  .account-auth-primary {
    grid-template-columns: 1fr;
  }

  .whatsapp-qr-box img,
  .whatsapp-qr-empty {
    width: min(100%, 240px);
    height: auto;
    aspect-ratio: 1;
  }

  .whatsapp-connect-layout {
    align-items: start;
  }

  .whatsapp-connect-form,
  .telegram-auth-grid .settings-fields {
    align-content: start;
    align-self: start;
  }

  .whatsapp-connect-form .account-connect-actions > button,
  .telegram-auth-grid .settings-fields > button {
    flex: 0 0 auto;
    min-height: 44px;
    height: auto;
    padding-block: 11px;
  }

  .integration-admin-details summary {
    display: grid;
  }
}

@media (max-width: 1180px) {
  .crm-side-nav.compact-rail {
    position: static;
    min-height: auto;
  }

  .compact-rail .module-brand {
    display: none;
  }

  .compact-rail.module-launcher nav {
    grid-template-columns: repeat(5, minmax(58px, 1fr));
  }

  .compact-rail.module-launcher nav a {
    min-height: 58px;
    padding: 8px 4px;
  }
}

@media (max-width: 520px) {
  .compact-rail.module-launcher nav {
    grid-template-columns: repeat(5, minmax(52px, 1fr));
    gap: 6px;
  }

  .compact-rail.module-launcher nav a span {
    width: 28px;
    height: 28px;
    font-size: 15px;
  }

  .compact-rail.module-launcher nav a strong {
    font-size: 10px;
  }
}

.dashboard-stage {
  overflow: visible;
  background:
    radial-gradient(circle at top center, rgba(59, 130, 246, 0.1), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.module-dashboard {
  padding: 0;
}

.dashboard-live-panel {
  min-height: 100%;
}

.dashboard-shell {
  display: grid;
  gap: 22px;
  padding: 26px;
}

.dashboard-layout-expanded {
  grid-template-columns: 218px minmax(0, 1fr);
}

.dashboard-side-nav {
  padding: 18px 14px;
}

.dashboard-side-nav .module-brand {
  grid-template-columns: 52px minmax(0, 1fr);
  justify-items: start;
  gap: 12px;
  padding-bottom: 18px;
}

.dashboard-side-nav .module-brand strong,
.dashboard-side-nav .module-brand small {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

.dashboard-side-nav .module-brand strong {
  color: #ffffff;
  font-size: 14px;
}

.dashboard-side-nav .module-brand small {
  margin-top: 2px;
  color: #93a4bf;
  font-size: 12px;
}

.dashboard-side-nav.module-launcher nav {
  gap: 8px;
}

.dashboard-side-nav.module-launcher nav a {
  grid-template-columns: 34px minmax(0, 1fr);
  justify-items: start;
  gap: 12px;
  min-height: 56px;
  padding: 11px 12px;
  text-align: left;
}

.dashboard-side-nav.module-launcher nav a span {
  width: 34px;
  height: 34px;
  font-size: 16px;
}

.dashboard-side-nav.module-launcher nav a strong {
  font-size: 13px;
}

.dashboard-side-nav .module-sidebar-form {
  margin-top: auto;
}

.dashboard-side-nav .module-sidebar-form button {
  width: 100%;
}

.dashboard-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.dashboard-hud-copy h2 {
  margin: 0;
  color: #10213d;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1;
}

.dashboard-hud-copy p {
  margin: 10px 0 0;
  color: #60708c;
  font-size: 18px;
}

.dashboard-hud-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dashboard-search {
  min-width: min(100%, 420px);
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid #e4ebf5;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.05);
}

.dashboard-search span {
  color: #8a9ab3;
  font-size: 18px;
}

.dashboard-search input {
  min-width: 0;
  min-height: 40px;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.dashboard-search small {
  padding: 5px 8px;
  border-radius: 10px;
  background: #f3f6fb;
  color: #7a8aa3;
  font-size: 12px;
  font-weight: 800;
}

.dashboard-notify,
.dashboard-user {
  min-height: 54px;
  border: 1px solid #e4ebf5;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.05);
}

.dashboard-notify {
  position: relative;
  width: 54px;
  min-width: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-size: 18px;
}

.dashboard-notify i {
  position: absolute;
  top: 9px;
  right: 8px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.dashboard-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-radius: 18px;
}

.dashboard-user > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
}

.dashboard-user strong,
.dashboard-user small {
  display: block;
}

.dashboard-user strong {
  color: #10213d;
  font-size: 14px;
}

.dashboard-user small {
  margin-top: 2px;
  color: #66768f;
  font-size: 12px;
}

.dashboard-scene-grid {
  display: grid;
  grid-template-columns: minmax(270px, 0.88fr) minmax(520px, 1.36fr) minmax(280px, 0.9fr);
  gap: 20px;
  align-items: start;
}

.dashboard-left-rail,
.dashboard-right-rail {
  display: grid;
  gap: 18px;
}

.dashboard-card {
  border: 1px solid #e6edf7;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.08);
}

.dashboard-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 22px 24px 0;
}

.dashboard-card-head h3 {
  margin: 0;
  color: #10213d;
  font-size: 20px;
}

.dashboard-card-head p,
.dashboard-card-head span,
.dashboard-card-head strong {
  color: #60708c;
  font-size: 14px;
}

.dashboard-kpi-list {
  display: grid;
  gap: 14px;
  padding: 18px 22px 22px;
}

.dashboard-kpi-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.dashboard-kpi-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
}

.dashboard-kpi-item small {
  display: block;
  color: #6c7d95;
  font-size: 13px;
}

.dashboard-kpi-item strong {
  display: block;
  margin-top: 4px;
  color: #10213d;
  font-size: 28px;
  line-height: 1;
}

.dashboard-kpi-item em {
  color: #16a34a;
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.kpi-tone-blue .dashboard-kpi-icon { background: linear-gradient(135deg, #2563eb, #4f8df8); }
.kpi-tone-cyan .dashboard-kpi-icon { background: linear-gradient(135deg, #06b6d4, #2dd4bf); }
.kpi-tone-violet .dashboard-kpi-icon { background: linear-gradient(135deg, #8b5cf6, #c084fc); }
.kpi-tone-indigo .dashboard-kpi-icon { background: linear-gradient(135deg, #3b82f6, #60a5fa); }

.dashboard-trend-layout {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  padding: 18px 22px 22px;
}

.dashboard-trend-y,
.dashboard-trend-x {
  display: grid;
}

.dashboard-trend-y {
  align-content: stretch;
  gap: 34px;
  color: #94a3b8;
  font-size: 12px;
}

.dashboard-trend-plot svg {
  width: 100%;
  height: auto;
}

.dashboard-trend-area {
  fill: rgba(59, 130, 246, 0.12);
}

.dashboard-trend-line {
  fill: none;
  stroke: #2563eb;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-trend-dot {
  fill: #ffffff;
  stroke: #2563eb;
  stroke-width: 3;
}

.dashboard-trend-x {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-top: 8px;
  color: #90a0b8;
  font-size: 12px;
}

.dashboard-source-layout {
  display: grid;
  grid-template-columns: 122px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 18px 22px 22px;
}

.dashboard-source-donut {
  position: relative;
  width: 122px;
  height: 122px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--source-gradient);
}

.dashboard-source-donut::before {
  content: "";
  position: absolute;
  width: 72px;
  height: 72px;
  inset: 25px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px #edf2f7;
}

.dashboard-source-donut > div {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.dashboard-source-donut strong {
  color: #10213d;
  font-size: 24px;
  line-height: 1;
}

.dashboard-source-donut small {
  margin-top: 3px;
  color: #70809b;
  font-size: 12px;
}

.dashboard-source-list {
  display: grid;
  gap: 10px;
}

.dashboard-source-list article {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #5f708b;
  font-size: 13px;
}

.dashboard-source-list span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dashboard-source-list i {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 999px;
  background: var(--item-color);
}

.dashboard-source-list strong {
  color: #10213d;
}

.dashboard-funnel-card {
  padding: 0 0 22px;
}

.dashboard-funnel-head {
  padding-right: 28px;
}

.dashboard-funnel-head p {
  margin: 6px 0 0;
}

.dashboard-funnel-meta {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.dashboard-funnel-meta span {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f6f9fd;
  color: #66768f;
  font-weight: 800;
}

.dashboard-funnel-meta strong {
  color: #10213d;
  font-size: 16px;
}

.dashboard-funnel-stage {
  position: relative;
  padding: 22px 34px 4px;
}

.dashboard-funnel-stage::after {
  content: "";
  position: absolute;
  left: 16%;
  right: 16%;
  bottom: 6px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.18), transparent 72%);
  filter: blur(12px);
}

.dashboard-funnel-stack {
  position: relative;
  display: grid;
  gap: 14px;
}

.funnel-layer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 22px 28px;
  border-radius: 26px;
  color: #ffffff;
  box-shadow: 0 22px 36px rgba(37, 99, 235, 0.2);
  animation: funnelFloat 12s ease-in-out infinite;
}

.funnel-layer:nth-child(1) { width: 100%; margin: 0 auto; }
.funnel-layer:nth-child(2) { width: 88%; margin: 0 auto; animation-delay: -2s; }
.funnel-layer:nth-child(3) { width: 76%; margin: 0 auto; animation-delay: -4s; }
.funnel-layer:nth-child(4) { width: 65%; margin: 0 auto; animation-delay: -6s; }
.funnel-layer:nth-child(5) { width: 54%; margin: 0 auto; animation-delay: -8s; }

.funnel-layer::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.26), transparent 42%);
  pointer-events: none;
}

.funnel-blue { background: linear-gradient(180deg, #2d7cff 0%, #1e55d5 100%); }
.funnel-teal { background: linear-gradient(180deg, #32d6e2 0%, #12b8c8 100%); }
.funnel-violet { background: linear-gradient(180deg, #8f68ff 0%, #6849e5 100%); }
.funnel-magenta { background: linear-gradient(180deg, #b55cff 0%, #8c3ef2 100%); }
.funnel-royal { background: linear-gradient(180deg, #3f7dff 0%, #2f56d1 100%); }

.funnel-layer-main {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.funnel-layer-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 22px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.funnel-layer-copy > strong {
  display: block;
  font-size: clamp(22px, 3vw, 28px);
}

.funnel-layer-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.funnel-layer-metrics small {
  display: block;
  opacity: 0.76;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.funnel-layer-metrics b {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

.funnel-layer em {
  min-width: 92px;
  padding: 12px 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #2563eb;
  font-size: 15px;
  font-style: normal;
  font-weight: 900;
  text-align: center;
}

.dashboard-list,
.dashboard-deals-list {
  display: grid;
  gap: 10px;
  padding: 18px 22px 22px;
}

.dashboard-list-row,
.dashboard-deal-row {
  display: grid;
  align-items: center;
  gap: 12px;
}

.dashboard-list-row {
  grid-template-columns: 46px minmax(0, 1fr) auto;
}

.dashboard-list-icon,
.dashboard-deal-avatar {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 900;
}

.dashboard-list-row strong,
.dashboard-deal-row strong {
  display: block;
  color: #10213d;
  font-size: 15px;
}

.dashboard-list-row small,
.dashboard-deal-row small,
.dashboard-deal-meta small {
  display: block;
  margin-top: 3px;
  color: #6d7d95;
  font-size: 13px;
  line-height: 1.4;
}

.dashboard-list-row time {
  color: #6c7d95;
  font-size: 13px;
  font-weight: 800;
}

.dashboard-deal-row {
  grid-template-columns: 46px minmax(0, 1fr) auto;
}

.dashboard-deal-meta {
  text-align: right;
}

.dashboard-deal-meta strong {
  color: #2563eb;
  font-size: 14px;
}

.tone-orange {
  background: linear-gradient(135deg, #fb923c, #f97316);
  color: #ffffff;
}

.tone-cyan {
  background: linear-gradient(135deg, #38bdf8, #22c55e);
  color: #ffffff;
}

.tone-violet {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: #ffffff;
}

.tone-slate {
  background: linear-gradient(135deg, #cbd5e1, #94a3b8);
  color: #ffffff;
}

.dashboard-highlight-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 14px;
}

.dashboard-highlight-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 74px;
  padding: 14px 18px;
  border: 1px solid #e6edf7;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
}

.dashboard-highlight-card > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
}

.dashboard-highlight-card strong {
  display: block;
  color: #10213d;
  font-size: 15px;
}

.dashboard-highlight-card small {
  display: block;
  margin-top: 4px;
  color: #6d7d95;
  font-size: 13px;
  line-height: 1.45;
}

.dashboard-highlight-card.tone-blue > span { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.dashboard-highlight-card.tone-cyan > span { background: linear-gradient(135deg, #06b6d4, #22c55e); }
.dashboard-highlight-card.tone-violet > span { background: linear-gradient(135deg, #8b5cf6, #c084fc); }

.dashboard-highlight-link {
  min-width: 190px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0 22px;
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid #dbe4f0;
  color: #2563eb;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
}

@keyframes funnelFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@media (max-width: 1380px) {
  .dashboard-scene-grid {
    grid-template-columns: minmax(250px, 0.92fr) minmax(420px, 1.08fr);
    grid-template-areas:
      "left center"
      "right center"
      "highlights highlights";
  }

  .dashboard-left-rail { grid-area: left; }
  .dashboard-funnel-card { grid-area: center; }
  .dashboard-right-rail { grid-area: right; }
}

@media (max-width: 1180px) {
  .dashboard-layout-expanded {
    grid-template-columns: 1fr;
  }

  .dashboard-side-nav {
    position: static;
    min-height: auto;
  }

  .dashboard-side-nav .module-brand {
    display: grid;
  }

  .dashboard-side-nav.module-launcher nav {
    grid-template-columns: repeat(5, minmax(58px, 1fr));
  }

  .dashboard-side-nav.module-launcher nav a {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 6px;
    text-align: center;
  }

  .dashboard-scene-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-highlight-strip {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-highlight-link {
    min-height: 72px;
  }
}

@media (max-width: 760px) {
  .dashboard-shell {
    padding: 18px;
  }

  .dashboard-hud,
  .dashboard-hud-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-search,
  .dashboard-user,
  .dashboard-highlight-link {
    width: 100%;
    min-width: 0;
  }

  .dashboard-trend-layout,
  .dashboard-source-layout,
  .dashboard-highlight-strip {
    grid-template-columns: 1fr;
  }

  .dashboard-source-layout {
    justify-items: center;
  }

  .dashboard-funnel-stage {
    padding: 18px 16px 4px;
  }

  .funnel-layer,
  .funnel-layer:nth-child(1),
  .funnel-layer:nth-child(2),
  .funnel-layer:nth-child(3),
  .funnel-layer:nth-child(4),
  .funnel-layer:nth-child(5) {
    width: 100%;
  }

  .funnel-layer {
    grid-template-columns: 1fr;
    padding: 18px 18px 20px;
  }

  .funnel-layer-main {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .funnel-layer-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-kpi-item,
  .dashboard-list-row,
  .dashboard-deal-row {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .dashboard-list-row time,
  .dashboard-deal-meta {
    grid-column: 2;
    text-align: left;
  }
}

@media (max-width: 520px) {
  .dashboard-side-nav .module-brand {
    justify-items: center;
  }

  .dashboard-side-nav.module-launcher nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-card-head,
  .dashboard-kpi-list,
  .dashboard-trend-layout,
  .dashboard-source-layout,
  .dashboard-list,
  .dashboard-deals-list {
    padding-left: 16px;
    padding-right: 16px;
  }

  .dashboard-hud-copy p {
    font-size: 16px;
  }
}

/* Dashboard reference refresh */
.dashboard-workbench {
  padding: 16px;
}

.dashboard-workbench .modular-shell.crm-board {
  width: min(100%, 1680px);
  margin: 0 auto;
}

.dashboard-workbench .modular-shell.crm-board.dashboard-layout-expanded {
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.dashboard-side-nav {
  position: sticky;
  top: 18px;
  min-height: calc(100vh - 36px);
  padding: 20px 16px 16px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #e4ebf5;
  border-radius: 34px;
  color: #10213d;
  box-shadow: 0 34px 80px rgba(15, 23, 42, 0.11);
  backdrop-filter: blur(18px);
}

.dashboard-side-nav .module-brand {
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 0;
}

.dashboard-side-nav .module-brand span {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, #326dff, #8457ff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.dashboard-side-nav .module-brand strong {
  color: #10213d;
  font-size: 17px;
  line-height: 1.1;
}

.dashboard-side-nav .module-brand small {
  color: #7a8aa4;
  font-size: 12px;
}

.dashboard-nav-primary,
.dashboard-nav-secondary {
  display: grid;
  gap: 8px;
}

.dashboard-nav-section-label {
  margin: 12px 6px 8px;
  color: #8a9ab3;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dashboard-nav-primary a,
.dashboard-nav-secondary a {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 18px;
  color: #5e708a;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.dashboard-nav-primary a:hover,
.dashboard-nav-primary a.active,
.dashboard-nav-secondary a:hover,
.dashboard-nav-secondary a.active {
  transform: translateY(-1px);
  border-color: #dce7f7;
  background: linear-gradient(180deg, #f4f8ff 0%, #eef4ff 100%);
  color: #245fe7;
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.08);
}

.dashboard-nav-primary a span,
.dashboard-nav-secondary a span {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #f3f6fb;
  color: inherit;
  font-size: 16px;
  font-weight: 900;
}

.dashboard-nav-primary a strong,
.dashboard-nav-secondary a strong {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.dashboard-side-offer {
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding: 18px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.26), transparent 34%),
    linear-gradient(135deg, #edf3ff 0%, #f7faff 100%);
  border: 1px solid #dbe6f7;
}

.dashboard-side-offer strong {
  color: #2648a6;
  font-size: 16px;
}

.dashboard-side-offer p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.dashboard-side-offer a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  border-radius: 14px;
  background: #ffffff;
  color: #2563eb;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 18px 30px rgba(37, 99, 235, 0.1);
}

.dashboard-side-nav .module-sidebar-form {
  margin-top: 12px;
}

.dashboard-side-nav .module-sidebar-form button {
  min-height: 48px;
  border-radius: 16px;
  border-color: #d7e2f3;
  background: #ffffff;
  color: #51637f;
  font-size: 14px;
}

.dashboard-stage {
  padding: 0;
  background:
    radial-gradient(circle at top center, rgba(86, 120, 255, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.74) 0%, rgba(247, 250, 255, 0.92) 100%);
  border-radius: 38px;
  border: 0;
}

.dashboard-shell {
  position: relative;
  gap: 22px;
  padding: 6px 4px;
}

.dashboard-shell::before {
  content: "";
  position: absolute;
  inset: 6% 14% auto;
  height: 420px;
  background: radial-gradient(circle, rgba(91, 139, 255, 0.12), transparent 70%);
  pointer-events: none;
  filter: blur(10px);
}

.dashboard-hud {
  position: relative;
  z-index: 1;
  gap: 22px;
  padding: 4px 8px 2px;
}

.dashboard-hud-copy h2 {
  color: #111f3f;
  font-size: clamp(44px, 4vw, 58px);
  font-weight: 900;
  letter-spacing: -0.05em;
}

.dashboard-eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  color: #6d7df8;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dashboard-hud-copy p {
  max-width: 640px;
  color: #6b7b94;
  font-size: 18px;
}

.dashboard-hud-tools {
  gap: 16px;
}

.dashboard-search {
  min-width: min(100%, 460px);
  min-height: 60px;
  padding: 0 18px;
  border-radius: 22px;
  border-color: #e4ebf5;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.06);
}

.dashboard-search input {
  font-size: 15px;
}

.dashboard-search small,
.dashboard-mini-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f3f6fb;
  color: #7a8aa3;
  font-size: 12px;
  font-weight: 800;
}

.dashboard-notify {
  width: 60px;
  min-width: 60px;
  min-height: 60px;
  border-radius: 22px;
}

.dashboard-user {
  min-height: 60px;
  min-width: 220px;
  padding: 0 18px 0 14px;
  border-radius: 22px;
}

.dashboard-user > span {
  width: 44px;
  height: 44px;
  font-size: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.dashboard-scene-grid {
  position: relative;
  z-index: 1;
  grid-template-columns: minmax(292px, 0.82fr) minmax(560px, 1.28fr) minmax(306px, 0.84fr);
  gap: 22px;
}

.dashboard-left-rail,
.dashboard-right-rail {
  gap: 20px;
}

.dashboard-card {
  overflow: hidden;
  border: 1px solid rgba(224, 233, 245, 0.92);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 58px rgba(15, 23, 42, 0.07);
  backdrop-filter: blur(20px);
}

.dashboard-card-head {
  padding: 24px 26px 0;
}

.dashboard-card-head h3 {
  font-size: 21px;
  font-weight: 850;
}

.dashboard-card-head p,
.dashboard-card-head span,
.dashboard-card-head strong {
  font-size: 14px;
}

.dashboard-kpi-list,
.dashboard-trend-layout,
.dashboard-source-layout,
.dashboard-list,
.dashboard-deals-list {
  padding-left: 24px;
  padding-right: 24px;
}

.dashboard-kpi-list {
  gap: 16px;
  padding-bottom: 24px;
}

.dashboard-kpi-item strong {
  font-size: 20px;
  line-height: 1.1;
}

.dashboard-kpi-item em {
  min-width: 82px;
  text-align: right;
}

.dashboard-trend-card,
.dashboard-source-card {
  min-height: 256px;
}

.dashboard-trend-plot {
  padding: 12px 12px 0;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(239, 245, 255, 0.95) 0%, rgba(248, 251, 255, 0.92) 100%);
}

.dashboard-trend-x {
  margin-top: 10px;
}

.dashboard-source-layout {
  min-height: 194px;
}

.dashboard-funnel-card {
  position: relative;
  padding-bottom: 28px;
  background:
    radial-gradient(circle at top center, rgba(86, 120, 255, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(248, 251, 255, 0.96) 100%);
}

.dashboard-funnel-head {
  align-items: flex-start;
}

.dashboard-funnel-meta {
  gap: 10px;
}

.dashboard-funnel-meta strong {
  font-size: 17px;
}

.dashboard-funnel-stage {
  padding: 18px 28px 10px;
}

.dashboard-funnel-stage::after {
  left: 18%;
  right: 18%;
  bottom: 2px;
  height: 34px;
  opacity: 0.55;
}

.dashboard-funnel-stack {
  gap: 16px;
}

.funnel-layer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 0;
  background: none;
  box-shadow: none;
  animation: none;
}

.funnel-layer:nth-child(1) { width: 100%; margin: 0 auto; }
.funnel-layer:nth-child(2) { width: 90%; margin: 0 auto; }
.funnel-layer:nth-child(3) { width: 86%; margin: 0 auto; }
.funnel-layer:nth-child(4) { width: 80%; margin: 0 auto; }
.funnel-layer:nth-child(5) { width: 74%; margin: 0 auto; }

.funnel-layer-body {
  position: relative;
  overflow: hidden;
  padding: 24px 30px 26px;
  color: #ffffff;
  clip-path: polygon(4.5% 0, 95.5% 0, 100% 50%, 95.5% 100%, 4.5% 100%, 0 50%);
  border-radius: 34px;
  box-shadow: 0 26px 44px rgba(37, 99, 235, 0.18);
}

.funnel-layer-body::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 8px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.funnel-layer-body::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: -16px;
  height: 34px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.26);
  filter: blur(18px);
  opacity: 0.22;
}

.funnel-blue .funnel-layer-body {
  background: linear-gradient(135deg, #2b72ff 0%, #2f84ff 48%, #2158e5 100%);
}

.funnel-teal .funnel-layer-body {
  background: linear-gradient(135deg, #22c1ff 0%, #2cd3c2 46%, #18b1cf 100%);
}

.funnel-violet .funnel-layer-body {
  background: linear-gradient(135deg, #8d5cf7 0%, #7b5cff 46%, #6448ec 100%);
}

.funnel-magenta .funnel-layer-body {
  background: linear-gradient(135deg, #b25cff 0%, #915bff 42%, #7b45f5 100%);
}

.funnel-royal .funnel-layer-body {
  background: linear-gradient(135deg, #3159ff 0%, #2454df 44%, #173cbb 100%);
}

.funnel-layer-main {
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.funnel-layer-icon {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  font-size: 22px;
}

.funnel-layer-copy strong {
  font-size: 18px;
  letter-spacing: -0.03em;
}

.funnel-layer-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.funnel-layer-metrics small {
  color: rgba(255, 255, 255, 0.8);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.funnel-layer-metrics b {
  margin-top: 6px;
  font-size: 15px;
}

.funnel-layer em {
  position: relative;
  min-width: 92px;
  padding: 12px 0;
  border: 1px solid #d5e3ff;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: #2563eb;
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.1);
}

.funnel-layer em::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 100%;
  width: 34px;
  border-top: 1px dashed #bfd2ff;
  transform: translateY(-50%);
}

.dashboard-list,
.dashboard-deals-list {
  gap: 0;
  padding-top: 12px;
  padding-bottom: 8px;
}

.dashboard-list-row,
.dashboard-deal-row {
  min-height: 74px;
  padding: 10px 0;
  border-bottom: 1px solid #edf2f7;
}

.dashboard-list-row:last-child,
.dashboard-deal-row:last-child {
  border-bottom: 0;
}

.dashboard-list-icon,
.dashboard-deal-avatar {
  border-radius: 15px;
}

.dashboard-deal-meta strong {
  color: #10213d;
  font-size: 15px;
}

.dashboard-deal-meta small {
  color: #6c7d95;
  font-size: 12px;
  font-weight: 700;
}

.dashboard-card-link {
  display: inline-flex;
  align-items: center;
  padding: 0 24px 24px;
  color: #2563eb;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}

.dashboard-card-link:hover {
  color: #1d4ed8;
}

.dashboard-highlight-strip {
  position: relative;
  z-index: 1;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(180px, auto);
  gap: 16px;
}

.dashboard-highlight-card,
.dashboard-highlight-link {
  min-height: 82px;
  border-radius: 24px;
}

.dashboard-highlight-link {
  min-width: 212px;
}

@media (max-width: 1320px) {
  .dashboard-scene-grid {
    grid-template-columns: minmax(280px, 0.9fr) minmax(520px, 1.1fr);
    grid-template-areas:
      "left center"
      "right center";
  }

  .dashboard-left-rail { grid-area: left; }
  .dashboard-funnel-card { grid-area: center; }
  .dashboard-right-rail { grid-area: right; }

  .dashboard-highlight-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-highlight-link {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1180px) {
  .dashboard-workbench .modular-shell.crm-board.dashboard-layout-expanded {
    grid-template-columns: 1fr;
  }

  .dashboard-side-nav {
    position: static;
    min-height: auto;
  }

  .dashboard-nav-primary,
  .dashboard-nav-secondary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-nav-primary a,
  .dashboard-nav-secondary a {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 8px;
    min-height: 88px;
  }

  .dashboard-nav-primary a strong,
  .dashboard-nav-secondary a strong {
    white-space: normal;
  }

  .dashboard-scene-grid {
    grid-template-columns: 1fr;
    grid-template-areas: none;
  }

  .dashboard-left-rail,
  .dashboard-funnel-card,
  .dashboard-right-rail {
    grid-area: auto;
  }

  .funnel-layer:nth-child(1),
  .funnel-layer:nth-child(2),
  .funnel-layer:nth-child(3),
  .funnel-layer:nth-child(4),
  .funnel-layer:nth-child(5) {
    width: 100%;
  }
}

@media (max-width: 820px) {
  .dashboard-workbench {
    padding: 12px;
  }

  .dashboard-hud,
  .dashboard-hud-tools {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-search,
  .dashboard-user {
    min-width: 0;
    width: 100%;
  }

  .dashboard-nav-primary,
  .dashboard-nav-secondary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-funnel-stage {
    padding-left: 18px;
    padding-right: 18px;
  }

  .funnel-layer {
    grid-template-columns: 1fr;
  }

  .funnel-layer em {
    justify-self: end;
  }

  .funnel-layer-main {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .funnel-layer-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-highlight-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .dashboard-side-nav {
    padding: 16px 12px 12px;
    border-radius: 26px;
  }

  .dashboard-nav-primary,
  .dashboard-nav-secondary {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-card {
    border-radius: 26px;
  }

  .dashboard-card-head,
  .dashboard-kpi-list,
  .dashboard-trend-layout,
  .dashboard-source-layout,
  .dashboard-list,
  .dashboard-deals-list {
    padding-left: 18px;
    padding-right: 18px;
  }

  .dashboard-kpi-item,
  .dashboard-list-row,
  .dashboard-deal-row {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .dashboard-kpi-item em,
  .dashboard-list-row time,
  .dashboard-deal-meta {
    grid-column: 2;
    text-align: left;
  }

  .funnel-layer-body {
    padding: 22px 20px 24px;
    clip-path: polygon(3% 0, 97% 0, 100% 50%, 97% 100%, 3% 100%, 0 50%);
  }

  .funnel-layer-metrics {
    grid-template-columns: 1fr;
  }
}

/* Dashboard reference lock-in */
.dashboard-hidden-copy {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.dashboard-side-nav .dashboard-hidden-copy {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.dashboard-workbench {
  padding: 0;
  background:
    radial-gradient(circle at 50% 0, rgba(71, 116, 255, 0.09), transparent 32%),
    linear-gradient(180deg, #f6f9ff 0%, #eff5ff 100%);
}

.dashboard-workbench .modular-shell.crm-board.dashboard-layout-expanded {
  width: min(100%, 1680px);
  margin: 0 auto;
  padding: 18px 18px 24px;
  grid-template-columns: 214px minmax(0, 1fr);
  gap: 18px;
  background: transparent;
}

.dashboard-side-nav {
  gap: 0;
  min-height: calc(100vh - 36px);
  padding: 18px 16px 14px;
  border: 1px solid #edf2f8;
  border-radius: 0 0 28px 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(252, 253, 255, 0.98) 100%);
  box-shadow: none;
}

.dashboard-side-nav .module-brand {
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  padding-bottom: 0;
  border-bottom: 0;
}

.dashboard-side-nav .module-brand span {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(145deg, #2563eb 0%, #8b5cf6 100%);
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 16px 28px rgba(86, 92, 230, 0.24);
}

.dashboard-side-nav .module-brand strong {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: nowrap;
  color: #101f3f;
  font-size: 21px;
  line-height: 1;
}

.dashboard-side-nav .module-brand .dashboard-hidden-copy {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.dashboard-brand-caption {
  display: none;
}

.dashboard-brand-subtitle {
  display: none;
}

.dashboard-nav-grid {
  display: grid;
  gap: 8px;
}

.dashboard-side-nav.module-launcher .dashboard-nav-grid a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 9px 10px;
  border-radius: 12px;
  color: #7a8aa4;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-decoration: none;
  transition: background 140ms ease, color 140ms ease;
}

.dashboard-side-nav.module-launcher .dashboard-nav-grid a:hover,
.dashboard-side-nav.module-launcher .dashboard-nav-grid a.active {
  background: #eef4ff;
  color: #245ee9;
}

.dashboard-side-nav.module-launcher .dashboard-nav-grid a span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  color: #95a5c1;
  font-size: 14px;
  font-weight: 700;
}

.dashboard-side-nav.module-launcher .dashboard-nav-grid a.active span {
  background: rgba(255, 255, 255, 0.96);
  color: #245ee9;
}

.dashboard-side-nav.module-launcher .dashboard-nav-grid a strong {
  color: inherit;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.dashboard-side-offer {
  margin-top: 22px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f3f7ff 0%, #eef4ff 100%);
  box-shadow: none;
}

.dashboard-side-offer strong {
  color: #5a57cc;
  font-size: 15px;
}

.dashboard-side-offer p {
  color: #7b879e;
  font-size: 13px;
}

.dashboard-side-offer a {
  min-height: 40px;
  border-radius: 12px;
  background: #ffffff;
  font-size: 13px;
}

.dashboard-side-nav .module-sidebar-form {
  margin-top: auto;
  padding-top: 16px;
}

.dashboard-stage {
  padding: 0;
  border-radius: 32px;
  background:
    radial-gradient(circle at 30% 0, rgba(98, 126, 255, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(248, 251, 255, 0.95) 100%);
}

.dashboard-shell {
  gap: 16px;
  padding: 10px 8px 14px;
}

.dashboard-hud {
  gap: 16px;
  align-items: flex-start;
  padding: 2px 8px 6px;
}

.dashboard-hud-copy h2 {
  margin: 0;
  color: #18274f;
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.dashboard-hud-copy p {
  margin: 8px 0 0;
  color: #7082a3;
  font-size: 16px;
}

.dashboard-hud-tools {
  gap: 14px;
}

.dashboard-search {
  min-width: 392px;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 18px;
  box-shadow: 0 16px 32px rgba(54, 76, 114, 0.06);
}

.dashboard-notify {
  width: 52px;
  min-width: 52px;
  min-height: 52px;
  border-radius: 18px;
}

.dashboard-user {
  min-height: 52px;
  min-width: 214px;
  gap: 12px;
  padding: 0 14px 0 10px;
  border-radius: 18px;
}

.dashboard-user-photo {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(145deg, #2563eb 0%, #8b5cf6 100%);
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
}

.dashboard-user b {
  margin-left: auto;
  color: #6b7b94;
  font-size: 14px;
}

.dashboard-card {
  border: 1px solid #e7edf7;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 50px rgba(46, 76, 119, 0.08);
}

.dashboard-scene-grid {
  grid-template-columns: minmax(332px, 0.9fr) minmax(648px, 1.16fr) minmax(292px, 0.8fr);
  gap: 18px;
}

.dashboard-kpi-card .dashboard-card-head h3,
.dashboard-trend-card .dashboard-card-head h3,
.dashboard-source-card .dashboard-card-head h3 {
  font-size: 16px;
}

.dashboard-left-rail,
.dashboard-right-rail {
  gap: 18px;
}

.dashboard-card-head {
  padding: 18px 22px 0;
}

.dashboard-card-head h3 {
  color: #17284d;
  font-size: 18px;
  font-weight: 800;
}

.dashboard-kpi-list,
.dashboard-trend-layout,
.dashboard-source-layout,
.dashboard-list,
.dashboard-deals-list {
  padding-left: 22px;
  padding-right: 22px;
}

.dashboard-kpi-list {
  gap: 10px;
  padding-top: 16px;
  padding-bottom: 18px;
}

.dashboard-kpi-item {
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
}

.dashboard-kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 999px;
}

.dashboard-kpi-item strong {
  font-size: 17px;
  line-height: 1.15;
}

.dashboard-kpi-item em {
  font-size: 12px;
}

.dashboard-mini-pill {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 12px;
}

.dashboard-mini-pill-select::after {
  content: "⌄";
  margin-left: 6px;
  font-size: 11px;
}

.dashboard-trend-card,
.dashboard-source-card {
  min-height: 210px;
}

.dashboard-trend-layout {
  padding-top: 10px;
  padding-bottom: 18px;
}

.dashboard-trend-y {
  gap: 30px;
  font-size: 11px;
}

.dashboard-trend-plot {
  position: relative;
}

.dashboard-trend-plot svg {
  overflow: visible;
}

.dashboard-trend-badge rect {
  fill: #2f6ef6;
}

.dashboard-trend-badge text {
  fill: #ffffff;
  font-size: 10px;
  font-weight: 800;
  text-anchor: middle;
}

.dashboard-source-layout {
  align-items: center;
  min-height: 142px;
  padding-top: 12px;
  padding-bottom: 18px;
}

.dashboard-source-donut {
  width: 112px;
  height: 112px;
}

.dashboard-funnel-card {
  padding-bottom: 18px;
}

.dashboard-funnel-head {
  align-items: center;
  padding-right: 22px;
}

.dashboard-funnel-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dashboard-info-dot {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid #d7e3f7;
  color: #92a0b8;
  font-size: 11px;
  font-weight: 700;
}

.dashboard-funnel-meta {
  display: block;
}

.dashboard-funnel-meta strong {
  color: #18274f;
  font-size: 16px;
}

.dashboard-funnel-stage {
  padding: 10px 16px 6px;
}

.dashboard-funnel-stage::after {
  left: 20%;
  right: 20%;
  bottom: -6px;
  height: 34px;
  background: radial-gradient(circle, rgba(63, 87, 152, 0.18), transparent 70%);
}

.dashboard-funnel-stack {
  gap: 10px;
}

.funnel-layer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  align-items: center;
  gap: 12px;
  padding: 0;
  background: transparent;
  box-shadow: none;
  animation: none;
}

.funnel-layer:nth-child(1) { width: 100%; }
.funnel-layer:nth-child(2) { width: 90%; }
.funnel-layer:nth-child(3) { width: 82%; }
.funnel-layer:nth-child(4) { width: 74%; }
.funnel-layer:nth-child(5) { width: 66%; }

.funnel-layer-body {
  position: relative;
  min-height: 102px;
  padding: 20px 28px 18px 92px;
  color: #ffffff;
  clip-path: polygon(2% 0, 98% 0, 92% 100%, 8% 100%);
  border-radius: 28px;
  box-shadow: 0 22px 38px rgba(54, 88, 173, 0.18);
  overflow: hidden;
}

.funnel-layer-body::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 8px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.funnel-layer-body::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: -12px;
  height: 24px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.24);
  filter: blur(10px);
  opacity: 0.18;
}

.funnel-blue .funnel-layer-body { background: linear-gradient(180deg, #3d84ff 0%, #2a63e2 100%); }
.funnel-teal .funnel-layer-body { background: linear-gradient(180deg, #41d5df 0%, #2bbbc9 100%); }
.funnel-violet .funnel-layer-body { background: linear-gradient(180deg, #8e68ff 0%, #6c4fec 100%); }
.funnel-magenta .funnel-layer-body { background: linear-gradient(180deg, #b15efe 0%, #8b50ef 100%); }
.funnel-royal .funnel-layer-body { background: linear-gradient(180deg, #3e6dff 0%, #2d4fd2 100%); }

.funnel-layer-main {
  display: block;
  position: relative;
}

.funnel-layer-icon {
  position: absolute;
  left: -66px;
  top: 50%;
  width: 54px;
  height: 54px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  font-size: 21px;
}

.funnel-layer-copy strong {
  display: block;
  text-align: center;
  font-size: 17px;
  font-weight: 800;
}

.funnel-layer-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
  text-align: center;
}

.funnel-layer-metrics small {
  color: rgba(255, 255, 255, 0.78);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.funnel-layer-metrics b {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 800;
}

.funnel-layer em {
  position: relative;
  min-width: 86px;
  padding: 10px 0;
  border: 1px solid #d4e2ff;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #2563eb;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.funnel-layer em::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 100%;
  width: 36px;
  border-top: 1px dashed #bfd2ff;
  transform: translateY(-50%);
}

.dashboard-counter {
  color: #71819a;
  font-size: 13px;
}

.dashboard-list,
.dashboard-deals-list {
  gap: 0;
  padding-top: 12px;
  padding-bottom: 8px;
}

.dashboard-list-row,
.dashboard-deal-row {
  min-height: 62px;
  padding: 10px 0;
  border-bottom: 1px solid #edf2f7;
}

.dashboard-list-row:last-child,
.dashboard-deal-row:last-child {
  border-bottom: 0;
}

.dashboard-list-icon,
.dashboard-deal-avatar {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  font-size: 16px;
}

.dashboard-list-icon.tone-blue,
.dashboard-deal-avatar.tone-blue {
  background: #eef4ff;
  color: #326dff;
}

.dashboard-list-icon.tone-cyan,
.dashboard-deal-avatar.tone-cyan {
  background: #ebfbfa;
  color: #27c2c7;
}

.dashboard-list-icon.tone-violet,
.dashboard-deal-avatar.tone-violet {
  background: #f4ebff;
  color: #8b52f3;
}

.dashboard-list-icon.tone-royal,
.dashboard-deal-avatar.tone-royal {
  background: #eef2ff;
  color: #4964ef;
}

.dashboard-list-icon.tone-slate,
.dashboard-deal-avatar.tone-slate {
  background: #f1f5f9;
  color: #90a0b8;
}

.tone-blue {
  background: linear-gradient(135deg, #4284ff, #2f66f2);
  color: #ffffff;
}

.tone-royal {
  background: linear-gradient(135deg, #5d7bff, #3c59ef);
  color: #ffffff;
}

.dashboard-list-row strong,
.dashboard-deal-row strong {
  font-size: 13px;
}

.dashboard-list-row time {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #6c7d95;
  font-size: 12px;
  font-weight: 700;
}

.dashboard-time-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 999px;
}

.dashboard-time-dot.tone-blue { background: #3c72f2; }
.dashboard-time-dot.tone-cyan { background: #2dc8ba; }
.dashboard-time-dot.tone-violet { background: #8d4ff1; }
.dashboard-time-dot.tone-royal { background: #4964ef; }

.dashboard-card-link {
  padding: 4px 22px 18px;
  font-size: 13px;
}

.dashboard-deal-meta strong {
  color: #1f2f54;
  font-size: 13px;
}

.dashboard-stage-badge {
  font-weight: 700;
}

.tone-text-blue { color: #336cf1; }
.tone-text-cyan { color: #22b8c9; }
.tone-text-violet { color: #8a5cf2; }
.tone-text-royal { color: #4b63df; }
.tone-text-slate { color: #8a98b0; }

.dashboard-highlight-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr)) 192px;
  gap: 14px;
}

.dashboard-highlight-card,
.dashboard-highlight-link {
  min-height: 74px;
  border-radius: 20px;
}

.dashboard-highlight-card.tone-blue,
.dashboard-highlight-card.tone-cyan,
.dashboard-highlight-card.tone-violet {
  background: #ffffff;
}

.dashboard-highlight-link {
  justify-content: center;
  font-size: 13px;
}

@media (max-width: 1260px) {
  .dashboard-workbench .modular-shell.crm-board.dashboard-layout-expanded {
    grid-template-columns: 1fr;
  }

  .dashboard-side-nav {
    position: static;
    min-height: auto;
    border-radius: 28px;
  }

  .dashboard-nav-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .dashboard-nav-grid a {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 6px;
    min-height: 80px;
    text-align: center;
  }

  .dashboard-nav-grid a strong {
    white-space: normal;
  }

  .dashboard-scene-grid {
    grid-template-columns: 1fr;
    grid-template-areas: none;
  }

  .dashboard-left-rail,
  .dashboard-funnel-card,
  .dashboard-right-rail {
    grid-area: auto;
  }
}

@media (max-width: 760px) {
  .dashboard-workbench .modular-shell.crm-board.dashboard-layout-expanded {
    padding: 14px 14px 18px;
  }

  .dashboard-nav-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-hud,
  .dashboard-hud-tools {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-search,
  .dashboard-user {
    min-width: 0;
    width: 100%;
  }

  .dashboard-scene-grid {
    gap: 16px;
  }

  .dashboard-funnel-stage {
    padding-left: 10px;
    padding-right: 10px;
  }

  .funnel-layer,
  .funnel-layer:nth-child(1),
  .funnel-layer:nth-child(2),
  .funnel-layer:nth-child(3),
  .funnel-layer:nth-child(4),
  .funnel-layer:nth-child(5) {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .funnel-layer em {
    justify-self: end;
  }

  .funnel-layer-body {
    padding: 18px 18px 18px 74px;
  }

  .funnel-layer-icon {
    left: -52px;
    width: 42px;
    height: 42px;
    font-size: 17px;
  }

  .funnel-layer-metrics {
    grid-template-columns: 1fr;
  }

  .dashboard-highlight-strip {
    grid-template-columns: 1fr;
  }
}

/* Dashboard reference final polish */
.dashboard-workbench .modular-shell.crm-board.dashboard-layout-expanded {
  width: min(100%, 1700px);
  gap: 18px;
}

.dashboard-side-nav {
  position: sticky;
  top: 18px;
  width: 100%;
  min-width: 0;
  align-self: stretch;
  padding: 12px 14px 22px;
  border: 1px solid #edf2fb;
  border-radius: 0 0 30px 30px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 22px 48px rgba(72, 96, 146, 0.07);
}

.dashboard-side-nav.crm-side-nav.compact-rail {
  width: 100%;
  min-height: auto;
  align-self: stretch;
}

.dashboard-side-nav .module-brand {
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}

.dashboard-side-nav .module-brand span {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2a79ff 0%, #6a49ff 100%);
  box-shadow: 0 16px 32px rgba(81, 94, 233, 0.24);
  color: transparent;
  font-size: 0;
  overflow: hidden;
}

.dashboard-side-nav .module-brand span::before,
.dashboard-side-nav .module-brand span::after {
  content: "";
  position: absolute;
  border-radius: 6px;
}

.dashboard-side-nav .module-brand span::before {
  left: 11px;
  top: 8px;
  width: 18px;
  height: 18px;
  background: rgba(255, 255, 255, 0.2);
}

.dashboard-side-nav .module-brand span::after {
  right: 9px;
  bottom: 9px;
  width: 18px;
  height: 18px;
  background: rgba(255, 255, 255, 0.9);
  mix-blend-mode: screen;
}

.dashboard-side-nav .module-brand strong {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
  color: #122248;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.dashboard-side-nav .module-brand small {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

.dashboard-nav-grid {
  gap: 6px;
  width: 100%;
}

.dashboard-side-nav.module-launcher .dashboard-nav-grid a {
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  min-height: 46px;
  padding: 11px 12px;
  border-radius: 14px;
  color: #7f8fa9;
}

.dashboard-side-nav.module-launcher .dashboard-nav-grid a:hover,
.dashboard-side-nav.module-launcher .dashboard-nav-grid a.active {
  background: #eef4ff;
  color: #2d63f0;
}

.dashboard-side-nav.module-launcher .dashboard-nav-grid a span {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  color: #95a6c3;
  font-size: 0;
}

.dashboard-side-nav.module-launcher .dashboard-nav-grid a span svg,
.dashboard-search svg,
.dashboard-notify svg {
  width: 16px;
  height: 16px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-search svg,
.dashboard-notify svg {
  width: 18px;
  height: 18px;
}

.dashboard-side-nav.module-launcher .dashboard-nav-grid a.active span {
  background: #ffffff;
  color: #2d63f0;
  box-shadow: 0 10px 18px rgba(88, 110, 163, 0.14);
}

.dashboard-side-nav.module-launcher .dashboard-nav-grid a strong {
  font-size: 13px;
  font-weight: 500;
}

.dashboard-side-offer {
  margin-top: auto;
  padding: 18px 16px 18px;
  border: 1px solid #dbe5ff;
  border-radius: 22px;
  background: linear-gradient(180deg, #f4f7ff 0%, #ebf1ff 100%);
}

.dashboard-side-offer::before {
  content: "♛";
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  border-radius: 12px;
  background: #eef3ff;
  color: #5c57d5;
  font-size: 16px;
}

.dashboard-side-offer strong {
  color: #5652cb;
}

.dashboard-side-offer p {
  line-height: 1.45;
}

.dashboard-side-nav .module-sidebar-form {
  display: none;
}

.dashboard-stage {
  background:
    radial-gradient(circle at 24% 2%, rgba(99, 132, 255, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(248, 251, 255, 0.96) 100%);
}

.dashboard-shell {
  gap: 18px;
  padding: 8px 8px 16px;
}

.dashboard-hud {
  align-items: flex-start;
  padding: 0 4px 10px;
}

.dashboard-hud-copy h2 {
  color: #15254e;
  font-size: clamp(40px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.05em;
}

.dashboard-hud-copy p {
  margin-top: 6px;
  color: #7384a1;
  font-size: 15px;
}

.dashboard-hud-tools {
  align-items: center;
  gap: 14px;
}

.dashboard-search {
  min-width: 414px;
  min-height: 54px;
  padding: 0 18px;
  border: 1px solid #e6edf8;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 18px 34px rgba(80, 100, 140, 0.07);
}

.dashboard-search span {
  color: #97a5bc;
}

.dashboard-search input {
  font-size: 15px;
}

.dashboard-search small {
  min-width: 36px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #e8eef8;
  border-radius: 10px;
  background: #f7f9fd;
  color: #93a1b9;
  font-size: 12px;
  font-weight: 700;
}

.dashboard-notify {
  width: 50px;
  height: 50px;
  border-radius: 17px;
  color: #7c8aa2;
  border: 1px solid #e6edf8;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(82, 102, 142, 0.08);
}

.dashboard-user {
  min-width: 224px;
  min-height: 54px;
  gap: 10px;
  padding: 6px 14px 6px 10px;
  border: 1px solid #e8eef7;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 32px rgba(82, 102, 142, 0.08);
}

.dashboard-user-photo {
  position: relative;
  overflow: hidden;
  color: transparent;
  font-size: 0;
  text-indent: -9999px;
  background:
    radial-gradient(circle at 49% 34%, #f1c9a5 0 22%, transparent 23%),
    radial-gradient(circle at 49% 25%, #3b2d29 0 28%, transparent 29%),
    radial-gradient(ellipse at 50% 84%, #5d89d8 0 36%, #3154d4 37% 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.96), 0 8px 20px rgba(76, 96, 139, 0.16);
}

.dashboard-user-photo::before {
  content: "";
  position: absolute;
  inset: 6px 9px 16px;
  border-radius: 999px 999px 18px 18px;
  background:
    radial-gradient(circle at 50% 32%, #f2cfad 0 34%, transparent 35%),
    radial-gradient(circle at 50% 24%, #43312f 0 46%, transparent 47%),
    linear-gradient(180deg, #eef6ff 0%, #94bbea 44%, #355fe0 45%, #3153d2 100%);
}

.dashboard-user-photo::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: 6px;
  height: 16px;
  border-radius: 999px 999px 12px 12px;
  background: linear-gradient(180deg, #4978ea 0%, #3558d2 100%);
}

.dashboard-user strong {
  color: #192950;
  font-size: 14px;
  font-weight: 700;
}

.dashboard-user small {
  color: #7d8ca5;
  font-size: 12px;
}

.dashboard-card {
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #eef3fb;
  box-shadow: 0 26px 60px rgba(46, 76, 119, 0.08);
}

.dashboard-scene-grid {
  grid-template-columns: minmax(332px, 0.88fr) minmax(672px, 1.18fr) minmax(306px, 0.8fr);
  gap: 18px;
}

.dashboard-card-head {
  padding: 20px 22px 0;
}

.dashboard-card-head h3 {
  color: #19294f;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.18;
  text-transform: none;
}

.dashboard-kpi-card .dashboard-card-head h3,
.dashboard-trend-card .dashboard-card-head h3,
.dashboard-source-card .dashboard-card-head h3 {
  font-size: 16px;
}

.dashboard-funnel-meta strong {
  font-size: 15px;
}

.dashboard-kpi-list {
  padding-top: 18px;
}

.dashboard-kpi-item {
  gap: 14px;
}

.dashboard-kpi-item small,
.dashboard-source-list span,
.dashboard-source-list strong,
.dashboard-list-row small,
.dashboard-deal-row small {
  text-transform: none;
}

.dashboard-kpi-item strong {
  color: #1c2c54;
  font-size: 17px;
}

.dashboard-mini-pill {
  min-height: 32px;
  border-radius: 12px;
  background: #f4f6fb;
}

.dashboard-funnel-stage {
  padding: 14px 8px 10px;
}

.dashboard-funnel-stage::after {
  left: 22%;
  right: 22%;
  bottom: -6px;
  height: 34px;
  background: radial-gradient(circle, rgba(63, 87, 152, 0.2), transparent 70%);
}

.dashboard-funnel-stack {
  align-items: center;
  gap: 10px;
}

.funnel-layer {
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 16px;
}

.funnel-layer:nth-child(2) { width: 91%; }
.funnel-layer:nth-child(3) { width: 84%; }
.funnel-layer:nth-child(4) { width: 77%; }
.funnel-layer:nth-child(5) { width: 69%; }

.funnel-layer-body {
  min-height: 110px;
  padding: 16px 28px 18px 20px;
  clip-path: polygon(0 0, 100% 0, 91.5% 100%, 8.5% 100%);
  border-radius: 30px;
}

.funnel-layer:nth-child(1) .funnel-layer-body {
  min-height: 116px;
}

.funnel-layer:nth-child(5) .funnel-layer-body {
  min-height: 104px;
}

.funnel-layer-body::before {
  left: 10%;
  right: 10%;
  top: 10px;
  height: 20px;
  opacity: 0.22;
}

.funnel-layer-main {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.funnel-layer-icon {
  position: static;
  width: 60px;
  height: 60px;
  transform: none;
  font-size: 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 12px 26px rgba(35, 58, 119, 0.14);
}

.funnel-layer-copy strong {
  margin-bottom: 8px;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.funnel-layer-metrics {
  margin-top: 10px;
  gap: 6px;
}

.funnel-layer em {
  min-width: 88px;
  padding: 10px 0;
  font-size: 12px;
  box-shadow: 0 10px 20px rgba(130, 152, 196, 0.12);
}

.dashboard-list-row,
.dashboard-deal-row {
  min-height: 66px;
  padding: 12px 0;
}

.dashboard-list {
  padding-top: 8px;
}

.dashboard-list-icon {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  font-size: 15px;
}

.dashboard-deal-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
}

.dashboard-list-row strong,
.dashboard-deal-row strong {
  color: #1d2d54;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.dashboard-list-row small,
.dashboard-deal-row small {
  color: #7b8ca7;
  font-size: 12px;
  line-height: 1.35;
}

.dashboard-list-row time {
  color: #71829d;
  font-size: 12px;
  font-weight: 600;
}

.dashboard-counter {
  display: none;
}

.dashboard-card-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #2f63eb;
  font-size: 14px;
}

.dashboard-card-link::after {
  content: "→";
  font-size: 16px;
  line-height: 1;
}

.dashboard-highlight-strip {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 184px;
  gap: 16px;
}

.dashboard-highlight-card,
.dashboard-highlight-link {
  border-radius: 22px;
}

.dashboard-highlight-card {
  min-height: 88px;
  padding: 18px 20px;
}

.dashboard-highlight-card span {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 16px;
}

.dashboard-highlight-card strong {
  color: #18274e;
  font-size: 13px;
  font-weight: 700;
}

.dashboard-highlight-card small {
  color: #6f809d;
  font-size: 12px;
  line-height: 1.45;
}

.dashboard-highlight-link {
  min-height: 88px;
  padding: 0 18px;
  border: 1px solid #eef3fb;
  background: #ffffff;
  color: #2f63eb;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 22px 48px rgba(64, 90, 138, 0.08);
}

@media (max-width: 1260px) {
  .dashboard-side-nav {
    position: static;
    padding-bottom: 18px;
    border-radius: 28px;
  }
}

@media (max-width: 760px) {
  .dashboard-hud-copy h2 {
    font-size: 34px;
  }

  .dashboard-search {
    min-width: 0;
  }

  .dashboard-side-nav.module-launcher .dashboard-nav-grid a strong {
    font-size: 12px;
  }

  .funnel-layer-main {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
  }

  .funnel-layer-icon {
    width: 48px;
    height: 48px;
  }
}

@media (max-width: 1260px) {
  .dashboard-workbench .modular-shell.crm-board.dashboard-layout-expanded {
    width: min(100%, 1120px);
    padding: 16px;
    display: flex;
    flex-direction: column;
  }

  .dashboard-side-nav {
    min-height: auto;
    gap: 14px;
    border-radius: 28px;
  }

  .dashboard-side-nav.crm-side-nav.compact-rail {
    width: 100%;
    padding: 12px 14px 18px;
  }

  .dashboard-side-nav,
  .module-stage.dashboard-stage {
    width: 100%;
  }

  .dashboard-side-nav.module-launcher .dashboard-nav-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .dashboard-side-nav.module-launcher .dashboard-nav-grid a {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 8px;
    min-height: 74px;
    padding: 12px 8px;
    text-align: center;
  }

  .dashboard-side-nav.module-launcher .dashboard-nav-grid a span {
    width: 32px;
    height: 32px;
  }

  .dashboard-side-nav.module-launcher .dashboard-nav-grid a strong {
    font-size: 12px;
    line-height: 1.2;
    white-space: normal;
  }

  .dashboard-shell {
    padding: 0;
  }

  .dashboard-scene-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "left center"
      "right right";
    gap: 18px;
  }

  .dashboard-left-rail { grid-area: left; }
  .dashboard-funnel-card { grid-area: center; }
  .dashboard-right-rail { grid-area: right; }

  .dashboard-right-rail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .dashboard-highlight-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-highlight-link {
    grid-column: 1 / -1;
    min-height: 80px;
  }
}

@media (max-width: 980px) {
  .dashboard-scene-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: none;
  }

  .dashboard-left-rail,
  .dashboard-funnel-card,
  .dashboard-right-rail {
    grid-area: auto;
  }

  .dashboard-left-rail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .dashboard-source-card {
    grid-column: 1 / -1;
  }

  .dashboard-right-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .dashboard-workbench .modular-shell.crm-board.dashboard-layout-expanded {
    width: 100%;
    padding: 12px;
    gap: 14px;
  }

  .dashboard-side-nav {
    padding: 12px 12px 16px;
    border-radius: 26px;
  }

  .dashboard-side-nav .module-brand {
    margin-bottom: 12px;
  }

  .dashboard-side-nav.module-launcher .dashboard-nav-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .dashboard-side-nav.module-launcher .dashboard-nav-grid a {
    min-height: 68px;
    padding: 10px 6px;
  }

  .dashboard-side-nav.module-launcher .dashboard-nav-grid a strong {
    font-size: 11px;
  }

  .dashboard-shell {
    gap: 14px;
  }

  .dashboard-hud {
    padding: 0;
  }

  .dashboard-hud,
  .dashboard-hud-tools {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-search {
    width: 100%;
    min-width: 0;
  }

  .dashboard-notify {
    width: 50px;
    height: 50px;
    align-self: flex-start;
  }

  .dashboard-user {
    width: 100%;
    min-width: 0;
  }

  .dashboard-left-rail,
  .dashboard-right-rail {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .dashboard-card {
    border-radius: 26px;
  }

  .dashboard-card-head {
    padding: 18px 18px 0;
  }

  .dashboard-funnel-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 18px 18px 0;
  }

  .dashboard-funnel-title {
    flex-wrap: wrap;
    gap: 8px;
  }

  .dashboard-funnel-title h3 {
    width: 100%;
  }

  .dashboard-funnel-meta {
    width: 100%;
  }

  .dashboard-funnel-meta strong {
    display: inline-flex;
    max-width: 100%;
    padding: 7px 10px;
    border-radius: 12px;
    background: #f4f7ff;
    color: #5e6f8f;
    font-size: 13px;
    line-height: 1.25;
  }

  .dashboard-funnel-stage {
    padding: 12px 14px 16px;
  }

  .dashboard-funnel-stage::after {
    display: none;
  }

  .dashboard-funnel-stack {
    align-items: stretch;
    gap: 10px;
  }

  .funnel-layer,
  .funnel-layer:nth-child(1),
  .funnel-layer:nth-child(2),
  .funnel-layer:nth-child(3),
  .funnel-layer:nth-child(4),
  .funnel-layer:nth-child(5) {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .funnel-layer-body {
    min-height: auto;
    padding: 14px;
    clip-path: none;
    border-radius: 22px;
    box-shadow: 0 16px 30px rgba(46, 76, 119, 0.14);
  }

  .funnel-layer-body::before,
  .funnel-layer-body::after {
    display: none;
  }

  .funnel-layer-main {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
  }

  .funnel-layer-icon {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }

  .funnel-layer-copy strong {
    text-align: left;
    font-size: 17px;
  }

  .funnel-layer-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    text-align: left;
  }

  .funnel-layer-metrics div {
    min-width: 0;
    padding: 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.14);
  }

  .funnel-layer-metrics small {
    font-size: 9px;
    line-height: 1.2;
    letter-spacing: 0.03em;
    overflow-wrap: anywhere;
  }

  .funnel-layer-metrics b {
    font-size: 13px;
  }

  .funnel-layer em {
    display: none;
  }

  .dashboard-highlight-strip {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .dashboard-highlight-link {
    grid-column: auto;
    min-height: 72px;
  }
}

/* Dashboard header containment */
.dashboard-hud {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  align-items: start;
  gap: 18px;
}

.dashboard-hud-copy {
  min-width: 0;
}

.dashboard-hud-tools {
  width: 100%;
  min-width: 0;
  justify-self: end;
  justify-content: stretch;
}

.dashboard-search {
  width: 100%;
  max-width: 420px;
  min-width: 0;
  justify-self: end;
}

@media (max-width: 760px) {
  .dashboard-hud {
    grid-template-columns: minmax(0, 1fr);
  }

  .dashboard-hud-tools,
  .dashboard-search {
    max-width: none;
  }
}

.max-observability-panel {
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
}

.max-observability-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.max-observability-list {
  display: grid;
  gap: 0.75rem;
}

@media (max-width: 900px) {
  .max-observability-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* CRM polish pass: compact chats, cleaner rails, readable Russian wrapping. */
.dashboard-side-nav .module-brand,
.crm-side-nav .module-brand {
  display: none !important;
}

.dialog-row-large,
aside.compact-mode-active .dialog-row-large {
  min-height: 52px !important;
}

.dialog-row-large.status-hot_lead,
.dialog-row-large.needs-manager,
.dialog-row-large.status-human_takeover {
  background: var(--surface, #fff) !important;
  box-shadow: none !important;
}

.large-chat p,
.card-chat p,
.big-chat p,
.dialog-row-title,
.dialog-row-desc,
.chat-module-client-bar,
.status-pill,
.channel-badge,
.dialog-row-badge,
.module-launcher nav a strong,
.module-launcher nav a small {
  word-break: normal !important;
  overflow-wrap: break-word !important;
  hyphens: none !important;
  text-wrap: pretty;
}

.chat-module-client-bar,
.dialog-row-header,
.dialog-row-body,
.module-launcher nav a {
  min-width: 0 !important;
}

.status-pill,
.channel-badge,
.dialog-row-badge,
.view-control-btn {
  white-space: normal !important;
  line-height: 1.15 !important;
}

.client-card-quick-settings {
  margin-top: 1rem;
  padding: 0.85rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface, #fff) 92%, #e2e8f0);
  box-shadow: inset 0 0 0 1px rgb(15 23 42 / 0.08);
}

.settings-tabs-nav {
  position: sticky !important;
  top: 0 !important;
  z-index: 5 !important;
  background: color-mix(in srgb, var(--surface, #fff) 94%, transparent) !important;
  backdrop-filter: blur(10px);
}

.dashboard-simple-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(320px, 1.05fr);
  gap: 18px;
  align-items: start;
}

.dialog-priority-badge {
  display: inline-grid;
  place-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.dialog-priority-badge.priority-hot {
  background: #fff7ed;
  color: #9a3412;
  box-shadow: inset 0 0 0 1px #fed7aa;
}

.dialog-priority-badge.priority-manager {
  background: #eff6ff;
  color: #1d4ed8;
  box-shadow: inset 0 0 0 1px #bfdbfe;
}

@media (max-width: 900px) {
  .dashboard-simple-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
