main {
  padding: 28px 32px 60px;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.panel { display: none; animation: fadeIn 0.3s ease; }
.panel.active { display: block; }

.panel h2 {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeSlideUp 0.4s ease;
  position: relative;
}

.panel h2::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--cyan);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--cyan-glow);
}

.panel h2.sub { margin-top: 32px; }

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

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

/* ============ СЕТКА ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

/* ============ КАРТОЧКИ ============ */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 200, 212, 0.06), transparent);
  transition: left 0.6s;
  pointer-events: none;
}

.card:hover::before { left: 100%; }

.card:hover {
  border-color: var(--cyan);
  background: var(--panel-2);
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--cyan);
}

.card.clickable { cursor: pointer; }
.card.clickable:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan), var(--shadow);
}

.card .name {
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: 0.2px;
}

.card .role {
  display: inline-block;
  color: var(--cyan);
  font-size: 10.5px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 2px 8px;
  background: rgba(0, 200, 212, 0.1);
  border-radius: 4px;
  margin-bottom: 8px;
  font-weight: 600;
}

.card .role.gold { color: var(--gold); background: rgba(251, 191, 36, 0.1); }
.card .role.red { color: var(--red); background: rgba(239, 68, 68, 0.1); }
.card .role.blue { color: var(--blue); background: rgba(59, 130, 246, 0.1); }
.card .role.green { color: var(--green); background: rgba(74, 222, 128, 0.1); }
.card .role.gray { color: var(--text-2); background: rgba(164, 177, 192, 0.1); }
.card .role.danger { color: var(--red); background: rgba(239, 68, 68, 0.1); }
.card .role.ally { color: var(--blue); background: rgba(59, 130, 246, 0.1); }

.card .stat {
  color: var(--text-2);
  font-size: 12.5px;
  margin-top: 6px;
}

.card .stat .val { color: #fff; font-weight: 500; }

.online { color: var(--green); }
.offline { color: var(--muted); }
.danger { color: var(--red); }
.ally { color: var(--blue); }

/* ============ КНОПКИ ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 11px 20px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn:hover {
  background: var(--blue-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn.secondary {
  background: var(--panel-2);
  border: 1px solid var(--border-light);
  color: var(--text-2);
}

.btn.secondary:hover {
  background: var(--panel-3);
  color: #fff;
  border-color: var(--cyan);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn.danger { background: var(--red-dark); }
.btn.danger:hover {
  background: var(--red);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.btn.small { padding: 7px 12px; font-size: 11.5px; }

/* ============ ПРОГРЕСС-БАР ============ */
.bar {
  background: var(--bg-2);
  height: 6px;
  margin-top: 10px;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  border-radius: 3px;
  transition: width 0.6s ease;
  box-shadow: 0 0 10px rgba(0, 200, 212, 0.5);
}

/* ============ МУЗЫКА ============ */
.music-player {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  max-width: 520px;
}

/* ============ АЛЬБОМ ============ */
.album {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.photo {
  aspect-ratio: 1/1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s;
}

.photo:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  transform: scale(1.02);
  box-shadow: var(--shadow);
}

/* ============ ТАБЛИЦА ============ */
.users-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 16px;
  font-size: 13px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.users-table th {
  background: var(--panel-2);
  color: var(--text-2);
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.users-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  transition: all 0.15s;
}

.users-table tr:last-child td { border-bottom: none; }
.users-table tr:hover td {
  background: var(--panel-2);
  transform: translateX(3px);
}

.users-table .actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ============ ЛОГ ============ */
.log {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 12px;
  max-height: 280px;
  overflow-y: auto;
  margin-top: 20px;
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

.log-line {
  padding: 5px 0;
  border-bottom: 1px solid rgba(42, 53, 67, 0.5);
  color: var(--text-2);
}

.log-line:last-child { border-bottom: none; }
.log-line .ts { color: var(--muted); margin-right: 10px; }
.log-line .ok { color: var(--green); }
.log-line .warn { color: var(--gold); }
.log-line .crit { color: var(--red); }

/* ============ ФОРМА ============ */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.form-field { display: flex; flex-direction: column; }

.form-field label {
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.form-field input,
.form-field select,
.form-field textarea {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13.5px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-glow);
  transform: scale(1.005);
}

.form-field textarea { resize: vertical; min-height: 80px; }
.form-hint { color: var(--muted); font-size: 11px; margin-top: 4px; }

/* ============ ФУТЕР ============ */
footer {
  text-align: center;
  padding: 28px;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 1px;
  border-top: 1px solid var(--border);
  margin-top: 60px;
  position: relative;
  z-index: 1;
}

/* ============ МОДАЛКА ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s;
}

.modal {
  background: var(--panel);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 540px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

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

.modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--blue), var(--cyan));
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.modal h3 {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal h3::before {
  content: '';
  width: 4px;
  height: 18px;
  background: var(--cyan);
  border-radius: 2px;
}

.modal p { color: var(--text-2); font-size: 13.5px; margin-bottom: 20px; }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* ============ АДАПТИВ ============ */
@media (max-width: 640px) {
  main { padding: 18px 16px 40px; }
  .panel h2 { font-size: 16px; }
  .grid { grid-template-columns: 1fr; }
}

/* ============ ПЛАВНЫЕ ПЕРЕХОДЫ ============ */
* {
  transition: background-color 0.2s ease,
              border-color 0.2s ease,
              color 0.15s ease;
}

/* ============ TOOLBAR УЧАСТНИКОВ ============ */
.users-toolbar {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.users-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.users-bulk-row {
  background: linear-gradient(90deg, rgba(0, 200, 212, 0.08), var(--panel));
  border-color: rgba(0, 200, 212, 0.3);
  animation: fadeIn 0.2s;
}

.users-search {
  flex: 1;
  min-width: 200px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
}
.users-search:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-glow);
}

.users-filter {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  min-width: 130px;
}
.users-filter:focus {
  outline: none;
  border-color: var(--cyan);
}

.users-check {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border: 1px solid var(--border);
  transition: all 0.15s;
}
.users-check:hover {
  border-color: var(--cyan);
  color: #fff;
}
.users-check input[type="checkbox"] {
  accent-color: var(--cyan);
  cursor: pointer;
}

.users-selected-info {
  color: var(--cyan);
  font-size: 12.5px;
  font-weight: 600;
  margin-right: 8px;
  padding: 6px 12px;
  background: rgba(0, 200, 212, 0.1);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 200, 212, 0.3);
}

.btn-reset {
  font-size: 11.5px;
  padding: 6px 12px;
}

/* ============ ЧЕКБОКСЫ В ТАБЛИЦЕ ============ */
.users-table .check-cell {
  width: 36px;
  text-align: center;
  padding: 8px 6px;
}
.users-table .check-cell input[type="checkbox"] {
  accent-color: var(--cyan);
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.users-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}
.users-table th.sortable:hover {
  color: var(--cyan);
}

.users-table tr.user-banned {
  background: rgba(239, 68, 68, 0.04);
}
.users-table tr.user-banned td {
  opacity: 0.8;
}

.last-seen-cell {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

@media (max-width: 768px) {
  .users-toolbar-row {
    padding: 10px;
  }
  .users-search {
    min-width: 100%;
  }
  .users-filter {
    flex: 1;
    min-width: 120px;
  }
  .users-check {
    flex: 1;
    justify-content: center;
  }
  .last-seen-cell {
    display: none;
  }
  .users-table th:nth-child(6),
  .users-table td:nth-child(6) {
    display: none;
  }
}

/* ============ ADMIN: ВКЛАДКИ ============ */
.admin-sections {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.admin-section-card {
  position: relative;
  padding: 20px 18px;
  transition: all 0.2s;
}

.admin-section-card:hover {
  transform: translateY(-4px);
  border-color: var(--cyan);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--cyan);
}

.admin-section-icon {
  font-size: 32px;
  margin-bottom: 10px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.admin-section-card .name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}

.admin-section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.admin-section-head .btn {
  flex-shrink: 0;
}

.admin-section-title {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin: 0;
}

.admin-section-view {
  animation: fadeIn 0.25s ease;
}

/* ============ ПРЕМИИ ============ */
.premium-card {
  border-left: 3px solid var(--gold) !important;
  position: relative;
}

.premium-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-top: 14px solid var(--gold);
  border-left: 14px solid transparent;
  opacity: 0.7;
}

.premium-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.premium-icon {
  font-size: 28px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(251, 191, 36, 0.4));
}

.premium-card .name {
  margin-bottom: 4px;
}

.premium-amount {
  color: var(--gold);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

.premium-target {
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 6px;
  font-size: 12.5px;
}
.premium-target-label {
  color: var(--muted);
  margin-right: 6px;
}
.premium-target-name {
  color: #fff;
  font-weight: 700;
}

.premium-card .contract-meta {
  border-top: 1px solid var(--border);
  margin-top: 10px;
  padding-top: 10px;
}

/* ============ МОБИЛКА ADMIN ============ */
@media (max-width: 640px) {
  .admin-sections {
    grid-template-columns: 1fr;
  }
  .admin-section-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .admin-section-head .btn {
    width: 100%;
  }
  .admin-section-title {
    font-size: 15px;
  }
  .admin-section-icon {
    font-size: 26px;
  }
}
