*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0d0f17;
  --bg2:       #141826;
  --bg3:       #1c2133;
  --bg-card:   #161b29;
  --border:    #252b3d;
  --border2:   #2e3650;
  --purple:    #d4af6a;
  --purple2:   #c19a4f;
  --purple3:   #b08b42;
  --gold:      #d4af6a;
  --gold-soft: rgba(212,175,106,0.12);
  --text:      #e8eaf0;
  --muted:     #8a91a8;
  --danger:    #ef4444;
  --success:   #22c55e;
  --discord:   #5865f2;
  --sidebar-bg: #0a0c14;
}

html, body {
  height: 100%;
  background:
    radial-gradient(ellipse 80% 50% at 70% 0%, rgba(212,175,106,0.04), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
}

/* ===== ЭКРАНЫ ===== */
#loading-screen,
#login-screen,
#panel-screen {
  display: none;
  width: 100%;
  min-height: 100vh;
}

/* ===== ЗАГРУЗКА ===== */
#loading-screen {
  align-items: center;
  justify-content: center;
}
.loader-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--muted);
}
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== ЛОГИН ===== */
#login-screen {
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 60% 40%, #2d1b69 0%, var(--bg) 70%);
}
.login-wrap {
  width: 100%;
  max-width: 420px;
  padding: 20px;
}
.login-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 32px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.login-logo {
  font-size: 48px;
  margin-bottom: 12px;
}
.login-card h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--purple);
  margin-bottom: 8px;
}
.login-sub {
  color: var(--muted);
  margin-bottom: 28px;
  font-size: 13px;
}
.btn-discord {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 20px;
  background: var(--discord);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn-discord:hover { background: #4752c4; }
.btn-discord:active { transform: scale(0.98); }
.login-error {
  display: none;
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 8px;
  color: #fca5a5;
  font-size: 13px;
}
.login-note {
  margin-top: 20px;
  padding: 10px 14px;
  background: rgba(124,58,237,0.1);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== ПАНЕЛЬ ===== */
#panel-screen {
  display: flex;
}

/* ===== САЙДБАР ===== */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  position: relative;
}
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px 18px;
}
.sidebar-logo {
  font-size: 22px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), var(--purple3));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0a0c14;
  box-shadow: 0 4px 16px rgba(212,175,106,0.25);
}
.sidebar-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
}
.sidebar-title .accent { color: var(--gold); }
.sidebar-subtitle {
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 2px;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 14px 8px;
  padding: 12px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  overflow: hidden;
}
.user-meta { overflow: hidden; }
.user-name {
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-dept {
  color: var(--success);
  font-size: 11px;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.user-dept::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
}
.user-lvl { display: none; }
.nav-section-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
  padding: 14px 22px 8px;
  font-weight: 600;
}
.sidebar-nav {
  flex: 1;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
}
.nav-item:hover {
  background: var(--bg2);
  color: var(--text);
}
.nav-item.active {
  background: linear-gradient(135deg, var(--gold-soft), transparent);
  color: var(--gold);
  border-color: rgba(212,175,106,0.2);
}
.nav-item.active::after {
  content: '';
  position: absolute;
  right: 14px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; }
.logout-btn {
  margin: 10px;
  padding: 10px 14px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 12px;
  color: #fca5a5;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logout-btn:hover { background: rgba(239,68,68,0.2); }

/* ===== КОНТЕНТ ===== */
.main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 14px;
  min-height: 100vh;
}
@media (min-width: 700px) {
  .main { padding: 28px 32px; }
}
.page-content { display: none; }
.page-content.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.breadcrumbs .bc-root { color: var(--gold); font-weight: 600; }
.breadcrumbs .bc-sep { color: var(--muted); }
.breadcrumbs .bc-current { color: var(--muted); }
.breadcrumbs .bc-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--success);
  font-size: 12px;
}
.breadcrumbs .bc-status::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.page-header {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.page-header-icon {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--gold);
}
.page-header h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.page-header-actions { margin-left: auto; }

/* ===== СТАТЫ ===== */
.stats-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 700px) {
  .stats-row {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
  }
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: border-color 0.2s, transform 0.2s;
}
.stat-card:hover { border-color: var(--border2); transform: translateY(-2px); }
.stat-icon {
  font-size: 26px;
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 14px;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
}
.stat-num {
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.stat-label { color: var(--muted); font-size: 13px; margin-top: 6px; }

/* ===== ТАБЛИЦЫ ===== */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; min-width: 400px; }
thead { background: var(--bg2); }
th {
  padding: 14px 18px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(37,43,61,0.6);
  font-size: 13px;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(212,175,106,0.04); }
.empty {
  text-align: center;
  color: var(--muted);
  padding: 36px 16px !important;
}
.badge-level {
  display: inline-block;
  padding: 4px 11px;
  background: var(--gold-soft);
  border-radius: 8px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
}

/* ===== НАСТРОЙКИ ===== */
.settings-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
}
.settings-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text);
}
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 500;
}
.field input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.field input:focus { border-color: var(--purple); }
.btn-save {
  margin-top: 8px;
  padding: 10px 24px;
  background: var(--purple);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-save:hover { background: var(--purple2); }

/* ===== СКРОЛЛБАР ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple3); }

/* ===== ФОРМА РЕГИСТРАЦИИ ===== */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px;
  max-width: 560px;
}
.form-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 500;
}
.req { color: var(--danger); }
.field input, .field select {
  width: 100%;
  padding: 13px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
}
.field input::placeholder { color: #4a516b; }
.field select option { background: var(--bg2); }

.btn-primary {
  padding: 13px 26px;
  background: linear-gradient(135deg, var(--gold), var(--purple2));
  color: #0a0c14;
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(212,175,106,0.2);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(212,175,106,0.3); }

.btn-danger {
  padding: 13px 26px;
  background: var(--danger);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-danger:hover { background: #dc2626; }

/* ===== КНОПКИ В ТАБЛИЦЕ ===== */
.btn-tbl {
  border: none;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  margin-right: 4px;
}
.btn-edit { background: rgba(124,58,237,0.15); color: #a78bfa; }
.btn-edit:hover { background: rgba(124,58,237,0.3); }
.btn-del { background: rgba(239,68,68,0.15); color: #fca5a5; }
.btn-del:hover { background: rgba(239,68,68,0.3); }

/* ===== BADGE УРОВНЕЙ ===== */
.badge-level {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}
.lv1 { background: rgba(148,163,184,0.15); color: #94a3b8; }
.lv2 { background: rgba(34,197,94,0.15); color: #86efac; }
.lv3 { background: rgba(59,130,246,0.15); color: #93c5fd; }
.lv4 { background: rgba(245,158,11,0.15); color: #fcd34d; }
.lv5 { background: rgba(239,68,68,0.15); color: #fca5a5; }

/* ===== ПРАВА НА ГЛАВНОЙ ===== */
.access-info {
  margin-top: 28px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  max-width: 600px;
}
.access-info h3 { font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.access-list { display: flex; flex-direction: column; gap: 8px; }
.access-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}
.access-item.yes { color: var(--text); }
.access-item .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}
.access-item.yes .dot { background: var(--success); }

/* ===== MONO ===== */
.mono { font-family: monospace; font-size: 12px; color: var(--muted); }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 9999;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast.success {
  background: rgba(34,197,94,0.15);
  border: 1px solid rgba(34,197,94,0.3);
  color: #86efac;
}
.toast.error {
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5;
}

/* ===== МОДАЛКА ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
@media (min-width: 600px) {
  .modal-overlay {
    align-items: center;
    padding: 20px;
  }
}
.modal-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px 14px 0 0;
  padding: 24px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
}
@media (min-width: 600px) {
  .modal-box {
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h3 { font-size: 15px; font-weight: 600; }
.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}
.modal-close:hover { background: var(--bg3); color: var(--text); }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.btn-cancel {
  padding: 9px 18px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-cancel:hover { background: var(--border); color: var(--text); }

/* ===== ПРОФИЛЬ СОТРУДНИКА ===== */
.modal-wide { max-width: 580px; }

.profile-title {
  display: flex;
  align-items: center;
  gap: 14px;
}
.profile-avatar {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 50%;
  background: var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
}
.profile-name {
  font-size: 18px;
  font-weight: 700;
}
.profile-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 12px 0;
}
@media (min-width: 480px) {
  .profile-stats { grid-template-columns: repeat(4, 1fr); }
}
.profile-stat {
  background: var(--bg3);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}
.profile-stat-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--purple);
}
.profile-stat-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.profile-discord-id {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg3);
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
}
.profile-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.profile-tab {
  padding: 8px 14px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: -1px;
}
.profile-tab:hover { color: var(--text); }
.profile-tab.active {
  color: var(--purple);
  border-bottom-color: var(--purple);
}
.profile-tab-content { display: none; }
.profile-tab-content.active { display: block; }

/* Подсветка строки при наведении */
.row-clickable:hover td { background: rgba(124,58,237,0.08) !important; }

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */
@media (max-width: 600px) {

  /* Скрываем лишние колонки таблицы сотрудников */
  #users-tbody td:nth-child(2),
  #users-tbody td:nth-child(5),
  table thead th:nth-child(2),
  #page-users thead th:nth-child(5) { display: none; }

  /* Тикеты — скрываем лишнее */
  #tickets-tbody td:nth-child(3),
  #tickets-tbody td:nth-child(5),
  #page-tickets thead th:nth-child(3),
  #page-tickets thead th:nth-child(5) { display: none; }

  /* Форма */
  .form-card { padding: 16px; }

  /* Профиль — компактнее */
  .profile-title { gap: 10px; }
  .profile-avatar { width: 42px; height: 42px; font-size: 18px; }
  .profile-name { font-size: 15px; }
  .profile-tab { padding: 6px 10px; font-size: 12px; }
}

/* ===== ИКОНКИ ===== */
.nav-icon { font-size: 18px; width: 20px; text-align: center; }

/* ===== РОЛИ МОДЕРАЦИИ ===== */
.mod-roles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}
@media (max-width: 700px) {
  .mod-roles-grid { grid-template-columns: 1fr; }
}
.mod-role-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.mod-role-card h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--muted);
}
.mod-role-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 24px;
}
.mod-role-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg3);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-family: monospace;
}
.mod-role-pill button {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 14px;
}
.mod-role-empty {
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
}

/* ===== ВСТРОЕННЫЕ SVG ИКОНКИ ===== */
.nav-icon svg, .stat-icon svg, .sidebar-logo svg {
  display: block;
}
.nav-icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; color: currentColor; }
.stat-icon { display: inline-flex; color: var(--purple); }
.sidebar-logo { display: inline-flex; color: var(--purple); }
.btn-primary svg, .btn-danger svg, .btn-cancel svg, .logout-btn svg, .btn-tbl svg, .modal-close svg {
  vertical-align: -2px;
}

/* ===== КАРТОЧКИ НАКАЗАНИЙ ===== */
.punish-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 720px;
}
.punish-card {
  display: flex;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent, var(--gold));
  border-radius: 16px;
  padding: 18px 20px;
  transition: border-color 0.2s, transform 0.2s;
}
.punish-card:hover {
  border-color: var(--border2);
  border-left-color: var(--accent, var(--gold));
  transform: translateX(2px);
}
.punish-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.punish-body { flex: 1; min-width: 0; }
.punish-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.punish-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.punish-issuer {
  font-size: 12px;
  color: var(--gold);
  font-weight: 500;
  white-space: nowrap;
}
.punish-mid {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.punish-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 9px;
  border-radius: 6px;
}
.punish-date {
  font-size: 11px;
  color: var(--muted);
}
.punish-reason {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

/* ===== АДАПТАЦИЯ НОВОГО ДИЗАЙНА ===== */
@media (max-width: 600px) {
  .page-header-icon { width: 46px; height: 46px; min-width: 46px; font-size: 22px; border-radius: 13px; }
  .page-header h1 { font-size: 21px; }
  .page-sub { font-size: 12px; }
  .breadcrumbs { font-size: 12px; margin-bottom: 18px; }
  .breadcrumbs .bc-status { font-size: 11px; }
  .punish-card { padding: 14px 16px; gap: 12px; }
  .punish-icon { width: 42px; height: 42px; min-width: 42px; font-size: 19px; }
  .punish-name { font-size: 15px; }
  .stat-card { padding: 18px; }
  .stat-num { font-size: 26px; }
}

/* Второй stats-row (счётчики профиля) — отступ */
.profile-stats + .profile-stats { margin-top: 8px; }

/* ===== МОБИЛЬНАЯ ШАПКА И ВЫЕЗЖАЮЩИЙ САЙДБАР ===== */
.mobile-topbar { display: none; }
.sidebar-overlay { display: none; }
.sidebar-close-btn { display: none; }

@media (max-width: 860px) {
  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
  }
  .mobile-burger {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 10px;
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
  .mobile-topbar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
  }
  .mobile-topbar-logo svg { color: var(--gold); }
  .mobile-topbar-logo .accent { color: var(--gold); }
  .mobile-topbar-avatar {
    margin-left: auto;
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 13px;
    cursor: pointer;
  }

  /* Сайдбар становится выезжающей панелью */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    min-width: 280px;
    max-width: 84vw;
    z-index: 101;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 8px 0 32px rgba(0,0,0,0.4);
  }
  .sidebar.open { transform: translateX(0); }

  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  .sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--muted);
    cursor: pointer;
    z-index: 2;
  }
  .sidebar .sidebar-header { padding-right: 50px; }

  #panel-screen { display: block !important; }
  .main { width: 100%; padding: 16px; }

  .page-header { flex-wrap: wrap; }
  .page-header h1 { font-size: 20px; }
  .page-header-icon { width: 46px; height: 46px; min-width: 46px; font-size: 21px; border-radius: 13px; }

  .breadcrumbs { display: none; }

  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 14px; flex-direction: column; align-items: flex-start; gap: 10px; }
  .stat-icon { width: 40px; height: 40px; min-width: 40px; font-size: 19px; }
  .stat-num { font-size: 22px; }
  .stat-label { font-size: 11px; }

  .form-card { padding: 16px; max-width: 100%; }
  .punish-list { max-width: 100%; }
  .punish-card { padding: 14px; gap: 12px; }
  .punish-icon { width: 40px; height: 40px; min-width: 40px; font-size: 18px; }
  .punish-name { font-size: 14px; }
  .punish-top { flex-direction: column; align-items: flex-start; gap: 4px; }

  .mod-roles-grid { grid-template-columns: 1fr; }

  .modal-box { max-width: 92vw; }
}
