/* =============================================================================
   CRM Metrics-Nest - Современный UI дизайн
   Автор: Assistant
   Дата: 2024
   ============================================================================= */

/* Основные CSS-переменные для консистентности */
:root {
  --primary-gradient: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
  --success-gradient: linear-gradient(135deg, #198754 0%, #20c997 100%);
  --warning-gradient: linear-gradient(135deg, #fd7e14 0%, #ffc107 100%);
  --danger-gradient: linear-gradient(135deg, #dc3545 0%, #fd5e53 100%);
  --info-gradient: linear-gradient(135deg, #0dcaf0 0%, #17a2b8 100%);
  
  --primary-color: #667eea;
  --success-color: #20c997;
  --warning-color: #fd7e14;
  --danger-color: #ff6b6b;
  --info-color: #17a2b8;
  
  --text-dark: #2d3748;
  --text-muted: #718096;
  --bg-light: #f7fafc;
  --border-color: #e2e8f0;
  
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  --border-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --mint-gradient: linear-gradient(135deg, #00d4aa 0%, #01a68a 100%);
  --orange-gradient: linear-gradient(135deg, #ff9a56 0%, #ffad56 100%);
  --purple-gradient: linear-gradient(135deg, #6f42c1 0%, #9c27b0 100%);
  --teal-gradient: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  --gradient-violet-pink: linear-gradient(90deg, #a18cd1 0%, #fbc2eb 100%);
}

/* ROI card gradient border */
.card-gradient-roi {
  border-left: 6px solid transparent;
  border-image: var(--gradient-violet-pink) 1;
}

/* Основные стили body */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =========================================================================
   СТРАНИЦА АВТОРИЗАЦИИ
   ========================================================================= */

.auth-body {
  background: var(--primary-gradient);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.auth-body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.auth-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  padding: 40px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-card .card-icon {
  width: 64px;
  height: 64px;
  background: var(--primary-gradient);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: var(--shadow-md);
}

.auth-card .card-icon i {
  font-size: 24px;
  color: white;
}

.auth-card h4 {
  color: var(--text-dark);
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 1.5rem;
}

.auth-card p {
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 0.95rem;
}

/* =========================================================================
   СОВРЕМЕННЫЕ ФОРМЫ
   ========================================================================= */

.form-control {
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 14px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
  background: white;
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  background: white;
}

.form-control::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.input-group .form-control {
  border-right: none;
}

.input-group-text {
  background: white;
  border: 2px solid var(--border-color);
  border-left: none;
  color: var(--text-muted);
}

/* =========================================================================
   СОВРЕМЕННЫЕ КНОПКИ
   ========================================================================= */

.btn {
  font-weight: 600;
  border-radius: var(--border-radius);
  padding: 12px 24px;
  font-size: 0.95rem;
  border: none;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

/* =========================================================================
   МОБИЛЬНАЯ НАВИГАЦИЯ
   ========================================================================= */

/* Бургер меню */
.mobile-burger {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 10;
}

.mobile-burger span {
  width: 100%;
  height: 3px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: var(--transition);
  transform-origin: 1px;
}

.mobile-burger.active span:nth-child(1) {
  transform: rotate(45deg);
}

.mobile-burger.active span:nth-child(2) {
  opacity: 0;
}

.mobile-burger.active span:nth-child(3) {
  transform: rotate(-45deg);
}

/* Мобильное боковое меню */
.mobile-sidebar {
  position: fixed;
  top: 0;
  left: -100%;
  width: 280px;
  height: 100vh;
  background: white;
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  transition: var(--transition);
  overflow-y: auto;
}

.mobile-sidebar.active {
  left: 0;
}

.mobile-sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.mobile-sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-light);
}

.mobile-sidebar-header .user-info {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.mobile-sidebar-header .user-avatar {
  width: 50px;
  height: 50px;
  background: var(--primary-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
}

.mobile-sidebar-header .user-avatar i {
  font-size: 24px;
  color: white;
}

.mobile-sidebar-header .user-details h6 {
  margin: 0;
  font-weight: 600;
  color: var(--text-dark);
}

.mobile-sidebar-header .user-details small {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.mobile-sidebar-header .user-earnings {
  background: var(--success-gradient);
  color: white;
  padding: 10px 15px;
  border-radius: var(--border-radius);
  text-align: center;
}

.mobile-sidebar-header .user-earnings h6 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.mobile-sidebar-header .user-earnings small {
  opacity: 0.9;
  font-size: 0.8rem;
}

.mobile-sidebar-nav {
  padding: 20px 0;
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  color: var(--text-dark);
  text-decoration: none;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
  position: relative;
}

.mobile-nav-item:hover {
  background: var(--bg-light);
  color: var(--primary-color);
  text-decoration: none;
}

.mobile-nav-item.active {
  background: var(--primary-gradient);
  color: white;
}

.mobile-nav-item i {
  width: 20px;
  margin-right: 15px;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.mobile-nav-item .nav-text {
  font-weight: 500;
  flex: 1;
}

.mobile-nav-item .dropdown-arrow {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  transition: var(--transition);
}

.mobile-nav-item.active .dropdown-arrow {
  transform: translateY(-50%) rotate(180deg);
}

.mobile-dropdown-menu {
  background: var(--bg-light);
  border-top: 1px solid var(--border-color);
  max-height: 0;
  overflow: hidden;
  transition: var(--transition);
}

.mobile-dropdown-menu.active {
  max-height: 500px;
}

/* Автоматическое открытие выпадающих меню для активной страницы */
.mobile-nav-item.active + .mobile-dropdown-menu {
  max-height: 500px;
}

.mobile-nav-item.active .dropdown-arrow {
  transform: translateY(-50%) rotate(180deg);
}

.mobile-dropdown-item {
  display: flex;
  align-items: center;
  padding: 12px 20px 12px 55px;
  color: var(--text-dark);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 0.9rem;
  transition: var(--transition);
}

.mobile-dropdown-item:hover {
  background: rgba(102, 126, 234, 0.1);
  color: var(--primary-color);
  text-decoration: none;
}

.mobile-dropdown-item i {
  width: 16px;
  margin-right: 10px;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.mobile-sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-light);
}

.mobile-logout-btn {
  width: 100%;
  background: var(--danger-gradient);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: var(--border-radius);
  font-weight: 600;
  transition: var(--transition);
}

.mobile-logout-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: white;
}

/* Мобильная шапка */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  background: white;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.mobile-header .mobile-logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dark);
  text-decoration: none;
  display: flex;
  align-items: center;
}

.mobile-header .mobile-logo i {
  margin-right: 8px;
  color: var(--primary-color);
  flex-shrink: 0;
}





.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, #5a6fd8 0%, #6b4190 100%);
}

.btn-success {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 10px !important;
  box-shadow: 0 2px 8px rgba(34,197,94,0.10);
  font-weight: 600;
  transition: box-shadow 0.18s, background 0.18s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-success:hover, .btn-gradient-success:focus {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
  color: #fff !important;
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border: none !important;
}

.btn-warning {
  background: var(--warning-gradient);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-warning:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-outline-primary {
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-1px);
}

.btn-outline-primary.active {
  background: var(--primary-gradient);
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-md);
}

/* =========================================================================
   КАСТОМНЫЕ ГРАДИЕНТНЫЕ КНОПКИ ДЛЯ ОТЧЕТОВ
   ========================================================================= */
.btn-gradient-primary {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: var(--shadow-md);
  border: none;
}
.btn-gradient-primary:hover, .btn-gradient-primary:focus {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.btn-gradient-success {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 10px !important;
  box-shadow: 0 2px 8px rgba(34,197,94,0.10);
  font-weight: 600;
  transition: box-shadow 0.18s, background 0.18s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-gradient-success:hover, .btn-gradient-success:focus {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%) !important;
  color: #fff !important;
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border: none !important;
}

.btn-gradient-danger {
  background: var(--danger-gradient);
  color: #fff;
  box-shadow: var(--shadow-md);
  border: none;
}
.btn-gradient-danger:hover, .btn-gradient-danger:focus {
  background: var(--danger-gradient);
  color: #fff;
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.btn-gradient-warning {
  background: var(--warning-gradient);
  color: #fff;
  box-shadow: var(--shadow-md);
  border: none;
}
.btn-gradient-warning:hover, .btn-gradient-warning:focus {
  background: var(--warning-gradient);
  color: #fff;
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.btn-gradient-info {
  background: linear-gradient(135deg, #36d1c4 0%, #5b86e5 100%) !important;
  color: #fff !important;
  box-shadow: var(--shadow-md);
  border: none;
}
.btn-gradient-info:hover, .btn-gradient-info:focus {
  background: linear-gradient(135deg, #36d1c4 0%, #5b86e5 100%) !important;
  color: #fff !important;
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.btn-gradient-orange {
  background: var(--orange-gradient);
  color: #fff;
  box-shadow: var(--shadow-md);
  border: none;
}
.btn-gradient-orange:hover, .btn-gradient-orange:focus {
  background: var(--orange-gradient);
  color: #fff;
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.btn-gradient-purple {
  background: var(--purple-gradient);
  color: #fff;
  box-shadow: var(--shadow-md);
  border: none;
}
.btn-gradient-purple:hover, .btn-gradient-purple:focus {
  background: var(--purple-gradient);
  color: #fff;
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.btn-gradient-teal {
  background: var(--teal-gradient);
  color: #fff;
  box-shadow: var(--shadow-md);
  border: none;
}
.btn-gradient-teal:hover, .btn-gradient-teal:focus {
  background: var(--teal-gradient);
  color: #fff;
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.btn-gradient-mint {
  background: var(--mint-gradient);
  color: #fff;
  box-shadow: var(--shadow-md);
  border: none;
}
.btn-gradient-mint:hover, .btn-gradient-mint:focus {
  background: var(--mint-gradient);
  color: #fff;
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* =========================================================================
   КАРТОЧКИ И МЕТРИКИ
   ========================================================================= */

.card {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  background: white;
  transition: var(--transition);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-body {
  padding: 24px;
}

/* Карточки метрик */
.metric-card {
  border: none;
  border-radius: var(--border-radius);
  background: white;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  overflow: hidden;
  position: relative;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary-gradient);
}

.metric-card.success::before {
  background: var(--success-gradient);
}

.metric-card.warning::before {
  background: var(--warning-gradient);
}

.metric-card.danger::before {
  background: var(--danger-gradient);
}

.metric-card.info::before {
  background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
}

.metric-card.tian::before {
  background: var(--gradient-violet-pink);
}

.metric-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.metric-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1;
  margin-bottom: 8px;
}

.metric-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.metric-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
}

.metric-trend.positive {
  color: var(--success-color);
  background: rgba(32, 201, 151, 0.1);
}

.metric-trend.negative {
  color: var(--danger-color);
  background: rgba(255, 107, 107, 0.1);
}

/* =========================================================================
   НАВИГАЦИЯ
   ========================================================================= */

.main-navbar {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--primary-color) !important;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  margin: 0;
}

.navbar-brand:hover {
  color: var(--primary-color) !important;
  text-decoration: none;
}

.navbar-brand i {
  font-size: 1.75rem;
}

/* Центральная навигация */
.main-nav-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: 8px;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
}

.nav-tab:hover {
  color: var(--primary-color);
  background: rgba(102, 126, 234, 0.1);
  text-decoration: none;
}

.nav-tab.active {
  color: var(--primary-color);
  background: rgba(102, 126, 234, 0.15);
  font-weight: 600;
}

.nav-tab i {
  font-size: 1.1rem;
}

/* Правая часть навигации */
.navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-dropdown {
  position: relative;
}

.user-dropdown .dropdown-toggle {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dark);
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  transition: var(--transition);
}

.user-dropdown .dropdown-toggle:hover {
  background: rgba(102, 126, 234, 0.1);
  color: var(--primary-color);
}



.dropdown-menu {
  border: none;
  box-shadow: var(--shadow-lg);
  border-radius: var(--border-radius);
  padding: 8px;
  margin-top: 8px;
  min-width: 200px;
}

.dropdown-item {
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 500;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropdown-item:hover {
  background: rgba(102, 126, 234, 0.1);
  color: var(--primary-color);
}

/* Dropdown для табов навигации */
.nav-tab.dropdown {
  position: relative;
}

.nav-tab.dropdown .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  display: none;
  min-width: 250px;
}

.nav-tab.dropdown:hover .dropdown-menu,
.nav-tab.dropdown.show .dropdown-menu {
  display: block;
}

.nav-tab.dropdown .dropdown-menu .dropdown-item {
  font-size: 0.9rem;
  white-space: nowrap;
}

/* Мобильная навигация */
@media (max-width: 768px) {
  /* Скрываем десктопную навигацию */
  .main-navbar {
    display: none !important;
  }

  /* Показываем мобильную шапку */
  .mobile-header {
    display: flex !important;
  }

  /* Показываем бургер меню */
  .mobile-burger {
    display: flex !important;
  }
}

@media (max-width: 576px) {
  .mobile-header {
    padding: 12px 15px;
  }

  .mobile-header .mobile-logo {
    font-size: 1.1rem;
  }


}



/* =========================================================================
   АЛЕРТЫ
   ========================================================================= */

.alert {
  border: none;
  border-radius: var(--border-radius);
  padding: 16px 20px;
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.alert-success {
  background: rgba(32, 201, 151, 0.1);
  color: var(--success-color);
  border-left: 4px solid var(--success-color);
}

.alert-warning {
  background: rgba(253, 126, 20, 0.1);
  color: var(--warning-color);
  border-left: 4px solid var(--warning-color);
}

.alert-danger {
  background: rgba(255, 107, 107, 0.1);
  color: var(--danger-color);
  border-left: 4px solid var(--danger-color);
}

.alert-info {
  background: rgba(23, 162, 184, 0.1);
  color: var(--info-color);
  border-left: 4px solid var(--info-color);
}

/* =========================================================================
   ТАБЛИЦЫ
   ========================================================================= */

.table {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table thead th {
  background: var(--bg-light);
  border: none;
  padding: 16px;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.table tbody td {
  padding: 16px;
  border-color: var(--border-color);
  vertical-align: middle;
  text-align: left;
}

.table tbody tr:hover {
  background: rgba(102, 126, 234, 0.02);
}

/* =========================================================================
   БЕЙДЖИ И СТАТУСЫ
   ========================================================================= */

.badge {
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

.badge.bg-success {
  background: var(--success-gradient) !important;
}

.badge.bg-warning {
  background: var(--warning-gradient) !important;
}

.badge.bg-danger {
  background: var(--danger-gradient) !important;
}

.badge.bg-primary {
  background: var(--primary-gradient) !important;
}

/* =========================================================================
   ГРАФИКИ И ДИАГРАММЫ
   ========================================================================= */

.chart-container {
  width: 100%;
  min-height: 400px;
  padding: 20px;
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.chart-container::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  background: var(--primary-gradient);
  border-radius: var(--border-radius);
  z-index: -1;
  opacity: 0.02;
}

canvas {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* =========================================================================
   КНОПКИ ДИАПАЗОНОВ
   ========================================================================= */

.range-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 24px;
}

.range-btns .btn {
  border-radius: 12px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 48px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.range-btns .btn i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px; /* iOS-style mini radius */
  background: var(--primary-gradient);
  color: white;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.range-btns .btn.active i {
  background: var(--success-gradient);
  box-shadow: 0 2px 6px rgba(79, 172, 254, 0.3);
}

.range-btns .btn:hover i {
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

#calendarRangeGroup {
  display: none;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}

#calendarRangeGroup .form-control {
  width: 140px;
}

/* =========================================================================
   ПОДВАЛ
   ========================================================================= */

.footer {
  background: white;
  border-top: 1px solid var(--border-color);
  margin-top: 40px;
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* =========================================================================
   УТИЛИТЫ И ХЕЛПЕРЫ
   ========================================================================= */

.text-gradient-primary {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.text-gradient-danger {
  background: var(--danger-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.text-gradient-warning {
  background: var(--warning-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.text-gradient-success {
  background: var(--success-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.text-gradient-mint {
  background: var(--mint-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.text-gradient-orange {
  background: var(--orange-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.text-gradient-purple {
  background: var(--purple-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.text-gradient-teal {
  background: var(--teal-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.mint-gradient-bg {
  background: var(--mint-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(67, 233, 123, 0.15);
}

/* Header Icon with iOS-style radius */
.header-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px; /* iOS-style rounded corners */
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
}

.header-icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.header-icon i {
  font-size: 28px;
  color: white;
  font-weight: 600;
}

/* Chart Header Icon with iOS-style radius */
.chart-header-icon {
  width: 48px;
  height: 48px;
  border-radius: 11px; /* iOS-style rounded corners */
  background: var(--success-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(79, 172, 254, 0.2);
  transition: all 0.3s ease;
}

.chart-header-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 172, 254, 0.3);
}

.chart-header-icon i {
  font-size: 22px;
  color: white;
  font-weight: 600;
}

/* Menu Profit Icon with iOS-style radius */
.menu-profit-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px; /* iOS-style rounded corners */
  background: var(--success-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(79, 172, 254, 0.2);
  transition: all 0.3s ease;
}

.menu-profit-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 172, 254, 0.3);
}

.menu-profit-icon i {
  font-size: 18px;
  color: white;
  font-weight: 600;
}

/* Domains Header Icon with iOS-style radius */
.domains-header-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px; /* iOS-style rounded corners */
  background: var(--info-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(13, 202, 240, 0.3);
  transition: all 0.3s ease;
}

.domains-header-icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13, 202, 240, 0.4);
}

.domains-header-icon i {
  font-size: 28px;
  color: white;
  font-weight: 600;
}

/* Test Header Icon with iOS-style radius */
.test-header-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px; /* iOS-style rounded corners */
  background: var(--orange-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(255, 154, 86, 0.3);
  transition: all 0.3s ease;
}

.test-header-icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 154, 86, 0.4);
}

.test-header-icon i {
  font-size: 28px;
  color: white;
  font-weight: 600;
}

/* Error Page Icons with iOS-style radius */
.error-icon-403 {
  width: 100px;
  height: 100px;
  border-radius: 22px; /* iOS-style rounded corners */
  background: var(--danger-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(255, 107, 107, 0.3);
  transition: all 0.3s ease;
}

.error-icon-404 {
  width: 100px;
  height: 100px;
  border-radius: 22px; /* iOS-style rounded corners */
  background: var(--warning-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(250, 112, 154, 0.3);
  transition: all 0.3s ease;
}

.error-icon-403:hover,
.error-icon-404:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(255, 107, 107, 0.4);
}

.error-icon-403 i,
.error-icon-404 i {
  font-size: 40px;
  color: white;
  font-weight: 600;
}

.error-info-card {
  background: rgba(102, 126, 234, 0.05);
  border: 1px solid rgba(102, 126, 234, 0.1);
  border-radius: 16px;
  padding: 20px;
  transition: all 0.3s ease;
}

.error-info-card:hover {
  background: rgba(102, 126, 234, 0.08);
  border-color: rgba(102, 126, 234, 0.15);
}

.error-info-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px; /* iOS-style rounded corners */
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(102, 126, 234, 0.2);
  transition: all 0.3s ease;
}

.error-info-icon i {
  font-size: 18px;
  color: white;
  font-weight: 600;
}



/* iOS-style Logout Button */
.btn-logout-ios {
  border: 2px solid #dc3545;
  color: #dc3545;
  background: transparent;
  border-radius: 12px; /* iOS-style rounded corners */
  padding: 8px 16px;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-logout-ios:hover {
  border-color: #dc3545;
  color: #dc3545;
  background: rgba(220, 53, 69, 0.05);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

.btn-logout-ios:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
}

.btn-logout-ios:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(220, 53, 69, 0.2);
}

.bg-gradient-primary {
  background: var(--primary-gradient) !important;
}

.bg-gradient-success {
  background: var(--success-gradient) !important;
}

.bg-gradient-warning {
  background: var(--warning-gradient) !important;
}

.bg-gradient-danger {
  background: var(--danger-gradient) !important;
}

.shadow-custom {
  box-shadow: var(--shadow-md);
}

.border-radius-custom {
  border-radius: var(--border-radius);
}

/* =========================================================================
   АНИМАЦИИ
   ========================================================================= */

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.slide-up {
  animation: slideUp 0.5s ease-out;
}

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

/* =========================================================================
   ОТЗЫВЧИВОСТЬ
   ========================================================================= */

@media (max-width: 768px) {
  .auth-card {
    padding: 30px 24px;
    margin: 16px;
  }
  
  .metric-value {
    font-size: 2rem;
  }
  
  .range-btns .btn span {
    display: none;
  }
  
  .chart-container {
    min-height: 300px;
    padding: 16px;
  }
}

@media (max-width: 576px) {
  .navbar-brand {
    font-size: 1.25rem;
  }
  
  .metric-card {
    margin-bottom: 16px;
  }
  
  .card-body {
    padding: 20px;
  }
  

  
  .navbar-right {
    gap: 4px;
  }
  
  .navbar-right .d-flex {
    gap: 2px;
  }
  
  .menu-profit-icon {
    width: 28px;
    height: 28px;
  }
  
  .menu-profit-icon i {
    font-size: 0.75rem;
  }
}

/* =========================================================================
   СПЕЦИФИЧНЫЕ СТИЛИ ДЛЯ КОМПОНЕНТОВ
   ========================================================================= */

/* Старые стили автокомплита удалены - используем новые в конце файла */

/* Цветовые классы для иконок */
.text-orange { color: #fd7e14 !important; }
.text-teal { color: #007bff !important; }
.text-purple { color: #6f42c1 !important; }
.text-mint { color: #00d4aa !important; }

/* =========================================================================
   ЗАГРУЗЧИКИ
   ========================================================================= */

.spinner-custom {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(102, 126, 234, 0.1);
  border-left: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  color: var(--text-muted);
  font-style: italic;
}

/* =========================================================================
   ФИНАЛЬНЫЕ НАСТРОЙКИ
   ========================================================================= */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Убираем ограничения ширины для полноэкранного дизайна */

/* Исправление Bootstrap конфликтов */
.btn:focus,
.btn:active {
  box-shadow: none !important;
  outline: none !important;
}

.form-control:focus {
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

/* Плавные переходы для всех интерактивных элементов */
a, button, .btn, .card, .nav-link, .dropdown-item, .form-control, .alert {
  transition: var(--transition);
}

/* Иконки - делаем квадратными и одинаковыми */
.nav-tab i,
.btn i,
.card i,
.metric-card i,
.alert i,
.dropdown-item i,
.auth-card i,
.form-label i,
.badge i {
  width: 1.2em;
  height: 1.2em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: inherit;
  line-height: 1;
  vertical-align: middle;
}

/* Особые размеры для больших иконок */
.fs-1 i, .fs-2 i, .fs-3 i, .fs-4 i, .fs-5 i {
  width: 1em;
  height: 1em;
}

/* Иконки в больших заголовках и карточках метрик */
.metric-card .bg-gradient-primary i,
.metric-card .bg-gradient-success i,
.metric-card .bg-gradient-warning i,
.metric-card .bg-gradient-danger i,
.metric-card .bg-gradient-info i,
.card .bg-gradient-primary i,
.card .bg-gradient-success i,
.card .bg-gradient-warning i,
.card .bg-gradient-danger i,
.card .bg-gradient-info i {
  width: 1.5em;
  height: 1.5em;
  font-size: 1.25rem;
}

/* =========================================================================
   АВТОКОМПЛИТ - ИСПРАВЛЯЕМ БАГИ
   ========================================================================= */

.autocomplete-items {
  position: absolute;
  top: auto;
  left: 0;
  right: auto;
  background: white;
  border: 2px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  box-shadow: var(--shadow-lg);
  max-height: 230px;
  overflow-y: auto;
  z-index: 1055;
  display: none;
  width: 100%;
  max-width: 100%;
  min-width: 300px;
}

@media (max-width: 576px) {
  .autocomplete-items {
    max-height: 40vh;
  }
}

.autocomplete-item {
  padding: 12px 16px;
  cursor: pointer;
  background-color: white;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
  font-weight: 500;
  color: var(--text-dark);
  display: block;
  text-decoration: none;
  white-space: normal;
  overflow: hidden;
  word-wrap: break-word;
  line-height: 1.3;
}

.autocomplete-item:hover {
  background: rgba(102, 126, 234, 0.1);
  color: var(--primary-color);
  border-bottom-color: transparent;
}

.autocomplete-item:last-child {
  border-bottom: none;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* Исправляем позиционирование контейнера для автокомплита */
.position-relative {
  position: relative;
}

/* Улучшения для форм с автокомплитом */
.autocomplete-container {
  position: relative;
}

/* Убираем focus стили с input когда открыт автокомплит */
.autocomplete-container .form-control:focus {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* Когда автокомплит активен, input должен выглядеть связанным */
.autocomplete-container .form-control:focus + .autocomplete-items[style*="block"] ~ .form-control {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* Улучшения для позиционирования автокомплита */
.position-relative {
  position: relative;
  overflow: visible;
}

/* Предотвращение обрезания в Bootstrap col */
.col-md-6 {
  overflow: visible;
}

/* Улучшения для форм на странице доменов */
.domains-form-container {
  overflow: visible;
  z-index: 1;
}

.domains-form-container .row {
  overflow: visible;
}

.domains-form-container .col-md-6 {
  overflow: visible;
}

/* Адаптивное позиционирование автокомплита */
.autocomplete-items.align-right {
  left: auto !important;
  right: 0 !important;
  transform: none !important;
}

.autocomplete-items.align-left {
  left: 0 !important;
  right: auto !important;
  transform: none !important;
}

/* Улучшения для позиционирования autocomplete относительно form-control */
.form-control {
  position: relative;
  z-index: 1;
}

.form-control:focus {
  z-index: 2;
}

/* Улучшения для автокомплита в формах */
.autocomplete-items {
  min-width: 100%;
  box-sizing: border-box;
}

/* Toast уведомления */
.toast-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  opacity: 1 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  animation: slideInRight 0.3s ease-out;
  min-width: 300px;
  max-width: 400px;
  padding: 1rem 1.25rem;
  border: 1px solid;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.toast-notification.success {
  background-color: #d4edda !important;
  border-color: #c3e6cb !important;
  color: #155724 !important;
}

.toast-notification.error {
  background-color: #f8d7da !important;
  border-color: #f5c6cb !important;
  color: #721c24 !important;
}

/* =========================================================================
   АДМИН-ПАНЕЛЬ
   ========================================================================= */

/* Таблица пользователей */
.admin-users-table th,
.admin-users-table td {
  vertical-align: middle !important;
}

.admin-users-table .input-group-sm .form-control {
  min-width: 70px;
  max-width: 100px;
}

.admin-users-table .input-group-sm {
  flex-wrap: nowrap;
}

.admin-users-table .salary-input {
  min-width: 70px;
  max-width: 100px;
}

.admin-users-table .api-input {
  max-width: 380px;
}

.admin-users-table .buyer-input {
  width: 60px;
}

.admin-users-table .test-click-group {
  width: 250px;
}

/* Строки байеров */
.buyer-row {
  background-color: #f8f9fa !important;
  border-left: 4px solid var(--primary-color);
}

.buyer-row td {
  padding: 1rem !important;
}

/* Бонусная сетка */
.bonus-grid-section {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.bonus-grid-section:hover {
  box-shadow: var(--shadow-md);
}

#bonusGridTable .bonus-cell {
  background-color: #f0f9ff;
  font-weight: 600;
  color: var(--primary-color);
}

/* Домены секция */
.domains-section {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.domains-section:hover {
  box-shadow: var(--shadow-md);
}

/* OK индикаторы */
.ok-mark, .ok-letter, .ok-group {
  color: var(--success-color) !important;
  font-weight: 600;
}

/* Улучшенные кнопки в таблице */
.admin-users-table .btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

.admin-users-table .btn-outline-secondary:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* Персональная статистика для админ-панели */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* Десктоп: одна строка из 4 блоков */
@media (min-width: 992px) {
  .admin-stats {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
  }
}

/* Планшеты: 2 колонки */
@media (min-width: 768px) and (max-width: 991px) {
  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
  }
}

/* Адаптивность для admin-stats */
@media (max-width: 768px) {
  .admin-stats {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .admin-stat-card {
    padding: 1rem;
  }
  
  .admin-stat-value {
    font-size: 1.5rem;
  }
}

@media (max-width: 576px) {
  .admin-stats {
    gap: 0.75rem;
  }
  
  .admin-stat-card {
    padding: 0.75rem;
  }
  
  .admin-stat-value {
    font-size: 1.25rem;
  }
  
  .admin-stat-label {
    font-size: 0.8rem;
  }
}

.admin-stat-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  margin-bottom: 0; /* Убираем margin-bottom чтобы не дублировать gap */
}

.admin-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
}

.admin-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.admin-stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  color: white;
}

.admin-stat-card.primary .stat-icon {
  background: var(--primary-gradient);
}

.admin-stat-card.success .stat-icon {
  background: var(--success-gradient);
}

.admin-stat-card.warning .stat-icon {
  background: var(--warning-gradient);
}

.admin-stat-card.danger .stat-icon {
  background: var(--danger-gradient);
}

.admin-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
}

.admin-stat-label {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Адаптивность для админ-панели */
@media (max-width: 768px) {
  .admin-users-table .api-input {
    max-width: 200px;
  }
  
  .admin-users-table .test-click-group {
    width: 150px;
  }
  
  .buyer-row .row {
    flex-direction: column;
  }
  
  .buyer-row .col-auto {
    margin-bottom: 0.5rem;
  }
  
  /* Дополнительные стили для admin страницы */
  .card {
    margin-bottom: 1.5rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .details-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .details-icon {
    width: 40px;
    height: 40px;
  }
  
  .details-icon i {
    font-size: 1rem;
  }
}

@media (max-width: 576px) {
  .admin-users-table .api-input {
    max-width: 150px;
  }
  
  .admin-users-table .test-click-group {
    width: 120px;
  }
  
  .buyer-row .row {
    gap: 0.5rem;
  }
  
  .buyer-row .col-md-4,
  .buyer-row .col-md-3,
  .buyer-row .col-md-5 {
    width: 100%;
    margin-bottom: 0.5rem;
  }
  
  .card-body {
    padding: 0.75rem;
  }
  
  .details-header {
    gap: 0.25rem;
  }
  
  .details-icon {
    width: 35px;
    height: 35px;
  }
  
  .details-icon i {
    font-size: 0.875rem;
  }
}

/* Стили для правильных отступов между блоками на admin странице */
main .card {
  margin-bottom: 2rem;
}

main .card:last-child {
  margin-bottom: 0;
}

/* Десктоп: увеличенные отступы */
@media (min-width: 992px) {
  main .card {
    margin-bottom: 3rem;
  }
  
  main .admin-stats {
    margin-bottom: 3rem;
  }
}

/* Планшеты: средние отступы */
@media (min-width: 768px) and (max-width: 991px) {
  main .card {
    margin-bottom: 2.5rem;
  }
  
  main .admin-stats {
    margin-bottom: 2.5rem;
  }
}

/* =========================================================================
   СТРАНИЦА rCPC
   ========================================================================= */



.rcpc-filter-card {
  background: white;
  border-radius: 16px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(102, 126, 234, 0.1);
}

.rcpc-filter-card .filter-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
}

.rcpc-filter-card .filter-icon i {
  font-size: 1.25rem;
  color: white;
}

.rcpc-excluded-card {
  background: white;
  border-radius: 16px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(220, 53, 69, 0.1);
}

.rcpc-excluded-card .header-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
}

.rcpc-excluded-card .header-icon i {
  font-size: 1.25rem;
  color: white;
}

.rcpc-excluded-card .form-control {
  min-height: 48px;
  border-radius: 12px;
  font-size: 1rem;
}
.rcpc-excluded-card .btn {
  min-height: 48px !important;
  height: 100% !important;
  border-radius: 12px !important;
  font-size: 1rem !important;
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
  box-shadow: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.rcpc-table-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(102, 126, 234, 0.1);
  margin-bottom: 30px;
}

.rcpc-table-card .card-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 20px 30px;
  border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.rcpc-table-card .card-header h5 {
  margin: 0;
  font-weight: 600;
  color: var(--text-dark);
  display: flex;
  align-items: center;
}

.rcpc-table-card .card-header .header-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
}

.rcpc-table-card .card-header .header-icon i {
  font-size: 1rem;
  color: white;
}

.rcpc-table {
  margin: 0;
}

.rcpc-table thead th {
  background: linear-gradient(135deg, #343a40 0%, #495057 100%);
  color: white;
  font-weight: 600;
  padding: 15px;
  text-align: center;
  border: none;
  font-size: 0.9rem;
}

.rcpc-table tbody td {
  padding: 15px;
  vertical-align: middle;
  border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.rcpc-table tbody tr:hover {
  background: rgba(102, 126, 234, 0.04);
}

.rcpc-table .country-flag {
  width: 24px;
  height: 18px;
  margin-right: 10px;
  border-radius: 3px;
  object-fit: cover;
}

.rcpc-table .cpc-value {
  font-weight: 600;
  color: var(--success-color);
}

.rcpc-table .no-data {
  color: var(--text-muted);
  font-style: italic;
}

.rcpc-table .copy-cpc-btn {
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.8rem;
  transition: var(--transition);
}

.rcpc-table .copy-cpc-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.rcpc-table .copy-cpc-btn-soft,
.copy-cpc-btn-soft {
  background: #f4f8ff !important;
  color: #3b5b7a !important;
  border: 1px solid #e0e8f3 !important;
  border-radius: 12px !important;
  padding: 8px 10px !important;
  font-size: 1.2rem !important;
  transition: box-shadow 0.18s, background 0.18s, color 0.18s;
  box-shadow: none !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none !important;
  min-width: 44px;
  min-height: 44px;
}
.rcpc-table .copy-cpc-btn-soft:hover,
.copy-cpc-btn-soft:hover {
  background: #e6f0fa !important;
  color: #1a3a5d !important;
  border-color: #b6d4fa !important;
  box-shadow: 0 2px 12px rgba(102, 126, 234, 0.13) !important;
}

.rcpc-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.rcpc-stat-card {
  background: white;
  border-radius: 16px;
  padding: 30px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(102, 126, 234, 0.1);
  transition: var(--transition);
}

.rcpc-stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.rcpc-stat-card .card-header {
  background: none;
  padding: 0;
  border: none;
  margin-bottom: 20px;
}

.rcpc-stat-card .card-header h6 {
  margin: 0;
  font-weight: 600;
  color: var(--text-dark);
  display: flex;
  align-items: center;
}

.rcpc-stat-card .card-header .header-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
}

.rcpc-stat-card .card-header .header-icon i {
  font-size: 1rem;
  color: white;
}

.rcpc-stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.rcpc-stat-item:last-child {
  border-bottom: none;
}

.rcpc-stat-item .label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.rcpc-stat-item .value {
  font-weight: 600;
  color: var(--text-dark);
}

.rcpc-top-country {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.rcpc-top-country:last-child {
  border-bottom: none;
}

.rcpc-top-country .country-info {
  display: flex;
  align-items: center;
}

.rcpc-top-country .rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dc3545 0%, #fd5e53 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 2px 12px rgba(220, 53, 69, 0.18);
  margin-right: 14px;
  transition: box-shadow 0.18s, background 0.18s;
}

.rcpc-top-country .cpc-value {
  font-weight: 600;
  color: var(--success-color);
}

.rcpc-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  max-width: 400px;
}

.rcpc-notification .alert {
  border-radius: 12px;
  padding: 15px 20px;
  margin: 0;
  box-shadow: var(--shadow-lg);
  border: none;
}

.rcpc-notification .alert-success {
  background: var(--success-gradient);
  color: white;
}

.rcpc-notification .alert-success .btn-close {
  filter: invert(1);
}

.rcpc-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.rcpc-empty-state i {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.5;
}

.rcpc-empty-state p {
  font-size: 1.1rem;
  margin: 0;
}

@media (max-width: 768px) {
  .rcpc-filter-card,
  .rcpc-excluded-card {
    padding: 20px;
  }
  
  .rcpc-stats-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .rcpc-stat-card {
    padding: 20px;
  }
  
  .rcpc-table thead th {
    font-size: 0.8rem;
    padding: 10px 8px;
  }
  
  .rcpc-table tbody td {
    padding: 10px 8px;
  }
  
  .rcpc-notification {
    left: 20px;
    right: 20px;
    max-width: none;
  }
}

.reports-header-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--orange-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(255, 154, 86, 0.3);
  transition: all 0.3s ease;
}

.reports-header-icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 154, 86, 0.4);
}

.reports-header-icon i {
  font-size: 28px;
  color: #fff;
  font-weight: 600;
}

/* Report Icon Styles */
.report-icon {
  width: 60px;
  height: 60px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transition: all 0.3s ease;
}

.report-icon i {
  font-size: 32px;
  font-weight: 600;
}

.report-icon-medium {
  width: 50px;
  height: 50px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transition: all 0.3s ease;
}

.report-icon-medium i {
  font-size: 32px;
  font-weight: 600;
}

.search-btn-danger {
  border: 2px solid #ff6b6b;
  background: transparent;
  color: #ff6b6b;
}
.search-btn-danger:hover, .search-btn-danger:focus {
  background: #ff6b6b;
  color: #fff;
  border-color: #ff6b6b;
}

.search-btn-success {
  border: 2px solid #20c997;
  background: transparent;
  color: #20c997;
}
.search-btn-success:hover, .search-btn-success:focus {
  background: #20c997;
  color: #fff;
  border-color: #20c997;
}

.search-btn-primary {
  border: 2px solid #667eea;
  background: transparent;
  color: #667eea;
}
.search-btn-primary:hover, .search-btn-primary:focus {
  background: #667eea;
  color: #fff;
  border-color: #667eea;
}

.search-btn-info {
  border: 2px solid #17a2b8;
  background: transparent;
  color: #17a2b8;
}
.search-btn-info:hover, .search-btn-info:focus {
  background: #17a2b8;
  color: #fff;
  border-color: #17a2b8;
}

.search-btn-warning {
  border: 2px solid #fd7e14;
  background: transparent;
  color: #fd7e14;
}
.search-btn-warning:hover, .search-btn-warning:focus {
  background: #fd7e14;
  color: #fff;
  border-color: #fd7e14;
}

.search-btn-mint {
  border: 2px solid #00d4aa;
  background: transparent;
  color: #00d4aa;
}
.search-btn-mint:hover, .search-btn-mint:focus {
  background: #00d4aa;
  color: #fff;
  border-color: #00d4aa;
}

.search-btn-purple {
  border: 2px solid #6f42c1;
  background: transparent;
  color: #6f42c1;
}
.search-btn-purple:hover, .search-btn-purple:focus {
  background: #6f42c1;
  color: #fff;
  border-color: #6f42c1;
}

.search-btn-teal {
  border: 2px solid #007bff;
  background: transparent;
  color: #007bff;
}
.search-btn-teal:hover, .search-btn-teal:focus {
  background: #007bff;
  color: #fff;
  border-color: #007bff;
}

.search-btn-danger, .search-btn-success, .search-btn-primary, .search-btn-info, .search-btn-warning, .search-btn-mint, .search-btn-purple, .search-btn-teal {
  border-radius: 12px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

/* =========================================================================
   ОТЧЕТЫ - НОВЫЙ ДИЗАЙН
   ========================================================================= */

/* Заголовок отчета с иконкой слева */
.report-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
}

.report-header-icon {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.report-header-icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.report-header-icon i {
  font-size: 28px;
  color: #fff;
  font-weight: 600;
}

.report-header-content h1 {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 700;
}

.report-header-content p {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* Карточки пользователя с белой полоской */
.user-stats-card {
  position: relative;
  overflow: hidden;
}

.user-stats-card::before {
  content: '';
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 10px;
  width: 6px;
  height: 80%;
  background: rgba(255, 255, 255, 0.8);
  z-index: 1;
}

/* Детализация с иконкой */
.details-header {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.details-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--info-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
  transition: all 0.3s ease;
}

.details-icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(23, 162, 184, 0.4);
}

.details-icon i {
  font-size: 22px;
  color: #fff;
  font-weight: 600;
}

/* Таблица с правильными размерами столбцов */

.table td, .table th {
  padding: 0.75rem !important;
  vertical-align: middle;
  white-space: nowrap;
  border: 1px solid #dee2e6;
}

/* Столбец кампании */
.reports-table .col-campaign {
  width: 200px;
  max-width: 200px;
}

.reports-table .col-campaign .cell-content {
  max-width: 180px;
  overflow-x: auto;
  white-space: nowrap;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
}

.reports-table .col-campaign .cell-content::-webkit-scrollbar {
  height: 4px;
}

.reports-table .col-campaign .cell-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 2px;
}

.reports-table .col-campaign .cell-content::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 2px;
}

.reports-table .col-campaign .cell-content::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Столбец страны */
.reports-table .col-country {
  width: 150px;
  max-width: 150px;
}

.reports-table .col-country .cell-content {
  max-width: 130px;
  overflow-x: auto;
  white-space: nowrap;
  font-size: 0.9rem;
}

.reports-table .col-country .cell-content::-webkit-scrollbar {
  height: 4px;
}

.reports-table .col-country .cell-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 2px;
}

.reports-table .col-country .cell-content::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 2px;
}

.reports-table .col-country .cell-content::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Числовые столбцы одинакового размера */
.reports-table .col-numeric {
  width: 90px;
  max-width: 90px;
  text-align: center;
}

/* Столбцы для расхода/дохода (чуть шире) */
.reports-table .col-money {
  width: 110px;
  max-width: 110px;
  text-align: center;
}

/* Заголовки столбцов - нормальный регистр */
.reports-table thead th {
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: none;
  background: #ff9a56 !important;
  color: white !important;
  border-color: rgba(255,255,255,0.2) !important;
}

/* Иконки в заголовках столбцов */
.reports-table thead th i {
  font-size: 0.8rem;
  margin-right: 0.5rem;
}

/* Мобильная адаптивность */
@media (max-width: 768px) {
  .report-header {
    flex-direction: column;
    text-align: center;
  }
  
  .report-header-icon {
    margin-right: 0;
    margin-bottom: 1rem;
  }
  
  .report-header-content h1 {
    font-size: 2rem;
  }
  
  .reports-table .col-campaign,
  .reports-table .col-country {
    width: 120px;
    max-width: 120px;
  }
  
  .reports-table .col-numeric {
    width: 70px;
    max-width: 70px;
  }
  
  .reports-table .col-money {
    width: 90px;
    max-width: 90px;
  }
}

/* Мягкие фоны для кнопок действий */
.bg-soft-info {
  background: rgba(13, 202, 240, 0.12) !important;
  color: #17a2b8 !important;
}
.bg-soft-warning {
  background: rgba(253, 193, 7, 0.14) !important;
  color: #fd7e14 !important;
}

.edit-btn-soft {
  background: #fff8ed !important;
  color: #fd7e14 !important;
  border: 1px solid #ffe5c2 !important;
  border-radius: 16px !important;
  padding: 8px 10px !important;
  font-size: 1.2rem !important;
  transition: box-shadow 0.18s, background 0.18s, color 0.18s;
  box-shadow: none !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none !important;
  min-width: 44px;
  min-height: 44px;
}
.edit-btn-soft:hover {
  background: #fff1db !important;
  color: #fd7e14 !important;
  border-color: #ffd7a6 !important;
  box-shadow: 0 2px 12px rgba(253, 126, 20, 0.10) !important;
}

.excluded-tags-input {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 48px;
  border: 1px solid #e0e8f3;
  border-radius: 12px;
  padding: 6px 10px;
  background: #fff;
  align-items: center;
  cursor: text;
}
.excluded-tags-input input {
  border: none;
  outline: none;
  min-width: 60px;
  font-size: 1rem;
  background: transparent;
  padding: 4px 0;
}
.excluded-tag {
  display: flex;
  align-items: center;
  background: #f4f8ff;
  color: #3b5b7a;
  border-radius: 8px;
  padding: 4px 10px 4px 8px;
  font-size: 1rem;
  font-weight: 500;
  box-shadow: 0 1px 4px rgba(102,126,234,0.06);
  margin-right: 2px;
  margin-bottom: 2px;
  transition: background 0.15s;
}
.excluded-tag-remove {
  margin-left: 6px;
  color: #b6b6b6;
  cursor: pointer;
  font-size: 1.1em;
  transition: color 0.15s;
}
.excluded-tag-remove:hover {
  color: #e74c3c;
}

.crm-toast-notification {
  position: fixed;
  right: 32px;
  top: 32px;
  z-index: 9999;
  min-width: 320px;
  max-width: 90vw;
  background: #fff;
  color: #1a3a5d;
  border-radius: 16px;
  box-shadow: 0 6px 32px rgba(60, 72, 88, 0.18);
  padding: 18px 28px 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.08rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-40px);
  transition: opacity 0.25s, transform 0.25s;
}
.crm-toast-notification.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.crm-toast-notification .bi {
  font-size: 1.5em;
  margin-right: 8px;
}
.crm-toast-success {
  border-left: 6px solid #4fd18b;
}
.crm-toast-error {
  border-left: 6px solid #e74c3c;
}

.crm-toast-error {
  border-left: 6px solid #e74c3c;
}

.card.bg-gradient-info,
.bg-gradient-info {
  background: linear-gradient(135deg, #36d1c4 0%, #5b86e5 100%) !important;
  color: #fff !important;
}

/* =========================================================================
   УНИФИЦИРОВАННЫЕ СТИЛИ ИКОНОК
   ========================================================================= */

/* Унифицированные размеры иконок для всех страниц */
.header-icon i,
.chart-header-icon i,
.details-icon i,
.reports-header-icon i,
.report-header-icon i,
.domains-header-icon i,
.test-header-icon i {
  font-size: 24px !important;
}

/* Исключения для специальных случаев */
.header-icon i.fs-1,
.chart-header-icon i.fs-1,
.details-icon i.fs-1 {
  font-size: 2.5rem !important;
}

/* Унификация стилей для всех иконок в заголовках */
.header-icon,
.chart-header-icon,
.details-icon,
.reports-header-icon,
.report-header-icon,
.domains-header-icon,
.test-header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

/* Унифицированные hover эффекты */
.header-icon:hover,
.chart-header-icon:hover,
.details-icon:hover,
.reports-header-icon:hover,
.report-header-icon:hover,
.domains-header-icon:hover,
.test-header-icon:hover {
  transform: translateY(-2px);
}

/* Мобильная адаптация для иконок */
@media (max-width: 768px) {
  .header-icon,
  .domains-header-icon,
  .test-header-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
  }
  
  .header-icon i,
  .domains-header-icon i,
  .test-header-icon i {
    font-size: 20px !important;
  }
  
  .chart-header-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }
  
  .chart-header-icon i {
    font-size: 18px !important;
  }
  
  .details-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }
  
  .details-icon i {
    font-size: 18px !important;
  }
  
  /* Фикс: иконка всегда слева от текста в заголовках на мобиле */
  .text-center .d-flex.align-items-center.justify-content-center {
    justify-content: center !important;
    text-align: center;
  }
}

@media (max-width: 576px) {
  .header-icon,
  .domains-header-icon,
  .test-header-icon {
    width: 40px;
    height: 40px;
  }
  
  .header-icon i,
  .domains-header-icon i,
  .test-header-icon i {
    font-size: 18px !important;
  }
}

/* =========================================================================
   УНИФИЦИРОВАННЫЕ СТИЛИ ИКОНОК
   ========================================================================= */

/* Унифицированные размеры иконок для всех страниц */
.header-icon i,
.chart-header-icon i,
.details-icon i,
.reports-header-icon i,
.report-header-icon i,
.domains-header-icon i,
.test-header-icon i {
  font-size: 24px !important;
}

/* Исключения для специальных случаев */
.header-icon i.fs-1,
.chart-header-icon i.fs-1,
.details-icon i.fs-1 {
  font-size: 2.5rem !important;
}

/* Унификация стилей для всех иконок в заголовках */
.header-icon,
.chart-header-icon,
.details-icon,
.reports-header-icon,
.report-header-icon,
.domains-header-icon,
.test-header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

/* Унифицированные hover эффекты */
.header-icon:hover,
.chart-header-icon:hover,
.details-icon:hover,
.reports-header-icon:hover,
.report-header-icon:hover,
.domains-header-icon:hover,
.test-header-icon:hover {
  transform: translateY(-2px);
}

/* Мобильная адаптация для иконок */
@media (max-width: 768px) {
  .header-icon,
  .domains-header-icon,
  .test-header-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
  }
  
  .header-icon i,
  .domains-header-icon i,
  .test-header-icon i {
    font-size: 20px !important;
  }
  
  .chart-header-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }
  
  .chart-header-icon i {
    font-size: 18px !important;
  }
  
  .details-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }
  
  .details-icon i {
    font-size: 18px !important;
  }
  
  /* Фикс: иконка всегда слева от текста в заголовках на мобиле */
  .text-center .d-flex.align-items-center.justify-content-center {
    justify-content: center !important;
    text-align: center;
  }
}

@media (max-width: 576px) {
  .header-icon,
  .domains-header-icon,
  .test-header-icon {
    width: 40px;
    height: 40px;
  }
  
  .header-icon i,
  .domains-header-icon i,
  .test-header-icon i {
    font-size: 18px !important;
  }
}

/* Адаптивность для формы дат в быстрых отчетах (reports/index.php) */
@media (max-width: 768px) {
  .quick-report-form {
    flex-direction: column !important;
    gap: 8px !important;
  }
  .quick-report-form > * {
    width: 100% !important;
    min-width: 0;
  }
}

@media (max-width: 768px) {
  /* Центрируем верхнее меню */
  .main-nav-tabs, .navbar-right {
    justify-content: center !important;
    text-align: center;
  }
  .main-nav-tabs .nav-tab {
    margin-left: 0;
    margin-right: 0;
  }
  /* Центрируем футер */
  .footer {
    text-align: center !important;
    justify-content: center !important;
    align-items: center !important;
  }
  .footer .d-flex {
    justify-content: center !important;
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 768px) {
  .footer .row.align-items-center {
    display: flex;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center;
    gap: 12px;
  }
  .footer .col-md-6,
  .footer .col-md-6.text-md-end {
    width: 100%;
    text-align: center !important;
    justify-content: center !important;
  }
  .footer .d-flex {
    justify-content: center !important;
    flex-direction: row !important;
    gap: 8px;
  }
  
  /* Фикс для первой строки футера - в одну линию */
  .footer-mobile-row {
    flex-direction: row !important;
    justify-content: center !important;
    gap: 16px !important;
    flex-wrap: wrap;
  }
  
  /* Фикс для копирайта */
  .footer-copyright {
    justify-content: center !important;
  }
  
  /* Фикс для иконок в футере - они должны быть слева от текста */
  .footer .d-flex.align-items-center {
    flex-direction: row !important;
    align-items: center !important;
  }
  
  .footer .d-flex.align-items-center i {
    flex-shrink: 0;
    margin-right: 2px;
  }
  
  .footer .d-flex.align-items-center span {
    flex: 1;
  }
}

.dropdown-menu.w-100 {
  left: 50% !important;
  transform: translateX(-50%) !important;
  right: auto !important;
  min-width: 320px !important;
  width: 320px !important;
  box-shadow: 0 8px 32px rgba(60,60,120,0.10), 0 1.5px 6px rgba(60,60,120,0.08);
  border-radius: 18px !important;
  padding: 12px 0;
  margin-top: 8px !important;
  top: calc(100% + 8px) !important;
  margin-top: 0 !important;
}

/* Десктоп: dropdown на всю ширину кнопки */
@media (min-width: 992px) {
  .dropdown-menu.w-100 {
    width: 100% !important;
    min-width: 100% !important;
    left: 0 !important;
    transform: none !important;
    right: 0 !important;
  }
}

.dropdown-menu.w-100 .dropdown-item {
  padding: 12px 20px;
  font-size: 1.08rem;
  font-weight: 500;
  border-radius: 10px;
  transition: background 0.15s;
}

.dropdown-menu.w-100 .dropdown-item:hover {
  background: rgba(102,126,234,0.08);
}

/* Full-width campaigns block for domains page */
.all-campaigns-fullwidth {
  width: 100%;
  margin-top: 32px;
  margin-bottom: 32px;
  background: transparent;
  /* Сохраняем CRM-стиль */
}

@media (max-width: 991.98px) {
  .all-campaigns-fullwidth {
    width: 100%;
    margin-top: 20px;
    margin-bottom: 20px;
  }
}

.footer-flex {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  text-align: left;
}
.footer-meta {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-copyright {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .footer-flex {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
  }
  .footer-meta {
    justify-content: center;
    gap: 16px;
  }
  .footer-copyright {
    margin-top: 4px;
    justify-content: center;
  }
}

.stats-row {
  display: flex;
  gap: 16px;
}
.stats-row > [class^='col-'] {
  flex: 1 1 0;
  padding: 0;
}
@media (max-width: 991.98px) {
  .stats-row {
    flex-wrap: wrap;
    gap: 12px;
  }
  .stats-row > [class^='col-'] {
    min-width: 220px;
    margin-bottom: 12px;
  }
}

.admin-stat-card.primary::before {
  background: var(--primary-gradient);
}
.admin-stat-card.danger::before {
  background: var(--danger-gradient);
}
.admin-stat-card.warning::before {
  background: var(--warning-gradient);
}
.admin-stat-card.success::before {
  background: var(--success-gradient);
}

.menu-profit-bar {
  width: 7px;
  height: 40px;
  border-radius: 4px;
  background: linear-gradient(135deg, #19c2e6 0%, #1e90c2 100%);
  display: inline-block;
  margin-right: 8px;
}
@media (max-width: 991.98px) {
  .menu-profit-bar {
    height: 28px;
  }
}

/* Стили для размещения блоков статистики в ряд на rcpc странице */
.rcpc-stats-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Десктоп: два блока в ряд */
@media (min-width: 992px) {
  .rcpc-stats-container {
    flex-direction: row;
    gap: 2rem;
  }
  
  .rcpc-stats-container .card {
    flex: 1;
    margin-bottom: 0;
  }
}

/* Планшеты: остаются в колонку */
@media (min-width: 768px) and (max-width: 991px) {
  .rcpc-stats-container {
    gap: 1.5rem;
  }
}

/* Мобильные: в колонку с меньшими отступами */
@media (max-width: 767px) {
  .rcpc-stats-container {
    gap: 1rem;
  }
}

/* Стили для карточек статистики на главной странице в стиле админки */
.dashboard-stat-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(60,60,120,0.08);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.dashboard-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.dashboard-stat-card.purple::before {
  background: linear-gradient(135deg, #6f42c1, #8e44ad);
}

.dashboard-stat-card.info::before {
  background: linear-gradient(135deg, #17a2b8, #20c997);
}

.dashboard-stat-card.orange::before {
  background: linear-gradient(135deg, #fd7e14, #ff6b35);
}

.dashboard-stat-card.success::before {
  background: linear-gradient(135deg, #198754, #20c997);
}

.dashboard-stat-card.danger::before {
  background: linear-gradient(135deg, #dc3545, #e74c3c);
}

.dashboard-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(60,60,120,0.12);
}

.dashboard-stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  color: white;
}

.dashboard-stat-card.purple .stat-icon {
  background: linear-gradient(135deg, #6f42c1, #8e44ad);
}

.dashboard-stat-card.info .stat-icon {
  background: linear-gradient(135deg, #17a2b8, #20c997);
}

.dashboard-stat-card.orange .stat-icon {
  background: linear-gradient(135deg, #fd7e14, #ff6b35);
}

.dashboard-stat-card.success .stat-icon {
  background: linear-gradient(135deg, #198754, #20c997);
}

.dashboard-stat-card.danger .stat-icon {
  background: linear-gradient(135deg, #dc3545, #e74c3c);
}

.dashboard-stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6c757d;
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}

.dashboard-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #212529;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.dashboard-stat-trend {
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.dashboard-stat-trend.positive {
  color: #198754;
}

.dashboard-stat-trend.negative {
  color: #dc3545;
}

/* Адаптивность для карточек статистики */
@media (max-width: 768px) {
  .dashboard-stat-card {
    padding: 1.25rem;
  }
  
  .dashboard-stat-card .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }
  
  .dashboard-stat-value {
    font-size: 1.5rem;
  }
}

@media (max-width: 576px) {
  .dashboard-stat-card {
    padding: 1rem;
  }
  
  .dashboard-stat-card .stat-icon {
    width: 36px;
    height: 36px;
    font-size: 1.125rem;
  }
  
  .dashboard-stat-value {
    font-size: 1.25rem;
  }
  
  .dashboard-stat-label {
    font-size: 0.7rem;
  }
}

@media (max-width: 768px) {
  .details-header {
    display: flex;
    align-items: center;
    flex-direction: row !important;
  }
  .details-icon {
    flex-shrink: 0;
    margin-right: 12px !important;
    margin-bottom: 0 !important;
  }
}

@media (max-width: 768px) {
  /* Фикс для карточек кампаний на странице доменов */
  .border.rounded-3.p-3.mb-3 {
    word-break: break-all;
    overflow-wrap: anywhere;
  }
  
  /* Фикс для длинных доменов и тегов */
  .border.rounded-3.p-3.mb-3 .d-flex.align-items-center.gap-3 span,
  .border.rounded-3.p-3.mb-3 code,
  .border.rounded-3.p-3.mb-3 h6 {
    word-break: break-all;
    overflow-wrap: anywhere;
    max-width: 100%;
  }
  
  /* Фикс для кнопок */
  .border.rounded-3.p-3.mb-3 .btn {
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  /* Фикс для flex-контейнера */
  .border.rounded-3.p-3.mb-3 .d-flex.align-items-center {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  /* Фикс для страницы редактирования ссылок */
  .short-link-group {
    flex-direction: column;
  }
  
  .short-link-group .form-control {
    border-radius: 0.375rem 0.375rem 0 0 !important;
    border-bottom: 0;
    display: block !important;
    width: 100% !important;
    min-height: 38px !important;
  }
  
  .short-link-group .btn {
    border-radius: 0 0 0.375rem 0.375rem !important;
    border-top: 0;
    display: block !important;
    width: 100% !important;
  }
  
  #ogPreview {
    max-width: 100% !important;
  }
}


/* Стили для сортируемых таблиц в отчетах */
th.sortable { 
  cursor: pointer; 
  user-select: none; 
}

th.sortable .sort-indicator { 
  margin-left: .25rem; 
  font-size: .75rem; 
}

/* Стили для сокращателя ссылок (short) */
.og-autofill-spinner { 
  display: none; 
  margin-left: 8px; 
}

.table-links th, .table-links td { 
  vertical-align: middle; 
}

.table-links img { 
  max-width: 60px; 
  max-height: 40px; 
  border-radius: 6px; 
}

.edit-btn { 
  cursor: pointer; 
}

.ctr-cell { 
  font-weight: 500; 
  color: #7b2ff2; 
}

.table-trash th, .table-trash td { 
  vertical-align: middle; 
}

.table-trash img { 
  max-width: 60px; 
  max-height: 40px; 
  border-radius: 6px; 
}

.action-buttons { 
  white-space: nowrap; 
}

.deleted-info { 
  font-size: 0.875rem; 
}

/* Стили для тестовых кликов (test) */
.table-actions {
  display: flex;
  gap: 0.5rem;
}

.link-url {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state i {
  font-size: 4rem;
  color: #dee2e6;
  margin-bottom: 1rem;
}

.empty-state h4 {
  color: #6c757d;
  margin-bottom: 0.5rem;
}

/* Стили для автокомплита в test */
.autocomplete-items {
  position: absolute;
  border: 1px solid #d4d4d4;
  border-bottom: none;
  border-top: none;
  z-index: 99;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 150px;
  overflow-y: auto;
  background-color: white;
}

.autocomplete-items div {
  padding: 10px;
  cursor: pointer;
  background-color: #fff;
  border-bottom: 1px solid #d4d4d4;
}

.autocomplete-items div:hover {
  background-color: #e9e9e9;
}

.autocomplete-active {
  background-color: DodgerBlue !important;
  color: #ffffff;
}

/* Дополнительные стили для test-click/index.php */
.autocomplete-items {
  display: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border-radius: 0 0 8px 8px;
  max-height: 200px;
}

.autocomplete-item {
  padding: 10px;
  cursor: pointer;
  background-color: #fff;
  border-bottom: 1px solid #d4d4d4;
  transition: background-color 0.2s;
}

.autocomplete-item:hover {
  background-color: #e9ecef;
}

.autocomplete-item:last-child {
  border-bottom: none;
  border-radius: 0 0 8px 8px;
}

/* Toast уведомления */
.toast-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  animation: slideInRight 0.3s ease-out;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Валидация полей */
.form-control.is-invalid {
  border-color: #dc3545;
  padding-right: calc(1.5em + .75rem);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(.375em + .1875rem) center;
  background-size: calc(.75em + .375rem) calc(.75em + .375rem);
}

/* Дополнительные стили для test */
.empty-state p {
  color: #adb5bd;
}

.deleted-info {
  color: #dc3545;
  font-size: 0.875rem;
}

/* Стили для строки поиска в отчетах */
.search-container .input-group-lg {
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #e9ecef;
  transition: all 0.3s ease;
}

.search-container .input-group-lg:focus-within {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

.search-container .form-control:focus {
  box-shadow: none !important;
  border-color: transparent !important;
}

.search-container .input-group-text {
  padding: 0.75rem 1rem 0.75rem 1.25rem;
}

.search-container .btn-white {
  background: white;
  border: 1px solid #dee2e6;
  padding: 0.75rem 1.25rem 0.75rem 0.75rem;
}

.search-container .btn-white:hover {
  background: #f8f9fa;
}

.search-container kbd {
  background: #f1f3f5;
  color: #495057;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.875rem;
  box-shadow: 0 2px 0 rgba(0,0,0,0.1);
}
