.funnel-list, .stuck-list { display: grid; gap: 14px; }
.funnel-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
  align-items: center;
}
.funnel-meta { display: grid; gap: 6px; }
.funnel-name { font-weight: 700; }
.funnel-bar {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--blue-100);
}
.funnel-bar__fill { height: 100%; background: linear-gradient(90deg, #3554df, #6c88ff); }
.funnel-values { text-align: right; color: var(--muted); font-size: 14px; }

.table-wrap {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
}
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.5;
  vertical-align: top;
}
th { color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
.table-row-toggle td {
  padding-top: 16px;
  text-align: center;
}
.is-selected-row td {
  background: #eef3ff;
  font-weight: 600;
}

.stuck-item {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}
.stuck-item__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.stuck-item__badge-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.stuck-item__title {
  font-weight: 700;
  line-height: 1.4;
  text-wrap: pretty;
}
.stuck-item__meta { color: var(--muted); font-size: 13px; }
.stuck-item__summary {
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  text-wrap: pretty;
}
.stuck-item__hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.stuck-item__ai-note {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(37, 63, 184, 0.08);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.stuck-item__badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.stuck-item__badge--danger {
  background: #fff0f0;
  color: var(--danger);
}
.stuck-item__badge--warning {
  background: #fff7e7;
  color: #b47b00;
}
.stuck-item__badge--success {
  background: #edf9f2;
  color: #1d8d4c;
}
.stuck-item__badge--neutral {
  background: #eef3ff;
  color: var(--blue-600);
}
.ai-verdict-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}
.ai-verdict-badge--success {
  background: #edf9f2;
  color: #1d8d4c;
  border-color: rgba(29, 141, 76, 0.18);
}
.ai-verdict-badge--warning {
  background: #fff7e7;
  color: #b47b00;
  border-color: rgba(180, 123, 0, 0.16);
}
.ai-verdict-badge--danger {
  background: #fff0f0;
  color: var(--danger);
  border-color: rgba(227, 77, 77, 0.18);
}
.ai-verdict-badge--neutral {
  background: #eef3ff;
  color: var(--blue-600);
  border-color: rgba(51, 80, 212, 0.14);
}
.list-toggle-wrap {
  display: flex;
  justify-content: center;
}
.list-toggle-button {
  min-width: 180px;
}

.empty {
  padding: 18px;
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

/* ── Сайт ЛК Дашборд ────────────────────────────────────────── */
.site-lk-wrap { padding: 0 0 40px; }
.site-lk-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 8px; }
.site-lk-title { font-size: 20px; font-weight: 600; color: var(--text); margin: 0; }
.site-lk-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.site-lk-period { display: flex; gap: 6px; }
.site-lk-manager-select { height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 13px; cursor: pointer; }

.kpi-row { display: flex; flex-wrap: wrap; gap: 12px; padding: 0 24px 4px; }
.kpi-card { flex: 1; min-width: 100px; padding: 14px 16px; border-radius: 10px; background: var(--panel-bg, rgba(0,0,0,0.03)); border: 1px solid var(--border); }
.kpi-card--action {
  cursor: pointer;
  text-align: left;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.kpi-card--action:hover {
  transform: translateY(-1px);
  border-color: rgba(51,80,212,0.34);
  box-shadow: 0 10px 22px rgba(37,63,184,0.08);
}
.manager-row-button {
  width: 100%;
  background: transparent;
  border: 0;
  padding: 0;
  text-align: inherit;
  color: inherit;
  cursor: pointer;
}
.manager-row-button td {
  transition: background 0.15s ease;
}
.manager-row-button:hover td {
  background: rgba(37,63,184,0.04);
}
.kpi-card__value { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1; }
.kpi-card__label { font-size: 11px; color: var(--muted); margin-top: 4px; }
.kpi-card__meta { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.35; }
.kpi-card--won .kpi-card__value { color: #16a34a; }
.kpi-card--lost .kpi-card__value { color: #dc2626; }
.kpi-card--active .kpi-card__value { color: #2563eb; }
.kpi-card--revenue .kpi-card__value { color: #7c3aed; font-size: 18px; }
.kpi-card--conv .kpi-card__value { color: #d97706; }

.timings-grid { display: flex; flex-wrap: wrap; gap: 12px; padding: 0 24px 4px; }
.timing-card { flex: 1; min-width: 140px; padding: 14px 16px; border-radius: 10px; background: var(--panel-bg, rgba(0,0,0,0.03)); border: 1px solid var(--border); }
.timing-card--warn { border-color: #f59e0b; background: rgba(245,158,11,0.06); }
.timing-card__value { font-size: 20px; font-weight: 700; color: var(--text); }
.timing-card__label { font-size: 11px; color: var(--muted); margin-top: 4px; }
.timing-card__norm { font-size: 10px; color: var(--muted); margin-top: 2px; opacity: 0.6; }

.stages-table-wrap { padding: 0 24px; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 8px 12px; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--border); }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text); }
.data-table tr:hover td { background: rgba(0,0,0,0.02); }
.sla-row td { background: rgba(220,38,38,0.04); }
.warn-text { color: #d97706 !important; }
.empty-state { padding: 24px; color: var(--muted); text-align: center; }

.period-btn { padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border); background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; transition: all 0.15s; }
.period-btn:hover { background: rgba(0,0,0,0.04); color: var(--text); }
.period-btn--active { background: rgba(99,102,241,0.1); border-color: #6366f1; color: #4f46e5; }

/* ── Под ключ Dashboard ── */
.turnkey-funnel-bars { display: flex; flex-direction: column; gap: 8px; padding: 8px 24px 16px; }
.turnkey-funnel-step { display: flex; flex-direction: column; gap: 2px; }
.turnkey-funnel-step__label { font-size: 12px; color: var(--muted); font-weight: 500; }
.turnkey-funnel-bar-wrap { display: flex; align-items: center; gap: 8px; }
.turnkey-funnel-bar { height: 22px; border-radius: 4px; min-width: 2px; transition: width 0.3s ease; }
.turnkey-funnel-bar--ok   { background: rgba(99,102,241,0.45); }
.turnkey-funnel-bar--warn { background: rgba(245,158,11,0.55); }
.turnkey-funnel-bar--won  { background: rgba(16,185,129,0.6); }
.turnkey-funnel-step__count { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }
.turnkey-funnel-step__drop  { font-size: 11px; color: #ef4444; padding-left: 0; }

.analysis-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
}
.analysis-modal--hidden {
  display: none;
}
.analysis-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 23, 44, 0.42);
  backdrop-filter: blur(4px);
}
.analysis-modal__panel {
  position: relative;
  width: min(1760px, calc(100vw - 24px));
  max-height: min(96vh, 1180px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--surface);
  border: 1px solid rgba(37,63,184,0.12);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(16,23,44,0.22);
}
.analysis-modal__header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding: 10px 18px 8px;
  border-bottom: 1px solid var(--border);
}
.analysis-modal__eyebrow {
  margin: 0 0 2px;
  color: var(--blue-600);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.analysis-modal__header h2 {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.2;
}
.analysis-modal__header .panel__hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  max-width: 1320px;
}
.analysis-modal__body {
  overflow: auto;
  padding: 10px 16px 14px;
  display: grid;
  gap: 10px;
}
.analysis-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.analysis-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.analysis-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
}
.analysis-chip--active {
  background: rgba(99,102,241,0.1);
  border-color: #6366f1;
  color: #4338ca;
}
.analysis-table-wrap {
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: auto;
  min-height: 0;
  max-height: calc(96vh - 270px);
}
.analysis-table {
  width: 100%;
  border-collapse: collapse;
}
.analysis-table th,
.analysis-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 12px;
  line-height: 1.35;
}
.analysis-table th {
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.analysis-table tbody tr:last-child td {
  border-bottom: 0;
}
.analysis-table__title {
  display: grid;
  gap: 4px;
}
.analysis-table__title strong {
  font-size: 12px;
}
.analysis-table__meta {
  color: var(--muted);
  font-size: 11px;
}
.analysis-table__stack {
  display: grid;
  gap: 3px;
}
.analysis-table__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 1280px) {
  .analysis-modal {
    padding: 10px;
  }

  .analysis-modal__panel {
    width: min(100vw - 12px, 1760px);
    max-height: 97vh;
  }

  .analysis-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .analysis-table-wrap {
    max-height: calc(97vh - 320px);
  }
}
