:root { --bg:#0f172a; --card:#111827; --muted:#9ca3af; --accent:#3b82f6; --accent2:#10b981; }
* { box-sizing: border-box; }
body {
  font-family: 'Inter', sans-serif;
  margin: 0; background: #0b1220; color: #e5e7eb;
}

/* Мобильные безопасные отступы для плавающих элементов */
@supports (padding: max(0px)) {
  body {
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }
}
header {
  position: sticky; top: 0; z-index: 1000;
  padding: 16px 24px; background: rgba(2,6,23,0.8); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex; align-items: center; justify-content: space-between;
}

.header-left {
  display: flex; align-items: center; gap: 12px;
}

.header-right {
  display: flex; align-items: center; gap: 12px;
  z-index: 50;
  position: relative;
}

.logout-btn {
  background: #ef4444;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
}

.logout-btn:hover {
  background: #dc2626;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.user-info:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}
header h1 { font-size: 18px; margin: 0; font-weight: 600; }

/* Стили для роли пользователя */
#userRole {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

#userRole:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.container { padding: 24px; max-width: 1400px; margin: 0 auto; }
.nav { 
  display: flex; 
  flex-direction: row;
  gap: 10px; 
  margin-bottom: 20px; 
  flex-wrap: wrap;
}

.nav a { 
  color: var(--muted); 
  text-decoration: none; 
  padding: 8px 12px; 
  border-radius: 8px; 
  transition: all 0.3s ease;
  white-space: nowrap;
  font-size: 14px;
}

.nav a.active, .nav a:hover { 
  background: var(--card); 
  color: white; 
}
.card {
  background: var(--card); border: 1px solid rgba(255,255,255,0.06); border-radius: 14px; padding: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  margin-bottom: 20px;
}
h2 { margin: 0 0 10px; font-size: 16px; font-weight: 600; }
input, select {
  background: #0b1020; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; padding: 10px; color: white; width: 100%;
}
button {
  padding: 10px 14px; border: none; border-radius: 8px;
  background: var(--accent); color: white; cursor: pointer;
}

/* Дополнительные стили для компонентов */
.controls { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; flex-direction: row; justify-content: flex-start; }
.form-group { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.filters .form-group { flex: 1; max-width: 200px; }
.form-group label { font-size: 12px; color: var(--muted); }
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 6px 8px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.08); }

/* Специальные стили для таблицы активности устройств */
.device-activity-table {
  font-size: 13px;
}

.device-activity-table th {
  font-size: 11px;
  padding: 8px 6px;
  white-space: nowrap;
}

.device-activity-table td {
  padding: 8px 6px;
  font-size: 12px;
}

.device-activity-table th:nth-child(1),
.device-activity-table td:nth-child(1) {
  min-width: 120px;
  max-width: 150px;
}

.device-activity-table th:nth-child(2),
.device-activity-table td:nth-child(2) {
  min-width: 80px;
  max-width: 100px;
}

.device-activity-table th:nth-child(3),
.device-activity-table td:nth-child(3),
.device-activity-table th:nth-child(4),
.device-activity-table td:nth-child(4) {
  min-width: 140px;
  max-width: 160px;
}

.device-activity-table th:nth-child(5),
.device-activity-table td:nth-child(5) {
  min-width: 100px;
  max-width: 120px;
}

/* Статус устройства */
.status-online {
  color: #10b981;
  font-weight: 500;
}

.status-offline {
  color: #ef4444;
  font-weight: 500;
}

/* Адаптивные стили для таблицы устройств */
@media (max-width: 768px) {
  header {
    padding: 12px 14px;
    gap: 8px;
    flex-wrap: wrap;
  }
  header h1 { font-size: 16px; }
  .header-left { gap: 8px; flex: 1 1 auto; }
  .header-right {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    z-index: 1001;
    justify-content: flex-end;
    flex: 1 1 auto;
  }
  .header-right > * { flex: 0 0 auto; }
  .header-right .user-info { order: 2; }
  .header-right .sound-test-btn { order: 1; }
  .header-right .logout-btn { order: 3; }
  .user-info { padding: 6px 8px; font-size: 12px; }
  .logout-btn { padding: 8px 12px; font-size: 12px; }
  #userRole { font-size: 10px; padding: 3px 6px; }
  .nav { margin-bottom: 12px; }
  .nav a { font-size: 13px; padding: 8px 10px; }

  /* Админ блок — компактная сетка на мобильных */
  .admin-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
  }
  .admin-nav a {
    width: 100%;
    text-align: center;
    padding: 10px 8px;
    font-size: 13px;
  }
  .device-activity-table {
    font-size: 11px;
  }
  
  .device-activity-table th,
  .device-activity-table td {
    padding: 6px 4px;
    font-size: 10px;
  }
  
  .device-activity-table th:nth-child(1),
  .device-activity-table td:nth-child(1) {
    min-width: 80px;
    max-width: 100px;
  }
  
  .device-activity-table th:nth-child(2),
  .device-activity-table td:nth-child(2) {
    min-width: 60px;
    max-width: 80px;
  }
  
  .device-activity-table th:nth-child(3),
  .device-activity-table td:nth-child(3),
  .device-activity-table th:nth-child(4),
  .device-activity-table td:nth-child(4) {
    min-width: 90px;
    max-width: 110px;
  }
  
  .device-activity-table th:nth-child(5),
  .device-activity-table td:nth-child(5) {
    min-width: 70px;
    max-width: 90px;
  }
}

@media (max-width: 480px) {
  header { padding: 10px 12px; }
  header h1 { font-size: 14px; }
  .header-right { gap: 4px; }
  .user-info { padding: 4px 6px; font-size: 11px; }
  .logout-btn { padding: 6px 10px; font-size: 11px; }
  .nav a { font-size: 12px; padding: 6px 8px; }

  /* Админ блок — одна колонка на очень узких экранах */
  .admin-nav {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px;
  }
  .admin-nav a {
    padding: 9px 8px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .device-activity-table {
    font-size: 10px;
  }
  
  .device-activity-table th,
  .device-activity-table td {
    padding: 4px 2px;
    font-size: 9px;
  }
  
  .device-activity-table th:nth-child(1),
  .device-activity-table td:nth-child(1) {
    min-width: 60px;
    max-width: 80px;
  }
  
  .device-activity-table th:nth-child(2),
  .device-activity-table td:nth-child(2) {
    min-width: 50px;
    max-width: 60px;
  }
  
  .device-activity-table th:nth-child(3),
  .device-activity-table td:nth-child(3),
  .device-activity-table th:nth-child(4),
  .device-activity-table td:nth-child(4) {
    min-width: 70px;
    max-width: 90px;
  }
  
  .device-activity-table th:nth-child(5),
  .device-activity-table td:nth-child(5) {
    min-width: 50px;
    max-width: 70px;
  }
}
th { 
  font-weight: 600; 
  color: var(--muted); 
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#transactionsTable th:nth-child(2) {
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.2;
  max-height: 2.4em;
}
.pagination { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 20px; }
.category-badge { 
  background: var(--accent); color: white; padding: 2px 8px; border-radius: 12px; 
  font-size: 11px; font-weight: 500;
}
.delete-btn { 
  background: #ef4444; padding: 6px 10px; font-size: 12px;
}
.show-key-btn {
  background: var(--accent); padding: 6px 10px; font-size: 12px; margin-right: 8px;
}
.api-key code {
  background: #1f2937; padding: 4px 8px; border-radius: 4px; font-family: monospace;
}
.primary { background: var(--accent2); }
.positive { color: #10b981; }
.negative { color: #ef4444; }
.settings-section { margin-bottom: 30px; }
.settings-section h3 { margin-bottom: 15px; font-size: 14px; }
.row { display: flex; gap: 12px; }
.label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.charts { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 20px; }
.chart-container { background: var(--card); padding: 16px; border-radius: 8px; height: 400px; }
.chart-container h3 { margin-bottom: 15px; font-size: 14px; }
.chart-container canvas { max-height: 350px !important; }
.icon { margin-right: 8px; }

/* Стили для аналитики */
.analytics-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.summary-card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.summary-title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-value {
  font-size: 24px;
  font-weight: 600;
  color: white;
}

.quick-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.quick-filter-btn {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #3b82f6;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-filter-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.5);
}

.quick-filter-btn:active {
  background: rgba(59, 130, 246, 0.3);
}

.action-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.secondary {
  background: rgba(156, 163, 175, 0.1);
  border: 1px solid rgba(156, 163, 175, 0.3);
  color: var(--muted);
}

.secondary:hover {
  background: rgba(156, 163, 175, 0.2);
  border-color: rgba(156, 163, 175, 0.5);
}

/* Адаптивность для аналитики */
@media (max-width: 768px) {
  .analytics-summary {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .charts {
    grid-template-columns: 1fr;
  }
  
  .filters {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }
  
  .form-group {
    width: 100%;
  }
  
  .quick-filters {
    justify-content: center;
  }
  
  .action-buttons {
    justify-content: center;
  }
  
  .nav {
    flex-direction: column;
    gap: 8px;
  }
  
  .admin-nav {
    flex-direction: column;
  }
  
  .admin-nav a {
    text-align: center;
  }
  
  .user-info {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }
  
  .header-right {
    flex-direction: column;
    gap: 8px;
    z-index: 1001;
  }
  
  .container {
    padding: 16px;
    margin-top: 20px;
  }
}

/* Кастомные скроллбары */
* {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

*:hover {
  scrollbar-color: rgba(156, 163, 175, 0.3) transparent;
}

/* Webkit scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 3px;
  transition: background 0.3s ease;
}

:hover::-webkit-scrollbar-thumb {
  background: rgba(156, 163, 175, 0.3);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(156, 163, 175, 0.5);
}

/* Стили для автокомплита и подсказок */
.autocomplete-container {
  position: relative;
  width: 100%;
}

.suggestions-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 2000;
  max-height: 200px;
  overflow-y: auto;
  display: block;
}

.suggestion-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background-color 0.2s ease;
}

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

.suggestion-item:hover {
  background: rgba(59, 130, 246, 0.1);
}

.suggestion-item:active {
  background: rgba(59, 130, 246, 0.2);
}

.suggestion-item.no-suggestions {
  color: var(--muted);
  font-style: italic;
  cursor: default;
}

.suggestion-item.no-suggestions:hover {
  background: transparent;
}





/* Стили для datetime-local */
input[type="datetime-local"] {
  font-family: inherit;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}



button {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Стили для статистики */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 24px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.stats:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-item:hover::before {
  opacity: 1;
}

.stat-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.stat-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: white;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.stat-value.positive {
  color: #10b981;
  text-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.stat-value.negative {
  color: #ef4444;
  text-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* Анимация для обновления значений */
@keyframes statUpdate {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.stat-value.updating {
  animation: statUpdate 0.3s ease;
}

/* Специальные стили для таблиц */
.table-scroll {
  overflow: visible;
  transition: all 0.3s ease;
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  margin-top: 20px;
}

#transactionsTable {
  width: 100%;
  table-layout: auto;
  font-size: 12px;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1200px;
}

#transactionsTable thead {
  background: rgba(255, 255, 255, 0.03);
  position: sticky;
  top: 0;
  z-index: 100;
}

#transactionsTable th {
  padding: 12px 8px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px;
}

#transactionsTable td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background-color 0.2s ease;
}

#transactionsTable tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.table-scroll::-webkit-scrollbar-thumb {
  background: transparent;
}

.table-scroll:hover::-webkit-scrollbar-thumb {
  background: rgba(156, 163, 175, 0.3);
}

/* Анимации для новых транзакций */
@keyframes slideInFromTop {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideOutToBottom {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(20px);
  }
}

.new-transaction {
  animation: slideInFromTop 0.4s ease-out;
}

/* Плавные переходы для всех строк таблицы */
tbody tr {
  transition: all 0.3s ease;
}

tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

/* Modal styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.modal-content {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-content h3 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 600;
}

.form-group input[type="text"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.form-group input[type="text"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.form-group small {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.form-group input[type="checkbox"] {
  margin-right: 0.5rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
}

.edit-btn, .delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.edit-btn:hover {
  background-color: rgba(34, 197, 94, 0.2);
}

.delete-btn:hover {
  background-color: rgba(239, 68, 68, 0.2);
}

/* Cleanup component styles */
.cleanup-sections {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin: 2rem 0;
}

.cleanup-section {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  background: var(--bg-secondary);
}

.cleanup-section.danger-zone {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

.cleanup-section h3 {
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
}

.cleanup-section p {
  margin: 0 0 1rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.cleanup-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.cleanup-stats {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.cleanup-stats h3 {
  margin: 0 0 1rem 0;
  color: var(--text-primary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--card-bg);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

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

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

/* Button variants */
.danger {
  background: #ef4444;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s;
}

.danger:hover {
  background: #dc2626;
}

.warning {
  background: #f59e0b;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s;
}

.warning:hover {
  background: #d97706;
}

/* Админ навигация */
.admin-nav {
  border-top: 2px solid #dc2626;
  margin-top: 10px;
  padding-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  background: rgba(220, 38, 38, 0.1);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  justify-content: flex-start;
  align-items: center;
}

.admin-nav a {
  background-color: #dc2626;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 1px solid rgba(220, 38, 38, 0.3);
  white-space: nowrap;
}

.admin-nav a:hover {
  background-color: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(220, 38, 38, 0.3);
}

.admin-nav a.active {
  background-color: #991b1b;
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.4);
}

/* Бейджи */
.badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.badge.admin {
  background: #10b981;
  color: white;
}

.badge.user {
  background: #3b82f6;
  color: white;
}

.badge.none {
  background: #6b7280;
  color: white;
}

.badge.active {
  background: #10b981;
  color: white;
}

.badge.inactive {
  background: #ef4444;
  color: white;
}

/* Стили для клиентской аналитики */
.data-status {
  margin-bottom: 20px;
  padding: 12px 16px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.data-status.error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
}

.data-status.success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
}

.data-status.filtered {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.2);
}

.status-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.status-icon {
  font-size: 16px;
}

.status-text {
  font-weight: 500;
}

/* Анимация загрузки */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.data-status.loading .status-icon {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Стили для таблицы операций - широкая колонка суммы */
/* Стили для колонок таблицы транзакций */
#transactionsTable th:nth-child(1),
#transactionsTable td:nth-child(1) {
  width: 8%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#transactionsTable th:nth-child(2),
#transactionsTable td:nth-child(2) {
  width: 10%;
  white-space: normal;
  word-wrap: break-word;
  line-height: 1.2;
  max-height: 2.4em;
  overflow: hidden;
}

#transactionsTable th:nth-child(3),
#transactionsTable td:nth-child(3) {
  width: 10%;
  overflow: hidden;
  text-overflow: ellipsis;
}

#transactionsTable th:nth-child(4),
#transactionsTable td:nth-child(4) {
  width: 14%;
  text-align: right;
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

#transactionsTable th:nth-child(5),
#transactionsTable td:nth-child(5) {
  width: 8%;
  overflow: hidden;
  text-overflow: ellipsis;
}

#transactionsTable th:nth-child(6),
#transactionsTable td:nth-child(6) {
  width: 14%;
  overflow: hidden;
  text-overflow: ellipsis;
}

#transactionsTable th:nth-child(7),
#transactionsTable td:nth-child(7) {
  width: 12%;
  overflow: hidden;
  text-overflow: ellipsis;
}

#transactionsTable th:nth-child(8),
#transactionsTable td:nth-child(8) {
  width: 8%;
  overflow: hidden;
  text-overflow: ellipsis;
}

#transactionsTable th:nth-child(9),
#transactionsTable td:nth-child(9) {
  width: 10%;
  overflow: hidden;
  text-overflow: ellipsis;
}

#transactionsTable th:nth-child(10),
#transactionsTable td:nth-child(10) {
  width: 4%;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}

/* Стили для фильтров по сумме */
#minAmountFilter,
#maxAmountFilter {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  background: #0b1020;
  color: white;
  font-size: 14px;
}

#minAmountFilter:focus,
#maxAmountFilter:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Стили для модуля очистки */
.quick-dates {
  margin: 20px 0;
  padding: 16px;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
}

.quick-dates h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: var(--muted);
}

.quick-date-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-date-btn {
  padding: 8px 12px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #3b82f6;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-date-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-1px);
}

.quick-date-btn:active {
  background: rgba(59, 130, 246, 0.3);
  transform: translateY(0);
}

/* Стили для datetime-local полей */
input[type="datetime-local"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  background: #0b1020;
  color: white;
  font-size: 14px;
  font-family: inherit;
}

input[type="datetime-local"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Стили для select в модальном окне */
.modal-content select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  background: #0b1020;
  color: white;
  font-size: 14px;
  font-family: inherit;
}

.modal-content select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Стили для small текста в модальном окне */
.modal-content small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  display: block;
}

/* Стили для аналитики транзакций */
.analytics-sections {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 20px;
}

.section h3 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: #e5e7eb;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Отступ для блока общей статистики */
.general-stats-section {
  margin-bottom: 30px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px;
  transition: all 0.3s ease;
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.stat-title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #e5e7eb;
}

.sender-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.top-senders {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px;
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
  transition: all 0.3s ease;
}

.top-senders:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.top-senders h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: #e5e7eb;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 12px;
}

.sender-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.detail-item .label {
  font-size: 12px;
  color: var(--muted);
}

.detail-item .value {
  font-size: 14px;
  font-weight: 600;
  color: #e5e7eb;
}

.senders-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sender-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.sender-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.sender-name {
  font-size: 14px;
  font-weight: 500;
  color: #e5e7eb;
}

.sender-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.transaction-count {
  font-size: 11px;
  color: var(--muted);
}

.total-amount {
  font-size: 12px;
  font-weight: 600;
  color: #10b981;
}

.device-stats {
  margin-top: 16px;
}

.devices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.device-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px;
  transition: all 0.3s ease;
}

.device-card:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.device-card.green {
  border-left: 4px solid #10b981;
}

.device-card.yellow {
  border-left: 4px solid #f59e0b;
}

.device-card.orange {
  border-left: 4px solid #f97316;
}

.device-card.red {
  border-left: 4px solid #ef4444;
}

.device-name {
  font-size: 16px;
  font-weight: 600;
  color: #e5e7eb;
  margin-bottom: 12px;
}

.device-stats .stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.device-stats .stat-item:last-child {
  margin-bottom: 0;
}

.device-stats .label {
  font-size: 12px;
  color: var(--muted);
}

.device-stats .value {
  font-size: 14px;
  font-weight: 600;
  color: #e5e7eb;
}

.device-stats .value.green {
  color: #10b981;
}

.device-stats .value.yellow {
  color: #f59e0b;
}

.device-stats .value.orange {
  color: #f97316;
}

.device-stats .value.red {
  color: #ef4444;
}

.time-stats {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  align-items: stretch;
  min-height: 500px;
}

.time-chart {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.time-chart canvas {
  flex: 1;
  width: 100% !important;
  height: 100% !important;
}

.hourly-stats {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.hourly-stats h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: #e5e7eb;
}

.hourly-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.hour-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 8px;
  text-align: center;
  transition: all 0.3s ease;
}

.hour-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.hour-label {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 4px;
}

.hour-count {
  font-size: 12px;
  font-weight: 600;
  color: #e5e7eb;
  margin-bottom: 2px;
}

.hour-amount {
  font-size: 10px;
  color: #10b981;
}

.no-data {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 20px;
}

.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 12px;
  margin: 16px 0;
  color: #ef4444;
  font-size: 14px;
}

/* Стили для экспорта */
.export-section {
  margin-bottom: 20px;
  text-align: center;
}

.export-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

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

.export-btn:active {
  transform: translateY(0);
}

/* Улучшенные стили для статистики по отправителям */
.sender-stats-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Поле поиска отправителя вынесено отдельно */
.sender-search-section {
  margin: 20px 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}

.sender-search-group {
  max-width: 300px;
}

.sender-search-group .autocomplete-container {
  width: 100%;
}

.sender-search-group input {
  width: 100%;
  font-size: 14px;
}

/* Детальная информация по отправителю */
.sender-details-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sender-summary-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
}

.sender-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.sender-header h4 {
  margin: 0;
  font-size: 18px;
  color: #e5e7eb;
}

.sender-stats-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sender-stats-summary .stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}

.sender-stats-summary .label {
  font-size: 12px;
  color: var(--muted);
  margin-right: 16px;
}

.sender-stats-summary .value {
  font-size: 14px;
  font-weight: 600;
  color: #e5e7eb;
}

.sender-transactions {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
}

.transactions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.transactions-header h4 {
  margin: 0;
  font-size: 16px;
  color: #e5e7eb;
}

.transactions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.transaction-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px;
  transition: all 0.3s ease;
}

.transaction-item:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
}

.transaction-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.transaction-time {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.transaction-time .date {
  font-size: 14px;
  font-weight: 600;
  color: #e5e7eb;
}

.transaction-time .time {
  font-size: 12px;
  color: var(--muted);
}

.transaction-details {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.transaction-amount {
  font-size: 16px;
  font-weight: 700;
}

.transaction-amount.positive {
  color: #10b981;
}

.transaction-amount.negative {
  color: #ef4444;
}

.transaction-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: #60a5fa;
  vertical-align: middle;
}

.transaction-bank {
  font-size: 12px;
  color: var(--muted);
}

.transaction-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}

.transaction-meta .device {
  background: rgba(59, 130, 246, 0.1);
  padding: 2px 8px;
  border-radius: 12px;
}

.transaction-meta .category {
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 8px;
  border-radius: 12px;
}

.sender-search-result {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 16px;
}

.sender-search-result h4 {
  margin: 0 0 12px 0;
  color: #e5e7eb;
  font-size: 14px;
}

.sender-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
}

.sender-item:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
}

.sender-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.sender-name {
  font-size: 16px;
  font-weight: 600;
  color: #e5e7eb;
  margin-bottom: 8px;
}

.sender-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.transaction-count {
  font-size: 12px;
  color: var(--muted);
  background: rgba(59, 130, 246, 0.1);
  padding: 2px 8px;
  border-radius: 12px;
}

.total-amount {
  font-size: 14px;
  font-weight: 600;
  color: #10b981;
}

/* Вертикальное отображение устройств */
.devices-vertical {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  max-height: none;
  overflow-y: visible;
  padding-right: 0;
}

/* Скроллбар больше не нужен, так как все устройства помещаются */

.device-card-vertical {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 10px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  min-height: auto;
}

.device-card-vertical::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
}

.device-card-vertical.green::before {
  background: #10b981;
}

.device-card-vertical.yellow::before {
  background: #f59e0b;
}

.device-card-vertical.orange::before {
  background: #f97316;
}

.device-card-vertical.red::before {
  background: #ef4444;
}

.device-card-vertical:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.device-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.device-name {
  font-size: 13px;
  font-weight: 600;
  color: #e5e7eb;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  margin-left: 8px;
}

.device-indicator.green {
  background: #10b981;
  box-shadow: 0 0 4px #10b981;
}

.device-indicator.yellow {
  background: #f59e0b;
  box-shadow: 0 0 4px #f59e0b;
}

.device-indicator.orange {
  background: #f97316;
  box-shadow: 0 0 4px #f97316;
}

.device-indicator.red {
  background: #ef4444;
  box-shadow: 0 0 4px #ef4444;
}

.device-stats-vertical {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.device-stats-vertical .stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 3px;
  transition: all 0.2s ease;
}

.device-stats-vertical .stat-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.device-stats-vertical .label {
  font-size: 9px;
  color: var(--muted);
  font-weight: 500;
}

.device-stats-vertical .value {
  font-size: 10px;
  font-weight: 600;
  color: #e5e7eb;
}

.device-stats-vertical .value.green {
  color: #10b981;
}

.device-stats-vertical .value.yellow {
  color: #f59e0b;
}

.device-stats-vertical .value.orange {
  color: #f97316;
}

.device-stats-vertical .value.red {
  color: #ef4444;
}

/* Кнопки временной шкалы */
.time-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.time-btn {
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.time-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s;
}

.time-btn:hover::before {
  left: 100%;
}

.time-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e5e7eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.time-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.time-btn.active:hover {
  background: #2563eb;
  transform: translateY(-2px);
}

/* Навигация для недели */
.week-navigation {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 18px;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #e5e7eb;
  transform: scale(1.1);
}

.period-label {
  flex: 1;
  text-align: center;
  font-weight: 500;
  color: #e5e7eb;
  font-size: 14px;
}

/* Селекторы для месяца */
.month-selectors {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  align-items: center;
}

/* Контролы для произвольного периода */
.custom-period-controls {
  background: rgba(255, 255, 255, 0.03);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 20px;
}

.period-type-selector {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  transition: color 0.3s ease;
}

.radio-label:hover {
  color: #e5e7eb;
}

.radio-label input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.radio-label input[type="radio"]:checked + span {
  color: #e5e7eb;
  font-weight: 500;
}

.date-inputs {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.month-selectors .selector-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.month-selectors label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

/* Сетка почасовой статистики */
.hourly-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 10px;
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hour-tile {
  position: relative;
  padding: 12px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
  height: 100%;
}

.hour-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.hour-time {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.3px;
}

.hour-count {
  font-size: 18px;
  font-weight: 700;
  margin: 2px 0;
  line-height: 1;
}

.hour-amount {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1;
}

/* Цветовые классы для плиток */
.hour-tile-empty {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.hour-tile-empty .hour-count {
  color: #f87171;
}

.hour-tile-low {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}

.hour-tile-low .hour-count {
  color: #fbbf24;
}

.hour-tile-medium {
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.3);
  color: #fde68a;
}

.hour-tile-medium .hour-count {
  color: #fcd34d;
}

.hour-tile-high {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.hour-tile-high .hour-count {
  color: #34d399;
}

/* Адаптивность для временной статистики */
@media (max-width: 1200px) {
  .time-stats {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  
  .time-chart {
    min-height: 400px;
  }
  
  .hourly-stats-grid {
    min-height: 400px;
  }
}

/* Адаптивность для средних экранов */
@media (max-width: 1200px) {
  .devices-vertical {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

/* Адаптивность для планшетов */
@media (max-width: 1024px) {
  .devices-vertical {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    max-height: 450px;
  }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  .hourly-stats-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 8px;
    padding: 12px;
  }
  
  .hour-tile {
    padding: 10px 6px;
  }
  
  .hour-count {
    font-size: 18px;
  }
  
  .devices-vertical {
    grid-template-columns: 1fr;
    max-height: none;
  }

  /* Стили для таблицы на мобильных устройствах */
  .table-scroll {
    overflow-x: auto;
    margin-top: 30px;
  }
  
  #transactionsTable {
    font-size: 10px;
    min-width: 800px;
  }

  #transactionsTable th,
  #transactionsTable td {
    padding: 4px 6px;
  }

  #transactionsTable th {
    font-size: 9px;
    z-index: 100;
  }
}

@media (max-width: 480px) {
  .hourly-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(12, 1fr);
  }

  .devices-vertical {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 3px;
    max-height: none;
  }
  
  .device-card-vertical {
    padding: 5px;
  }
  
  .device-name {
    font-size: 9px;
  }
  
  .device-stats-vertical .stat-item {
    padding: 2px 3px;
  }
  
  .device-stats-vertical .label {
    font-size: 6px;
  }
  
  .device-stats-vertical .value {
    font-size: 7px;
  }

  /* Стили для таблицы на очень маленьких экранах */
  #transactionsTable {
    font-size: 9px;
  }

  #transactionsTable th,
  #transactionsTable td {
    padding: 3px 4px;
  }

  #transactionsTable th {
    font-size: 8px;
    z-index: 100;
  }
}

/* Селекторы времени */
.time-selectors {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  align-items: end;
  flex-wrap: wrap;
  backdrop-filter: blur(10px);
}

.selector-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 160px;
  flex: 1;
}

.selector-group label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 4px;
}

.selector-group select {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #e5e7eb;
  font-size: 14px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.selector-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.selector-group select:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Кнопка сброса фильтров */
#resetTimeFiltersBtn {
  padding: 10px 20px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-left: auto;
}

#resetTimeFiltersBtn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* Улучшенный график */
.time-chart {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 24px;
  height: 400px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.time-chart::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  .sender-stats-container {
    flex-direction: column;
  }
  
  .sender-search-group {
    max-width: 100%;
  }
  
  .top-senders {
    max-height: 300px;
  }
  
  .sender-header {
    flex-direction: column;
    gap: 12px;
  }
  
  .transaction-info {
    flex-direction: column;
    gap: 12px;
  }
  
  .transaction-details {
    align-items: flex-start;
  }
  
  .transaction-meta {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
  
  .time-stats {
    grid-template-columns: 1fr;
  }
  
  .hourly-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .devices-vertical {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 6px;
    max-height: none;
  }
  
  .device-card-vertical {
    padding: 8px;
  }
  
  .device-name {
    font-size: 12px;
  }
  
  .device-stats-vertical .stat-item {
    padding: 3px 4px;
  }
  
  .device-stats-vertical .label {
    font-size: 8px;
  }
  
  .device-stats-vertical .value {
    font-size: 9px;
  }
  
  .time-controls {
    justify-content: center;
    flex-direction: column;
    align-items: stretch;
  }
  
  .time-btn {
    flex: 1;
    min-width: 80px;
    text-align: center;
  }
  
  .time-selectors {
    flex-direction: column;
    gap: 12px;
  }
  
  .selector-group {
    min-width: 100%;
  }
  
  #resetTimeFiltersBtn {
    margin-left: 0;
    margin-top: 8px;
  }
  
  .time-chart {
    height: 300px;
    padding: 16px;
  }
}

/* Стили для вкладок */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 12px 20px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  border-bottom: 2px solid transparent;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

.tab-btn.active {
  background: var(--card);
  color: white;
  border-bottom-color: var(--accent);
}

.tab-btn.active::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* Стили для секции обучения */
.learning-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.learning-section h3 {
  margin: 0 0 15px 0;
  font-size: 16px;
  font-weight: 600;
  color: white;
}

.learning-section textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  color: white;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  resize: vertical;
  min-height: 100px;
  transition: all 0.3s ease;
}

.learning-section textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.learning-section textarea::placeholder {
  color: var(--muted);
}

/* Стили для результатов тестирования */
.success-message {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 8px;
  padding: 16px;
  margin-top: 15px;
}

.success-message h5 {
  margin: 0 0 10px 0;
  color: #10b981;
  font-size: 14px;
  font-weight: 600;
}

.success-message p {
  margin: 5px 0;
  font-size: 13px;
  color: #d1fae5;
}

.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 16px;
  margin-top: 15px;
}

.error-message h5 {
  margin: 0 0 10px 0;
  color: #ef4444;
  font-size: 14px;
  font-weight: 600;
}

.error-message p {
  margin: 5px 0;
  font-size: 13px;
  color: #fecaca;
}

/* Стили для кнопок правил парсинга */
.edit-rule-btn, .delete-rule-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
  margin-right: 4px;
}

.edit-rule-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.delete-rule-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

/* Стили для сырых данных */
.raw-data-controls {
  margin-bottom: 20px;
}

.raw-data-controls .filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
}

.raw-data-controls .form-group {
  flex: 1;
  min-width: 150px;
}

.view-raw-data-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
}

.view-raw-data-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.raw-data-section {
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.raw-data-section h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  font-weight: 600;
  color: white;
}

.raw-data-section pre {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 12px;
  font-size: 12px;
  color: #e5e7eb;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 300px;
  overflow-y: auto;
}

.pagination-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
  margin: 0 2px;
}

.pagination-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

.pagination-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Стили для индикатора часового пояса */
#timezoneIndicator {
  font-size: 12px;
  font-weight: normal;
  color: var(--muted);
  opacity: 0.8;
}

/* Стили для правил игнорирования в контексте sender-mappings */
.ignore-rules-section {
  margin-bottom: 30px;
}

.ignore-rules-section .header-section {
  margin-bottom: 20px;
}

.ignore-rules-section .description {
  color: var(--muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

.ignore-rules-section .rules-section {
  margin-bottom: 30px;
}

.ignore-rules-section .test-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.ignore-rules-section .test-form {
  display: grid;
  gap: 15px;
  margin-bottom: 20px;
}

.ignore-rules-section .test-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ignore-rules-section .test-form label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.ignore-rules-section .test-form textarea,
.ignore-rules-section .test-form input {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: white;
  font-size: 14px;
  transition: all 0.3s ease;
}

.ignore-rules-section .test-form textarea:focus,
.ignore-rules-section .test-form input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.ignore-rules-section .test-results {
  margin-top: 20px;
}

.ignore-rules-section .test-result {
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.ignore-rules-section .test-result.loading {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #3b82f6;
}

.ignore-rules-section .test-result.ignored {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.ignore-rules-section .test-result.not-ignored {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
}

.ignore-rules-section .test-result.matched {
  background: rgba(156, 163, 175, 0.1);
  border: 1px solid rgba(156, 163, 175, 0.3);
  color: #9ca3af;
}

.ignore-rules-section .test-result.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.ignore-rules-section .test-result.no-rules {
  background: rgba(156, 163, 175, 0.1);
  border: 1px solid rgba(156, 163, 175, 0.3);
  color: #9ca3af;
}

.ignore-rules-section .test-result h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  font-weight: 600;
}

.ignore-rules-section .test-result ul {
  margin: 0;
  padding-left: 20px;
}

.ignore-rules-section .test-result li {
  margin-bottom: 5px;
  font-size: 13px;
}

.ignore-rules-section .test-result p {
  margin: 0;
  font-size: 13px;
}

.edit-ignore-rule-btn,
.delete-ignore-rule-btn {
  background: transparent;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
  margin-right: 5px;
}

.edit-ignore-rule-btn {
  color: var(--accent);
}

.edit-ignore-rule-btn:hover {
  background: rgba(59, 130, 246, 0.2);
}

.delete-ignore-rule-btn {
  color: #ef4444;
}

.delete-ignore-rule-btn:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* Адаптивность для правил игнорирования */
@media (max-width: 768px) {
  .ignore-rules-section .test-form {
    grid-template-columns: 1fr;
  }
  
  .ignore-rules-section .test-result {
    padding: 12px;
  }
  
  .ignore-rules-section .test-result h4 {
    font-size: 13px;
  }
  
  .ignore-rules-section .test-result li,
  .ignore-rules-section .test-result p {
    font-size: 12px;
  }
}

.ignore-rules-container .header-section {
  margin-bottom: 30px;
}

.ignore-rules-container .description {
  color: var(--muted);
  margin-bottom: 20px;
  line-height: 1.5;
}

.ignore-rules-container .rules-section {
  margin-bottom: 40px;
}

.ignore-rules-container .test-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
}

.ignore-rules-container .test-form {
  display: grid;
  gap: 15px;
  margin-bottom: 20px;
}

.ignore-rules-container .test-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ignore-rules-container .test-form label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.ignore-rules-container .test-form textarea,
.ignore-rules-container .test-form input {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: white;
  font-size: 14px;
  transition: all 0.3s ease;
}

.ignore-rules-container .test-form textarea:focus,
.ignore-rules-container .test-form input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.ignore-rules-container .test-results {
  margin-top: 20px;
}

.ignore-rules-container .test-result {
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.ignore-rules-container .test-result.loading {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #3b82f6;
}

.ignore-rules-container .test-result.ignored {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.ignore-rules-container .test-result.not-ignored {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
}

.ignore-rules-container .test-result.matched {
  background: rgba(156, 163, 175, 0.1);
  border: 1px solid rgba(156, 163, 175, 0.3);
  color: #9ca3af;
}

.ignore-rules-container .test-result.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.ignore-rules-container .test-result.no-rules {
  background: rgba(156, 163, 175, 0.1);
  border: 1px solid rgba(156, 163, 175, 0.3);
  color: #9ca3af;
}

.ignore-rules-container .test-result h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  font-weight: 600;
}

.ignore-rules-container .test-result ul {
  margin: 0;
  padding-left: 20px;
}

.ignore-rules-container .test-result li {
  margin-bottom: 5px;
  font-size: 13px;
}

.ignore-rules-container .test-result p {
  margin: 0;
  font-size: 13px;
}

.ignore-rules-container .edit-ignore-rule-btn,
.ignore-rules-container .delete-ignore-rule-btn {
  background: transparent;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
  margin-right: 5px;
}

.ignore-rules-container .edit-ignore-rule-btn {
  color: var(--accent);
}

.ignore-rules-container .edit-ignore-rule-btn:hover {
  background: rgba(59, 130, 246, 0.2);
}

.ignore-rules-container .delete-ignore-rule-btn {
  color: #ef4444;
}

.ignore-rules-container .delete-ignore-rule-btn:hover {
  background: rgba(239, 68, 68, 0.2);
}

.ignore-rules-container .modal-content small {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 4px;
  display: block;
}

.ignore-rules-container .modal-content code {
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 4px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
}

/* Адаптивность для правил игнорирования */
@media (max-width: 768px) {
  .ignore-rules-container .test-form {
    grid-template-columns: 1fr;
  }
  
  .ignore-rules-container .table-container {
    overflow-x: auto;
  }
  
  .ignore-rules-container .test-result {
    padding: 12px;
  }
  
  .ignore-rules-container .test-result h4 {
    font-size: 13px;
  }
  
  .ignore-rules-container .test-result li,
  .ignore-rules-container .test-result p {
    font-size: 12px;
  }
}

/* Стили для компонента правил парсинга */
.parsing-rules-section {
  margin-bottom: 30px;
}

.parsing-rules-section .header-section {
  margin-bottom: 20px;
}

.parsing-rules-section .description {
  color: var(--muted);
  margin-bottom: 20px;
}

.parsing-rules-section .rules-section {
  margin-bottom: 30px;
}

.parsing-rules-section .test-section {
  background: var(--card);
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
}

.parsing-rules-section .test-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.parsing-rules-section .test-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.parsing-rules-section .test-form label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.parsing-rules-section .test-form textarea,
.parsing-rules-section .test-form input,
.parsing-rules-section .test-form select {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: white;
  font-size: 14px;
  transition: all 0.3s ease;
}

.parsing-rules-section .test-form textarea:focus,
.parsing-rules-section .test-form input:focus,
.parsing-rules-section .test-form select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

.parsing-rules-section .test-results {
  margin-top: 20px;
}

.parsing-rules-section .test-result {
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.parsing-rules-section .test-result.loading {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #3b82f6;
}

.parsing-rules-section .test-result.success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
}

.parsing-rules-section .test-result.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.parsing-rules-section .test-result h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  font-weight: 600;
}

.parsing-rules-section .test-result h5 {
  margin: 0 0 10px 0;
  font-size: 13px;
  font-weight: 600;
}

.parsing-rules-section .test-result p {
  margin: 0 0 5px 0;
  font-size: 13px;
}

.parsing-rules-section .test-result pre {
  background: rgba(0, 0, 0, 0.3);
  padding: 10px;
  border-radius: 4px;
  font-size: 12px;
  overflow-x: auto;
  margin: 10px 0;
}

.parsing-rules-section .parsed-data {
  background: rgba(16, 185, 129, 0.05);
  padding: 10px;
  border-radius: 4px;
  margin-top: 10px;
}

.parsing-rules-section .parsed-data p {
  margin: 0 0 5px 0;
  font-size: 13px;
}

.edit-parsing-rule-btn,
.delete-parsing-rule-btn {
  background: transparent;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
  margin-right: 5px;
}

.edit-parsing-rule-btn {
  color: var(--accent);
}

.edit-parsing-rule-btn:hover {
  background: rgba(59, 130, 246, 0.2);
}

.delete-parsing-rule-btn {
  color: #ef4444;
}

.delete-parsing-rule-btn:hover {
  background: rgba(239, 68, 68, 0.2);
}

.status-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.status-badge.active {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.status-badge.inactive {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

@media (max-width: 768px) {
  .parsing-rules-section .test-form {
    gap: 10px;
  }
  
  .parsing-rules-section .table-container {
    overflow-x: auto;
  }
  
  .parsing-rules-section .test-result {
    padding: 10px;
  }
  
  .parsing-rules-section .test-result h4 {
    font-size: 13px;
  }
  
  .parsing-rules-section .test-result h5 {
    font-size: 12px;
  }
  
  .parsing-rules-section .test-result p {
    font-size: 12px;
  }
}

/* Стили для детального просмотра правил */
.rule-details {
  max-height: 60vh;
  overflow-y: auto;
  padding: 10px;
}

.detail-section {
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.detail-section h4 {
  margin: 0 0 10px 0;
  color: #3b82f6;
  font-size: 14px;
  font-weight: 600;
}

.detail-section p {
  margin: 5px 0;
  font-size: 13px;
}

.detail-section code {
  display: block;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  word-break: break-all;
  margin-top: 5px;
}

.view-rule-btn {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #3b82f6;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  margin-right: 4px;
  transition: all 0.3s ease;
}

.view-rule-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
}

/* Стили для валютных элементов в админ статистике */
.currency-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.currency-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.currency-symbol {
  font-weight: 600;
  color: #e5e7eb;
  min-width: 16px;
}

.exchange-rate {
  font-size: 10px;
  color: #6b7280;
  font-style: italic;
  margin-left: auto;
}

/* Адаптивность для валютных элементов */
@media (max-width: 768px) {
  .currency-info {
    gap: 6px;
  }
  
  .currency-item {
    font-size: 11px;
  }
  
  .exchange-rate {
    font-size: 9px;
  }
}
/* === ЭКРАН ЗАГРУЗКИ АНАЛИТИКИ === */
.loading-modal {
  background: var(--card);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  min-width: 450px;
  max-width: 500px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.loading-modal h3 {
  margin: 0 0 15px 0;
  color: var(--text);
  font-size: 24px;
}

.loading-modal p {
  margin: 10px 0;
  color: var(--text-secondary);
  font-size: 15px;
}

.loading-hint {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
  margin: 5px 0 20px 0;
}

/* Контейнер прогресс-бара */
.loading-progress-container {
  width: 100%;
  margin: 25px 0 15px 0;
  position: relative;
}

/* Фон прогресс-бара */
.loading-progress-bar {
  width: 100%;
  height: 30px;
  background: rgba(33, 150, 243, 0.1);
  border-radius: 15px;
  overflow: hidden;
  position: relative;
  border: 2px solid rgba(33, 150, 243, 0.2);
}

/* Заполнение прогресс-бара с эффектом жидкости */
.loading-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, 
    #4CAF50 0%,
    #66BB6A 25%,
    #81C784 50%,
    #66BB6A 75%,
    #4CAF50 100%);
  background-size: 300% 100%;
  /* Скругление с обеих сторон - справа больше для эффекта жидкости */
  border-radius: 13px 15px 15px 13px;
  transition: width 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
  animation: liquidFlow 3s ease-in-out infinite;
  min-width: 0;
  width: 0;
  position: relative;
}

/* Анимация текучести жидкости */
@keyframes liquidFlow {
  0%, 100% { 
    background-position: 0% 50%;
    filter: brightness(1);
  }
  50% { 
    background-position: 100% 50%;
    filter: brightness(1.1);
  }
}


/* Текст процентов */
.loading-progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  z-index: 1;
}

/* Статус загрузки */
.loading-status {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 10px;
  min-height: 20px;
}
