.task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 12px;
}

.task-grid > .empty {
  grid-column: 1 / -1;
}

.task-card {
  min-height: 152px;
  display: grid;
  align-content: start;
  gap: 5px;
  width: 100%;
  padding: 14px;
  border: 1px solid #cfe5f5;
  border-radius: 14px;
  color: var(--text);
  text-align: left;
  box-shadow: 0 5px 16px rgba(11, 45, 92, .06);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.task-card:hover {
  border-color: #75bce7;
  box-shadow: 0 9px 22px rgba(11, 45, 92, .11);
  transform: translateY(-1px);
}

.task-card:focus-visible,
.integration-card:focus-visible {
  outline: 3px solid rgba(22, 139, 208, .25);
  outline-offset: 2px;
}

.task-card b {
  display: -webkit-box;
  overflow: hidden;
  color: var(--navy2);
  font-size: 16px;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.task-card small,
.task-card-client {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-card-client {
  font-weight: 700;
}

.task-card-status {
  justify-self: start;
  margin-bottom: 3px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #dff3ff;
  color: #075b8c;
  font-size: 11px;
  font-weight: 750;
}

.task-card.task-overdue .task-card-status {
  background: #ffe1df;
  color: #a7271d;
}

.task-card.task-overdue .task-card-client,
.task-card.task-overdue small {
  color: #a7271d;
}

.manager-workload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.manager-workload-grid > .empty {
  grid-column: 1 / -1;
}

.manager-workload-card {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(11, 45, 92, .06);
}

.manager-workload-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.manager-workload-head b,
.manager-workload-head small {
  display: block;
}

.manager-workload-head b {
  color: var(--navy2);
  line-height: 1.3;
}

.manager-workload-head small {
  margin-top: 3px;
  color: var(--muted);
}

.manager-workload-head > span {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e9f9f2;
  color: var(--green);
  font-size: 11px;
  font-weight: 750;
}

.manager-workload-head > span.has-overdue {
  background: #ffe1df;
  color: #a7271d;
}

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

.manager-workload-metrics > div {
  min-width: 0;
  padding: 9px;
  border-radius: 10px;
  background: #eef7fe;
}

.manager-workload-metrics span,
.manager-workload-metrics b {
  display: block;
}

.manager-workload-metrics span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manager-workload-metrics b {
  margin-top: 3px;
  color: var(--navy2);
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}

.manager-workload-metrics .metric-overdue {
  background: #fff0ef;
}

.manager-workload-metrics .metric-overdue b {
  color: #a7271d;
}

.modal-task-context {
  display: block;
  max-width: 56ch;
  margin-top: 3px;
  color: var(--muted);
}

.task-complete-action {
  background: var(--green);
}

.integration-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.integration-card {
  min-height: 178px;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--text);
  text-align: left;
  box-shadow: 0 5px 20px rgba(11, 45, 92, .06);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.integration-card:hover {
  border-color: #76bde7;
  box-shadow: 0 10px 24px rgba(11, 45, 92, .11);
  transform: translateY(-1px);
}

.integration-card.integration-attention {
  border-color: #efb0aa;
  background: #fffafa;
}

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

.integration-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  background: var(--navy2);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
}

.integration-card > b {
  color: var(--navy2);
  font-size: 17px;
}

.integration-card > span:not(.integration-card-top):not(.integration-open),
.integration-card > small {
  color: var(--muted);
}

.integration-open {
  align-self: end;
  margin-top: 6px;
  color: #0876c2;
  font-size: 13px;
  font-weight: 750;
}

.integration-warning {
  background: #fff0ef;
  color: #9c2015;
}

.integration-modal {
  width: min(920px, 100%);
}

.integration-modal .modal-head > div {
  display: grid;
  gap: 5px;
}

.integration-modal .modal-head .badge {
  justify-self: start;
}

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

.integration-summary > div {
  padding: 12px;
  border-radius: 11px;
  background: #eef7fe;
}

.integration-summary span,
.integration-summary b {
  display: block;
}

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

.integration-summary b {
  margin-top: 5px;
  color: var(--navy2);
  font-size: 18px;
}

.integration-status-note p {
  margin: 6px 0 0;
  color: var(--muted);
}

/* Цвет относится только к заголовку этапа. Карточки лидов сохраняют свои статусы. */
.funnel-col:nth-child(1) > .funnel-title { background: #1769aa; }
.funnel-col:nth-child(2) > .funnel-title { background: #b3261e; }
.funnel-col:nth-child(3) > .funnel-title { background: #0f766e; }
.funnel-col:nth-child(4) > .funnel-title { background: #6d28d9; }
.funnel-col:nth-child(5) > .funnel-title { background: #9a5b00; }
.funnel-col:nth-child(6) > .funnel-title { background: #3949ab; }
.funnel-col:nth-child(7) > .funnel-title { background: #006b7d; }
.funnel-col:nth-child(8) > .funnel-title { background: #a14400; }
.funnel-col:nth-child(9) > .funnel-title { background: #167a47; }
.funnel-col:nth-child(10) > .funnel-title { background: #682638; }

.event-registration-date {
  color: #075278 !important;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.report-main-filters {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  margin-bottom: 0;
}

.report-filter-help {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.channel-totals {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 1px;
  padding: 0 18px 18px;
  background: var(--line);
}

.channel-totals > div {
  min-width: 0;
  padding: 12px 14px;
  background: #eef7fe;
}

.channel-totals span,
.channel-totals b {
  display: block;
}

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

.channel-totals b {
  margin-top: 3px;
  color: var(--navy2);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.report-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 18px 18px;
  color: var(--muted);
  font-size: 13px;
}

.report-pagination .btn:disabled {
  cursor: default;
  opacity: .45;
}

@media (max-width: 760px) {
  .task-grid,
  .manager-workload-grid,
  .integration-card-grid,
  .integration-summary,
  .report-main-filters {
    grid-template-columns: 1fr;
  }

  .channel-totals {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
  }

  .task-card {
    min-height: 138px;
  }

  .modal-foot {
    flex-wrap: wrap;
  }

  .modal-foot .btn {
    flex: 1 1 auto;
  }
}
