body {
  font-family: 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f8fafc;
  line-height: 1.6;
  color: #2d3748;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 20px 40px;
}

/* Переключатель источника данных */
.data-source-switcher {
  margin-bottom: 20px;
  padding: 20px 0;
  border-bottom: 1px solid #e2e8f0;
}

/* Вкладки методов аутентификации */
.auth-method-tabs {
  margin-bottom: 25px;
  border-bottom: 2px solid #e2e8f0;
}

.auth-tab-buttons {
  display: flex;
  gap: 0;
  background: #f8fafc;
  border-radius: 12px 12px 0 0;
  padding: 4px;
  border: 1px solid #e2e8f0;
  border-bottom: none;
}

.auth-tab-btn {
  flex: 1;
  padding: 16px 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  margin: 0 2px;
  transition: all 0.3s ease;
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
}

.auth-tab-btn:hover:not(.active) {
  background: #ffffff;
  color: #374151;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.auth-tab-btn.active {
  background: #ffffff;
  color: #DA1A30;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(218, 26, 48, 0.15);
  border: 2px solid #DA1A30;
}

.auth-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: #DA1A30;
  border-radius: 2px;
}

.auth-tab-btn i {
  font-size: 18px;
  margin-bottom: 4px;
}

.auth-tab-btn .tab-label {
  font-size: 13px;
  font-weight: 600;
}

.auth-tab-btn .tab-count {
  font-size: 11px;
  opacity: 0.7;
  font-weight: 400;
}

.auth-tab-btn.active .tab-count {
  opacity: 0.8;
}

.switcher-buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.source-btn {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.source-btn:hover {
  border-color: #DA1A30;
  color: #DA1A30;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(218, 26, 48, 0.15);
}

.source-btn.active {
  background: #DA1A30;
  border-color: #DA1A30;
  color: white;
  box-shadow: 0 4px 12px rgba(218, 26, 48, 0.25);
}

.source-btn i {
  font-size: 16px;
}

.source-note {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  padding: 12px 16px;
  color: #0369a1;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.source-note i {
  color: #0284c7;
}

/* Сообщение об отсутствии данных */
.no-data-message {
  text-align: center;
  padding: 60px 20px;
  background: #ffffff;
  border-radius: 12px;
  border: 2px dashed #e2e8f0;
  margin: 40px 0;
}

.no-data-content {
  max-width: 400px;
  margin: 0 auto;
}

.no-data-content i {
  font-size: 48px;
  color: #94a3b8;
  margin-bottom: 20px;
  display: block;
}

.no-data-content h3 {
  font-size: 24px;
  color: #1e293b;
  margin: 0 0 16px 0;
  font-weight: 600;
}

.no-data-content p {
  color: #64748b;
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
}

/* Адаптивность для переключателя */
@media (max-width: 768px) {
  .switcher-buttons {
    flex-direction: column;
    gap: 8px;
  }
  
  .source-btn {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
  }
  
  .data-source-switcher {
    padding: 15px 0;
  }
  
  .no-data-message {
    padding: 40px 15px;
    margin: 20px 0;
  }
  
  .no-data-content i {
    font-size: 36px;
  }
  
  .no-data-content h3 {
    font-size: 20px;
  }
  
  .no-data-content p {
    font-size: 14px;
  }
}

header {
  background-color: #DA1A30; /* Фирменный цвет АльфаСтрахования */
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(218, 26, 48, 0.15);
  position: relative;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1280px;
}

.header-right {
  display: flex;
  align-items: center;
}

.header-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-content h1 {
  font-size: 18px;
  margin: 0;
  font-weight: 300;
  letter-spacing: 0.4px;
  opacity: 0.95;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  text-align: right;
}

.header-logout-btn {
  color: white;
  text-decoration: none;
  background-color: rgba(255, 255, 255, 0.15);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.header-logout-btn:hover {
  background-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.logo {
  width: 180px;
  height: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Акцентный цвет для кнопок и элементов */
.btn-primary {
  background-color: #DA1A30;
  border-color: #DA1A30;
}

h1 {
  margin: 0;
}

.dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

/* Специальный стиль для главной страницы с 3 колонками */
.dashboard-home {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}

.dashboard-home .info-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
  justify-content: space-between;
}

/* Обновленные стили для метрик на главной */
.dashboard-home .metric-description,
.dashboard-home .data-sync-info {
  margin: 0;
  box-sizing: border-box;
  min-height: 120px;
}

.dashboard-home .metric-description {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}

.dashboard-home .data-sync-info {
  display: flex;
  align-items: center;
  min-height: 80px;
  padding: 14px 18px;
}

.dashboard-home .card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Исправление для контейнера графика статусов */
.dashboard-home .card .statuses-chart-container {
  height: 300px;
  margin-top: 15px;
  max-height: 300px;
}

.card {
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 24px;
  border: 1px solid rgba(0, 0, 0, 0.03);
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #edf2f7;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.card h2 {
  margin-top: 0;
  margin-bottom: 0;
  color: #2d3748;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.export-buttons {
  display: flex;
  gap: 8px;
}

.export-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background-color: #28a745;
  color: white;
  border-radius: 4px;
  font-size: 13px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

.export-btn:hover {
  background-color: #218838;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 16px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid #edf2f7;
}

table th, table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #edf2f7;
  font-size: 14px;
}

table th {
  background-color: #f8fafc;
  font-weight: 600;
  color: #2d3748;
  letter-spacing: 0.3px;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

table tr:hover td {
  background-color: #f7fafc;
}

table tr:last-child td {
  border-bottom: none;
}

.chart-container {
  height: 350px;
  margin-top: 24px;
  position: relative;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.02);
  border-radius: 8px;
  padding: 16px 8px 8px;
  background-color: #fcfcfd;
  border: 1px solid #f1f5f9;
}

.nav-tabs {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 12px 0 0 0;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
  gap: 2px;
}

.nav-tabs li {
  margin-right: 4px;
}

.nav-tabs li:last-child {
  margin-left: auto;
}

.nav-tabs .logout-btn {
  background-color: #DA1A30;
  color: white !important;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(218, 26, 48, 0.15);
}

.nav-tabs .logout-btn:hover {
  background-color: #c00;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(218, 26, 48, 0.25);
}

.nav-tabs a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  text-decoration: none;
  color: #4a5568;
  border: 1px solid transparent;
  border-radius: 8px 8px 0 0;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
}

.nav-tabs a i {
  font-size: 16px;
  opacity: 0.8;
}

.nav-tabs a:hover {
  background-color: #f7fafc;
  color: #2d3748;
}

.nav-tabs a.active {
  background-color: white;
  border: 1px solid #e2e8f0;
  border-bottom-color: white;
  margin-bottom: -1px;
  color: #DA1A30;
  font-weight: 600;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.04);
}

.nav-tabs a.active i {
  opacity: 1;
}

.tab-content {
  padding: 20px;
  background-color: white;
  border: 1px solid #ddd;
  border-top: 0;
}

.hidden {
  display: none;
}

/* Стили для формы фильтров */
.filters-form {
  margin-bottom: 24px;
  background-color: #f9fafb;
  padding: 16px 20px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
  align-items: flex-end;
}

.filters-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin-top: 6px;
  font-weight: 500;
  color: #4a5568;
}

.chart-controls {
  margin: 20px 0;
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

/* Кнопки в контролах графиков */
.chart-controls .btn {
  min-width: 140px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  min-width: 150px;
}

.filter-group label {
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 14px;
  color: #2d3748;
  letter-spacing: 0.3px;
}

.filter-group select,
.filter-group input[type="date"] {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  height: 36px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.filter-group select:focus,
.filter-group input[type="date"]:focus {
  border-color: #DA1A30;
  outline: none;
  box-shadow: 0 0 0 3px rgba(218, 26, 48, 0.2);
}

/* Предустановки для выбора дат */
.date-presets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.date-presets span {
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
}

.date-preset {
  background-color: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 13px;
  text-decoration: none;
  color: #4a5568;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  display: inline-flex;
  align-items: center;
  height: 28px;
}

.date-preset:hover {
  background-color: #e2e8f0;
  text-decoration: none;
  color: #1a202c;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Стили для блока статистики */
.stats-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 20px 0;
  justify-content: space-around;
}

/* Специальные стили для страницы сервисов */
.services-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 20px 0;
}

.services-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  justify-content: space-between;
  margin: 0 0 20px 0;
}

/* Особый случай для пятого элемента во второй колонке (отправки в бот) */
.services-summary-column:nth-child(2) .services-summary {
  grid-template-columns: repeat(2, 1fr);
}

.services-summary-column:nth-child(2) .services-summary .stat-item:nth-child(5) {
  grid-column: 1 / 3;
}

.services-stat-item {
  margin: 0;
  box-sizing: border-box;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 15px;
  border-radius: 10px;
  background-color: #f8fafc;
  min-width: 150px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid #e2e8f0;
}

.stat-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

/* Стили для блока загруженных фото */
.uploaded-photos {
  background-color: #ebf4ff;
  border-left: 3px solid #3182ce;
}

/* Стили для множественного выбора статусов */
.select-multiple {
  width: 100%;
  min-height: 120px;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  background-color: white;
  transition: border-color 0.2s ease;
}

.select-multiple:focus {
  outline: none;
  border-color: #DA1A30;
  box-shadow: 0 0 0 3px rgba(218, 26, 48, 0.1);
}

/* Стили для разбивки по статусам */
.status-breakdown {
  margin-top: 30px;
  padding: 20px;
  background-color: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.status-breakdown h3 {
  margin: 0 0 20px 0;
  color: #2d3748;
  font-size: 18px;
  font-weight: 600;
}

.status-stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 30px;
}

.status-section {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.status-section h4 {
  margin: 0 0 15px 0;
  color: #4a5568;
  font-size: 16px;
  font-weight: 500;
}

.status-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.status-table thead {
  background-color: #f7fafc;
}

.status-table th,
.status-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.status-table th {
  font-weight: 600;
  color: #4a5568;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-table tbody tr:hover {
  background-color: #f8fafc;
}

.status-table tbody tr:last-child td {
  border-bottom: none;
}

.stat-value {
  font-size: 26px;
  font-weight: 600;
  color: #DA1A30;
  margin-bottom: 8px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  line-height: 1.2;
}

.stat-label {
  font-size: 14px;
  color: #4a5568;
  text-align: center;
  font-weight: 500;
  line-height: 1.4;
}

/* Стили для блока использования сервисов */
.services-stats {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.service-card {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.service-card h3 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 18px;
  color: #DA1A30;
  display: flex;
  align-items: center;
  gap: 10px;
}

.service-card h3 i {
  font-size: 20px;
}

.service-metrics {
  display: flex;
  justify-content: space-around;
  gap: 15px;
}

.service-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.service-metric .metric-value {
  font-size: 22px;
  font-weight: bold;
  color: #333;
  margin-bottom: 5px;
}

.service-metric .metric-label {
  font-size: 12px;
  color: #6c757d;
}

/* Стили для страницы NPS */
.nps-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 20px 0;
}

.nps-card {
  flex: 1;
  min-width: 300px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 20px;
}

.nps-card h2 {
  margin-top: 0;
  color: #2c3e50;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
  text-align: center;
}

.nps-gauge-container {
  margin: 15px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.nps-gauge {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background-color: #f5f5f5;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  margin-bottom: 15px;
}

.nps-score {
  font-size: 42px;
  font-weight: bold;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
}

.nps-bad {
  background-color: #ff6384;
}

.nps-neutral {
  background-color: #ffcd56;
}

.nps-good {
  background-color: #4bc0c0;
}

.nps-excellent {
  background-color: #36a2eb;
}

.nps-scale {
  width: 80%;
  height: 10px;
  display: flex;
  margin-bottom: 5px;
}

.nps-scale-section {
  flex: 1;
  height: 100%;
}

.nps-scale-section.bad {
  background-color: #ff6384;
  border-radius: 5px 0 0 5px;
}

.nps-scale-section.neutral {
  background-color: #ffcd56;
}

.nps-scale-section.good {
  background-color: #4bc0c0;
}

.nps-scale-section.excellent {
  background-color: #36a2eb;
  border-radius: 0 5px 5px 0;
}

.nps-scale-labels {
  width: 90%;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #6c757d;
}

.nps-stats {
  display: flex;
  justify-content: space-around;
  margin-top: 20px;
  flex-wrap: wrap;
}

.nps-stat {
  text-align: center;
  padding: 10px;
}

.nps-stat .stat-label {
  font-size: 14px;
  color: #6c757d;
  margin-bottom: 5px;
}

.nps-stat .stat-value {
  font-size: 18px;
  font-weight: bold;
  color: #2c3e50;
}

.feedback-text {
  max-width: 400px;
  white-space: normal;
  word-break: break-word;
}

.no-data-message {
  text-align: center;
  color: #6c757d;
  padding: 20px;
  font-style: italic;
}

.filters-buttons {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 8px;
}

/* Стили для кнопок в фильтрах */
.filters-buttons .btn {
  min-width: 100px;
  height: 36px !important;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  letter-spacing: 0.2px;
  height: 36px;
  line-height: 1;
  box-sizing: border-box;
}

/* Специальные стили для кнопок-ссылок */
a.btn {
  height: 36px;
  box-sizing: border-box;
  text-align: center;
}

.btn-primary {
  background-color: #DA1A30;
  color: white;
}

.btn-primary:hover {
  background-color: #C41829;
  box-shadow: 0 2px 5px rgba(218, 26, 48, 0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: #718096;
  color: white;
}

.btn-secondary:hover {
  background-color: #5A6777;
  box-shadow: 0 2px 5px rgba(113, 128, 150, 0.3);
  transform: translateY(-1px);
}

/* Стили для элементов формы */
input[type="date"], .form-control {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  width: 100%;
  font-size: 14px;
  height: 36px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  box-sizing: border-box;
}

input[type="date"]:focus, .form-control:focus {
  border-color: #DA1A30;
  outline: none;
  box-shadow: 0 0 0 3px rgba(218, 26, 48, 0.2);
}

.chart-controls {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

/* Стили для карточек на всю ширину */
.full-width {
  grid-column: 1 / -1;
  margin-bottom: 20px;
}

.full-width .chart-container {
  height: 400px;
}

/* Стили для описания метрик */
.metric-description {
  background-color: #f8f9fa;
  padding: 20px 24px;
  border-radius: 10px;
  margin: 20px 0 15px;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-left: 4px solid #3182ce;
  line-height: 1.6;
  color: #4a5568;
}

.metric-description h3 {
  margin-top: 0;
  margin-bottom: 12px;
  color: #2d3748;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* Особый стиль для первого блока описания на главной странице */
.dashboard:first-of-type + .metric-description,
.metric-description:first-child {
  background-color: #EDF2F7;
  border-left: 4px solid #DA1A30;
  margin-top: 0;
}

/* Стили для превью стилей в таблице */
.style-preview {
  width: 120px;
  height: 80px;
  text-align: center;
}

.style-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.no-preview {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f5f5f5;
  color: #999;
  font-size: 12px;
  border-radius: 4px;
}

.metric-description p {
  margin: 8px 0;
}

.filter-group small {
  color: #6c757d;
  display: block;
  margin-top: 3px;
  font-size: 12px;
}

/* Стили для фильтров статистики */
.filters {
  margin-bottom: 20px;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #DA1A30;
}

.filter-form {
  display: flex;
  gap: 15px;
  align-items: end;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  min-width: 150px;
}

.filter-group label {
  font-size: 14px;
  font-weight: 500;
  color: #4a5568;
  margin-bottom: 5px;
}

.filter-group input,
.filter-group select {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background-color: white;
  transition: border-color 0.2s ease;
}

.filter-group input:focus,
.filter-group select:focus {
  border-color: #DA1A30;
  outline: none;
  box-shadow: 0 0 0 3px rgba(218, 26, 48, 0.1);
}

.filter-btn, .reset-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  height: 38px;
}

.filter-btn {
  background-color: #DA1A30;
  color: white;
}

.filter-btn:hover {
  background-color: #b91527;
}

.reset-btn {
  background-color: #6c757d;
  color: white;
  margin-left: 8px;
}

.reset-btn:hover {
  background-color: #5a6268;
  text-decoration: none;
  color: white;
}

/* Стили для категорий */
.category-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: white;
}

.category-badge.child_status {
  background-color: #3b82f6;
}

.category-badge.checklists {
  background-color: #10b981;
}

.category-badge.diary {
  background-color: #8b5cf6;
}

.category-badge.auth {
  background-color: #f59e0b;
}

.category-badge.support {
  background-color: #ef4444;
}

.category-badge.vaccination {
  background-color: #06b6d4;
}

.category-badge.advertising {
  background-color: #ec4899;
}

.category-badge.onboarding {
  background-color: #f97316;
}

.category-badge.common {
  background-color: #84cc16;
}

.category-badge.unknown {
  background-color: #6b7280;
}

.metric-description ul, 
.metric-description ol {
  margin: 5px 0;
  padding-left: 25px;
}

.metric-description code {
  background-color: #e9ecef;
  padding: 2px 5px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 13px;
}

/* Стили для страницы регионов */
.chart-description {
  text-align: center;
  font-style: italic;
  color: #666;
  margin-top: 10px;
}

.regions-table-container {
  max-height: 350px;
  overflow-y: auto;
  margin-top: 15px;
}

.regions-table-container table {
  width: 100%;
  border-collapse: collapse;
}

.regions-table-container th, 
.regions-table-container td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.regions-table-container th {
  background-color: #f2f2f2;
  position: sticky;
  top: 0;
  z-index: 10;
}

.regions-table-container tr:hover {
  background-color: #f5f5f5;
}

/* Стили для контейнера статусов, чтобы учесть легенду внизу */
.statuses-chart-container {
  height: 320px;
  padding-bottom: 35px;
  margin-bottom: 15px;
}

/* Стили для таблицы статусов пользователей */
.user-status-table-container {
  margin-top: 30px;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  overflow-x: auto;
}

.user-status-table-container h3 {
  color: #2c3e50;
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 18px;
  font-weight: 500;
}

.user-status-table-container table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.user-status-table-container th, 
.user-status-table-container td {
  padding: 10px 15px;
  text-align: center;
  border-bottom: 1px solid #ddd;
}

.user-status-table-container th {
  background-color: #eef2f7;
  font-weight: bold;
  color: #2c3e50;
  white-space: nowrap;
}

.user-status-table-container td:first-child {
  font-weight: 500;
  text-align: left;
}

.user-status-table-container tr:hover {
  background-color: #f5f5f5;
}

/* Стили для важных уведомлений */
.important-notice {
  background-color: #fff8e6;
  border-left: 4px solid #f59e0b;
  padding: 16px 20px;
  margin-bottom: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.important-notice::before {
  content: "⚠️";
  font-size: 18px;
  line-height: 1;
}

.important-notice p {
  margin: 0;
  color: #92400e;
  font-size: 14px;
  line-height: 1.5;
}

/* Стили для контейнера таблицы */
.table-container, .table-responsive {
  margin-top: 20px;
  max-height: 600px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background-color: white;
}

.table-container table, .table-responsive table, .data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th:last-child,
.data-table td:last-child {
  white-space: nowrap;
}

.table-container th, .table-responsive th, .data-table th {
  position: sticky;
  top: 0;
  background-color: #f5f5f5;
  z-index: 10;
  padding: 12px 15px;
  text-align: left;
  border-bottom: 2px solid #ddd;
  color: #333;
  font-weight: bold;
}

.table-container td, .table-responsive td, .data-table td {
  padding: 10px 15px;
  border-bottom: 1px solid #eee;
}

.table-container tr:nth-child(even), .table-responsive tr:nth-child(even), .data-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

.table-container tr:hover, .table-responsive tr:hover, .data-table tr:hover {
  background-color: #f1f7fa;
}

/* Информационный блок о синхронизации данных */
.data-sync-info {
  display: flex;
  align-items: center;
  background-color: #d1ecf1;
  border-radius: 10px;
  padding: 16px 20px;
  margin-top: 16px;
  margin-bottom: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.sync-icon {
  margin-right: 14px;
  color: #0891b2;
  font-size: 20px;
  animation: spin 6s linear infinite;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.dashboard-home .sync-icon {
  font-size: 18px;
  margin-right: 12px;
}

.data-sync-info p {
  margin: 0;
  color: #0c5460;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: 0.2px;
}

.dashboard-home .data-sync-info p {
  font-size: 14px;
  line-height: 1.4;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  3% { transform: rotate(720deg); }
  12% { transform: rotate(720deg); }
  15% { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}

/* Стили для модального окна */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  overflow: auto;
}

.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 30px 35px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  width: 80%;
  max-width: 500px;
  position: relative;
  animation: modalFadeIn 0.3s ease-out;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

@keyframes modalFadeIn {
  from {opacity: 0; transform: translateY(-20px);}
  to {opacity: 1; transform: translateY(0);}
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
  transition: color 0.2s ease;
}

.close-modal:hover {
  color: #333;
}

.modal h2 {
  margin-top: 0;
  color: #DA1A30;
  margin-bottom: 15px;
  font-size: 22px;
}

.modal p {
  margin: 15px 0;
  font-size: 16px;
  line-height: 1.5;
  color: #333;
}

.modal-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 25px;
}

.modal-buttons .btn {
  padding: 10px 20px;
  min-width: 120px;
  font-size: 16px;
}

/* Стиль для отображения общего количества ответов */
.responses-summary-container {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 5px 0 15px;
  flex-wrap: wrap;
}

.responses-summary {
  text-align: center;
  color: #555;
  font-size: 15px;
  background-color: #f8f9fa;
  padding: 8px 12px;
  border-radius: 5px;
  display: inline-block;
}

.text-danger {
  color: #dc3545;
  font-weight: bold;
}

.text-warning {
  color: #ffc107;
  font-weight: bold;
}

.text-success {
  color: #28a745;
  font-weight: bold;
}

.text-primary {
  color: #007bff;
  font-weight: bold;
}

.nps-bad-text {
  color: #ff6384;
  font-weight: bold;
}

.nps-neutral-text {
  color: #ffcd56;
  font-weight: bold;
}

.nps-good-text {
  color: #4bc0c0;
  font-weight: bold;
}

.nps-excellent-text {
  color: #36a2eb;
  font-weight: bold;
}

/* Стили для блока интерпретации NPS */
.nps-interpretation {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 15px 0;
}

.nps-interpretation-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.nps-indicator {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
}

.responses-summary strong {
  color: #DA1A30;
  font-size: 16px;
  font-weight: 600;
}

/* Стили для заглушки графика */
.chart-placeholder {
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8f9fa;
  border-radius: 8px;
  margin: 20px 0;
  padding: 20px;
}

.placeholder-content {
  text-align: center;
  max-width: 700px;
  padding: 40px;
}

.placeholder-icon {
  font-size: 72px;
  color: #b8c5d0;
  margin-bottom: 25px;
}

.placeholder-content h3 {
  color: #555;
  margin-bottom: 20px;
  font-weight: 500;
  font-size: 24px;
}

.placeholder-content p {
  color: #6c757d;
  line-height: 1.6;
  margin-bottom: 15px;
  font-size: 16px;
}

/* Стили для таблицы удержания */
.retention-table-container {
  margin-top: 30px;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.retention-table-container h3 {
  color: #2c3e50;
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 18px;
}

.retention-table-container p {
  margin-bottom: 15px;
  color: #666;
}

.retention-table-container table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.retention-table-container th, 
.retention-table-container td {
  padding: 10px 15px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.retention-table-container th {
  background-color: #eef2f7;
  font-weight: bold;
  color: #2c3e50;
}

.retention-table-container tr:hover {
  background-color: #f5f5f5;
}

.retention-table-container tr:first-child {
  font-weight: bold;
}

.retention-table-container tr:first-child td:last-child {
  color: #DA1A30;
}
